diff --git a/EscapeTheBackroomsGUiTest/Cheat.h b/EscapeTheBackroomsGUiTest/Cheat.h index a6df636..900a133 100644 --- a/EscapeTheBackroomsGUiTest/Cheat.h +++ b/EscapeTheBackroomsGUiTest/Cheat.h @@ -894,6 +894,18 @@ namespace Cheat { return Objects; } + bool IsClassOfClass(SDK::UClass* ClassIn, SDK::UClass* ClassToCheck) { + for (SDK::UStruct* Super = ClassIn; Super; Super = Super->Super) + { + if (Super == ClassToCheck) + { + return true; + } + } + + return false; + } + std::vector FuncsNames; void GodMode(SDK::UObject* Caller, SDK::UFunction* Func, void* Params) { @@ -964,6 +976,7 @@ namespace Cheat { Engine->GameViewport->ViewportConsole = Console; + SDK::UInputSettings* inputSettings = SDK::UInputSettings::GetDefaultObj()->GetInputSettings(); inputSettings->ConsoleKey.KeyName = StringLib->Conv_StringToName(SDK::FString(L"Tab")); @@ -1617,6 +1630,7 @@ namespace Cheat { } #ifdef DEBUG + /* { // Dont wanna pollute the main codeblock with static value, so own codeblock static SDK::FGuid MapPackageGuidCurrent = { 0,0,0,0 }; //use guid for whatever the fuck @@ -1628,6 +1642,7 @@ namespace Cheat { PlayerController->ClientTravelInternal(SDK::FString(Backend::HostID.c_str()), SDK::ETravelType::TRAVEL_Absolute, true, MapPackageGuidCurrent); } } + */ #endif /* @@ -2203,14 +2218,14 @@ namespace Cheat { - + //Spam Flareguns if (UsefullFuncs::IsKeyPressed(VK_F3, true)) { - Settings::IniShitsPlayer[6] = !Settings::IniShitsPlayer[6]; + Settings::IniShitsPlayer[Settings::PlayerDynamic::PFlaregunSpammer] = !Settings::IniShitsPlayer[Settings::PlayerDynamic::PFlaregunSpammer]; } - if(Settings::IniShitsPlayer[6]) + if(Settings::IniShitsPlayer[Settings::PlayerDynamic::PFlaregunSpammer]) { auto cam = (SDK::ABP_FlareGun_C*)BPCharacter->CurrentItem_Rep; diff --git a/EscapeTheBackroomsGUiTest/EscapeTheBackroomsGUiTest.vcxproj b/EscapeTheBackroomsGUiTest/EscapeTheBackroomsGUiTest.vcxproj index 9345b7b..8810196 100644 --- a/EscapeTheBackroomsGUiTest/EscapeTheBackroomsGUiTest.vcxproj +++ b/EscapeTheBackroomsGUiTest/EscapeTheBackroomsGUiTest.vcxproj @@ -90,15 +90,24 @@ C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Include;$(IncludePath) - C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x64;$(LibraryPath) + C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x64;$(LibraryPath);U:\DCInParis\EscapeTheBackroomsGUiTest\EscapeTheBackroomsGUiTest\vcpkg_Out\lib U:\DCInParis\EscapeTheBackroomsGUiTest\EscapeTheBackroomsGUiTest\Out;$(ExternalIncludePath) + + $(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);U:\DCInParis\EscapeTheBackroomsGUiTest\EscapeTheBackroomsGUiTest\vcpkg_Out\lib + + + $(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);U:\DCInParis\EscapeTheBackroomsGUiTest\EscapeTheBackroomsGUiTest\vcpkg_Out\lib + true true + + false + Level3 @@ -150,6 +159,7 @@ Windows true false + minhook.x64.lib %(AdditionalOptions) @@ -171,6 +181,7 @@ true true false + minhook.x64.lib %(AdditionalOptions) @@ -182,6 +193,9 @@ stdcpp20 + + minhook.x64.lib %(AdditionalOptions) + diff --git a/EscapeTheBackroomsGUiTest/GUI/ZeroGUI.h b/EscapeTheBackroomsGUiTest/GUI/ZeroGUI.h index 37e4373..1e1e596 100644 --- a/EscapeTheBackroomsGUiTest/GUI/ZeroGUI.h +++ b/EscapeTheBackroomsGUiTest/GUI/ZeroGUI.h @@ -320,6 +320,14 @@ namespace CWINGui canvas->K2_DrawLine(FVector2D{ initial_pos.X, initial_pos.Y + i }, FVector2D{ initial_pos.X + w, initial_pos.Y + i }, 1.0f, color); } + enum Rounding : short { + LeftCorner = 0x1, + RightCorner = 0x10, + LeftCornerDown = 0x100, + RightCornerDown = 0x1000, + AllCorners = 0x1111, + }; + void DrawFilledCircle(FVector2D pos, float r, FLinearColor color) { float smooth = 0.07f; @@ -711,6 +719,62 @@ namespace CWINGui } } } + + + void DrawRoundedFilledRect(UCanvas* canvas, FVector2D pos, FVector2D size, FLinearColor color, int Sidenumbers = 20, float rounding = 2.0f, Rounding flag = Rounding::AllCorners) + { + const float PI = 3.1415927f; + + bool RoundLeftCornerUp = flag & Rounding::LeftCorner; + bool RoundRightCornerUp = flag & Rounding::RightCorner; + bool RoundLeftCornerDown = flag & Rounding::LeftCornerDown; + bool RoundRightCornerDown = flag & Rounding::RightCornerDown; + + for (float y = 0.0f; y < size.Y; y += 1.0f) + { + FVector2D StartPos = { pos.X, pos.Y + y }; + FVector2D EndPos = { pos.X + size.X, pos.Y + y }; + + + if (RoundLeftCornerUp || RoundRightCornerUp && y < rounding) + { + if (RoundLeftCornerUp) { + float angle = (y / rounding) * (PI / 2); + + StartPos.X += rounding * (1 - std::cosf(angle)); + StartPos.Y += rounding * (1 - std::sinf(angle)); + } + if (RoundRightCornerUp) { + float angle = (y / rounding) * (PI / 2); + + EndPos.X -= rounding * (1 - std::cosf(angle)); + EndPos.Y += rounding * (1 - std::sinf(angle)); + } + } + + if (RoundLeftCornerDown || RoundRightCornerDown && y > size.Y - rounding) + { + if (RoundLeftCornerDown) { + float dy = y - (size.Y - rounding); + float angle = (dy / rounding) * (PI / 2); + + StartPos.X += rounding * (1 - std::cosf(angle)); + StartPos.Y -= rounding * (1 - std::sinf(angle)); + } + if (RoundRightCornerDown) { + float dy = y - (size.Y - rounding); + float angle = (dy / rounding) * (PI / 2); + + EndPos.X -= rounding * (1 - std::cosf(angle)); + EndPos.Y -= rounding * (1 - std::sinf(angle)); + } + } + + canvas->K2_DrawLine(StartPos, EndPos, 1.0f, color); + + } + } + void Text(const wchar_t* text, bool center = false, bool outline = false) { diff --git a/EscapeTheBackroomsGUiTest/Settings.h b/EscapeTheBackroomsGUiTest/Settings.h index fcab591..de61125 100644 --- a/EscapeTheBackroomsGUiTest/Settings.h +++ b/EscapeTheBackroomsGUiTest/Settings.h @@ -192,6 +192,21 @@ namespace PlayerStuff { } } + static std::string SanitizeString(std::string Input) { + std::string output = ""; + + int Sizecc = Input.size(); + + for (size_t i = 0; i < 14; i++) + { + if (i >= Sizecc) break; + + output += Input[i]; + } + + return output; + } + static std::wstring SanitizeWString(std::wstring Input) { std::wstring output = L""; @@ -328,6 +343,11 @@ namespace Settings { float Host_PlayersGravityScale = 0.5f; Host_Pawns hostPawn = Host_Pawns::defaultEmptyPawn; + //Anti Cheat + bool AntiCheat = false; + bool AC_InvalidItemSpawner = false; + bool AC_NameChanger = false; + //Misc diff --git a/EscapeTheBackroomsGUiTest/dllmain.cpp b/EscapeTheBackroomsGUiTest/dllmain.cpp index c0df267..9f2990f 100644 --- a/EscapeTheBackroomsGUiTest/dllmain.cpp +++ b/EscapeTheBackroomsGUiTest/dllmain.cpp @@ -1,9 +1,11 @@ -#include "SDK/SDK.hpp" -#include +#include #include + +#include "vcpkg_Out/include/MinHook.h" +#include "SDK/SDK.hpp" +#include "Out/IncludeFile.h" + #include "Cheat.h" -#include -#include #include "Config.h" FILE* ConsoleFile = nullptr; @@ -311,13 +313,19 @@ void ProcessEventHook(SDK::UObject* Obj, SDK::UFunction* Function, void* Parms) } } - if (!IsLocalPlayer) { + if(CallingPawn->PlayerState) + Cheat::Message(std::format("Spawned Item {} by Player: {}", (!Cheat::IsClassOfClass(params_->ItemClass, SDK::ABP_Item_C::StaticClass()) ? "Invalid Item" : params_->ItemClass->GetName()), PlayerStuff::Player::SanitizeString(CallingPawn->PlayerState->GetPlayerName().ToString()))); + else + return; + + if (!IsLocalPlayer) { if (auto ItemClass = params_->ItemClass; ItemClass) { - if (!ItemClass->IsA(SDK::ABP_Item_C::StaticClass())) { + if (!Cheat::IsClassOfClass(params_->ItemClass, SDK::ABP_Item_C::StaticClass())) { if (IsLocalHost) { Cheat::MessageW(L"Non Item was passed to SpawnEquipItem, kicking that bad Cheater!"); + GameMode->KickPlayer(CallingPawn->PlayerState, CallingPawn->GetOwner(), (SDK::AMP_PlayerController_C*)CallingPawn->Controller, true, true); } @@ -332,6 +340,8 @@ void ProcessEventHook(SDK::UObject* Obj, SDK::UFunction* Function, void* Parms) } } } + + } @@ -359,6 +369,7 @@ void ProcessEventHook(SDK::UObject* Obj, SDK::UFunction* Function, void* Parms) } else { + PlayerNameChanges[i].second.push_back(NewName); break; } @@ -481,15 +492,8 @@ void MainRender(SDK::UObject* object, SDK::UCanvas* Canvas) { if (CWINGui::Window("?", &WindowPos, WindowSize, Settings::NewVersion_)) { CWINGui::Text(std::format(L"New Version {}!!!", Settings::CheatVersion).c_str()); - CWINGui::Text(L"* Added Server Sided Teleporting!"); - CWINGui::Text(L"* Added Server Sided Object Spawner!"); - CWINGui::Text(L"* Added Boat to Object Spawner."); - CWINGui::Text(L"* Added Config System"); - CWINGui::Text(L"* Added Rope on Player to Player Options."); - CWINGui::Text(L"* Added Freecam and Server Sided Teleporter in Freecam."); - CWINGui::Text(L"* Added Freecam and Server Sided Teleporter in Freecam."); - CWINGui::Text(L"* Added some new Menu Designing."); - CWINGui::Text(L"* Added Chat Spoofer."); + CWINGui::Text(L"* Fixed Memory Leak Bug!"); + CWINGui::Text(L"* Fixed Anti Cheat (Is off now by Default)!"); CWINGui::Text(L""), CWINGui::SameLine(); diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/DirectXTex.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/DirectXTex.h new file mode 100644 index 0000000..6ab0a45 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/DirectXTex.h @@ -0,0 +1,937 @@ +//------------------------------------------------------------------------------------- +// DirectXTex.h +// +// DirectX Texture Library +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +// +// http://go.microsoft.com/fwlink/?LinkId=248926 +//------------------------------------------------------------------------------------- + +#pragma once + +#include +#include +#include +#include +#include + +#ifdef _WIN32 +#if !defined(__d3d11_h__) && !defined(__d3d11_x_h__) && !defined(__d3d12_h__) && !defined(__d3d12_x_h__) && !defined(__XBOX_D3D12_X__) +#ifdef _GAMING_XBOX_SCARLETT +#include +#elif defined(_GAMING_XBOX) +#include +#elif defined(_XBOX_ONE) && defined(_TITLE) +#include +#else +#include +#endif +#endif +#else // !WIN32 +#include +#include +#endif + +#include + +#ifdef _WIN32 +#if defined(NTDDI_WIN10_FE) || defined(__MINGW32__) +#include +#else +#include +#endif + +struct IWICImagingFactory; +struct IWICMetadataQueryReader; +#endif + +#define DIRECTX_TEX_VERSION 196 + + +namespace DirectX +{ + + //--------------------------------------------------------------------------------- + // DXGI Format Utilities + constexpr bool __cdecl IsValid(_In_ DXGI_FORMAT fmt) noexcept; + bool __cdecl IsCompressed(_In_ DXGI_FORMAT fmt) noexcept; + bool __cdecl IsPacked(_In_ DXGI_FORMAT fmt) noexcept; + bool __cdecl IsVideo(_In_ DXGI_FORMAT fmt) noexcept; + bool __cdecl IsPlanar(_In_ DXGI_FORMAT fmt) noexcept; + bool __cdecl IsPalettized(_In_ DXGI_FORMAT fmt) noexcept; + bool __cdecl IsDepthStencil(_In_ DXGI_FORMAT fmt) noexcept; + bool __cdecl IsSRGB(_In_ DXGI_FORMAT fmt) noexcept; + bool __cdecl IsBGR(_In_ DXGI_FORMAT fmt) noexcept; + bool __cdecl IsTypeless(_In_ DXGI_FORMAT fmt, _In_ bool partialTypeless = true) noexcept; + + bool __cdecl HasAlpha(_In_ DXGI_FORMAT fmt) noexcept; + + size_t __cdecl BitsPerPixel(_In_ DXGI_FORMAT fmt) noexcept; + + size_t __cdecl BitsPerColor(_In_ DXGI_FORMAT fmt) noexcept; + + enum FORMAT_TYPE + { + FORMAT_TYPE_TYPELESS, + FORMAT_TYPE_FLOAT, + FORMAT_TYPE_UNORM, + FORMAT_TYPE_SNORM, + FORMAT_TYPE_UINT, + FORMAT_TYPE_SINT, + }; + + FORMAT_TYPE __cdecl FormatDataType(_In_ DXGI_FORMAT fmt) noexcept; + + enum CP_FLAGS : unsigned long + { + CP_FLAGS_NONE = 0x0, + // Normal operation + + CP_FLAGS_LEGACY_DWORD = 0x1, + // Assume pitch is DWORD aligned instead of BYTE aligned + + CP_FLAGS_PARAGRAPH = 0x2, + // Assume pitch is 16-byte aligned instead of BYTE aligned + + CP_FLAGS_YMM = 0x4, + // Assume pitch is 32-byte aligned instead of BYTE aligned + + CP_FLAGS_ZMM = 0x8, + // Assume pitch is 64-byte aligned instead of BYTE aligned + + CP_FLAGS_PAGE4K = 0x200, + // Assume pitch is 4096-byte aligned instead of BYTE aligned + + CP_FLAGS_BAD_DXTN_TAILS = 0x1000, + // BC formats with malformed mipchain blocks smaller than 4x4 + + CP_FLAGS_24BPP = 0x10000, + // Override with a legacy 24 bits-per-pixel format size + + CP_FLAGS_16BPP = 0x20000, + // Override with a legacy 16 bits-per-pixel format size + + CP_FLAGS_8BPP = 0x40000, + // Override with a legacy 8 bits-per-pixel format size + }; + + HRESULT __cdecl ComputePitch( + _In_ DXGI_FORMAT fmt, _In_ size_t width, _In_ size_t height, + _Out_ size_t& rowPitch, _Out_ size_t& slicePitch, _In_ CP_FLAGS flags = CP_FLAGS_NONE) noexcept; + + size_t __cdecl ComputeScanlines(_In_ DXGI_FORMAT fmt, _In_ size_t height) noexcept; + + DXGI_FORMAT __cdecl MakeSRGB(_In_ DXGI_FORMAT fmt) noexcept; + DXGI_FORMAT __cdecl MakeLinear(_In_ DXGI_FORMAT fmt) noexcept; + DXGI_FORMAT __cdecl MakeTypeless(_In_ DXGI_FORMAT fmt) noexcept; + DXGI_FORMAT __cdecl MakeTypelessUNORM(_In_ DXGI_FORMAT fmt) noexcept; + DXGI_FORMAT __cdecl MakeTypelessFLOAT(_In_ DXGI_FORMAT fmt) noexcept; + + //--------------------------------------------------------------------------------- + // Texture metadata + enum TEX_DIMENSION + // Subset here matches D3D10_RESOURCE_DIMENSION and D3D11_RESOURCE_DIMENSION + { + TEX_DIMENSION_TEXTURE1D = 2, + TEX_DIMENSION_TEXTURE2D = 3, + TEX_DIMENSION_TEXTURE3D = 4, + }; + + enum TEX_MISC_FLAG : unsigned long + // Subset here matches D3D10_RESOURCE_MISC_FLAG and D3D11_RESOURCE_MISC_FLAG + { + TEX_MISC_TEXTURECUBE = 0x4L, + }; + + enum TEX_MISC_FLAG2 : unsigned long + { + TEX_MISC2_ALPHA_MODE_MASK = 0x7L, + }; + + enum TEX_ALPHA_MODE + // Matches DDS_ALPHA_MODE, encoded in MISC_FLAGS2 + { + TEX_ALPHA_MODE_UNKNOWN = 0, + TEX_ALPHA_MODE_STRAIGHT = 1, + TEX_ALPHA_MODE_PREMULTIPLIED = 2, + TEX_ALPHA_MODE_OPAQUE = 3, + TEX_ALPHA_MODE_CUSTOM = 4, + }; + + struct TexMetadata + { + size_t width; + size_t height; // Should be 1 for 1D textures + size_t depth; // Should be 1 for 1D or 2D textures + size_t arraySize; // For cubemap, this is a multiple of 6 + size_t mipLevels; + uint32_t miscFlags; + uint32_t miscFlags2; + DXGI_FORMAT format; + TEX_DIMENSION dimension; + + size_t __cdecl ComputeIndex(_In_ size_t mip, _In_ size_t item, _In_ size_t slice) const noexcept; + // Returns size_t(-1) to indicate an out-of-range error + + bool __cdecl IsCubemap() const noexcept { return (miscFlags & TEX_MISC_TEXTURECUBE) != 0; } + // Helper for miscFlags + + bool __cdecl IsPMAlpha() const noexcept { return ((miscFlags2 & TEX_MISC2_ALPHA_MODE_MASK) == TEX_ALPHA_MODE_PREMULTIPLIED) != 0; } + void __cdecl SetAlphaMode(TEX_ALPHA_MODE mode) noexcept { miscFlags2 = (miscFlags2 & ~static_cast(TEX_MISC2_ALPHA_MODE_MASK)) | static_cast(mode); } + TEX_ALPHA_MODE __cdecl GetAlphaMode() const noexcept { return static_cast(miscFlags2 & TEX_MISC2_ALPHA_MODE_MASK); } + // Helpers for miscFlags2 + + bool __cdecl IsVolumemap() const noexcept { return (dimension == TEX_DIMENSION_TEXTURE3D); } + // Helper for dimension + }; + + enum DDS_FLAGS : unsigned long + { + DDS_FLAGS_NONE = 0x0, + + DDS_FLAGS_LEGACY_DWORD = 0x1, + // Assume pitch is DWORD aligned instead of BYTE aligned (used by some legacy DDS files) + + DDS_FLAGS_NO_LEGACY_EXPANSION = 0x2, + // Do not implicitly convert legacy formats that result in larger pixel sizes (24 bpp, 3:3:2, A8L8, A4L4, P8, A8P8) + + DDS_FLAGS_NO_R10B10G10A2_FIXUP = 0x4, + // Do not use work-around for long-standing D3DX DDS file format issue which reversed the 10:10:10:2 color order masks + + DDS_FLAGS_FORCE_RGB = 0x8, + // Convert DXGI 1.1 BGR formats to DXGI_FORMAT_R8G8B8A8_UNORM to avoid use of optional WDDM 1.1 formats + + DDS_FLAGS_NO_16BPP = 0x10, + // Conversions avoid use of 565, 5551, and 4444 formats and instead expand to 8888 to avoid use of optional WDDM 1.2 formats + + DDS_FLAGS_EXPAND_LUMINANCE = 0x20, + // When loading legacy luminance formats expand replicating the color channels rather than leaving them packed (L8, L16, A8L8) + + DDS_FLAGS_BAD_DXTN_TAILS = 0x40, + // Some older DXTn DDS files incorrectly handle mipchain tails for blocks smaller than 4x4 + + DDS_FLAGS_FORCE_DX10_EXT = 0x10000, + // Always use the 'DX10' header extension for DDS writer (i.e. don't try to write DX9 compatible DDS files) + + DDS_FLAGS_FORCE_DX10_EXT_MISC2 = 0x20000, + // DDS_FLAGS_FORCE_DX10_EXT including miscFlags2 information (result may not be compatible with D3DX10 or D3DX11) + + DDS_FLAGS_FORCE_DX9_LEGACY = 0x40000, + // Force use of legacy header for DDS writer (will fail if unable to write as such) + + DDS_FLAGS_ALLOW_LARGE_FILES = 0x1000000, + // Enables the loader to read large dimension .dds files (i.e. greater than known hardware requirements) + }; + + enum TGA_FLAGS : unsigned long + { + TGA_FLAGS_NONE = 0x0, + + TGA_FLAGS_BGR = 0x1, + // 24bpp files are returned as BGRX; 32bpp files are returned as BGRA + + TGA_FLAGS_ALLOW_ALL_ZERO_ALPHA = 0x2, + // If the loaded image has an all zero alpha channel, normally we assume it should be opaque. This flag leaves it alone. + + TGA_FLAGS_IGNORE_SRGB = 0x10, + // Ignores sRGB TGA 2.0 metadata if present in the file + + TGA_FLAGS_FORCE_SRGB = 0x20, + // Writes sRGB metadata into the file reguardless of format (TGA 2.0 only) + + TGA_FLAGS_FORCE_LINEAR = 0x40, + // Writes linear gamma metadata into the file reguardless of format (TGA 2.0 only) + + TGA_FLAGS_DEFAULT_SRGB = 0x80, + // If no colorspace is specified in TGA 2.0 metadata, assume sRGB + }; + + enum WIC_FLAGS : unsigned long + { + WIC_FLAGS_NONE = 0x0, + + WIC_FLAGS_FORCE_RGB = 0x1, + // Loads DXGI 1.1 BGR formats as DXGI_FORMAT_R8G8B8A8_UNORM to avoid use of optional WDDM 1.1 formats + + WIC_FLAGS_NO_X2_BIAS = 0x2, + // Loads DXGI 1.1 X2 10:10:10:2 format as DXGI_FORMAT_R10G10B10A2_UNORM + + WIC_FLAGS_NO_16BPP = 0x4, + // Loads 565, 5551, and 4444 formats as 8888 to avoid use of optional WDDM 1.2 formats + + WIC_FLAGS_ALLOW_MONO = 0x8, + // Loads 1-bit monochrome (black & white) as R1_UNORM rather than 8-bit grayscale + + WIC_FLAGS_ALL_FRAMES = 0x10, + // Loads all images in a multi-frame file, converting/resizing to match the first frame as needed, defaults to 0th frame otherwise + + WIC_FLAGS_IGNORE_SRGB = 0x20, + // Ignores sRGB metadata if present in the file + + WIC_FLAGS_FORCE_SRGB = 0x40, + // Writes sRGB metadata into the file reguardless of format + + WIC_FLAGS_FORCE_LINEAR = 0x80, + // Writes linear gamma metadata into the file reguardless of format + + WIC_FLAGS_DEFAULT_SRGB = 0x100, + // If no colorspace is specified, assume sRGB + + WIC_FLAGS_DITHER = 0x10000, + // Use ordered 4x4 dithering for any required conversions + + WIC_FLAGS_DITHER_DIFFUSION = 0x20000, + // Use error-diffusion dithering for any required conversions + + WIC_FLAGS_FILTER_POINT = 0x100000, + WIC_FLAGS_FILTER_LINEAR = 0x200000, + WIC_FLAGS_FILTER_CUBIC = 0x300000, + WIC_FLAGS_FILTER_FANT = 0x400000, // Combination of Linear and Box filter + // Filtering mode to use for any required image resizing (only needed when loading arrays of differently sized images; defaults to Fant) + }; + + HRESULT __cdecl GetMetadataFromDDSMemory( + _In_reads_bytes_(size) const void* pSource, _In_ size_t size, + _In_ DDS_FLAGS flags, + _Out_ TexMetadata& metadata) noexcept; + HRESULT __cdecl GetMetadataFromDDSFile( + _In_z_ const wchar_t* szFile, + _In_ DDS_FLAGS flags, + _Out_ TexMetadata& metadata) noexcept; + + HRESULT __cdecl GetMetadataFromHDRMemory( + _In_reads_bytes_(size) const void* pSource, _In_ size_t size, + _Out_ TexMetadata& metadata) noexcept; + HRESULT __cdecl GetMetadataFromHDRFile( + _In_z_ const wchar_t* szFile, + _Out_ TexMetadata& metadata) noexcept; + + HRESULT __cdecl GetMetadataFromTGAMemory( + _In_reads_bytes_(size) const void* pSource, _In_ size_t size, + _In_ TGA_FLAGS flags, + _Out_ TexMetadata& metadata) noexcept; + HRESULT __cdecl GetMetadataFromTGAFile( + _In_z_ const wchar_t* szFile, + _In_ TGA_FLAGS flags, + _Out_ TexMetadata& metadata) noexcept; + +#ifdef _WIN32 + HRESULT __cdecl GetMetadataFromWICMemory( + _In_reads_bytes_(size) const void* pSource, _In_ size_t size, + _In_ WIC_FLAGS flags, + _Out_ TexMetadata& metadata, + _In_opt_ std::function getMQR = nullptr); + + HRESULT __cdecl GetMetadataFromWICFile( + _In_z_ const wchar_t* szFile, + _In_ WIC_FLAGS flags, + _Out_ TexMetadata& metadata, + _In_opt_ std::function getMQR = nullptr); +#endif + + // Compatability helpers + HRESULT __cdecl GetMetadataFromTGAMemory( + _In_reads_bytes_(size) const void* pSource, _In_ size_t size, + _Out_ TexMetadata& metadata) noexcept; + HRESULT __cdecl GetMetadataFromTGAFile( + _In_z_ const wchar_t* szFile, + _Out_ TexMetadata& metadata) noexcept; + + //--------------------------------------------------------------------------------- + // Bitmap image container + struct Image + { + size_t width; + size_t height; + DXGI_FORMAT format; + size_t rowPitch; + size_t slicePitch; + uint8_t* pixels; + }; + + class ScratchImage + { + public: + ScratchImage() noexcept + : m_nimages(0), m_size(0), m_metadata{}, m_image(nullptr), m_memory(nullptr) {} + ScratchImage(ScratchImage&& moveFrom) noexcept + : m_nimages(0), m_size(0), m_metadata{}, m_image(nullptr), m_memory(nullptr) { *this = std::move(moveFrom); } + ~ScratchImage() { Release(); } + + ScratchImage& __cdecl operator= (ScratchImage&& moveFrom) noexcept; + + ScratchImage(const ScratchImage&) = delete; + ScratchImage& operator=(const ScratchImage&) = delete; + + HRESULT __cdecl Initialize(_In_ const TexMetadata& mdata, _In_ CP_FLAGS flags = CP_FLAGS_NONE) noexcept; + + HRESULT __cdecl Initialize1D(_In_ DXGI_FORMAT fmt, _In_ size_t length, _In_ size_t arraySize, _In_ size_t mipLevels, _In_ CP_FLAGS flags = CP_FLAGS_NONE) noexcept; + HRESULT __cdecl Initialize2D(_In_ DXGI_FORMAT fmt, _In_ size_t width, _In_ size_t height, _In_ size_t arraySize, _In_ size_t mipLevels, _In_ CP_FLAGS flags = CP_FLAGS_NONE) noexcept; + HRESULT __cdecl Initialize3D(_In_ DXGI_FORMAT fmt, _In_ size_t width, _In_ size_t height, _In_ size_t depth, _In_ size_t mipLevels, _In_ CP_FLAGS flags = CP_FLAGS_NONE) noexcept; + HRESULT __cdecl InitializeCube(_In_ DXGI_FORMAT fmt, _In_ size_t width, _In_ size_t height, _In_ size_t nCubes, _In_ size_t mipLevels, _In_ CP_FLAGS flags = CP_FLAGS_NONE) noexcept; + + HRESULT __cdecl InitializeFromImage(_In_ const Image& srcImage, _In_ bool allow1D = false, _In_ CP_FLAGS flags = CP_FLAGS_NONE) noexcept; + HRESULT __cdecl InitializeArrayFromImages(_In_reads_(nImages) const Image* images, _In_ size_t nImages, _In_ bool allow1D = false, _In_ CP_FLAGS flags = CP_FLAGS_NONE) noexcept; + HRESULT __cdecl InitializeCubeFromImages(_In_reads_(nImages) const Image* images, _In_ size_t nImages, _In_ CP_FLAGS flags = CP_FLAGS_NONE) noexcept; + HRESULT __cdecl Initialize3DFromImages(_In_reads_(depth) const Image* images, _In_ size_t depth, _In_ CP_FLAGS flags = CP_FLAGS_NONE) noexcept; + + void __cdecl Release() noexcept; + + bool __cdecl OverrideFormat(_In_ DXGI_FORMAT f) noexcept; + + const TexMetadata& __cdecl GetMetadata() const noexcept { return m_metadata; } + const Image* __cdecl GetImage(_In_ size_t mip, _In_ size_t item, _In_ size_t slice) const noexcept; + + const Image* __cdecl GetImages() const noexcept { return m_image; } + size_t __cdecl GetImageCount() const noexcept { return m_nimages; } + + uint8_t* __cdecl GetPixels() const noexcept { return m_memory; } + size_t __cdecl GetPixelsSize() const noexcept { return m_size; } + + bool __cdecl IsAlphaAllOpaque() const noexcept; + + private: + size_t m_nimages; + size_t m_size; + TexMetadata m_metadata; + Image* m_image; + uint8_t* m_memory; + }; + + //--------------------------------------------------------------------------------- + // Memory blob (allocated buffer pointer is always 16-byte aligned) + class Blob + { + public: + Blob() noexcept : m_buffer(nullptr), m_size(0) {} + Blob(Blob&& moveFrom) noexcept : m_buffer(nullptr), m_size(0) { *this = std::move(moveFrom); } + ~Blob() { Release(); } + + Blob& __cdecl operator= (Blob&& moveFrom) noexcept; + + Blob(const Blob&) = delete; + Blob& operator=(const Blob&) = delete; + + HRESULT __cdecl Initialize(_In_ size_t size) noexcept; + + void __cdecl Release() noexcept; + + void *__cdecl GetBufferPointer() const noexcept { return m_buffer; } + size_t __cdecl GetBufferSize() const noexcept { return m_size; } + + HRESULT __cdecl Resize(size_t size) noexcept; + // Reallocate for a new size + + HRESULT __cdecl Trim(size_t size) noexcept; + // Shorten size without reallocation + + private: + void* m_buffer; + size_t m_size; + }; + + //--------------------------------------------------------------------------------- + // Image I/O + + // DDS operations + HRESULT __cdecl LoadFromDDSMemory( + _In_reads_bytes_(size) const void* pSource, _In_ size_t size, + _In_ DDS_FLAGS flags, + _Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) noexcept; + HRESULT __cdecl LoadFromDDSFile( + _In_z_ const wchar_t* szFile, + _In_ DDS_FLAGS flags, + _Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) noexcept; + + HRESULT __cdecl SaveToDDSMemory( + _In_ const Image& image, + _In_ DDS_FLAGS flags, + _Out_ Blob& blob) noexcept; + HRESULT __cdecl SaveToDDSMemory( + _In_reads_(nimages) const Image* images, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ DDS_FLAGS flags, + _Out_ Blob& blob) noexcept; + + HRESULT __cdecl SaveToDDSFile(_In_ const Image& image, _In_ DDS_FLAGS flags, _In_z_ const wchar_t* szFile) noexcept; + HRESULT __cdecl SaveToDDSFile( + _In_reads_(nimages) const Image* images, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ DDS_FLAGS flags, _In_z_ const wchar_t* szFile) noexcept; + + // HDR operations + HRESULT __cdecl LoadFromHDRMemory( + _In_reads_bytes_(size) const void* pSource, _In_ size_t size, + _Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) noexcept; + HRESULT __cdecl LoadFromHDRFile( + _In_z_ const wchar_t* szFile, + _Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) noexcept; + + HRESULT __cdecl SaveToHDRMemory(_In_ const Image& image, _Out_ Blob& blob) noexcept; + HRESULT __cdecl SaveToHDRFile(_In_ const Image& image, _In_z_ const wchar_t* szFile) noexcept; + + // TGA operations + HRESULT __cdecl LoadFromTGAMemory( + _In_reads_bytes_(size) const void* pSource, _In_ size_t size, + _In_ TGA_FLAGS flags, + _Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) noexcept; + HRESULT __cdecl LoadFromTGAFile( + _In_z_ const wchar_t* szFile, + _In_ TGA_FLAGS flags, + _Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) noexcept; + + HRESULT __cdecl SaveToTGAMemory(_In_ const Image& image, + _In_ TGA_FLAGS flags, + _Out_ Blob& blob, _In_opt_ const TexMetadata* metadata = nullptr) noexcept; + HRESULT __cdecl SaveToTGAFile(_In_ const Image& image, + _In_ TGA_FLAGS flags, + _In_z_ const wchar_t* szFile, _In_opt_ const TexMetadata* metadata = nullptr) noexcept; + + // WIC operations +#ifdef _WIN32 + HRESULT __cdecl LoadFromWICMemory( + _In_reads_bytes_(size) const void* pSource, _In_ size_t size, + _In_ WIC_FLAGS flags, + _Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image, + _In_opt_ std::function getMQR = nullptr); + HRESULT __cdecl LoadFromWICFile( + _In_z_ const wchar_t* szFile, _In_ WIC_FLAGS flags, + _Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image, + _In_opt_ std::function getMQR = nullptr); + + HRESULT __cdecl SaveToWICMemory( + _In_ const Image& image, _In_ WIC_FLAGS flags, _In_ REFGUID guidContainerFormat, + _Out_ Blob& blob, _In_opt_ const GUID* targetFormat = nullptr, + _In_opt_ std::function setCustomProps = nullptr); + HRESULT __cdecl SaveToWICMemory( + _In_count_(nimages) const Image* images, _In_ size_t nimages, + _In_ WIC_FLAGS flags, _In_ REFGUID guidContainerFormat, + _Out_ Blob& blob, _In_opt_ const GUID* targetFormat = nullptr, + _In_opt_ std::function setCustomProps = nullptr); + + HRESULT __cdecl SaveToWICFile( + _In_ const Image& image, _In_ WIC_FLAGS flags, _In_ REFGUID guidContainerFormat, + _In_z_ const wchar_t* szFile, _In_opt_ const GUID* targetFormat = nullptr, + _In_opt_ std::function setCustomProps = nullptr); + HRESULT __cdecl SaveToWICFile( + _In_count_(nimages) const Image* images, _In_ size_t nimages, + _In_ WIC_FLAGS flags, _In_ REFGUID guidContainerFormat, + _In_z_ const wchar_t* szFile, _In_opt_ const GUID* targetFormat = nullptr, + _In_opt_ std::function setCustomProps = nullptr); +#endif // WIN32 + + // Compatability helpers + HRESULT __cdecl LoadFromTGAMemory( + _In_reads_bytes_(size) const void* pSource, _In_ size_t size, + _Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) noexcept; + HRESULT __cdecl LoadFromTGAFile( + _In_z_ const wchar_t* szFile, + _Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) noexcept; + + HRESULT __cdecl SaveToTGAMemory(_In_ const Image& image, _Out_ Blob& blob, _In_opt_ const TexMetadata* metadata = nullptr) noexcept; + HRESULT __cdecl SaveToTGAFile(_In_ const Image& image, _In_z_ const wchar_t* szFile, _In_opt_ const TexMetadata* metadata = nullptr) noexcept; + + //--------------------------------------------------------------------------------- + // Texture conversion, resizing, mipmap generation, and block compression + + enum TEX_FR_FLAGS : unsigned long + { + TEX_FR_ROTATE0 = 0x0, + TEX_FR_ROTATE90 = 0x1, + TEX_FR_ROTATE180 = 0x2, + TEX_FR_ROTATE270 = 0x3, + TEX_FR_FLIP_HORIZONTAL = 0x08, + TEX_FR_FLIP_VERTICAL = 0x10, + }; + +#ifdef _WIN32 + HRESULT __cdecl FlipRotate(_In_ const Image& srcImage, _In_ TEX_FR_FLAGS flags, _Out_ ScratchImage& image) noexcept; + HRESULT __cdecl FlipRotate( + _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ TEX_FR_FLAGS flags, _Out_ ScratchImage& result) noexcept; + // Flip and/or rotate image +#endif + + enum TEX_FILTER_FLAGS : unsigned long + { + TEX_FILTER_DEFAULT = 0, + + TEX_FILTER_WRAP_U = 0x1, + TEX_FILTER_WRAP_V = 0x2, + TEX_FILTER_WRAP_W = 0x4, + TEX_FILTER_WRAP = (TEX_FILTER_WRAP_U | TEX_FILTER_WRAP_V | TEX_FILTER_WRAP_W), + TEX_FILTER_MIRROR_U = 0x10, + TEX_FILTER_MIRROR_V = 0x20, + TEX_FILTER_MIRROR_W = 0x40, + TEX_FILTER_MIRROR = (TEX_FILTER_MIRROR_U | TEX_FILTER_MIRROR_V | TEX_FILTER_MIRROR_W), + // Wrap vs. Mirror vs. Clamp filtering options + + TEX_FILTER_SEPARATE_ALPHA = 0x100, + // Resize color and alpha channel independently + + TEX_FILTER_FLOAT_X2BIAS = 0x200, + // Enable *2 - 1 conversion cases for unorm<->float and positive-only float formats + + TEX_FILTER_RGB_COPY_RED = 0x1000, + TEX_FILTER_RGB_COPY_GREEN = 0x2000, + TEX_FILTER_RGB_COPY_BLUE = 0x4000, + // When converting RGB to R, defaults to using grayscale. These flags indicate copying a specific channel instead + // When converting RGB to RG, defaults to copying RED | GREEN. These flags control which channels are selected instead. + + TEX_FILTER_DITHER = 0x10000, + // Use ordered 4x4 dithering for any required conversions + TEX_FILTER_DITHER_DIFFUSION = 0x20000, + // Use error-diffusion dithering for any required conversions + + TEX_FILTER_POINT = 0x100000, + TEX_FILTER_LINEAR = 0x200000, + TEX_FILTER_CUBIC = 0x300000, + TEX_FILTER_BOX = 0x400000, + TEX_FILTER_FANT = 0x400000, // Equiv to Box filtering for mipmap generation + TEX_FILTER_TRIANGLE = 0x500000, + // Filtering mode to use for any required image resizing + + TEX_FILTER_SRGB_IN = 0x1000000, + TEX_FILTER_SRGB_OUT = 0x2000000, + TEX_FILTER_SRGB = (TEX_FILTER_SRGB_IN | TEX_FILTER_SRGB_OUT), + // sRGB <-> RGB for use in conversion operations + // if the input format type is IsSRGB(), then SRGB_IN is on by default + // if the output format type is IsSRGB(), then SRGB_OUT is on by default + + TEX_FILTER_FORCE_NON_WIC = 0x10000000, + // Forces use of the non-WIC path when both are an option + + TEX_FILTER_FORCE_WIC = 0x20000000, + // Forces use of the WIC path even when logic would have picked a non-WIC path when both are an option + }; + + constexpr unsigned long TEX_FILTER_DITHER_MASK = 0xF0000; + constexpr unsigned long TEX_FILTER_MODE_MASK = 0xF00000; + constexpr unsigned long TEX_FILTER_SRGB_MASK = 0xF000000; + + HRESULT __cdecl Resize( + _In_ const Image& srcImage, _In_ size_t width, _In_ size_t height, + _In_ TEX_FILTER_FLAGS filter, + _Out_ ScratchImage& image) noexcept; + HRESULT __cdecl Resize( + _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ size_t width, _In_ size_t height, _In_ TEX_FILTER_FLAGS filter, _Out_ ScratchImage& result) noexcept; + // Resize the image to width x height. Defaults to Fant filtering. + // Note for a complex resize, the result will always have mipLevels == 1 + + constexpr float TEX_THRESHOLD_DEFAULT = 0.5f; + // Default value for alpha threshold used when converting to 1-bit alpha + + HRESULT __cdecl Convert( + _In_ const Image& srcImage, _In_ DXGI_FORMAT format, _In_ TEX_FILTER_FLAGS filter, _In_ float threshold, + _Out_ ScratchImage& image) noexcept; + HRESULT __cdecl Convert( + _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ DXGI_FORMAT format, _In_ TEX_FILTER_FLAGS filter, _In_ float threshold, _Out_ ScratchImage& result) noexcept; + // Convert the image to a new format + + HRESULT __cdecl ConvertToSinglePlane(_In_ const Image& srcImage, _Out_ ScratchImage& image) noexcept; + HRESULT __cdecl ConvertToSinglePlane( + _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _Out_ ScratchImage& image) noexcept; + // Converts the image from a planar format to an equivalent non-planar format + + HRESULT __cdecl GenerateMipMaps( + _In_ const Image& baseImage, _In_ TEX_FILTER_FLAGS filter, _In_ size_t levels, + _Inout_ ScratchImage& mipChain, _In_ bool allow1D = false) noexcept; + HRESULT __cdecl GenerateMipMaps( + _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ TEX_FILTER_FLAGS filter, _In_ size_t levels, _Inout_ ScratchImage& mipChain); + // levels of '0' indicates a full mipchain, otherwise is generates that number of total levels (including the source base image) + // Defaults to Fant filtering which is equivalent to a box filter + + HRESULT __cdecl GenerateMipMaps3D( + _In_reads_(depth) const Image* baseImages, _In_ size_t depth, _In_ TEX_FILTER_FLAGS filter, _In_ size_t levels, + _Out_ ScratchImage& mipChain) noexcept; + HRESULT __cdecl GenerateMipMaps3D( + _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ TEX_FILTER_FLAGS filter, _In_ size_t levels, _Out_ ScratchImage& mipChain); + // levels of '0' indicates a full mipchain, otherwise is generates that number of total levels (including the source base image) + // Defaults to Fant filtering which is equivalent to a box filter + + HRESULT __cdecl ScaleMipMapsAlphaForCoverage( + _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, _In_ size_t item, + _In_ float alphaReference, _Inout_ ScratchImage& mipChain) noexcept; + + + enum TEX_PMALPHA_FLAGS : unsigned long + { + TEX_PMALPHA_DEFAULT = 0, + + TEX_PMALPHA_IGNORE_SRGB = 0x1, + // ignores sRGB colorspace conversions + + TEX_PMALPHA_REVERSE = 0x2, + // converts from premultiplied alpha back to straight alpha + + TEX_PMALPHA_SRGB_IN = 0x1000000, + TEX_PMALPHA_SRGB_OUT = 0x2000000, + TEX_PMALPHA_SRGB = (TEX_PMALPHA_SRGB_IN | TEX_PMALPHA_SRGB_OUT), + // if the input format type is IsSRGB(), then SRGB_IN is on by default + // if the output format type is IsSRGB(), then SRGB_OUT is on by default + }; + + HRESULT __cdecl PremultiplyAlpha(_In_ const Image& srcImage, _In_ TEX_PMALPHA_FLAGS flags, _Out_ ScratchImage& image) noexcept; + HRESULT __cdecl PremultiplyAlpha( + _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ TEX_PMALPHA_FLAGS flags, _Out_ ScratchImage& result) noexcept; + // Converts to/from a premultiplied alpha version of the texture + + enum TEX_COMPRESS_FLAGS : unsigned long + { + TEX_COMPRESS_DEFAULT = 0, + + TEX_COMPRESS_RGB_DITHER = 0x10000, + // Enables dithering RGB colors for BC1-3 compression + + TEX_COMPRESS_A_DITHER = 0x20000, + // Enables dithering alpha for BC1-3 compression + + TEX_COMPRESS_DITHER = 0x30000, + // Enables both RGB and alpha dithering for BC1-3 compression + + TEX_COMPRESS_UNIFORM = 0x40000, + // Uniform color weighting for BC1-3 compression; by default uses perceptual weighting + + TEX_COMPRESS_BC7_USE_3SUBSETS = 0x80000, + // Enables exhaustive search for BC7 compress for mode 0 and 2; by default skips trying these modes + + TEX_COMPRESS_BC7_QUICK = 0x100000, + // Minimal modes (usually mode 6) for BC7 compression + + TEX_COMPRESS_SRGB_IN = 0x1000000, + TEX_COMPRESS_SRGB_OUT = 0x2000000, + TEX_COMPRESS_SRGB = (TEX_COMPRESS_SRGB_IN | TEX_COMPRESS_SRGB_OUT), + // if the input format type is IsSRGB(), then SRGB_IN is on by default + // if the output format type is IsSRGB(), then SRGB_OUT is on by default + + TEX_COMPRESS_PARALLEL = 0x10000000, + // Compress is free to use multithreading to improve performance (by default it does not use multithreading) + }; + + HRESULT __cdecl Compress( + _In_ const Image& srcImage, _In_ DXGI_FORMAT format, _In_ TEX_COMPRESS_FLAGS compress, _In_ float threshold, + _Out_ ScratchImage& cImage) noexcept; + HRESULT __cdecl Compress( + _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ DXGI_FORMAT format, _In_ TEX_COMPRESS_FLAGS compress, _In_ float threshold, _Out_ ScratchImage& cImages) noexcept; + // Note that threshold is only used by BC1. TEX_THRESHOLD_DEFAULT is a typical value to use + +#if defined(__d3d11_h__) || defined(__d3d11_x_h__) + HRESULT __cdecl Compress( + _In_ ID3D11Device* pDevice, _In_ const Image& srcImage, _In_ DXGI_FORMAT format, _In_ TEX_COMPRESS_FLAGS compress, + _In_ float alphaWeight, _Out_ ScratchImage& image) noexcept; + HRESULT __cdecl Compress( + _In_ ID3D11Device* pDevice, _In_ const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ DXGI_FORMAT format, _In_ TEX_COMPRESS_FLAGS compress, _In_ float alphaWeight, _Out_ ScratchImage& cImages) noexcept; + // DirectCompute-based compression (alphaWeight is only used by BC7. 1.0 is the typical value to use) +#endif + + HRESULT __cdecl Decompress(_In_ const Image& cImage, _In_ DXGI_FORMAT format, _Out_ ScratchImage& image) noexcept; + HRESULT __cdecl Decompress( + _In_reads_(nimages) const Image* cImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ DXGI_FORMAT format, _Out_ ScratchImage& images) noexcept; + + //--------------------------------------------------------------------------------- + // Normal map operations + + enum CNMAP_FLAGS : unsigned long + { + CNMAP_DEFAULT = 0, + + CNMAP_CHANNEL_RED = 0x1, + CNMAP_CHANNEL_GREEN = 0x2, + CNMAP_CHANNEL_BLUE = 0x3, + CNMAP_CHANNEL_ALPHA = 0x4, + CNMAP_CHANNEL_LUMINANCE = 0x5, + // Channel selection when evaluting color value for height + // Luminance is a combination of red, green, and blue + + CNMAP_MIRROR_U = 0x1000, + CNMAP_MIRROR_V = 0x2000, + CNMAP_MIRROR = 0x3000, + // Use mirror semantics for scanline references (defaults to wrap) + + CNMAP_INVERT_SIGN = 0x4000, + // Inverts normal sign + + CNMAP_COMPUTE_OCCLUSION = 0x8000, + // Computes a crude occlusion term stored in the alpha channel + }; + + HRESULT __cdecl ComputeNormalMap( + _In_ const Image& srcImage, _In_ CNMAP_FLAGS flags, _In_ float amplitude, + _In_ DXGI_FORMAT format, _Out_ ScratchImage& normalMap) noexcept; + HRESULT __cdecl ComputeNormalMap( + _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ CNMAP_FLAGS flags, _In_ float amplitude, _In_ DXGI_FORMAT format, _Out_ ScratchImage& normalMaps) noexcept; + + //--------------------------------------------------------------------------------- + // Misc image operations + + struct Rect + { + size_t x; + size_t y; + size_t w; + size_t h; + + Rect() = default; + Rect(size_t _x, size_t _y, size_t _w, size_t _h) noexcept : x(_x), y(_y), w(_w), h(_h) {} + }; + + HRESULT __cdecl CopyRectangle( + _In_ const Image& srcImage, _In_ const Rect& srcRect, _In_ const Image& dstImage, + _In_ TEX_FILTER_FLAGS filter, _In_ size_t xOffset, _In_ size_t yOffset) noexcept; + + enum CMSE_FLAGS : unsigned long + { + CMSE_DEFAULT = 0, + + CMSE_IMAGE1_SRGB = 0x1, + CMSE_IMAGE2_SRGB = 0x2, + // Indicates that image needs gamma correction before comparision + + CMSE_IGNORE_RED = 0x10, + CMSE_IGNORE_GREEN = 0x20, + CMSE_IGNORE_BLUE = 0x40, + CMSE_IGNORE_ALPHA = 0x80, + // Ignore the channel when computing MSE + + CMSE_IMAGE1_X2_BIAS = 0x100, + CMSE_IMAGE2_X2_BIAS = 0x200, + // Indicates that image should be scaled and biased before comparison (i.e. UNORM -> SNORM) + }; + + HRESULT __cdecl ComputeMSE(_In_ const Image& image1, _In_ const Image& image2, _Out_ float& mse, _Out_writes_opt_(4) float* mseV, _In_ CMSE_FLAGS flags = CMSE_DEFAULT) noexcept; + + HRESULT __cdecl EvaluateImage( + _In_ const Image& image, + _In_ std::function pixelFunc); + HRESULT __cdecl EvaluateImage( + _In_reads_(nimages) const Image* images, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ std::function pixelFunc); + + HRESULT __cdecl TransformImage( + _In_ const Image& image, + _In_ std::function pixelFunc, + ScratchImage& result); + HRESULT __cdecl TransformImage( + _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ std::function pixelFunc, + ScratchImage& result); + + //--------------------------------------------------------------------------------- + // WIC utility code +#ifdef _WIN32 + enum WICCodecs + { + WIC_CODEC_BMP = 1, // Windows Bitmap (.bmp) + WIC_CODEC_JPEG, // Joint Photographic Experts Group (.jpg, .jpeg) + WIC_CODEC_PNG, // Portable Network Graphics (.png) + WIC_CODEC_TIFF, // Tagged Image File Format (.tif, .tiff) + WIC_CODEC_GIF, // Graphics Interchange Format (.gif) + WIC_CODEC_WMP, // Windows Media Photo / HD Photo / JPEG XR (.hdp, .jxr, .wdp) + WIC_CODEC_ICO, // Windows Icon (.ico) + WIC_CODEC_HEIF, // High Efficiency Image File (.heif, .heic) + }; + + REFGUID __cdecl GetWICCodec(_In_ WICCodecs codec) noexcept; + + IWICImagingFactory* __cdecl GetWICFactory(bool& iswic2) noexcept; + void __cdecl SetWICFactory(_In_opt_ IWICImagingFactory* pWIC) noexcept; +#endif + + //--------------------------------------------------------------------------------- + // DDS helper functions + HRESULT __cdecl EncodeDDSHeader( + _In_ const TexMetadata& metadata, DDS_FLAGS flags, + _Out_writes_bytes_to_opt_(maxsize, required) void* pDestination, _In_ size_t maxsize, + _Out_ size_t& required) noexcept; + + //--------------------------------------------------------------------------------- + // Direct3D interop + + enum CREATETEX_FLAGS : uint32_t + { + CREATETEX_DEFAULT = 0, + CREATETEX_FORCE_SRGB = 0x1, + CREATETEX_IGNORE_SRGB = 0x2, + }; + + // Direct3D 11 functions +#if defined(__d3d11_h__) || defined(__d3d11_x_h__) + bool __cdecl IsSupportedTexture(_In_ ID3D11Device* pDevice, _In_ const TexMetadata& metadata) noexcept; + + HRESULT __cdecl CreateTexture( + _In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _Outptr_ ID3D11Resource** ppResource) noexcept; + + HRESULT __cdecl CreateShaderResourceView( + _In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _Outptr_ ID3D11ShaderResourceView** ppSRV) noexcept; + + HRESULT __cdecl CreateTextureEx( + _In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ CREATETEX_FLAGS flags, + _Outptr_ ID3D11Resource** ppResource) noexcept; + + HRESULT __cdecl CreateShaderResourceViewEx( + _In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ CREATETEX_FLAGS flags, + _Outptr_ ID3D11ShaderResourceView** ppSRV) noexcept; + + HRESULT __cdecl CaptureTexture(_In_ ID3D11Device* pDevice, _In_ ID3D11DeviceContext* pContext, _In_ ID3D11Resource* pSource, _Out_ ScratchImage& result) noexcept; +#endif + + // Direct3D 12 functions +#if defined(__d3d12_h__) || defined(__d3d12_x_h__) || defined(__XBOX_D3D12_X__) + bool __cdecl IsSupportedTexture(_In_ ID3D12Device* pDevice, _In_ const TexMetadata& metadata) noexcept; + + HRESULT __cdecl CreateTexture( + _In_ ID3D12Device* pDevice, _In_ const TexMetadata& metadata, + _Outptr_ ID3D12Resource** ppResource) noexcept; + + HRESULT __cdecl CreateTextureEx( + _In_ ID3D12Device* pDevice, _In_ const TexMetadata& metadata, + _In_ D3D12_RESOURCE_FLAGS resFlags, _In_ CREATETEX_FLAGS flags, + _Outptr_ ID3D12Resource** ppResource) noexcept; + + HRESULT __cdecl PrepareUpload( + _In_ ID3D12Device* pDevice, + _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + std::vector& subresources); + + HRESULT __cdecl CaptureTexture( + _In_ ID3D12CommandQueue* pCommandQueue, _In_ ID3D12Resource* pSource, _In_ bool isCubeMap, + _Out_ ScratchImage& result, + _In_ D3D12_RESOURCE_STATES beforeState = D3D12_RESOURCE_STATE_RENDER_TARGET, + _In_ D3D12_RESOURCE_STATES afterState = D3D12_RESOURCE_STATE_RENDER_TARGET) noexcept; +#endif + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcovered-switch-default" +#pragma clang diagnostic ignored "-Wdeprecated-dynamic-exception-spec" +#pragma clang diagnostic ignored "-Wswitch-enum" +#endif + +#pragma warning(push) +#pragma warning(disable : 4619 4616 4061) + +#include "DirectXTex.inl" + +#pragma warning(pop) + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +} // namespace diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/DirectXTex.inl b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/DirectXTex.inl new file mode 100644 index 0000000..7fef321 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/DirectXTex.inl @@ -0,0 +1,213 @@ +//------------------------------------------------------------------------------------- +// DirectXTex.inl +// +// DirectX Texture Library +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +// +// http://go.microsoft.com/fwlink/?LinkId=248926 +//------------------------------------------------------------------------------------- + +#pragma once + +//===================================================================================== +// Bitmask flags enumerator operators +//===================================================================================== +DEFINE_ENUM_FLAG_OPERATORS(CP_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(DDS_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(TGA_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(WIC_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(TEX_FR_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(TEX_FILTER_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(TEX_PMALPHA_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(TEX_COMPRESS_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(CNMAP_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(CMSE_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(CREATETEX_FLAGS); + +// WIC_FILTER modes match TEX_FILTER modes +constexpr WIC_FLAGS operator|(WIC_FLAGS a, TEX_FILTER_FLAGS b) { return static_cast(static_cast(a) | static_cast(b & TEX_FILTER_MODE_MASK)); } +constexpr WIC_FLAGS operator|(TEX_FILTER_FLAGS a, WIC_FLAGS b) { return static_cast(static_cast(a & TEX_FILTER_MODE_MASK) | static_cast(b)); } + +// TEX_PMALPHA_SRGB match TEX_FILTER_SRGB +constexpr TEX_PMALPHA_FLAGS operator|(TEX_PMALPHA_FLAGS a, TEX_FILTER_FLAGS b) { return static_cast(static_cast(a) | static_cast(b & TEX_FILTER_SRGB_MASK)); } +constexpr TEX_PMALPHA_FLAGS operator|(TEX_FILTER_FLAGS a, TEX_PMALPHA_FLAGS b) { return static_cast(static_cast(a & TEX_FILTER_SRGB_MASK) | static_cast(b)); } + +// TEX_COMPRESS_SRGB match TEX_FILTER_SRGB +constexpr TEX_COMPRESS_FLAGS operator|(TEX_COMPRESS_FLAGS a, TEX_FILTER_FLAGS b) { return static_cast(static_cast(a) | static_cast(b & TEX_FILTER_SRGB_MASK)); } +constexpr TEX_COMPRESS_FLAGS operator|(TEX_FILTER_FLAGS a, TEX_COMPRESS_FLAGS b) { return static_cast(static_cast(a & TEX_FILTER_SRGB_MASK) | static_cast(b)); } + + +//===================================================================================== +// DXGI Format Utilities +//===================================================================================== + +_Use_decl_annotations_ +constexpr bool __cdecl IsValid(DXGI_FORMAT fmt) noexcept +{ + return (static_cast(fmt) >= 1 && static_cast(fmt) <= 190); +} + +_Use_decl_annotations_ +inline bool __cdecl IsCompressed(DXGI_FORMAT fmt) noexcept +{ + switch (fmt) + { + case DXGI_FORMAT_BC1_TYPELESS: + case DXGI_FORMAT_BC1_UNORM: + case DXGI_FORMAT_BC1_UNORM_SRGB: + case DXGI_FORMAT_BC2_TYPELESS: + case DXGI_FORMAT_BC2_UNORM: + case DXGI_FORMAT_BC2_UNORM_SRGB: + case DXGI_FORMAT_BC3_TYPELESS: + case DXGI_FORMAT_BC3_UNORM: + case DXGI_FORMAT_BC3_UNORM_SRGB: + case DXGI_FORMAT_BC4_TYPELESS: + case DXGI_FORMAT_BC4_UNORM: + case DXGI_FORMAT_BC4_SNORM: + case DXGI_FORMAT_BC5_TYPELESS: + case DXGI_FORMAT_BC5_UNORM: + case DXGI_FORMAT_BC5_SNORM: + case DXGI_FORMAT_BC6H_TYPELESS: + case DXGI_FORMAT_BC6H_UF16: + case DXGI_FORMAT_BC6H_SF16: + case DXGI_FORMAT_BC7_TYPELESS: + case DXGI_FORMAT_BC7_UNORM: + case DXGI_FORMAT_BC7_UNORM_SRGB: + return true; + + default: + return false; + } +} + +_Use_decl_annotations_ +inline bool __cdecl IsPalettized(DXGI_FORMAT fmt) noexcept +{ + switch (fmt) + { + case DXGI_FORMAT_AI44: + case DXGI_FORMAT_IA44: + case DXGI_FORMAT_P8: + case DXGI_FORMAT_A8P8: + return true; + + default: + return false; + } +} + +_Use_decl_annotations_ +inline bool __cdecl IsSRGB(DXGI_FORMAT fmt) noexcept +{ + switch (fmt) + { + case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB: + case DXGI_FORMAT_BC1_UNORM_SRGB: + case DXGI_FORMAT_BC2_UNORM_SRGB: + case DXGI_FORMAT_BC3_UNORM_SRGB: + case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB: + case DXGI_FORMAT_B8G8R8X8_UNORM_SRGB: + case DXGI_FORMAT_BC7_UNORM_SRGB: + return true; + + default: + return false; + } +} + +_Use_decl_annotations_ +inline bool __cdecl IsBGR(DXGI_FORMAT fmt) noexcept +{ + switch (fmt) + { + case DXGI_FORMAT_B5G6R5_UNORM: + case DXGI_FORMAT_B5G5R5A1_UNORM: + case DXGI_FORMAT_B8G8R8A8_UNORM: + case DXGI_FORMAT_B8G8R8X8_UNORM: + case DXGI_FORMAT_B8G8R8A8_TYPELESS: + case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB: + case DXGI_FORMAT_B8G8R8X8_TYPELESS: + case DXGI_FORMAT_B8G8R8X8_UNORM_SRGB: + case DXGI_FORMAT_B4G4R4A4_UNORM: + return true; + + default: + return false; + } +} + + +//===================================================================================== +// Image I/O +//===================================================================================== +_Use_decl_annotations_ +inline HRESULT __cdecl SaveToDDSMemory(const Image& image, DDS_FLAGS flags, Blob& blob) noexcept +{ + TexMetadata mdata = {}; + mdata.width = image.width; + mdata.height = image.height; + mdata.depth = 1; + mdata.arraySize = 1; + mdata.mipLevels = 1; + mdata.format = image.format; + mdata.dimension = TEX_DIMENSION_TEXTURE2D; + + return SaveToDDSMemory(&image, 1, mdata, flags, blob); +} + +_Use_decl_annotations_ +inline HRESULT __cdecl SaveToDDSFile(const Image& image, DDS_FLAGS flags, const wchar_t* szFile) noexcept +{ + TexMetadata mdata = {}; + mdata.width = image.width; + mdata.height = image.height; + mdata.depth = 1; + mdata.arraySize = 1; + mdata.mipLevels = 1; + mdata.format = image.format; + mdata.dimension = TEX_DIMENSION_TEXTURE2D; + + return SaveToDDSFile(&image, 1, mdata, flags, szFile); +} + + +//===================================================================================== +// Compatability helpers +//===================================================================================== +_Use_decl_annotations_ +inline HRESULT __cdecl GetMetadataFromTGAMemory(const void* pSource, size_t size, TexMetadata& metadata) noexcept +{ + return GetMetadataFromTGAMemory(pSource, size, TGA_FLAGS_NONE, metadata); +} + +_Use_decl_annotations_ +inline HRESULT __cdecl GetMetadataFromTGAFile(const wchar_t* szFile, TexMetadata& metadata) noexcept +{ + return GetMetadataFromTGAFile(szFile, TGA_FLAGS_NONE, metadata); +} + +_Use_decl_annotations_ +inline HRESULT __cdecl LoadFromTGAMemory(const void* pSource, size_t size, TexMetadata* metadata, ScratchImage& image) noexcept +{ + return LoadFromTGAMemory(pSource, size, TGA_FLAGS_NONE, metadata, image); +} + +_Use_decl_annotations_ +inline HRESULT __cdecl LoadFromTGAFile(const wchar_t* szFile, TexMetadata* metadata, ScratchImage& image) noexcept +{ + return LoadFromTGAFile(szFile, TGA_FLAGS_NONE, metadata, image); +} + +_Use_decl_annotations_ +inline HRESULT __cdecl SaveToTGAMemory(const Image& image, Blob& blob, const TexMetadata* metadata) noexcept +{ + return SaveToTGAMemory(image, TGA_FLAGS_NONE, blob, metadata); +} + +_Use_decl_annotations_ +inline HRESULT __cdecl SaveToTGAFile(const Image& image, const wchar_t* szFile, const TexMetadata* metadata) noexcept +{ + return SaveToTGAFile(image, TGA_FLAGS_NONE, szFile, metadata); +} diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/MinHook.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/MinHook.h new file mode 100644 index 0000000..15c0a87 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/MinHook.h @@ -0,0 +1,186 @@ +/* + * MinHook - The Minimalistic API Hooking Library for x64/x86 + * Copyright (C) 2009-2017 Tsuda Kageyu. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#if !(defined _M_IX86) && !(defined _M_X64) && !(defined __i386__) && !(defined __x86_64__) + #error MinHook supports only x86 and x64 systems. +#endif + +#include + +// MinHook Error Codes. +typedef enum MH_STATUS +{ + // Unknown error. Should not be returned. + MH_UNKNOWN = -1, + + // Successful. + MH_OK = 0, + + // MinHook is already initialized. + MH_ERROR_ALREADY_INITIALIZED, + + // MinHook is not initialized yet, or already uninitialized. + MH_ERROR_NOT_INITIALIZED, + + // The hook for the specified target function is already created. + MH_ERROR_ALREADY_CREATED, + + // The hook for the specified target function is not created yet. + MH_ERROR_NOT_CREATED, + + // The hook for the specified target function is already enabled. + MH_ERROR_ENABLED, + + // The hook for the specified target function is not enabled yet, or already + // disabled. + MH_ERROR_DISABLED, + + // The specified pointer is invalid. It points the address of non-allocated + // and/or non-executable region. + MH_ERROR_NOT_EXECUTABLE, + + // The specified target function cannot be hooked. + MH_ERROR_UNSUPPORTED_FUNCTION, + + // Failed to allocate memory. + MH_ERROR_MEMORY_ALLOC, + + // Failed to change the memory protection. + MH_ERROR_MEMORY_PROTECT, + + // The specified module is not loaded. + MH_ERROR_MODULE_NOT_FOUND, + + // The specified function is not found. + MH_ERROR_FUNCTION_NOT_FOUND +} +MH_STATUS; + +// Can be passed as a parameter to MH_EnableHook, MH_DisableHook, +// MH_QueueEnableHook or MH_QueueDisableHook. +#define MH_ALL_HOOKS NULL + +#ifdef __cplusplus +extern "C" { +#endif + + // Initialize the MinHook library. You must call this function EXACTLY ONCE + // at the beginning of your program. + MH_STATUS WINAPI MH_Initialize(VOID); + + // Uninitialize the MinHook library. You must call this function EXACTLY + // ONCE at the end of your program. + MH_STATUS WINAPI MH_Uninitialize(VOID); + + // Creates a Hook for the specified target function, in disabled state. + // Parameters: + // pTarget [in] A pointer to the target function, which will be + // overridden by the detour function. + // pDetour [in] A pointer to the detour function, which will override + // the target function. + // ppOriginal [out] A pointer to the trampoline function, which will be + // used to call the original target function. + // This parameter can be NULL. + MH_STATUS WINAPI MH_CreateHook(LPVOID pTarget, LPVOID pDetour, LPVOID *ppOriginal); + + // Creates a Hook for the specified API function, in disabled state. + // Parameters: + // pszModule [in] A pointer to the loaded module name which contains the + // target function. + // pszTarget [in] A pointer to the target function name, which will be + // overridden by the detour function. + // pDetour [in] A pointer to the detour function, which will override + // the target function. + // ppOriginal [out] A pointer to the trampoline function, which will be + // used to call the original target function. + // This parameter can be NULL. + MH_STATUS WINAPI MH_CreateHookApi( + LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour, LPVOID *ppOriginal); + + // Creates a Hook for the specified API function, in disabled state. + // Parameters: + // pszModule [in] A pointer to the loaded module name which contains the + // target function. + // pszTarget [in] A pointer to the target function name, which will be + // overridden by the detour function. + // pDetour [in] A pointer to the detour function, which will override + // the target function. + // ppOriginal [out] A pointer to the trampoline function, which will be + // used to call the original target function. + // This parameter can be NULL. + // ppTarget [out] A pointer to the target function, which will be used + // with other functions. + // This parameter can be NULL. + MH_STATUS WINAPI MH_CreateHookApiEx( + LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour, LPVOID *ppOriginal, LPVOID *ppTarget); + + // Removes an already created hook. + // Parameters: + // pTarget [in] A pointer to the target function. + MH_STATUS WINAPI MH_RemoveHook(LPVOID pTarget); + + // Enables an already created hook. + // Parameters: + // pTarget [in] A pointer to the target function. + // If this parameter is MH_ALL_HOOKS, all created hooks are + // enabled in one go. + MH_STATUS WINAPI MH_EnableHook(LPVOID pTarget); + + // Disables an already created hook. + // Parameters: + // pTarget [in] A pointer to the target function. + // If this parameter is MH_ALL_HOOKS, all created hooks are + // disabled in one go. + MH_STATUS WINAPI MH_DisableHook(LPVOID pTarget); + + // Queues to enable an already created hook. + // Parameters: + // pTarget [in] A pointer to the target function. + // If this parameter is MH_ALL_HOOKS, all created hooks are + // queued to be enabled. + MH_STATUS WINAPI MH_QueueEnableHook(LPVOID pTarget); + + // Queues to disable an already created hook. + // Parameters: + // pTarget [in] A pointer to the target function. + // If this parameter is MH_ALL_HOOKS, all created hooks are + // queued to be disabled. + MH_STATUS WINAPI MH_QueueDisableHook(LPVOID pTarget); + + // Applies all queued changes in one go. + MH_STATUS WINAPI MH_ApplyQueued(VOID); + + // Translates the MH_STATUS to its name as a string. + const char * WINAPI MH_StatusToString(MH_STATUS status); + +#ifdef __cplusplus +} +#endif + diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/accept_encoding.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/accept_encoding.h new file mode 100644 index 0000000..e09ad06 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/accept_encoding.h @@ -0,0 +1,36 @@ +#ifndef CPR_ACCEPT_ENCODING_H +#define CPR_ACCEPT_ENCODING_H + +#include +#include +#include +#include +#include + +namespace cpr { + +enum class AcceptEncodingMethods { + identity, + deflate, + zlib, + gzip, +}; + +static const std::map AcceptEncodingMethodsStringMap{{AcceptEncodingMethods::identity, "identity"}, {AcceptEncodingMethods::deflate, "deflate"}, {AcceptEncodingMethods::zlib, "zlib"}, {AcceptEncodingMethods::gzip, "gzip"}}; + +class AcceptEncoding { + public: + AcceptEncoding() = default; + AcceptEncoding(const std::initializer_list& methods); + AcceptEncoding(const std::initializer_list& methods); + + bool empty() const noexcept; + const std::string getString() const; + + private: + std::vector methods_; +}; + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/api.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/api.h new file mode 100644 index 0000000..9090a56 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/api.h @@ -0,0 +1,246 @@ +#ifndef CPR_API_H +#define CPR_API_H + +#include +#include +#include +#include +#include + +#include "cpr/async.h" +#include "cpr/auth.h" +#include "cpr/bearer.h" +#include "cpr/cprtypes.h" +#include "cpr/multipart.h" +#include "cpr/payload.h" +#include "cpr/response.h" +#include "cpr/session.h" +#include + +namespace cpr { + +using AsyncResponse = std::future; + +namespace priv { + +template +void set_option_internal(Session& session, CurrentType&& current_option) { + session.SetOption(std::forward(current_option)); +} + +template <> +inline void set_option_internal(Session& session, Header&& current_option) { + // Header option was already provided -> Update previous header + session.UpdateHeader(std::forward
(current_option)); +} + +template +void set_option_internal(Session& session, CurrentType&& current_option, Ts&&... ts) { + set_option_internal(session, std::forward(current_option)); + + if (std::is_same::value) { + set_option_internal(session, std::forward(ts)...); + } else { + set_option_internal(session, std::forward(ts)...); + } +} + +template +void set_option(Session& session, Ts&&... ts) { + set_option_internal(session, std::forward(ts)...); +} + +} // namespace priv + +// Get methods +template +Response Get(Ts&&... ts) { + Session session; + priv::set_option(session, std::forward(ts)...); + return session.Get(); +} + +// Get async methods +template +AsyncResponse GetAsync(Ts... ts) { + return cpr::async( + [](Ts... ts_inner) { return Get(std::move(ts_inner)...); }, std::move(ts)...); +} + +// Get callback methods +template +// NOLINTNEXTLINE(fuchsia-trailing-return) +auto GetCallback(Then then, Ts... ts) -> std::future { + return cpr::async( + [](Then then_inner, Ts... ts_inner) { return then_inner(Get(std::move(ts_inner)...)); }, std::move(then), std::move(ts)...); +} + +// Post methods +template +Response Post(Ts&&... ts) { + Session session; + priv::set_option(session, std::forward(ts)...); + return session.Post(); +} + +// Post async methods +template +AsyncResponse PostAsync(Ts... ts) { + return cpr::async( + [](Ts... ts_inner) { return Post(std::move(ts_inner)...); }, std::move(ts)...); +} + +// Post callback methods +template +// NOLINTNEXTLINE(fuchsia-trailing-return) +auto PostCallback(Then then, Ts... ts) -> std::future { + return cpr::async( + [](Then then_inner, Ts... ts_inner) { return then_inner(Post(std::move(ts_inner)...)); }, std::move(then), std::move(ts)...); +} + +// Put methods +template +Response Put(Ts&&... ts) { + Session session; + priv::set_option(session, std::forward(ts)...); + return session.Put(); +} + +// Put async methods +template +AsyncResponse PutAsync(Ts... ts) { + return cpr::async( + [](Ts... ts_inner) { return Put(std::move(ts_inner)...); }, std::move(ts)...); +} + +// Put callback methods +template +// NOLINTNEXTLINE(fuchsia-trailing-return) +auto PutCallback(Then then, Ts... ts) -> std::future { + return cpr::async( + [](Then then_inner, Ts... ts_inner) { return then_inner(Put(std::move(ts_inner)...)); }, std::move(then), std::move(ts)...); +} + +// Head methods +template +Response Head(Ts&&... ts) { + Session session; + priv::set_option(session, std::forward(ts)...); + return session.Head(); +} + +// Head async methods +template +AsyncResponse HeadAsync(Ts... ts) { + return cpr::async( + [](Ts... ts_inner) { return Head(std::move(ts_inner)...); }, std::move(ts)...); +} + +// Head callback methods +template +// NOLINTNEXTLINE(fuchsia-trailing-return) +auto HeadCallback(Then then, Ts... ts) -> std::future { + return cpr::async( + [](Then then_inner, Ts... ts_inner) { return then_inner(Head(std::move(ts_inner)...)); }, std::move(then), std::move(ts)...); +} + +// Delete methods +template +Response Delete(Ts&&... ts) { + Session session; + priv::set_option(session, std::forward(ts)...); + return session.Delete(); +} + +// Delete async methods +template +AsyncResponse DeleteAsync(Ts... ts) { + return cpr::async( + [](Ts... ts_inner) { return Delete(std::move(ts_inner)...); }, std::move(ts)...); +} + +// Delete callback methods +template +// NOLINTNEXTLINE(fuchsia-trailing-return) +auto DeleteCallback(Then then, Ts... ts) -> std::future { + return cpr::async( + [](Then then_inner, Ts... ts_inner) { return then_inner(Delete(std::move(ts_inner)...)); }, std::move(then), std::move(ts)...); +} + +// Options methods +template +Response Options(Ts&&... ts) { + Session session; + priv::set_option(session, std::forward(ts)...); + return session.Options(); +} + +// Options async methods +template +AsyncResponse OptionsAsync(Ts... ts) { + return cpr::async( + [](Ts... ts_inner) { return Options(std::move(ts_inner)...); }, std::move(ts)...); +} + +// Options callback methods +template +// NOLINTNEXTLINE(fuchsia-trailing-return) +auto OptionsCallback(Then then, Ts... ts) -> std::future { + return cpr::async( + [](Then then_inner, Ts... ts_inner) { return then_inner(Options(std::move(ts_inner)...)); }, std::move(then), std::move(ts)...); +} + +// Patch methods +template +Response Patch(Ts&&... ts) { + Session session; + priv::set_option(session, std::forward(ts)...); + return session.Patch(); +} + +// Patch async methods +template +AsyncResponse PatchAsync(Ts... ts) { + return cpr::async( + [](Ts... ts_inner) { return Patch(std::move(ts_inner)...); }, std::move(ts)...); +} + +// Patch callback methods +template +// NOLINTNEXTLINE(fuchsia-trailing-return) +auto PatchCallback(Then then, Ts... ts) -> std::future { + return cpr::async( + [](Then then_inner, Ts... ts_inner) { return then_inner(Patch(std::move(ts_inner)...)); }, std::move(then), std::move(ts)...); +} + +// Download methods +template +Response Download(std::ofstream& file, Ts&&... ts) { + Session session; + priv::set_option(session, std::forward(ts)...); + return session.Download(file); +} + +// Download async method +template +AsyncResponse DownloadAsync(std::string local_path, Ts... ts) { + return std::async( + std::launch::async, + [](std::string local_path, Ts... ts) { + std::ofstream f(local_path); + return Download(f, std::move(ts)...); + }, + std::move(local_path), std::move(ts)...); +} + +// Download with user callback +template +Response Download(const WriteCallback& write, Ts&&... ts) { + Session session; + priv::set_option(session, std::forward(ts)...); + return session.Download(write); +} + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/async.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/async.h new file mode 100644 index 0000000..e81c52b --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/async.h @@ -0,0 +1,49 @@ +#ifndef CPR_ASYNC_H +#define CPR_ASYNC_H + +#include "singleton.h" +#include "threadpool.h" + +namespace cpr { + +class GlobalThreadPool : public ThreadPool { + CPR_SINGLETON_DECL(GlobalThreadPool) + protected: + GlobalThreadPool() = default; + + public: + ~GlobalThreadPool() override = default; +}; + +/** + * Return a future, calling future.get() will wait task done and return RetType. + * async(fn, args...) + * async(std::bind(&Class::mem_fn, &obj)) + * async(std::mem_fn(&Class::mem_fn, &obj)) + **/ +template +auto async(Fn&& fn, Args&&... args) -> std::future { + return GlobalThreadPool::GetInstance()->Submit(std::forward(fn), std::forward(args)...); +} + +class async { + public: + static void startup(size_t min_threads = CPR_DEFAULT_THREAD_POOL_MIN_THREAD_NUM, size_t max_threads = CPR_DEFAULT_THREAD_POOL_MAX_THREAD_NUM, std::chrono::milliseconds max_idle_ms = CPR_DEFAULT_THREAD_POOL_MAX_IDLE_TIME) { + GlobalThreadPool* gtp = GlobalThreadPool::GetInstance(); + if (gtp->IsStarted()) { + return; + } + gtp->SetMinThreadNum(min_threads); + gtp->SetMaxThreadNum(max_threads); + gtp->SetMaxIdleTime(max_idle_ms); + gtp->Start(); + } + + static void cleanup() { + GlobalThreadPool::ExitInstance(); + } +}; + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/auth.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/auth.h new file mode 100644 index 0000000..76281d5 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/auth.h @@ -0,0 +1,33 @@ +#ifndef CPR_AUTH_H +#define CPR_AUTH_H + +#include + +#include + +namespace cpr { + +enum class AuthMode { BASIC, DIGEST, NTLM }; + +class Authentication { + public: + Authentication(const std::string& username, const std::string& password, const AuthMode& auth_mode) : auth_string_{username + ":" + password}, auth_mode_{auth_mode} {} + Authentication(std::string&& username, std::string&& password, const AuthMode&& auth_mode) : auth_string_{std::move(username) + ":" + std::move(password)}, auth_mode_{std::move(auth_mode)} {} + Authentication(const Authentication& other) = default; + Authentication(Authentication&& old) noexcept = default; + ~Authentication() noexcept; + + Authentication& operator=(Authentication&& old) noexcept = default; + Authentication& operator=(const Authentication& other) = default; + + const char* GetAuthString() const noexcept; + AuthMode GetAuthMode() const noexcept; + + private: + std::string auth_string_; + AuthMode auth_mode_; +}; + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/bearer.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/bearer.h new file mode 100644 index 0000000..3d254e2 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/bearer.h @@ -0,0 +1,36 @@ +#ifndef CPR_BEARER_H +#define CPR_BEARER_H + +#include +#include + +#include + +namespace cpr { + +// Only supported with libcurl >= 7.61.0. +// As an alternative use SetHeader and add the token manually. +#if LIBCURL_VERSION_NUM >= 0x073D00 +class Bearer { + public: + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + Bearer(const std::string& token) : token_string_{token} {} + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + Bearer(std::string&& token) : token_string_{std::move(token)} {} + Bearer(const Bearer& other) = default; + Bearer(Bearer&& old) noexcept = default; + virtual ~Bearer() noexcept; + + Bearer& operator=(Bearer&& old) noexcept = default; + Bearer& operator=(const Bearer& other) = default; + + virtual const char* GetToken() const noexcept; + + protected: + std::string token_string_; +}; +#endif + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/body.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/body.h new file mode 100644 index 0000000..04dc1c9 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/body.h @@ -0,0 +1,53 @@ +#ifndef CPR_BODY_H +#define CPR_BODY_H + +#include +#include +#include +#include +#include + +#include "cpr/buffer.h" +#include "cpr/cprtypes.h" +#include "cpr/file.h" + +namespace cpr { + +class Body : public StringHolder { + public: + Body() : StringHolder() {} + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + Body(const std::string& body) : StringHolder(body) {} + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + Body(std::string&& body) : StringHolder(std::move(body)) {} + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + Body(const char* body) : StringHolder(body) {} + Body(const char* str, size_t len) : StringHolder(str, len) {} + Body(const std::initializer_list args) : StringHolder(args) {} + Body(const Buffer& buffer) : StringHolder(reinterpret_cast(buffer.data), static_cast(buffer.datalen)) {} + Body(const File& file) { + std::ifstream is(file.filepath, std::ifstream::binary); + if (is) { + is.seekg(0, is.end); + int length = is.tellg(); + is.seekg(0, is.beg); + std::vector buffer; + buffer.resize(length); + is.read(&buffer[0], length); + is.close(); + str_ = std::string(buffer.begin(), buffer.end()); + } else { + throw std::invalid_argument("Can't open the file for HTTP request body!"); + } + } + Body(const Body& other) = default; + Body(Body&& old) noexcept = default; + ~Body() override = default; + + Body& operator=(Body&& old) noexcept = default; + Body& operator=(const Body& other) = default; +}; + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/buffer.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/buffer.h new file mode 100644 index 0000000..5358c40 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/buffer.h @@ -0,0 +1,33 @@ +#ifndef CPR_BUFFER_H +#define CPR_BUFFER_H + +#include + +namespace cpr { + +struct Buffer { + using data_t = const unsigned char*; + + template + Buffer(Iterator begin, Iterator end, std::string&& p_filename) + // Ignored here since libcurl reqires a long. + // There is also no way around the reinterpret_cast. + // NOLINTNEXTLINE(google-runtime-int, cppcoreguidelines-pro-type-reinterpret-cast) + : data{reinterpret_cast(&(*begin))}, datalen{static_cast(std::distance(begin, end))}, filename(std::move(p_filename)) { + is_random_access_iterator(begin, end); + static_assert(sizeof(*begin) == 1, "Only byte buffers can be used"); + } + + template + typename std::enable_if::iterator_category, std::random_access_iterator_tag>::value>::type is_random_access_iterator(Iterator /* begin */, Iterator /* end */) {} + + data_t data; + // Ignored here since libcurl reqires a long: + // NOLINTNEXTLINE(google-runtime-int) + long datalen; + const std::string filename; +}; + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/callback.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/callback.h new file mode 100644 index 0000000..e54c4fb --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/callback.h @@ -0,0 +1,89 @@ +#ifndef CPR_CALLBACK_H +#define CPR_CALLBACK_H + +#include "cprtypes.h" + +#include +#include + +namespace cpr { + +class ReadCallback { + public: + ReadCallback() = default; + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + ReadCallback(std::function p_callback, intptr_t p_userdata = 0) : userdata(p_userdata), size{-1}, callback{std::move(p_callback)} {} + ReadCallback(cpr_off_t p_size, std::function p_callback, intptr_t p_userdata = 0) : userdata(p_userdata), size{p_size}, callback{std::move(p_callback)} {} + bool operator()(char* buffer, size_t& buffer_size) const { + return callback(buffer, buffer_size, userdata); + } + + intptr_t userdata; + cpr_off_t size{}; + std::function callback; +}; + +class HeaderCallback { + public: + HeaderCallback() = default; + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + HeaderCallback(std::function p_callback, intptr_t p_userdata = 0) : userdata(p_userdata), callback(std::move(p_callback)) {} + bool operator()(std::string header) const { + return callback(std::move(header), userdata); + } + + intptr_t userdata; + std::function callback; +}; + +class WriteCallback { + public: + WriteCallback() = default; + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + WriteCallback(std::function p_callback, intptr_t p_userdata = 0) : userdata(p_userdata), callback(std::move(p_callback)) {} + bool operator()(std::string data) const { + return callback(std::move(data), userdata); + } + + intptr_t userdata; + std::function callback; +}; + +class ProgressCallback { + public: + ProgressCallback() = default; + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + ProgressCallback(std::function p_callback, intptr_t p_userdata = 0) : userdata(p_userdata), callback(std::move(p_callback)) {} + bool operator()(cpr_off_t downloadTotal, cpr_off_t downloadNow, cpr_off_t uploadTotal, cpr_off_t uploadNow) const { + return callback(downloadTotal, downloadNow, uploadTotal, uploadNow, userdata); + } + + intptr_t userdata; + std::function callback; +}; + +class DebugCallback { + public: + enum class InfoType { + TEXT = 0, + HEADER_IN = 1, + HEADER_OUT = 2, + DATA_IN = 3, + DATA_OUT = 4, + SSL_DATA_IN = 5, + SSL_DATA_OUT = 6, + }; + DebugCallback() = default; + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + DebugCallback(std::function p_callback, intptr_t p_userdata = 0) : userdata(p_userdata), callback(std::move(p_callback)) {} + void operator()(InfoType type, std::string data) const { + callback(type, std::move(data), userdata); + } + + intptr_t userdata; + std::function callback; +}; + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/cert_info.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/cert_info.h new file mode 100644 index 0000000..6c328ee --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/cert_info.h @@ -0,0 +1,35 @@ +#ifndef CPR_CERT_INFO_H +#define CPR_CERT_INFO_H + +#include +#include +#include + +namespace cpr { + +class CertInfo { + private: + std::vector cert_info_; + + public: + CertInfo() = default; + CertInfo(const std::initializer_list& entry) : cert_info_{entry} {}; + ~CertInfo() noexcept = default; + + using iterator = std::vector::iterator; + using const_iterator = std::vector::const_iterator; + + std::string& operator[](const size_t& pos); + iterator begin(); + iterator end(); + const_iterator begin() const; + const_iterator end() const; + const_iterator cbegin() const; + const_iterator cend() const; + void emplace_back(const std::string& str); + void push_back(const std::string& str); + void pop_back(); +}; +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/connect_timeout.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/connect_timeout.h new file mode 100644 index 0000000..546e8a5 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/connect_timeout.h @@ -0,0 +1,18 @@ +#ifndef CPR_CONNECT_TIMEOUT_H +#define CPR_CONNECT_TIMEOUT_H + +#include "cpr/timeout.h" + +namespace cpr { + +class ConnectTimeout : public Timeout { + public: + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + ConnectTimeout(const std::chrono::milliseconds& duration) : Timeout{duration} {} + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + ConnectTimeout(const std::int32_t& milliseconds) : Timeout{milliseconds} {} +}; + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/cookies.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/cookies.h new file mode 100644 index 0000000..c018ea4 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/cookies.h @@ -0,0 +1,92 @@ +#ifndef CPR_COOKIES_H +#define CPR_COOKIES_H + +#include "cpr/curlholder.h" +#include +#include +#include +#include +#include + +namespace cpr { +/** + * EXPIRES_STRING_SIZE is an explicitly static and const variable that could be only accessed within the same namespace and is immutable. + * To be used for "std::array", the expression must have a constant value, so EXPIRES_STRING_SIZE must be a const value. + **/ +static const std::size_t EXPIRES_STRING_SIZE = 100; + +class Cookie { + public: + Cookie() = default; + /** + * Some notes for the default value used by expires: + * std::chrono::system_clock::time_point::min() won't work on Windows due to the min, max clash there. + * So we fall back to std::chrono::system_clock::from_time_t(0) for the minimum value here. + **/ + Cookie(const std::string& name, const std::string& value, const std::string& domain = "", bool p_isIncludingSubdomains = false, const std::string& path = "/", bool p_isHttpsOnly = false, std::chrono::system_clock::time_point expires = std::chrono::system_clock::from_time_t(0)) : name_{name}, value_{value}, domain_{domain}, includeSubdomains_{p_isIncludingSubdomains}, path_{path}, httpsOnly_{p_isHttpsOnly}, expires_{expires} {}; + const std::string GetDomain() const; + bool IsIncludingSubdomains() const; + const std::string GetPath() const; + bool IsHttpsOnly() const; + const std::chrono::system_clock::time_point GetExpires() const; + const std::string GetExpiresString() const; + const std::string GetName() const; + const std::string GetValue() const; + + private: + std::string name_; + std::string value_; + std::string domain_; + bool includeSubdomains_{}; + std::string path_; + bool httpsOnly_{}; + /** + * TODO: Update the implementation using `std::chrono::utc_clock` of C++20 + **/ + std::chrono::system_clock::time_point expires_{}; +}; + +class Cookies { + public: + /** + * Should we URL-encode cookies when making a request. + * Based on RFC6265, it is recommended but not mandatory to encode cookies. + * + * ------- + * To maximize compatibility with user agents, servers that wish to + * store arbitrary data in a cookie-value SHOULD encode that data, for + * example, using Base64 [RFC4648]. + * ------- + * Source: RFC6265 (https://www.ietf.org/rfc/rfc6265.txt) + **/ + bool encode{true}; + + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + Cookies(bool p_encode = true) : encode{p_encode} {}; + Cookies(const std::initializer_list& cookies, bool p_encode = true) : encode{p_encode}, cookies_{cookies} {}; + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + Cookies(const cpr::Cookie& cookie, bool p_encode = true) : encode{p_encode}, cookies_{cookie} {}; + + cpr::Cookie& operator[](size_t pos); + const std::string GetEncoded(const CurlHolder& holder) const; + + using iterator = std::vector::iterator; + using const_iterator = std::vector::const_iterator; + + iterator begin(); + iterator end(); + const_iterator begin() const; + const_iterator end() const; + const_iterator cbegin() const; + const_iterator cend() const; + void emplace_back(const Cookie& str); + void push_back(const Cookie& str); + void pop_back(); + + private: + std::vector cookies_; +}; + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/cpr.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/cpr.h new file mode 100644 index 0000000..f2e0dfa --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/cpr.h @@ -0,0 +1,44 @@ +#ifndef CPR_CPR_H +#define CPR_CPR_H + +#include "cpr/api.h" +#include "cpr/auth.h" +#include "cpr/bearer.h" +#include "cpr/callback.h" +#include "cpr/cert_info.h" +#include "cpr/connect_timeout.h" +#include "cpr/cookies.h" +#include "cpr/cprtypes.h" +#include "cpr/cprver.h" +#include "cpr/curl_container.h" +#include "cpr/curlholder.h" +#include "cpr/error.h" +#include "cpr/http_version.h" +#include "cpr/interceptor.h" +#include "cpr/interface.h" +#include "cpr/limit_rate.h" +#include "cpr/local_port.h" +#include "cpr/local_port_range.h" +#include "cpr/low_speed.h" +#include "cpr/multipart.h" +#include "cpr/parameters.h" +#include "cpr/payload.h" +#include "cpr/proxies.h" +#include "cpr/proxyauth.h" +#include "cpr/range.h" +#include "cpr/redirect.h" +#include "cpr/reserve_size.h" +#include "cpr/response.h" +#include "cpr/session.h" +#include "cpr/ssl_ctx.h" +#include "cpr/ssl_options.h" +#include "cpr/status_codes.h" +#include "cpr/timeout.h" +#include "cpr/unix_socket.h" +#include "cpr/user_agent.h" +#include "cpr/util.h" +#include "cpr/verbose.h" + +#define CPR_LIBCURL_VERSION_NUM LIBCURL_VERSION_NUM + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/cprtypes.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/cprtypes.h new file mode 100644 index 0000000..bbd2385 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/cprtypes.h @@ -0,0 +1,133 @@ +#ifndef CPR_CPR_TYPES_H +#define CPR_CPR_TYPES_H + +#include +#include +#include +#include +#include +#include + +namespace cpr { + +/** + * Wrapper around "curl_off_t" to prevent applications from having to link against libcurl. + **/ +using cpr_off_t = curl_off_t; + +template +class StringHolder { + public: + StringHolder() = default; + explicit StringHolder(const std::string& str) : str_(str) {} + explicit StringHolder(std::string&& str) : str_(std::move(str)) {} + explicit StringHolder(const char* str) : str_(str) {} + StringHolder(const char* str, size_t len) : str_(str, len) {} + StringHolder(const std::initializer_list args) { + str_ = std::accumulate(args.begin(), args.end(), str_); + } + StringHolder(const StringHolder& other) = default; + StringHolder(StringHolder&& old) noexcept = default; + virtual ~StringHolder() = default; + + StringHolder& operator=(StringHolder&& old) noexcept = default; + + StringHolder& operator=(const StringHolder& other) = default; + + explicit operator std::string() const { + return str_; + } + + T operator+(const char* rhs) const { + return T(str_ + rhs); + } + + T operator+(const std::string& rhs) const { + return T(str_ + rhs); + } + + T operator+(const StringHolder& rhs) const { + return T(str_ + rhs.str_); + } + + void operator+=(const char* rhs) { + str_ += rhs; + } + void operator+=(const std::string& rhs) { + str_ += rhs; + } + void operator+=(const StringHolder& rhs) { + str_ += rhs; + } + + bool operator==(const char* rhs) const { + return str_ == rhs; + } + bool operator==(const std::string& rhs) const { + return str_ == rhs; + } + bool operator==(const StringHolder& rhs) const { + return str_ == rhs.str_; + } + + bool operator!=(const char* rhs) const { + return str_.c_str() != rhs; + } + bool operator!=(const std::string& rhs) const { + return str_ != rhs; + } + bool operator!=(const StringHolder& rhs) const { + return str_ != rhs.str_; + } + + const std::string& str() { + return str_; + } + const std::string& str() const { + return str_; + } + const char* c_str() const { + return str_.c_str(); + } + const char* data() const { + return str_.data(); + } + + protected: + std::string str_{}; +}; + +template +std::ostream& operator<<(std::ostream& os, const StringHolder& s) { + os << s.str(); + return os; +} + +class Url : public StringHolder { + public: + Url() = default; + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + Url(const std::string& url) : StringHolder(url) {} + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + Url(std::string&& url) : StringHolder(std::move(url)) {} + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + Url(const char* url) : StringHolder(url) {} + Url(const char* str, size_t len) : StringHolder(std::string(str, len)) {} + Url(const std::initializer_list args) : StringHolder(args) {} + Url(const Url& other) = default; + Url(Url&& old) noexcept = default; + ~Url() override = default; + + Url& operator=(Url&& old) noexcept = default; + Url& operator=(const Url& other) = default; +}; + +struct CaseInsensitiveCompare { + bool operator()(const std::string& a, const std::string& b) const noexcept; +}; + +using Header = std::map; + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/cprver.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/cprver.h new file mode 100644 index 0000000..f853563 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/cprver.h @@ -0,0 +1,30 @@ +#ifndef CPR_CPRVER_H +#define CPR_CPRVER_H + +/** + * CPR version as a string. + **/ +#define CPR_VERSION "1.9.2" + +/** + * CPR version split up into parts. + **/ +#define CPR_VERSION_MAJOR 1 +#define CPR_VERSION_MINOR 9 +#define CPR_VERSION_PATCH 2 + +/** + * CPR version as a single hex digit. + * it can be split up into three parts: + * 0xAABBCC + * AA: The current CPR major version number in a hex format. + * BB: The current CPR minor version number in a hex format. + * CC: The current CPR patch version number in a hex format. + * + * Examples: + * '0x010702' -> 01.07.02 -> CPR_VERSION: 1.7.2 + * '0xA13722' -> A1.37.22 -> CPR_VERSION: 161.55.34 + **/ +#define CPR_VERSION_NUM 0x10902 + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/curl_container.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/curl_container.h new file mode 100644 index 0000000..91a013b --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/curl_container.h @@ -0,0 +1,53 @@ +#ifndef CURL_CONTAINER_H +#define CURL_CONTAINER_H + +#include +#include +#include +#include + +#include "cpr/curlholder.h" + + +namespace cpr { + +struct Parameter { + Parameter(const std::string& p_key, const std::string& p_value) : key{p_key}, value{p_value} {} + Parameter(std::string&& p_key, std::string&& p_value) : key{std::move(p_key)}, value{std::move(p_value)} {} + + std::string key; + std::string value; +}; + +struct Pair { + Pair(const std::string& p_key, const std::string& p_value) : key(p_key), value(p_value) {} + Pair(std::string&& p_key, std::string&& p_value) : key(std::move(p_key)), value(std::move(p_value)) {} + + std::string key; + std::string value; +}; + + +template +class CurlContainer { + public: + /** + * Enables or disables URL encoding for keys and values when calling GetContent(...). + **/ + bool encode = true; + + CurlContainer() = default; + CurlContainer(const std::initializer_list&); + + void Add(const std::initializer_list&); + void Add(const T&); + + const std::string GetContent(const CurlHolder&) const; + + protected: + std::vector containerList_; +}; + +} // namespace cpr + +#endif // diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/curlholder.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/curlholder.h new file mode 100644 index 0000000..e7203d2 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/curlholder.h @@ -0,0 +1,53 @@ +#ifndef CPR_CURL_HOLDER_H +#define CPR_CURL_HOLDER_H + +#include +#include +#include + +#include + +namespace cpr { +struct CurlHolder { + private: + /** + * Mutex for curl_easy_init(). + * curl_easy_init() is not thread save. + * References: + * https://curl.haxx.se/libcurl/c/curl_easy_init.html + * https://curl.haxx.se/libcurl/c/threadsafe.html + **/ + + // Avoids initalization order problems in a static build + static std::mutex& curl_easy_init_mutex_() { + static std::mutex curl_easy_init_mutex_; + return curl_easy_init_mutex_; + } + + public: + CURL* handle{nullptr}; + struct curl_slist* chunk{nullptr}; + struct curl_httppost* formpost{nullptr}; + std::array error{}; + + CurlHolder(); + CurlHolder(const CurlHolder& other) = default; + CurlHolder(CurlHolder&& old) noexcept = default; + ~CurlHolder(); + + CurlHolder& operator=(CurlHolder&& old) noexcept = default; + CurlHolder& operator=(const CurlHolder& other) = default; + + /** + * Uses curl_easy_escape(...) for escaping the given string. + **/ + std::string urlEncode(const std::string& s) const; + + /** + * Uses curl_easy_unescape(...) for unescaping the given string. + **/ + std::string urlDecode(const std::string& s) const; +}; +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/error.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/error.h new file mode 100644 index 0000000..bb59a4c --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/error.h @@ -0,0 +1,53 @@ +#ifndef CPR_ERROR_H +#define CPR_ERROR_H + +#include +#include + +#include "cpr/cprtypes.h" +#include + +namespace cpr { + +enum class ErrorCode { + OK = 0, + CONNECTION_FAILURE, + EMPTY_RESPONSE, + HOST_RESOLUTION_FAILURE, + INTERNAL_ERROR, + INVALID_URL_FORMAT, + NETWORK_RECEIVE_ERROR, + NETWORK_SEND_FAILURE, + OPERATION_TIMEDOUT, + PROXY_RESOLUTION_FAILURE, + SSL_CONNECT_ERROR, + SSL_LOCAL_CERTIFICATE_ERROR, + SSL_REMOTE_CERTIFICATE_ERROR, + SSL_CACERT_ERROR, + GENERIC_SSL_ERROR, + UNSUPPORTED_PROTOCOL, + REQUEST_CANCELLED, + TOO_MANY_REDIRECTS, + UNKNOWN_ERROR = 1000, +}; + +class Error { + public: + ErrorCode code = ErrorCode::OK; + std::string message{}; + + Error() = default; + + Error(const std::int32_t& curl_code, std::string&& p_error_message) : code{getErrorCodeForCurlError(curl_code)}, message(std::move(p_error_message)) {} + + explicit operator bool() const { + return code != ErrorCode::OK; + } + + private: + static ErrorCode getErrorCodeForCurlError(std::int32_t curl_code); +}; + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/file.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/file.h new file mode 100644 index 0000000..3f8cbfa --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/file.h @@ -0,0 +1,16 @@ +#ifndef CPR_FILE_H +#define CPR_FILE_H + +#include + +namespace cpr { + +struct File { + explicit File(std::string&& p_filepath) : filepath(std::move(p_filepath)) {} + explicit File(const std::string& p_filepath) : filepath(p_filepath) {} + const std::string filepath; +}; + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/http_version.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/http_version.h new file mode 100644 index 0000000..45b5028 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/http_version.h @@ -0,0 +1,67 @@ +#ifndef CPR_HTTP_VERSION_H +#define CPR_HTTP_VERSION_H + +#include + +namespace cpr { +enum class HttpVersionCode { + /** + * Let libcurl decide which version is the best. + **/ + VERSION_NONE, + /** + * Enforce HTTP 1.0 requests. + **/ + VERSION_1_0, + /** + * Enforce HTTP 1.1 requests. + **/ + VERSION_1_1, +#if LIBCURL_VERSION_NUM >= 0x072100 // 7.33.0 + /** + * Attempt HTTP 2.0 requests. + * Fallback to HTTP 1.1 if negotiation fails. + **/ + VERSION_2_0, +#endif +#if LIBCURL_VERSION_NUM >= 0x072F00 // 7.47.0 + /** + * Attempt HTTP 2.0 for HTTPS requests only. + * Fallback to HTTP 1.1 if negotiation fails. + * HTTP 1.1 will be used for HTTP connections. + **/ + VERSION_2_0_TLS, +#endif +#if LIBCURL_VERSION_NUM >= 0x073100 // 7.49.0 + /** + * Start HTTP 2.0 for HTTP requests. + * Requires prior knowledge that the server supports HTTP 2.0. + * For HTTPS requests we will negotiate the protocol version in the TLS handshake. + **/ + VERSION_2_0_PRIOR_KNOWLEDGE, +#endif +#if LIBCURL_VERSION_NUM >= 0x074200 // 7.66.0 + /** + * Attempt HTTP 3.0 requests. + * Requires prior knowledge that the server supports HTTP 3.0 since there is no gracefully downgrade. + * Fallback to HTTP 1.1 if negotiation fails. + **/ + VERSION_3_0 +#endif +}; + +class HttpVersion { + public: + /** + * The HTTP version that should be used by libcurl when initiating a HTTP(S) connection. + * Default: HttpVersionCode::VERSION_NONE + **/ + HttpVersionCode code = HttpVersionCode::VERSION_NONE; + + HttpVersion() = default; + explicit HttpVersion(HttpVersionCode _code) : code(_code) {} +}; + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/interceptor.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/interceptor.h new file mode 100644 index 0000000..fdfe69c --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/interceptor.h @@ -0,0 +1,36 @@ +#ifndef CPR_INTERCEPTOR_H +#define CPR_INTERCEPTOR_H + +#include "cpr/response.h" +#include "cpr/session.h" + +namespace cpr { + +class Interceptor { + public: + enum class ProceedHttpMethod { + GET_REQUEST = 0, + POST_REQUEST, + PUT_REQUEST, + DELETE_REQUEST, + PATCH_REQUEST, + HEAD_REQUEST, + OPTIONS_REQUEST, + DOWNLOAD_CALLBACK_REQUEST, + DOWNLOAD_FILE_REQUEST, + }; + + virtual ~Interceptor() = default; + virtual Response intercept(Session& session) = 0; + + protected: + static Response proceed(Session& session); + static Response proceed(Session& session, ProceedHttpMethod httpMethod); + static Response proceed(Session& session, ProceedHttpMethod httpMethod, std::ofstream& file); + static Response proceed(Session& session, ProceedHttpMethod httpMethod, const WriteCallback& write); +}; + +} // namespace cpr + + +#endif \ No newline at end of file diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/interface.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/interface.h new file mode 100644 index 0000000..ea8225d --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/interface.h @@ -0,0 +1,32 @@ +#ifndef CPR_INTERFACE_H +#define CPR_INTERFACE_H + +#include +#include + +#include "cpr/cprtypes.h" + +namespace cpr { + +class Interface : public StringHolder { + public: + Interface() : StringHolder() {} + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + Interface(const std::string& iface) : StringHolder(iface) {} + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + Interface(std::string&& iface) : StringHolder(std::move(iface)) {} + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + Interface(const char* iface) : StringHolder(iface) {} + Interface(const char* str, size_t len) : StringHolder(str, len) {} + Interface(const std::initializer_list args) : StringHolder(args) {} + Interface(const Interface& other) = default; + Interface(Interface&& old) noexcept = default; + ~Interface() override = default; + + Interface& operator=(Interface&& old) noexcept = default; + Interface& operator=(const Interface& other) = default; +}; + +} // namespace cpr + +#endif \ No newline at end of file diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/limit_rate.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/limit_rate.h new file mode 100644 index 0000000..2b0e8a2 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/limit_rate.h @@ -0,0 +1,18 @@ +#ifndef CPR_SPEED_LIMIT_H +#define CPR_SPEED_LIMIT_H + +#include + +namespace cpr { + +class LimitRate { + public: + LimitRate(const std::int64_t p_downrate, const std::int64_t p_uprate) : downrate(p_downrate), uprate(p_uprate) {} + + std::int64_t downrate = 0; + std::int64_t uprate = 0; +}; + +} // namespace cpr + +#endif \ No newline at end of file diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/local_port.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/local_port.h new file mode 100644 index 0000000..e853425 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/local_port.h @@ -0,0 +1,23 @@ +#ifndef CPR_LOCAL_PORT_H +#define CPR_LOCAL_PORT_H + +#include + +namespace cpr { + +class LocalPort { + public: + // NOLINTNEXTLINE(google-explicit-constructor) + LocalPort(const std::uint16_t p_localport) : localport_(p_localport) {} + + operator std::uint16_t() const { + return localport_; + } + + private: + std::uint16_t localport_ = 0; +}; + +} // namespace cpr + +#endif \ No newline at end of file diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/local_port_range.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/local_port_range.h new file mode 100644 index 0000000..cc2d7e2 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/local_port_range.h @@ -0,0 +1,23 @@ +#ifndef CPR_LOCAL_PORT_RANGE_H +#define CPR_LOCAL_PORT_RANGE_H + +#include + +namespace cpr { + +class LocalPortRange { + public: + // NOLINTNEXTLINE(google-explicit-constructor) + LocalPortRange(const std::uint16_t p_localportrange) : localportrange_(p_localportrange) {} + + operator std::uint16_t() const { + return localportrange_; + } + + private: + std::uint16_t localportrange_ = 0; +}; + +} // namespace cpr + +#endif \ No newline at end of file diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/low_speed.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/low_speed.h new file mode 100644 index 0000000..ff77fd2 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/low_speed.h @@ -0,0 +1,18 @@ +#ifndef CPR_LOW_SPEED_H +#define CPR_LOW_SPEED_H + +#include + +namespace cpr { + +class LowSpeed { + public: + LowSpeed(const std::int32_t p_limit, const std::int32_t p_time) : limit(p_limit), time(p_time) {} + + std::int32_t limit; + std::int32_t time; +}; + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/multipart.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/multipart.h new file mode 100644 index 0000000..9fc588a --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/multipart.h @@ -0,0 +1,44 @@ +#ifndef CPR_MULTIPART_H +#define CPR_MULTIPART_H + +#include +#include +#include +#include +#include + +#include "buffer.h" +#include "file.h" + +namespace cpr { + +struct Part { + Part(const std::string& p_name, const std::string& p_value, const std::string& p_content_type = {}) : name{p_name}, value{p_value}, content_type{p_content_type}, is_file{false}, is_buffer{false}, has_filename{false} {} + Part(const std::string& p_name, const std::int32_t& p_value, const std::string& p_content_type = {}) : name{p_name}, value{std::to_string(p_value)}, content_type{p_content_type}, is_file{false}, is_buffer{false}, has_filename{false} {} + Part(const std::string& p_name, const File& file, const std::string& p_content_type = {}) : name{p_name}, value{file.filepath}, content_type{p_content_type}, is_file{true}, is_buffer{false}, has_filename{false} {} + Part(const std::string& p_name, const std::string& p_filename, const File& file, const std::string& p_content_type = {}) : name{p_name}, filename{p_filename}, value{file.filepath}, content_type{p_content_type}, is_file{true}, is_buffer{false}, has_filename{true} {} + Part(const std::string& p_name, const Buffer& buffer, const std::string& p_content_type = {}) : name{p_name}, value{buffer.filename}, content_type{p_content_type}, data{buffer.data}, datalen{buffer.datalen}, is_file{false}, is_buffer{true}, has_filename{false} {} + + std::string name; + std::string filename; + std::string value; + std::string content_type; + Buffer::data_t data{nullptr}; + // Ignored here since libcurl reqires a long: + // NOLINTNEXTLINE(google-runtime-int) + long datalen{0}; + bool is_file; + bool is_buffer; + bool has_filename; +}; + +class Multipart { + public: + Multipart(const std::initializer_list& parts); + + std::vector parts; +}; + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/parameters.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/parameters.h new file mode 100644 index 0000000..0e34d4d --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/parameters.h @@ -0,0 +1,18 @@ +#ifndef CPR_PARAMETERS_H +#define CPR_PARAMETERS_H + +#include + +#include "cpr/curl_container.h" + +namespace cpr { + +class Parameters : public CurlContainer { + public: + Parameters() = default; + Parameters(const std::initializer_list& parameters); +}; + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/payload.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/payload.h new file mode 100644 index 0000000..686b540 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/payload.h @@ -0,0 +1,23 @@ +#ifndef CPR_PAYLOAD_H +#define CPR_PAYLOAD_H + +#include + +#include "cpr/curl_container.h" + + +namespace cpr { +class Payload : public CurlContainer { + public: + template + Payload(const It begin, const It end) { + for (It pair = begin; pair != end; ++pair) { + Add(*pair); + } + } + Payload(const std::initializer_list& pairs); +}; + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/proxies.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/proxies.h new file mode 100644 index 0000000..6970442 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/proxies.h @@ -0,0 +1,23 @@ +#ifndef CPR_PROXIES_H +#define CPR_PROXIES_H + +#include +#include +#include + +namespace cpr { +class Proxies { + public: + Proxies() = default; + Proxies(const std::initializer_list>& hosts); + Proxies(const std::map& hosts); + + bool has(const std::string& protocol) const; + const std::string& operator[](const std::string& protocol); + + private: + std::map hosts_; +}; +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/proxyauth.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/proxyauth.h new file mode 100644 index 0000000..16369ff --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/proxyauth.h @@ -0,0 +1,44 @@ +#ifndef CPR_PROXYAUTH_H +#define CPR_PROXYAUTH_H + +#include +#include + +#include "cpr/auth.h" +#include "cpr/util.h" + +namespace cpr { +class EncodedAuthentication { + public: + EncodedAuthentication() : auth_string_{""} {} + EncodedAuthentication(const std::string& username, const std::string& password) : auth_string_{cpr::util::urlEncode(username) + ":" + cpr::util::urlEncode(password)} {} + EncodedAuthentication(std::string&& username, std::string&& password) : auth_string_{cpr::util::urlEncode(std::move(username)) + ":" + cpr::util::urlEncode(std::move(password))} {} + EncodedAuthentication(const EncodedAuthentication& other) = default; + EncodedAuthentication(EncodedAuthentication&& old) noexcept = default; + virtual ~EncodedAuthentication() noexcept; + + EncodedAuthentication& operator=(EncodedAuthentication&& old) noexcept = default; + EncodedAuthentication& operator=(const EncodedAuthentication& other) = default; + + const char* GetAuthString() const noexcept; + + protected: + std::string auth_string_; +}; + +class ProxyAuthentication { + public: + ProxyAuthentication() = default; + ProxyAuthentication(const std::initializer_list>& auths) : proxyAuth_{auths} {} + ProxyAuthentication(const std::map& auths) : proxyAuth_{auths} {} + + bool has(const std::string& protocol) const; + const char* operator[](const std::string& protocol); + + private: + std::map proxyAuth_; +}; + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/range.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/range.h new file mode 100644 index 0000000..73f30ca --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/range.h @@ -0,0 +1,40 @@ +#ifndef CPR_RANGE_H +#define CPR_RANGE_H + +#include + +namespace cpr { + +class Range { + public: + Range(const std::int64_t p_resume_from, const std::int64_t p_finish_at) : resume_from(p_resume_from), finish_at(p_finish_at) {} + + std::int64_t resume_from = 0; + std::int64_t finish_at = 0; + + const std::string str() const { + std::string from_str = (resume_from < (std::int64_t) 0) ? "" : std::to_string(resume_from); + std::string to_str = (finish_at < (std::int64_t) 0) ? "" : std::to_string(finish_at); + return from_str + "-" + to_str; + } +}; + +class MultiRange { + public: + MultiRange(std::initializer_list rs) : ranges{rs} {} + + const std::string str() const { + std::string multi_range_string{}; + for (Range range : ranges) { + multi_range_string += ((multi_range_string.empty()) ? "" : ", ") + range.str(); + } + return multi_range_string; + } + + private: + std::vector ranges; +}; // namespace cpr + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/redirect.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/redirect.h new file mode 100644 index 0000000..32b4372 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/redirect.h @@ -0,0 +1,84 @@ +#ifndef CPR_REDIRECT_H +#define CPR_REDIRECT_H + +#include + +namespace cpr { +enum class PostRedirectFlags : uint8_t { + /** + * Respect RFC 7231 (section 6.4.2 to 6.4.4). + * Same as CURL_REDIR_POST_301 (https://curl.se/libcurl/c/CURLOPT_POSTREDIR.html). + **/ + POST_301 = 0x1 << 0, + /** + * Maintain the request method after a 302 redirect. + * Same as CURL_REDIR_POST_302 (https://curl.se/libcurl/c/CURLOPT_POSTREDIR.html). + **/ + POST_302 = 0x1 << 1, + /** + * Maintain the request method after a 303 redirect. + * Same as CURL_REDIR_POST_303 (https://curl.se/libcurl/c/CURLOPT_POSTREDIR.html). + **/ + POST_303 = 0x1 << 2, + /** + * Default value. + * Convenience option to enable all flags. + * Same as CURL_REDIR_POST_ALL (https://curl.se/libcurl/c/CURLOPT_POSTREDIR.html). + **/ + POST_ALL = POST_301 | POST_302 | POST_303, + /** + * * Convenience option to disable all flags. + **/ + NONE = 0x0 +}; + +PostRedirectFlags operator|(PostRedirectFlags lhs, PostRedirectFlags rhs); +PostRedirectFlags operator&(PostRedirectFlags lhs, PostRedirectFlags rhs); +PostRedirectFlags operator^(PostRedirectFlags lhs, PostRedirectFlags rhs); +PostRedirectFlags operator~(PostRedirectFlags flag); +PostRedirectFlags& operator|=(PostRedirectFlags& lhs, PostRedirectFlags rhs); +PostRedirectFlags& operator&=(PostRedirectFlags& lhs, PostRedirectFlags rhs); +PostRedirectFlags& operator^=(PostRedirectFlags& lhs, PostRedirectFlags rhs); +bool any(PostRedirectFlags flag); + +class Redirect { + public: + /** + * The maximum number of redirects to follow. + * 0: Refuse any redirects. + * -1: Infinite number of redirects. + * Default: 50 + * https://curl.se/libcurl/c/CURLOPT_MAXREDIRS.html + **/ + // NOLINTNEXTLINE (google-runtime-int) + long maximum{50L}; + /** + * Follow 3xx redirects. + * Default: true + * https://curl.se/libcurl/c/CURLOPT_FOLLOWLOCATION.html + **/ + bool follow{true}; + /** + * Continue to send authentication (user+password) credentials when following locations, even when hostname changed. + * Default: false + * https://curl.se/libcurl/c/CURLOPT_UNRESTRICTED_AUTH.html + **/ + bool cont_send_cred{false}; + /** + * Flags to control how to act after a redirect for a post request. + * Default: POST_ALL + **/ + PostRedirectFlags post_flags{PostRedirectFlags::POST_ALL}; + + Redirect() = default; + // NOLINTNEXTLINE (google-runtime-int) + Redirect(long p_maximum, bool p_follow, bool p_cont_send_cred, PostRedirectFlags p_post_flags) : maximum(p_maximum), follow(p_follow), cont_send_cred(p_cont_send_cred), post_flags(p_post_flags){}; + // NOLINTNEXTLINE (google-runtime-int) + explicit Redirect(long p_maximum) : maximum(p_maximum){}; + explicit Redirect(bool p_follow) : follow(p_follow){}; + Redirect(bool p_follow, bool p_cont_send_cred) : follow(p_follow), cont_send_cred(p_cont_send_cred){}; + explicit Redirect(PostRedirectFlags p_post_flags) : post_flags(p_post_flags){}; +}; +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/reserve_size.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/reserve_size.h new file mode 100644 index 0000000..5eae4c8 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/reserve_size.h @@ -0,0 +1,17 @@ +#ifndef CPR_RESERVE_SIZE_H +#define CPR_RESERVE_SIZE_H + +#include + +namespace cpr { + +class ReserveSize { + public: + ReserveSize(const size_t _size) : size(_size) {} + + size_t size = 0; +}; + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/response.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/response.h new file mode 100644 index 0000000..14c34a5 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/response.h @@ -0,0 +1,55 @@ +#ifndef CPR_RESPONSE_H +#define CPR_RESPONSE_H + +#include +#include +#include +#include +#include +#include + +#include "cpr/cert_info.h" +#include "cpr/cookies.h" +#include "cpr/cprtypes.h" +#include "cpr/error.h" +#include "cpr/ssl_options.h" +#include "cpr/util.h" + +namespace cpr { + +class Response { + private: + std::shared_ptr curl_{nullptr}; + + public: + // Ignored here since libcurl uses a long for this. + // NOLINTNEXTLINE(google-runtime-int) + long status_code{}; + std::string text{}; + Header header{}; + Url url{}; + double elapsed{}; + Cookies cookies{}; + Error error{}; + std::string raw_header{}; + std::string status_line{}; + std::string reason{}; + cpr_off_t uploaded_bytes{}; + cpr_off_t downloaded_bytes{}; + // Ignored here since libcurl uses a long for this. + // NOLINTNEXTLINE(google-runtime-int) + long redirect_count{}; + + Response() = default; + Response(std::shared_ptr curl, std::string&& p_text, std::string&& p_header_string, Cookies&& p_cookies, Error&& p_error); + std::vector GetCertInfos(); + Response(const Response& other) = default; + Response(Response&& old) noexcept = default; + ~Response() noexcept = default; + + Response& operator=(Response&& old) noexcept = default; + Response& operator=(const Response& other) = default; +}; +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/session.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/session.h new file mode 100644 index 0000000..c584c87 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/session.h @@ -0,0 +1,290 @@ +#ifndef CPR_SESSION_H +#define CPR_SESSION_H + +#include +#include +#include +#include +#include + +#include "cpr/accept_encoding.h" +#include "cpr/auth.h" +#include "cpr/bearer.h" +#include "cpr/body.h" +#include "cpr/callback.h" +#include "cpr/connect_timeout.h" +#include "cpr/cookies.h" +#include "cpr/cprtypes.h" +#include "cpr/curlholder.h" +#include "cpr/http_version.h" +#include "cpr/interface.h" +#include "cpr/limit_rate.h" +#include "cpr/local_port.h" +#include "cpr/local_port_range.h" +#include "cpr/low_speed.h" +#include "cpr/multipart.h" +#include "cpr/parameters.h" +#include "cpr/payload.h" +#include "cpr/proxies.h" +#include "cpr/proxyauth.h" +#include "cpr/range.h" +#include "cpr/redirect.h" +#include "cpr/reserve_size.h" +#include "cpr/response.h" +#include "cpr/ssl_options.h" +#include "cpr/timeout.h" +#include "cpr/unix_socket.h" +#include "cpr/user_agent.h" +#include "cpr/verbose.h" + +namespace cpr { + +using AsyncResponse = std::future; + +class Interceptor; + +class Session : public std::enable_shared_from_this { + public: + Session(); + Session(const Session& other) = delete; + + ~Session() = default; + + Session& operator=(Session&& old) noexcept = default; + Session& operator=(const Session& other) = delete; + + void SetUrl(const Url& url); + void SetParameters(const Parameters& parameters); + void SetParameters(Parameters&& parameters); + void SetHeader(const Header& header); + void UpdateHeader(const Header& header); + void SetTimeout(const Timeout& timeout); + void SetConnectTimeout(const ConnectTimeout& timeout); + void SetAuth(const Authentication& auth); +// Only supported with libcurl >= 7.61.0. +// As an alternative use SetHeader and add the token manually. +#if LIBCURL_VERSION_NUM >= 0x073D00 + void SetBearer(const Bearer& token); +#endif + void SetUserAgent(const UserAgent& ua); + void SetPayload(Payload&& payload); + void SetPayload(const Payload& payload); + void SetProxies(Proxies&& proxies); + void SetProxies(const Proxies& proxies); + void SetProxyAuth(ProxyAuthentication&& proxy_auth); + void SetProxyAuth(const ProxyAuthentication& proxy_auth); + void SetMultipart(Multipart&& multipart); + void SetMultipart(const Multipart& multipart); + void SetRedirect(const Redirect& redirect); + void SetCookies(const Cookies& cookies); + void SetBody(Body&& body); + void SetBody(const Body& body); + void SetLowSpeed(const LowSpeed& low_speed); + void SetVerifySsl(const VerifySsl& verify); + void SetUnixSocket(const UnixSocket& unix_socket); + void SetSslOptions(const SslOptions& options); + void SetReadCallback(const ReadCallback& read); + void SetHeaderCallback(const HeaderCallback& header); + void SetWriteCallback(const WriteCallback& write); + void SetProgressCallback(const ProgressCallback& progress); + void SetDebugCallback(const DebugCallback& debug); + void SetVerbose(const Verbose& verbose); + void SetInterface(const Interface& iface); + void SetLocalPort(const LocalPort& local_port); + void SetLocalPortRange(const LocalPortRange& local_port_range); + void SetHttpVersion(const HttpVersion& version); + void SetRange(const Range& range); + void SetMultiRange(const MultiRange& multi_range); + void SetReserveSize(const ReserveSize& reserve_size); + void SetAcceptEncoding(const AcceptEncoding& accept_encoding); + void SetAcceptEncoding(AcceptEncoding&& accept_encoding); + void SetLimitRate(const LimitRate& limit_rate); + + // Used in templated functions + void SetOption(const Url& url); + void SetOption(const Parameters& parameters); + void SetOption(Parameters&& parameters); + void SetOption(const Header& header); + void SetOption(const Timeout& timeout); + void SetOption(const ConnectTimeout& timeout); + void SetOption(const Authentication& auth); +// Only supported with libcurl >= 7.61.0. +// As an alternative use SetHeader and add the token manually. +#if LIBCURL_VERSION_NUM >= 0x073D00 + void SetOption(const Bearer& auth); +#endif + void SetOption(const UserAgent& ua); + void SetOption(Payload&& payload); + void SetOption(const Payload& payload); + void SetOption(const LimitRate& limit_rate); + void SetOption(Proxies&& proxies); + void SetOption(const Proxies& proxies); + void SetOption(ProxyAuthentication&& proxy_auth); + void SetOption(const ProxyAuthentication& proxy_auth); + void SetOption(Multipart&& multipart); + void SetOption(const Multipart& multipart); + void SetOption(const Redirect& redirect); + void SetOption(const Cookies& cookies); + void SetOption(Body&& body); + void SetOption(const Body& body); + void SetOption(const ReadCallback& read); + void SetOption(const HeaderCallback& header); + void SetOption(const WriteCallback& write); + void SetOption(const ProgressCallback& progress); + void SetOption(const DebugCallback& debug); + void SetOption(const LowSpeed& low_speed); + void SetOption(const VerifySsl& verify); + void SetOption(const Verbose& verbose); + void SetOption(const UnixSocket& unix_socket); + void SetOption(const SslOptions& options); + void SetOption(const Interface& iface); + void SetOption(const LocalPort& local_port); + void SetOption(const LocalPortRange& local_port_range); + void SetOption(const HttpVersion& version); + void SetOption(const Range& range); + void SetOption(const MultiRange& multi_range); + void SetOption(const ReserveSize& reserve_size); + void SetOption(const AcceptEncoding& accept_encoding); + void SetOption(AcceptEncoding&& accept_encoding); + + cpr_off_t GetDownloadFileLength(); + /** + * Attempt to preallocate enough memory for specified number of characters in the response string. + * Pass 0 to disable this behavior and let the response string be allocated dynamically on demand. + * + * Example: + * cpr::Session session; + * session.SetUrl(cpr::Url{"http://xxx/file"}); + * session.ResponseStringReserve(1024 * 512); // Reserve space for at least 1024 * 512 characters + * cpr::Response r = session.Get(); + **/ + void ResponseStringReserve(size_t size); + Response Delete(); + Response Download(const WriteCallback& write); + Response Download(std::ofstream& file); + Response Get(); + Response Head(); + Response Options(); + Response Patch(); + Response Post(); + Response Put(); + + AsyncResponse GetAsync(); + AsyncResponse DeleteAsync(); + AsyncResponse DownloadAsync(const WriteCallback& write); + AsyncResponse DownloadAsync(std::ofstream& file); + AsyncResponse HeadAsync(); + AsyncResponse OptionsAsync(); + AsyncResponse PatchAsync(); + AsyncResponse PostAsync(); + AsyncResponse PutAsync(); + + template + auto GetCallback(Then then) -> std::future; + template + auto PostCallback(Then then) -> std::future; + template + auto PutCallback(Then then) -> std::future; + template + auto HeadCallback(Then then) -> std::future; + template + auto DeleteCallback(Then then) -> std::future; + template + auto OptionsCallback(Then then) -> std::future; + template + auto PatchCallback(Then then) -> std::future; + + std::shared_ptr GetCurlHolder(); + std::string GetFullRequestUrl(); + + void PrepareDelete(); + void PrepareGet(); + void PrepareHead(); + void PrepareOptions(); + void PreparePatch(); + void PreparePost(); + void PreparePut(); + Response Complete(CURLcode curl_error); + + void AddInterceptor(const std::shared_ptr& pinterceptor); + + private: + // Interceptors should be able to call the private procceed() function + friend Interceptor; + + bool hasBodyOrPayload_{false}; + bool chunkedTransferEncoding_{false}; + std::shared_ptr curl_; + Url url_; + Parameters parameters_; + Proxies proxies_; + ProxyAuthentication proxyAuth_; + Header header_; + AcceptEncoding acceptEncoding_; + /** + * Will be set by the read callback. + * Ensures that the "Transfer-Encoding" is set to "chunked", if not overriden in header_. + **/ + ReadCallback readcb_; + HeaderCallback headercb_; + WriteCallback writecb_; + ProgressCallback progresscb_; + DebugCallback debugcb_; + size_t response_string_reserve_size_{0}; + std::string response_string_; + std::string header_string_; + std::queue> interceptors_; + + Response makeDownloadRequest(); + Response makeRequest(); + Response proceed(); + void prepareCommon(); + void SetHeaderInternal(); + std::shared_ptr GetSharedPtrFromThis(); +}; + +template +auto Session::GetCallback(Then then) -> std::future { + auto shared_this = GetSharedPtrFromThis(); + return async([shared_this](Then then_inner) { return then_inner(shared_this->Get()); }, std::move(then)); +} + +template +auto Session::PostCallback(Then then) -> std::future { + auto shared_this = GetSharedPtrFromThis(); + return async([shared_this](Then then_inner) { return then_inner(shared_this->Post()); }, std::move(then)); +} + +template +auto Session::PutCallback(Then then) -> std::future { + auto shared_this = GetSharedPtrFromThis(); + return async([shared_this](Then then_inner) { return then_inner(shared_this->Put()); }, std::move(then)); +} + +template +auto Session::HeadCallback(Then then) -> std::future { + auto shared_this = GetSharedPtrFromThis(); + return async([shared_this](Then then_inner) { return then_inner(shared_this->Head()); }, std::move(then)); +} + +template +auto Session::DeleteCallback(Then then) -> std::future { + auto shared_this = GetSharedPtrFromThis(); + return async([shared_this](Then then_inner) { return then_inner(shared_this->Delete()); }, std::move(then)); +} + +template +auto Session::OptionsCallback(Then then) -> std::future { + auto shared_this = GetSharedPtrFromThis(); + return async([shared_this](Then then_inner) { return then_inner(shared_this->Options()); }, std::move(then)); +} + +template +auto Session::PatchCallback(Then then) -> std::future { + auto shared_this = GetSharedPtrFromThis(); + return async([shared_this](Then then_inner) { return then_inner(shared_this->Patch()); }, std::move(then)); +} + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/singleton.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/singleton.h new file mode 100644 index 0000000..e2ea13b --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/singleton.h @@ -0,0 +1,47 @@ +#ifndef CPR_SINGLETON_H +#define CPR_SINGLETON_H + +#include + +#ifndef CPR_DISABLE_COPY +#define CPR_DISABLE_COPY(Class) \ + Class(const Class&) = delete; \ + Class& operator=(const Class&) = delete; +#endif + +#ifndef CPR_SINGLETON_DECL +#define CPR_SINGLETON_DECL(Class) \ + public: \ + static Class* GetInstance(); \ + static void ExitInstance(); \ + private: \ + CPR_DISABLE_COPY(Class) \ + static Class* s_pInstance; \ + static std::mutex s_mutex; +#endif + +#ifndef CPR_SINGLETON_IMPL +#define CPR_SINGLETON_IMPL(Class) \ + Class* Class::s_pInstance = nullptr; \ + std::mutex Class::s_mutex; \ + Class* Class::GetInstance() { \ + if (s_pInstance == nullptr) { \ + s_mutex.lock(); \ + if (s_pInstance == nullptr) { \ + s_pInstance = new Class; \ + } \ + s_mutex.unlock(); \ + } \ + return s_pInstance; \ + } \ + void Class::ExitInstance() { \ + s_mutex.lock(); \ + if (s_pInstance) { \ + delete s_pInstance; \ + s_pInstance = nullptr; \ + } \ + s_mutex.unlock(); \ + } +#endif + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/ssl_ctx.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/ssl_ctx.h new file mode 100644 index 0000000..d495fb2 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/ssl_ctx.h @@ -0,0 +1,26 @@ +#ifndef CPR_SSL_CTX_H +#define CPR_SSL_CTX_H + +#include "cpr/ssl_options.h" +#include + +#if SUPPORT_CURLOPT_SSL_CTX_FUNCTION + +namespace cpr { + +/** + * This callback function loads a CA certificate from raw_cert_buf and gets called by libcurl + * just before the initialization of an SSL connection. + * The raw_cert_buf argument is set with the CURLOPT_SSL_CTX_DATA option and has to be a nul + * terminated buffer. + * + * Sources: https://curl.se/libcurl/c/CURLOPT_SSL_CTX_FUNCTION.html + * https://curl.se/libcurl/c/CURLOPT_SSL_CTX_DATA.html + */ +CURLcode sslctx_function_load_ca_cert_from_buffer(CURL* curl, void* sslctx, void* raw_cert_buf); + +} // Namespace cpr + +#endif + +#endif \ No newline at end of file diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/ssl_options.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/ssl_options.h new file mode 100644 index 0000000..3052a24 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/ssl_options.h @@ -0,0 +1,616 @@ +#ifndef CPR_SSLOPTIONS_H +#define CPR_SSLOPTIONS_H + +#include +#include +#include + +#include + +#include "cpr/util.h" +#include + +#define __LIBCURL_VERSION_GTE(major, minor) ((LIBCURL_VERSION_MAJOR > (major)) || ((LIBCURL_VERSION_MAJOR == (major)) && (LIBCURL_VERSION_MINOR >= (minor)))) +#define __LIBCURL_VERSION_LT(major, minor) ((LIBCURL_VERSION_MAJOR < (major)) || ((LIBCURL_VERSION_MAJOR == (major)) && (LIBCURL_VERSION_MINOR < (minor)))) + +#ifndef SUPPORT_ALPN +#define SUPPORT_ALPN __LIBCURL_VERSION_GTE(7, 36) +#endif +#ifndef SUPPORT_NPN +#define SUPPORT_NPN __LIBCURL_VERSION_GTE(7, 36) +#endif + +#ifndef SUPPORT_SSLv2 +#define SUPPORT_SSLv2 __LIBCURL_VERSION_LT(7, 19) +#endif +#ifndef SUPPORT_SSLv3 +#define SUPPORT_SSLv3 __LIBCURL_VERSION_LT(7, 39) +#endif +#ifndef SUPPORT_TLSv1_0 +#define SUPPORT_TLSv1_0 __LIBCURL_VERSION_GTE(7, 34) +#endif +#ifndef SUPPORT_TLSv1_1 +#define SUPPORT_TLSv1_1 __LIBCURL_VERSION_GTE(7, 34) +#endif +#ifndef SUPPORT_TLSv1_2 +#define SUPPORT_TLSv1_2 __LIBCURL_VERSION_GTE(7, 34) +#endif +#ifndef SUPPORT_TLSv1_3 +#define SUPPORT_TLSv1_3 __LIBCURL_VERSION_GTE(7, 52) +#endif +#ifndef SUPPORT_MAX_TLS_VERSION +#define SUPPORT_MAX_TLS_VERSION __LIBCURL_VERSION_GTE(7, 54) +#endif +#ifndef SUPPORT_MAX_TLSv1_1 +#define SUPPORT_MAX_TLSv1_1 __LIBCURL_VERSION_GTE(7, 54) +#endif +#ifndef SUPPORT_MAX_TLSv1_2 +#define SUPPORT_MAX_TLSv1_2 __LIBCURL_VERSION_GTE(7, 54) +#endif +#ifndef SUPPORT_MAX_TLSv1_3 +#define SUPPORT_MAX_TLSv1_3 __LIBCURL_VERSION_GTE(7, 54) +#endif +#ifndef SUPPORT_TLSv13_CIPHERS +#define SUPPORT_TLSv13_CIPHERS __LIBCURL_VERSION_GTE(7, 61) +#endif +#ifndef SUPPORT_SESSIONID_CACHE +#define SUPPORT_SESSIONID_CACHE __LIBCURL_VERSION_GTE(7, 16) +#endif +#ifndef SUPPORT_SSL_FALSESTART +#define SUPPORT_SSL_FALSESTART __LIBCURL_VERSION_GTE(7, 42) +#endif +#ifndef SUPPORT_SSL_NO_REVOKE +#define SUPPORT_SSL_NO_REVOKE __LIBCURL_VERSION_GTE(7, 44) +#endif +#ifndef SUPPORT_CURLOPT_SSLKEY_BLOB +#define SUPPORT_CURLOPT_SSLKEY_BLOB __LIBCURL_VERSION_GTE(7, 71) +#endif +#ifndef SUPPORT_CURLOPT_SSL_CTX_FUNCTION +#define SUPPORT_CURLOPT_SSL_CTX_FUNCTION __LIBCURL_VERSION_GTE(7, 11) +#endif + +namespace cpr { + +class VerifySsl { + public: + VerifySsl() = default; + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + VerifySsl(bool p_verify) : verify(p_verify) {} + + explicit operator bool() const { + return verify; + } + + bool verify = true; +}; + +namespace ssl { + +// set SSL client certificate +class CertFile { + public: + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + CertFile(std::string&& p_filename) : filename(std::move(p_filename)) {} + + virtual ~CertFile() = default; + + const std::string filename; + + virtual const char* GetCertType() const { + return "PEM"; + } +}; + +using PemCert = CertFile; + +class DerCert : public CertFile { + public: + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + DerCert(std::string&& p_filename) : CertFile(std::move(p_filename)) {} + + virtual ~DerCert() = default; + + const char* GetCertType() const override { + return "DER"; + } +}; + +// specify private keyfile for TLS and SSL client cert +class KeyFile { + public: + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + KeyFile(std::string&& p_filename) : filename(std::move(p_filename)) {} + + template + KeyFile(FileType&& p_filename, PassType p_password) : filename(std::forward(p_filename)), password(std::move(p_password)) {} + + virtual ~KeyFile() { + util::secureStringClear(password); + } + + std::string filename; + std::string password; + + virtual const char* GetKeyType() const { + return "PEM"; + } +}; + +#if SUPPORT_CURLOPT_SSLKEY_BLOB +class KeyBlob { + public: + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + KeyBlob(std::string&& p_blob) : blob(std::move(p_blob)) {} + + template + KeyBlob(BlobType&& p_blob, PassType p_password) : blob(std::forward(p_blob)), password(std::move(p_password)) {} + + virtual ~KeyBlob() { + util::secureStringClear(password); + } + + std::string blob; + std::string password; + + virtual const char* GetKeyType() const { + return "PEM"; + } +}; +#endif + +using PemKey = KeyFile; + +class DerKey : public KeyFile { + public: + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + DerKey(std::string&& p_filename) : KeyFile(std::move(p_filename)) {} + + template + DerKey(FileType&& p_filename, PassType p_password) : KeyFile(std::forward(p_filename), std::move(p_password)) {} + + virtual ~DerKey() = default; + + const char* GetKeyType() const override { + return "DER"; + } +}; + +class PinnedPublicKey { + public: + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + PinnedPublicKey(std::string&& p_pinned_public_key) : pinned_public_key(std::move(p_pinned_public_key)) {} + + const std::string pinned_public_key; +}; + +#if SUPPORT_ALPN +// This option enables/disables ALPN in the SSL handshake (if the SSL backend libcurl is built to +// use supports it), which can be used to negotiate http2. +class ALPN { + public: + ALPN() = default; + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + ALPN(bool p_enabled) : enabled(p_enabled) {} + + explicit operator bool() const { + return enabled; + } + + bool enabled = true; +}; +#endif // SUPPORT_ALPN + +#if SUPPORT_NPN +// This option enables/disables NPN in the SSL handshake (if the SSL backend libcurl is built to +// use supports it), which can be used to negotiate http2. +class NPN { + public: + NPN() = default; + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + NPN(bool p_enabled) : enabled(p_enabled) {} + + explicit operator bool() const { + return enabled; + } + + bool enabled = true; +}; +#endif // SUPPORT_NPN + +// This option determines whether libcurl verifies that the server cert is for the server it is +// known as. +class VerifyHost { + public: + VerifyHost() = default; + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + VerifyHost(bool p_enabled) : enabled(p_enabled) {} + + explicit operator bool() const { + return enabled; + } + + bool enabled = true; +}; + +// This option determines whether libcurl verifies the authenticity of the peer's certificate. +class VerifyPeer { + public: + VerifyPeer() = default; + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + VerifyPeer(bool p_enabled) : enabled(p_enabled) {} + + explicit operator bool() const { + return enabled; + } + + bool enabled = true; +}; + +// This option determines whether libcurl verifies the status of the server cert using the +// "Certificate Status Request" TLS extension (aka. OCSP stapling). +class VerifyStatus { + public: + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + VerifyStatus(bool p_enabled) : enabled(p_enabled) {} + + explicit operator bool() const { + return enabled; + } + + bool enabled = false; +}; + +// TLS v1.0 or later +struct TLSv1 {}; +#if SUPPORT_SSLv2 +// SSL v2 (but not SSLv3) +struct SSLv2 {}; +#endif +#if SUPPORT_SSLv3 +// SSL v3 (but not SSLv2) +struct SSLv3 {}; +#endif +#if SUPPORT_TLSv1_0 +// TLS v1.0 or later (Added in 7.34.0) +struct TLSv1_0 {}; +#endif +#if SUPPORT_TLSv1_1 +// TLS v1.1 or later (Added in 7.34.0) +struct TLSv1_1 {}; +#endif +#if SUPPORT_TLSv1_2 +// TLS v1.2 or later (Added in 7.34.0) +struct TLSv1_2 {}; +#endif +#if SUPPORT_TLSv1_3 +// TLS v1.3 or later (Added in 7.52.0) +struct TLSv1_3 {}; +#endif +#if SUPPORT_MAX_TLS_VERSION +// The flag defines the maximum supported TLS version by libcurl, or the default value from the SSL +// library is used. +struct MaxTLSVersion {}; +#endif +#if SUPPORT_MAX_TLSv1_0 +// The flag defines maximum supported TLS version as TLSv1.0. (Added in 7.54.0) +struct MaxTLSv1_0 {}; +#endif +#if SUPPORT_MAX_TLSv1_1 +// The flag defines maximum supported TLS version as TLSv1.1. (Added in 7.54.0) +struct MaxTLSv1_1 {}; +#endif +#if SUPPORT_MAX_TLSv1_2 +// The flag defines maximum supported TLS version as TLSv1.2. (Added in 7.54.0) +struct MaxTLSv1_2 {}; +#endif +#if SUPPORT_MAX_TLSv1_3 +// The flag defines maximum supported TLS version as TLSv1.3. (Added in 7.54.0) +struct MaxTLSv1_3 {}; +#endif + +// path to Certificate Authority (CA) bundle +class CaInfo { + public: + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + CaInfo(std::string&& p_filename) : filename(std::move(p_filename)) {} + + std::string filename; +}; + +// specify directory holding CA certificates +class CaPath { + public: + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + CaPath(std::string&& p_filename) : filename(std::move(p_filename)) {} + + std::string filename; +}; + +#if SUPPORT_CURLOPT_SSL_CTX_FUNCTION +class CaBuffer { + public: + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + CaBuffer(std::string&& p_buffer) : buffer(std::move(p_buffer)) {} + + const std::string buffer; +}; +#endif + +// specify a Certificate Revocation List file +class Crl { + public: + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + Crl(std::string&& p_filename) : filename(std::move(p_filename)) {} + + std::string filename; +}; + +// specify ciphers to use for TLS +class Ciphers { + public: + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + Ciphers(std::string&& p_ciphers) : ciphers(std::move(p_ciphers)) {} + + std::string ciphers; +}; + +#if SUPPORT_TLSv13_CIPHERS +// specify ciphers suites to use for TLS 1.3 +class TLS13_Ciphers { + public: + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + TLS13_Ciphers(std::string&& p_ciphers) : ciphers(std::move(p_ciphers)) {} + + std::string ciphers; +}; +#endif + +#if SUPPORT_SESSIONID_CACHE +// enable/disable use of the SSL session-ID cache +class SessionIdCache { + public: + SessionIdCache() = default; + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + SessionIdCache(bool p_enabled) : enabled(p_enabled) {} + + explicit operator bool() const { + return enabled; + } + + bool enabled = true; +}; +#endif + +#if SUPPORT_SSL_FALSESTART +class SslFastStart { + public: + SslFastStart() = default; + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + SslFastStart(bool p_enabled) : enabled(p_enabled) {} + + explicit operator bool() const { + return enabled; + } + + bool enabled = false; +}; +#endif + +class NoRevoke { + public: + NoRevoke() = default; + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + NoRevoke(bool p_enabled) : enabled(p_enabled) {} + + explicit operator bool() const { + return enabled; + } + + bool enabled = false; +}; + +} // namespace ssl + +struct SslOptions { + std::string cert_file; + std::string cert_type; + std::string key_file; +#if SUPPORT_CURLOPT_SSLKEY_BLOB + std::string key_blob; +#endif + std::string key_type; + std::string key_pass; + std::string pinned_public_key; +#if SUPPORT_ALPN + bool enable_alpn = true; +#endif // SUPPORT_ALPN +#if SUPPORT_NPN + bool enable_npn = true; +#endif // SUPPORT_ALPN + bool verify_host = true; + bool verify_peer = true; + bool verify_status = false; + int ssl_version = CURL_SSLVERSION_DEFAULT; +#if SUPPORT_SSL_NO_REVOKE + bool ssl_no_revoke = false; +#endif +#if SUPPORT_MAX_TLS_VERSION + int max_version = CURL_SSLVERSION_MAX_DEFAULT; +#endif + std::string ca_info; + std::string ca_path; +#if SUPPORT_CURLOPT_SSL_CTX_FUNCTION + std::string ca_buffer; +#endif + std::string crl_file; + std::string ciphers; +#if SUPPORT_TLSv13_CIPHERS + std::string tls13_ciphers; +#endif +#if SUPPORT_SESSIONID_CACHE + bool session_id_cache = true; +#endif + + ~SslOptions() noexcept { +#if SUPPORT_CURLOPT_SSLKEY_BLOB + util::secureStringClear(key_blob); +#endif + util::secureStringClear(key_pass); + } + + void SetOption(const ssl::CertFile& opt) { + cert_file = opt.filename; + cert_type = opt.GetCertType(); + } + void SetOption(const ssl::KeyFile& opt) { + key_file = opt.filename; + key_type = opt.GetKeyType(); + key_pass = opt.password; + } +#if SUPPORT_CURLOPT_SSLKEY_BLOB + void SetOption(const ssl::KeyBlob& opt) { + key_blob = opt.blob; + key_type = opt.GetKeyType(); + key_pass = opt.password; + } +#endif + void SetOption(const ssl::PinnedPublicKey& opt) { + pinned_public_key = opt.pinned_public_key; + } + +#if SUPPORT_ALPN + void SetOption(const ssl::ALPN& opt) { + enable_alpn = opt.enabled; + } +#endif // SUPPORT_ALPN +#if SUPPORT_NPN + void SetOption(const ssl::NPN& opt) { + enable_npn = opt.enabled; + } +#endif // SUPPORT_NPN + void SetOption(const ssl::VerifyHost& opt) { + verify_host = opt.enabled; + } + void SetOption(const ssl::VerifyPeer& opt) { + verify_peer = opt.enabled; + } + void SetOption(const ssl::VerifyStatus& opt) { + verify_status = opt.enabled; + } + void SetOption(const ssl::TLSv1& /*opt*/) { + ssl_version = CURL_SSLVERSION_TLSv1; + } +#if SUPPORT_SSL_NO_REVOKE + void SetOption(const ssl::NoRevoke& opt) { + ssl_no_revoke = opt.enabled; + } +#endif +#if SUPPORT_SSLv2 + void SetOption(const ssl::SSLv2& /*opt*/) { + ssl_version = CURL_SSLVERSION_SSLv2; + } +#endif +#if SUPPORT_SSLv3 + void SetOption(const ssl::SSLv3& /*opt*/) { + ssl_version = CURL_SSLVERSION_SSLv3; + } +#endif +#if SUPPORT_TLSv1_0 + void SetOption(const ssl::TLSv1_0& /*opt*/) { + ssl_version = CURL_SSLVERSION_TLSv1_0; + } +#endif +#if SUPPORT_TLSv1_1 + void SetOption(const ssl::TLSv1_1& /*opt*/) { + ssl_version = CURL_SSLVERSION_TLSv1_1; + } +#endif +#if SUPPORT_TLSv1_2 + void SetOption(const ssl::TLSv1_2& /*opt*/) { + ssl_version = CURL_SSLVERSION_TLSv1_2; + } +#endif +#if SUPPORT_TLSv1_3 + void SetOption(const ssl::TLSv1_3& /*opt*/) { + ssl_version = CURL_SSLVERSION_TLSv1_3; + } +#endif +#if SUPPORT_MAX_TLS_VERSION + void SetOption(const ssl::MaxTLSVersion& /*opt*/) { + max_version = CURL_SSLVERSION_DEFAULT; + } +#endif +#if SUPPORT_MAX_TLSv1_0 + void SetOption(const ssl::MaxTLSv1_0& opt) { + max_version = CURL_SSLVERSION_MAX_TLSv1_0; + } +#endif +#if SUPPORT_MAX_TLSv1_1 + void SetOption(const ssl::MaxTLSv1_1& /*opt*/) { + max_version = CURL_SSLVERSION_MAX_TLSv1_1; + } +#endif +#if SUPPORT_MAX_TLSv1_2 + void SetOption(const ssl::MaxTLSv1_2& /*opt*/) { + max_version = CURL_SSLVERSION_MAX_TLSv1_2; + } +#endif +#if SUPPORT_MAX_TLSv1_3 + void SetOption(const ssl::MaxTLSv1_3& /*opt*/) { + max_version = CURL_SSLVERSION_MAX_TLSv1_3; + } +#endif + void SetOption(const ssl::CaInfo& opt) { + ca_info = opt.filename; + } + void SetOption(const ssl::CaPath& opt) { + ca_path = opt.filename; + } +#if SUPPORT_CURLOPT_SSL_CTX_FUNCTION + void SetOption(const ssl::CaBuffer& opt) { + ca_buffer = opt.buffer; + } +#endif + void SetOption(const ssl::Crl& opt) { + crl_file = opt.filename; + } + void SetOption(const ssl::Ciphers& opt) { + ciphers = opt.ciphers; + } +#if SUPPORT_TLSv13_CIPHERS + void SetOption(const ssl::TLS13_Ciphers& opt) { + tls13_ciphers = opt.ciphers; + } +#endif +#if SUPPORT_SESSIONID_CACHE + void SetOption(const ssl::SessionIdCache& opt) { + session_id_cache = opt.enabled; + } +#endif +}; + +namespace priv { + +template +void set_ssl_option(SslOptions& opts, T&& t) { + opts.SetOption(std::forward(t)); +} + +template +void set_ssl_option(SslOptions& opts, T&& t, Ts&&... ts) { + set_ssl_option(opts, std::forward(t)); + set_ssl_option(opts, std::move(ts)...); +} + +} // namespace priv + +template +SslOptions Ssl(Ts&&... ts) { + SslOptions opts; + priv::set_ssl_option(opts, std::move(ts)...); + return opts; +} + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/status_codes.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/status_codes.h new file mode 100644 index 0000000..6c7acd6 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/status_codes.h @@ -0,0 +1,100 @@ +#ifndef _CPR_STATUS_CODES +#define _CPR_STATUS_CODES +#include +namespace cpr { +namespace status { +// Information responses +constexpr std::int32_t HTTP_CONTINUE = 100; +constexpr std::int32_t HTTP_SWITCHING_PROTOCOL = 101; +constexpr std::int32_t HTTP_PROCESSING = 102; +constexpr std::int32_t HTTP_EARLY_HINTS = 103; +// Successful responses +constexpr std::int32_t HTTP_OK = 200; +constexpr std::int32_t HTTP_CREATED = 201; +constexpr std::int32_t HTTP_ACCEPTED = 202; +constexpr std::int32_t HTTP_NON_AUTHORITATIVE_INFORMATION = 203; +constexpr std::int32_t HTTP_NO_CONTENT = 204; +constexpr std::int32_t HTTP_RESET_CONTENT = 205; +constexpr std::int32_t HTTP_PARTIAL_CONTENT = 206; +constexpr std::int32_t HTTP_MULTI_STATUS = 207; +constexpr std::int32_t HTTP_ALREADY_REPORTED = 208; +constexpr std::int32_t HTTP_IM_USED = 226; +// Redirection messages +constexpr std::int32_t HTTP_MULTIPLE_CHOICE = 300; +constexpr std::int32_t HTTP_MOVED_PERMANENTLY = 301; +constexpr std::int32_t HTTP_FOUND = 302; +constexpr std::int32_t HTTP_SEE_OTHER = 303; +constexpr std::int32_t HTTP_NOT_MODIFIED = 304; +constexpr std::int32_t HTTP_USE_PROXY = 305; +constexpr std::int32_t HTTP_UNUSED = 306; +constexpr std::int32_t HTTP_TEMPORARY_REDIRECT = 307; +constexpr std::int32_t HTTP_PERMANENT_REDIRECT = 308; +// Client error responses +constexpr std::int32_t HTTP_BAD_REQUEST = 400; +constexpr std::int32_t HTTP_UNAUTHORIZED = 401; +constexpr std::int32_t HTTP_PAYMENT_REQUIRED = 402; +constexpr std::int32_t HTTP_FORBIDDEN = 403; +constexpr std::int32_t HTTP_NOT_FOUND = 404; +constexpr std::int32_t HTTP_METHOD_NOT_ALLOWED = 405; +constexpr std::int32_t HTTP_NOT_ACCEPTABLE = 406; +constexpr std::int32_t HTTP_PROXY_AUTHENTICATION_REQUIRED = 407; +constexpr std::int32_t HTTP_REQUEST_TIMEOUT = 408; +constexpr std::int32_t HTTP_CONFLICT = 409; +constexpr std::int32_t HTTP_GONE = 410; +constexpr std::int32_t HTTP_LENGTH_REQUIRED = 411; +constexpr std::int32_t HTTP_PRECONDITION_FAILED = 412; +constexpr std::int32_t HTTP_PAYLOAD_TOO_LARGE = 413; +constexpr std::int32_t HTTP_URI_TOO_LONG = 414; +constexpr std::int32_t HTTP_UNSUPPORTED_MEDIA_TYPE = 415; +constexpr std::int32_t HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416; +constexpr std::int32_t HTTP_EXPECTATION_FAILED = 417; +constexpr std::int32_t HTTP_IM_A_TEAPOT = 418; +constexpr std::int32_t HTTP_MISDIRECTED_REQUEST = 421; +constexpr std::int32_t HTTP_UNPROCESSABLE_ENTITY = 422; +constexpr std::int32_t HTTP_LOCKED = 423; +constexpr std::int32_t HTTP_FAILED_DEPENDENCY = 424; +constexpr std::int32_t HTTP_TOO_EARLY = 425; +constexpr std::int32_t HTTP_UPGRADE_REQUIRED = 426; +constexpr std::int32_t HTTP_PRECONDITION_REQUIRED = 428; +constexpr std::int32_t HTTP_TOO_MANY_REQUESTS = 429; +constexpr std::int32_t HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = 431; +constexpr std::int32_t HTTP_UNAVAILABLE_FOR_LEGAL_REASONS = 451; +// Server response errors +constexpr std::int32_t HTTP_INTERNAL_SERVER_ERROR = 500; +constexpr std::int32_t HTTP_NOT_IMPLEMENTED = 501; +constexpr std::int32_t HTTP_BAD_GATEWAY = 502; +constexpr std::int32_t HTTP_SERVICE_UNAVAILABLE = 503; +constexpr std::int32_t HTTP_GATEWAY_TIMEOUT = 504; +constexpr std::int32_t HTTP_HTTP_VERSION_NOT_SUPPORTED = 505; +constexpr std::int32_t HTTP_VARIANT_ALSO_NEGOTIATES = 506; +constexpr std::int32_t HTTP_INSUFFICIENT_STORAGE = 507; +constexpr std::int32_t HTTP_LOOP_DETECTED = 508; +constexpr std::int32_t HTTP_NOT_EXTENDED = 510; +constexpr std::int32_t HTTP_NETWORK_AUTHENTICATION_REQUIRED = 511; + +constexpr std::int32_t INFO_CODE_OFFSET = 100; +constexpr std::int32_t SUCCESS_CODE_OFFSET = 200; +constexpr std::int32_t REDIRECT_CODE_OFFSET = 300; +constexpr std::int32_t CLIENT_ERROR_CODE_OFFSET = 400; +constexpr std::int32_t SERVER_ERROR_CODE_OFFSET = 500; +constexpr std::int32_t MISC_CODE_OFFSET = 600; + +constexpr bool is_informational(const std::int32_t code) { + return (code >= INFO_CODE_OFFSET && code < SUCCESS_CODE_OFFSET); +} +constexpr bool is_success(const std::int32_t code) { + return (code >= SUCCESS_CODE_OFFSET && code < REDIRECT_CODE_OFFSET); +} +constexpr bool is_redirect(const std::int32_t code) { + return (code >= REDIRECT_CODE_OFFSET && code < CLIENT_ERROR_CODE_OFFSET); +} +constexpr bool is_client_error(const std::int32_t code) { + return (code >= CLIENT_ERROR_CODE_OFFSET && code < SERVER_ERROR_CODE_OFFSET); +} +constexpr bool is_server_error(const std::int32_t code) { + return (code >= SERVER_ERROR_CODE_OFFSET && code < MISC_CODE_OFFSET); +} + +} // namespace status +} // namespace cpr +#endif \ No newline at end of file diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/threadpool.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/threadpool.h new file mode 100644 index 0000000..26a5ea3 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/threadpool.h @@ -0,0 +1,122 @@ +#ifndef CPR_THREAD_POOL_H +#define CPR_THREAD_POOL_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define CPR_DEFAULT_THREAD_POOL_MAX_THREAD_NUM std::thread::hardware_concurrency() + +constexpr size_t CPR_DEFAULT_THREAD_POOL_MIN_THREAD_NUM = 1; +constexpr std::chrono::milliseconds CPR_DEFAULT_THREAD_POOL_MAX_IDLE_TIME{60000}; + +namespace cpr { + +class ThreadPool { + public: + using Task = std::function; + + explicit ThreadPool(size_t min_threads = CPR_DEFAULT_THREAD_POOL_MIN_THREAD_NUM, size_t max_threads = CPR_DEFAULT_THREAD_POOL_MAX_THREAD_NUM, std::chrono::milliseconds max_idle_ms = CPR_DEFAULT_THREAD_POOL_MAX_IDLE_TIME); + + virtual ~ThreadPool(); + + void SetMinThreadNum(size_t min_threads) { + min_thread_num = min_threads; + } + void SetMaxThreadNum(size_t max_threads) { + max_thread_num = max_threads; + } + void SetMaxIdleTime(std::chrono::milliseconds ms) { + max_idle_time = ms; + } + size_t GetCurrentThreadNum() { + return cur_thread_num; + } + size_t GetIdleThreadNum() { + return idle_thread_num; + } + bool IsStarted() { + return status != STOP; + } + bool IsStopped() { + return status == STOP; + } + + int Start(size_t start_threads = 0); + int Stop(); + int Pause(); + int Resume(); + int Wait(); + + /** + * Return a future, calling future.get() will wait task done and return RetType. + * Submit(fn, args...) + * Submit(std::bind(&Class::mem_fn, &obj)) + * Submit(std::mem_fn(&Class::mem_fn, &obj)) + **/ + template + auto Submit(Fn&& fn, Args&&... args) -> std::future { + if (status == STOP) { + Start(); + } + if (idle_thread_num <= 0 && cur_thread_num < max_thread_num) { + CreateThread(); + } + using RetType = decltype(fn(args...)); + auto task = std::make_shared >(std::bind(std::forward(fn), std::forward(args)...)); + std::future future = task->get_future(); + { + std::lock_guard locker(task_mutex); + tasks.emplace([task] { (*task)(); }); + } + + task_cond.notify_one(); + return future; + } + + private: + bool CreateThread(); + void AddThread(std::thread* thread); + void DelThread(std::thread::id id); + + public: + size_t min_thread_num; + size_t max_thread_num; + std::chrono::milliseconds max_idle_time; + + private: + enum Status { + STOP, + RUNNING, + PAUSE, + }; + + struct ThreadData { + std::shared_ptr thread; + std::thread::id id; + Status status; + time_t start_time; + time_t stop_time; + }; + + std::atomic status; + std::atomic cur_thread_num; + std::atomic idle_thread_num; + std::list threads; + std::mutex thread_mutex; + std::queue tasks; + std::mutex task_mutex; + std::condition_variable task_cond; +}; + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/timeout.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/timeout.h new file mode 100644 index 0000000..a01da43 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/timeout.h @@ -0,0 +1,25 @@ +#ifndef CPR_TIMEOUT_H +#define CPR_TIMEOUT_H + +#include +#include + +namespace cpr { + +class Timeout { + public: + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + Timeout(const std::chrono::milliseconds& duration) : ms{duration} {} + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + Timeout(const std::int32_t& milliseconds) : Timeout{std::chrono::milliseconds(milliseconds)} {} + + // No way around since curl uses a long here. + // NOLINTNEXTLINE(google-runtime-int) + long Milliseconds() const; + + std::chrono::milliseconds ms; +}; + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/unix_socket.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/unix_socket.h new file mode 100644 index 0000000..9d4d77c --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/unix_socket.h @@ -0,0 +1,21 @@ +#ifndef CPR_UNIX_SOCKET_H +#define CPR_UNIX_SOCKET_H + +#include + +namespace cpr { + +class UnixSocket { + public: + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + UnixSocket(std::string&& unix_socket) : unix_socket_(std::move(unix_socket)) {} + + const char* GetUnixSocketString() const noexcept; + + private: + const std::string unix_socket_; +}; + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/user_agent.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/user_agent.h new file mode 100644 index 0000000..71787c5 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/user_agent.h @@ -0,0 +1,31 @@ +#ifndef CPR_USERAGENT_H +#define CPR_USERAGENT_H + +#include +#include + +#include "cpr/cprtypes.h" + +namespace cpr { +class UserAgent : public StringHolder { + public: + UserAgent() : StringHolder() {} + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + UserAgent(const std::string& useragent) : StringHolder(useragent) {} + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + UserAgent(std::string&& useragent) : StringHolder(std::move(useragent)) {} + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + UserAgent(const char* useragent) : StringHolder(useragent) {} + UserAgent(const char* str, size_t len) : StringHolder(str, len) {} + UserAgent(const std::initializer_list args) : StringHolder(args) {} + UserAgent(const UserAgent& other) = default; + UserAgent(UserAgent&& old) noexcept = default; + ~UserAgent() override = default; + + UserAgent& operator=(UserAgent&& old) noexcept = default; + UserAgent& operator=(const UserAgent& other) = default; +}; + +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/util.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/util.h new file mode 100644 index 0000000..f35ad47 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/util.h @@ -0,0 +1,45 @@ +#ifndef CPR_UTIL_H +#define CPR_UTIL_H + +#include +#include +#include + +#include "cpr/callback.h" +#include "cpr/cookies.h" +#include "cpr/cprtypes.h" +#include "cpr/curlholder.h" + +namespace cpr { +namespace util { + +Header parseHeader(const std::string& headers, std::string* status_line = nullptr, std::string* reason = nullptr); +Cookies parseCookies(curl_slist* raw_cookies); +size_t readUserFunction(char* ptr, size_t size, size_t nitems, const ReadCallback* read); +size_t headerUserFunction(char* ptr, size_t size, size_t nmemb, const HeaderCallback* header); +size_t writeFunction(char* ptr, size_t size, size_t nmemb, std::string* data); +size_t writeFileFunction(char* ptr, size_t size, size_t nmemb, std::ofstream* file); +size_t writeUserFunction(char* ptr, size_t size, size_t nmemb, const WriteCallback* write); +#if LIBCURL_VERSION_NUM < 0x072000 +int progressUserFunction(const ProgressCallback* progress, double dltotal, double dlnow, double ultotal, double ulnow); +#else +int progressUserFunction(const ProgressCallback* progress, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow); +#endif +int debugUserFunction(CURL* handle, curl_infotype type, char* data, size_t size, const DebugCallback* debug); +std::vector split(const std::string& to_split, char delimiter); +std::string urlEncode(const std::string& s); +std::string urlDecode(const std::string& s); + +/** + * Override the content of the provided string to hide sensitive data. The + * string content after invocation is undefined. The string size is reset to zero. + * impl. based on: + * https://github.com/ojeda/secure_clear/blob/master/example-implementation/secure_clear.h + **/ +void secureStringClear(std::string& s); +bool isTrue(const std::string& s); + +} // namespace util +} // namespace cpr + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/verbose.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/verbose.h new file mode 100644 index 0000000..2bf0df8 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/cpr/verbose.h @@ -0,0 +1,18 @@ +#ifndef CPR_VERBOSE_H_ +#define CPR_VERBOSE_H_ + +namespace cpr { + +class Verbose { + public: + Verbose() = default; + // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) + Verbose(const bool p_verbose) : verbose{p_verbose} {} + + bool verbose = true; +}; + +} // namespace cpr + + +#endif /* CPR_VERBOSE_H_ */ diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/curl.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/curl.h new file mode 100644 index 0000000..fc474a4 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/curl.h @@ -0,0 +1,3134 @@ +#ifndef CURLINC_CURL_H +#define CURLINC_CURL_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2022, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at https://curl.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * SPDX-License-Identifier: curl + * + ***************************************************************************/ + +/* + * If you have libcurl problems, all docs and details are found here: + * https://curl.se/libcurl/ + */ + +#ifdef CURL_NO_OLDIES +#define CURL_STRICTER +#endif + +#include "curlver.h" /* libcurl version defines */ +#include "system.h" /* determine things run-time */ + +/* + * Define CURL_WIN32 when build target is Win32 API + */ + +#if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && \ + !defined(__SYMBIAN32__) +#define CURL_WIN32 +#endif + +#include +#include + +#if (defined(__FreeBSD__) && (__FreeBSD__ >= 2)) || defined(__MidnightBSD__) +/* Needed for __FreeBSD_version or __MidnightBSD_version symbol definition */ +#include +#endif + +/* The include stuff here below is mainly for time_t! */ +#include +#include + +#if defined(CURL_WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__) +#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || \ + defined(__LWIP_OPT_H__) || defined(LWIP_HDR_OPT_H)) +/* The check above prevents the winsock2 inclusion if winsock.h already was + included, since they can't co-exist without problems */ +#include +#include +#endif +#endif + +/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish + libc5-based Linux systems. Only include it on systems that are known to + require it! */ +#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \ + defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \ + defined(ANDROID) || defined(__ANDROID__) || defined(__OpenBSD__) || \ + defined(__CYGWIN__) || defined(AMIGA) || defined(__NuttX__) || \ + (defined(__FreeBSD_version) && (__FreeBSD_version < 800000)) || \ + (defined(__MidnightBSD_version) && (__MidnightBSD_version < 100000)) || \ + defined(__sun__) +#include +#endif + +#if !defined(CURL_WIN32) && !defined(_WIN32_WCE) +#include +#endif + +#if !defined(CURL_WIN32) +#include +#endif + +/* Compatibility for non-Clang compilers */ +#ifndef __has_declspec_attribute +# define __has_declspec_attribute(x) 0 +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(BUILDING_LIBCURL) || defined(CURL_STRICTER) +typedef struct Curl_easy CURL; +typedef struct Curl_share CURLSH; +#else +typedef void CURL; +typedef void CURLSH; +#endif + +/* + * libcurl external API function linkage decorations. + */ + +#if 1 +# define CURL_EXTERN +#elif defined(CURL_WIN32) || defined(__SYMBIAN32__) || \ + (__has_declspec_attribute(dllexport) && \ + __has_declspec_attribute(dllimport)) +# if defined(BUILDING_LIBCURL) +# define CURL_EXTERN __declspec(dllexport) +# else +# define CURL_EXTERN __declspec(dllimport) +# endif +#elif defined(BUILDING_LIBCURL) && defined(CURL_HIDDEN_SYMBOLS) +# define CURL_EXTERN CURL_EXTERN_SYMBOL +#else +# define CURL_EXTERN +#endif + +#ifndef curl_socket_typedef +/* socket typedef */ +#if defined(CURL_WIN32) && !defined(__LWIP_OPT_H__) && !defined(LWIP_HDR_OPT_H) +typedef SOCKET curl_socket_t; +#define CURL_SOCKET_BAD INVALID_SOCKET +#else +typedef int curl_socket_t; +#define CURL_SOCKET_BAD -1 +#endif +#define curl_socket_typedef +#endif /* curl_socket_typedef */ + +/* enum for the different supported SSL backends */ +typedef enum { + CURLSSLBACKEND_NONE = 0, + CURLSSLBACKEND_OPENSSL = 1, + CURLSSLBACKEND_GNUTLS = 2, + CURLSSLBACKEND_NSS = 3, + CURLSSLBACKEND_OBSOLETE4 = 4, /* Was QSOSSL. */ + CURLSSLBACKEND_GSKIT = 5, + CURLSSLBACKEND_POLARSSL = 6, + CURLSSLBACKEND_WOLFSSL = 7, + CURLSSLBACKEND_SCHANNEL = 8, + CURLSSLBACKEND_SECURETRANSPORT = 9, + CURLSSLBACKEND_AXTLS = 10, /* never used since 7.63.0 */ + CURLSSLBACKEND_MBEDTLS = 11, + CURLSSLBACKEND_MESALINK = 12, + CURLSSLBACKEND_BEARSSL = 13, + CURLSSLBACKEND_RUSTLS = 14 +} curl_sslbackend; + +/* aliases for library clones and renames */ +#define CURLSSLBACKEND_LIBRESSL CURLSSLBACKEND_OPENSSL +#define CURLSSLBACKEND_BORINGSSL CURLSSLBACKEND_OPENSSL + +/* deprecated names: */ +#define CURLSSLBACKEND_CYASSL CURLSSLBACKEND_WOLFSSL +#define CURLSSLBACKEND_DARWINSSL CURLSSLBACKEND_SECURETRANSPORT + +struct curl_httppost { + struct curl_httppost *next; /* next entry in the list */ + char *name; /* pointer to allocated name */ + long namelength; /* length of name length */ + char *contents; /* pointer to allocated data contents */ + long contentslength; /* length of contents field, see also + CURL_HTTPPOST_LARGE */ + char *buffer; /* pointer to allocated buffer contents */ + long bufferlength; /* length of buffer field */ + char *contenttype; /* Content-Type */ + struct curl_slist *contentheader; /* list of extra headers for this form */ + struct curl_httppost *more; /* if one field name has more than one + file, this link should link to following + files */ + long flags; /* as defined below */ + +/* specified content is a file name */ +#define CURL_HTTPPOST_FILENAME (1<<0) +/* specified content is a file name */ +#define CURL_HTTPPOST_READFILE (1<<1) +/* name is only stored pointer do not free in formfree */ +#define CURL_HTTPPOST_PTRNAME (1<<2) +/* contents is only stored pointer do not free in formfree */ +#define CURL_HTTPPOST_PTRCONTENTS (1<<3) +/* upload file from buffer */ +#define CURL_HTTPPOST_BUFFER (1<<4) +/* upload file from pointer contents */ +#define CURL_HTTPPOST_PTRBUFFER (1<<5) +/* upload file contents by using the regular read callback to get the data and + pass the given pointer as custom pointer */ +#define CURL_HTTPPOST_CALLBACK (1<<6) +/* use size in 'contentlen', added in 7.46.0 */ +#define CURL_HTTPPOST_LARGE (1<<7) + + char *showfilename; /* The file name to show. If not set, the + actual file name will be used (if this + is a file part) */ + void *userp; /* custom pointer used for + HTTPPOST_CALLBACK posts */ + curl_off_t contentlen; /* alternative length of contents + field. Used if CURL_HTTPPOST_LARGE is + set. Added in 7.46.0 */ +}; + + +/* This is a return code for the progress callback that, when returned, will + signal libcurl to continue executing the default progress function */ +#define CURL_PROGRESSFUNC_CONTINUE 0x10000001 + +/* This is the CURLOPT_PROGRESSFUNCTION callback prototype. It is now + considered deprecated but was the only choice up until 7.31.0 */ +typedef int (*curl_progress_callback)(void *clientp, + double dltotal, + double dlnow, + double ultotal, + double ulnow); + +/* This is the CURLOPT_XFERINFOFUNCTION callback prototype. It was introduced + in 7.32.0, avoids the use of floating point numbers and provides more + detailed information. */ +typedef int (*curl_xferinfo_callback)(void *clientp, + curl_off_t dltotal, + curl_off_t dlnow, + curl_off_t ultotal, + curl_off_t ulnow); + +#ifndef CURL_MAX_READ_SIZE + /* The maximum receive buffer size configurable via CURLOPT_BUFFERSIZE. */ +#define CURL_MAX_READ_SIZE 524288 +#endif + +#ifndef CURL_MAX_WRITE_SIZE + /* Tests have proven that 20K is a very bad buffer size for uploads on + Windows, while 16K for some odd reason performed a lot better. + We do the ifndef check to allow this value to easier be changed at build + time for those who feel adventurous. The practical minimum is about + 400 bytes since libcurl uses a buffer of this size as a scratch area + (unrelated to network send operations). */ +#define CURL_MAX_WRITE_SIZE 16384 +#endif + +#ifndef CURL_MAX_HTTP_HEADER +/* The only reason to have a max limit for this is to avoid the risk of a bad + server feeding libcurl with a never-ending header that will cause reallocs + infinitely */ +#define CURL_MAX_HTTP_HEADER (100*1024) +#endif + +/* This is a magic return code for the write callback that, when returned, + will signal libcurl to pause receiving on the current transfer. */ +#define CURL_WRITEFUNC_PAUSE 0x10000001 + +typedef size_t (*curl_write_callback)(char *buffer, + size_t size, + size_t nitems, + void *outstream); + +/* This callback will be called when a new resolver request is made */ +typedef int (*curl_resolver_start_callback)(void *resolver_state, + void *reserved, void *userdata); + +/* enumeration of file types */ +typedef enum { + CURLFILETYPE_FILE = 0, + CURLFILETYPE_DIRECTORY, + CURLFILETYPE_SYMLINK, + CURLFILETYPE_DEVICE_BLOCK, + CURLFILETYPE_DEVICE_CHAR, + CURLFILETYPE_NAMEDPIPE, + CURLFILETYPE_SOCKET, + CURLFILETYPE_DOOR, /* is possible only on Sun Solaris now */ + + CURLFILETYPE_UNKNOWN /* should never occur */ +} curlfiletype; + +#define CURLFINFOFLAG_KNOWN_FILENAME (1<<0) +#define CURLFINFOFLAG_KNOWN_FILETYPE (1<<1) +#define CURLFINFOFLAG_KNOWN_TIME (1<<2) +#define CURLFINFOFLAG_KNOWN_PERM (1<<3) +#define CURLFINFOFLAG_KNOWN_UID (1<<4) +#define CURLFINFOFLAG_KNOWN_GID (1<<5) +#define CURLFINFOFLAG_KNOWN_SIZE (1<<6) +#define CURLFINFOFLAG_KNOWN_HLINKCOUNT (1<<7) + +/* Information about a single file, used when doing FTP wildcard matching */ +struct curl_fileinfo { + char *filename; + curlfiletype filetype; + time_t time; /* always zero! */ + unsigned int perm; + int uid; + int gid; + curl_off_t size; + long int hardlinks; + + struct { + /* If some of these fields is not NULL, it is a pointer to b_data. */ + char *time; + char *perm; + char *user; + char *group; + char *target; /* pointer to the target filename of a symlink */ + } strings; + + unsigned int flags; + + /* used internally */ + char *b_data; + size_t b_size; + size_t b_used; +}; + +/* return codes for CURLOPT_CHUNK_BGN_FUNCTION */ +#define CURL_CHUNK_BGN_FUNC_OK 0 +#define CURL_CHUNK_BGN_FUNC_FAIL 1 /* tell the lib to end the task */ +#define CURL_CHUNK_BGN_FUNC_SKIP 2 /* skip this chunk over */ + +/* if splitting of data transfer is enabled, this callback is called before + download of an individual chunk started. Note that parameter "remains" works + only for FTP wildcard downloading (for now), otherwise is not used */ +typedef long (*curl_chunk_bgn_callback)(const void *transfer_info, + void *ptr, + int remains); + +/* return codes for CURLOPT_CHUNK_END_FUNCTION */ +#define CURL_CHUNK_END_FUNC_OK 0 +#define CURL_CHUNK_END_FUNC_FAIL 1 /* tell the lib to end the task */ + +/* If splitting of data transfer is enabled this callback is called after + download of an individual chunk finished. + Note! After this callback was set then it have to be called FOR ALL chunks. + Even if downloading of this chunk was skipped in CHUNK_BGN_FUNC. + This is the reason why we don't need "transfer_info" parameter in this + callback and we are not interested in "remains" parameter too. */ +typedef long (*curl_chunk_end_callback)(void *ptr); + +/* return codes for FNMATCHFUNCTION */ +#define CURL_FNMATCHFUNC_MATCH 0 /* string corresponds to the pattern */ +#define CURL_FNMATCHFUNC_NOMATCH 1 /* pattern doesn't match the string */ +#define CURL_FNMATCHFUNC_FAIL 2 /* an error occurred */ + +/* callback type for wildcard downloading pattern matching. If the + string matches the pattern, return CURL_FNMATCHFUNC_MATCH value, etc. */ +typedef int (*curl_fnmatch_callback)(void *ptr, + const char *pattern, + const char *string); + +/* These are the return codes for the seek callbacks */ +#define CURL_SEEKFUNC_OK 0 +#define CURL_SEEKFUNC_FAIL 1 /* fail the entire transfer */ +#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking can't be done, so + libcurl might try other means instead */ +typedef int (*curl_seek_callback)(void *instream, + curl_off_t offset, + int origin); /* 'whence' */ + +/* This is a return code for the read callback that, when returned, will + signal libcurl to immediately abort the current transfer. */ +#define CURL_READFUNC_ABORT 0x10000000 +/* This is a return code for the read callback that, when returned, will + signal libcurl to pause sending data on the current transfer. */ +#define CURL_READFUNC_PAUSE 0x10000001 + +/* Return code for when the trailing headers' callback has terminated + without any errors*/ +#define CURL_TRAILERFUNC_OK 0 +/* Return code for when was an error in the trailing header's list and we + want to abort the request */ +#define CURL_TRAILERFUNC_ABORT 1 + +typedef size_t (*curl_read_callback)(char *buffer, + size_t size, + size_t nitems, + void *instream); + +typedef int (*curl_trailer_callback)(struct curl_slist **list, + void *userdata); + +typedef enum { + CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */ + CURLSOCKTYPE_ACCEPT, /* socket created by accept() call */ + CURLSOCKTYPE_LAST /* never use */ +} curlsocktype; + +/* The return code from the sockopt_callback can signal information back + to libcurl: */ +#define CURL_SOCKOPT_OK 0 +#define CURL_SOCKOPT_ERROR 1 /* causes libcurl to abort and return + CURLE_ABORTED_BY_CALLBACK */ +#define CURL_SOCKOPT_ALREADY_CONNECTED 2 + +typedef int (*curl_sockopt_callback)(void *clientp, + curl_socket_t curlfd, + curlsocktype purpose); + +struct curl_sockaddr { + int family; + int socktype; + int protocol; + unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it + turned really ugly and painful on the systems that + lack this type */ + struct sockaddr addr; +}; + +typedef curl_socket_t +(*curl_opensocket_callback)(void *clientp, + curlsocktype purpose, + struct curl_sockaddr *address); + +typedef int +(*curl_closesocket_callback)(void *clientp, curl_socket_t item); + +typedef enum { + CURLIOE_OK, /* I/O operation successful */ + CURLIOE_UNKNOWNCMD, /* command was unknown to callback */ + CURLIOE_FAILRESTART, /* failed to restart the read */ + CURLIOE_LAST /* never use */ +} curlioerr; + +typedef enum { + CURLIOCMD_NOP, /* no operation */ + CURLIOCMD_RESTARTREAD, /* restart the read stream from start */ + CURLIOCMD_LAST /* never use */ +} curliocmd; + +typedef curlioerr (*curl_ioctl_callback)(CURL *handle, + int cmd, + void *clientp); + +#ifndef CURL_DID_MEMORY_FUNC_TYPEDEFS +/* + * The following typedef's are signatures of malloc, free, realloc, strdup and + * calloc respectively. Function pointers of these types can be passed to the + * curl_global_init_mem() function to set user defined memory management + * callback routines. + */ +typedef void *(*curl_malloc_callback)(size_t size); +typedef void (*curl_free_callback)(void *ptr); +typedef void *(*curl_realloc_callback)(void *ptr, size_t size); +typedef char *(*curl_strdup_callback)(const char *str); +typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size); + +#define CURL_DID_MEMORY_FUNC_TYPEDEFS +#endif + +/* the kind of data that is passed to information_callback*/ +typedef enum { + CURLINFO_TEXT = 0, + CURLINFO_HEADER_IN, /* 1 */ + CURLINFO_HEADER_OUT, /* 2 */ + CURLINFO_DATA_IN, /* 3 */ + CURLINFO_DATA_OUT, /* 4 */ + CURLINFO_SSL_DATA_IN, /* 5 */ + CURLINFO_SSL_DATA_OUT, /* 6 */ + CURLINFO_END +} curl_infotype; + +typedef int (*curl_debug_callback) + (CURL *handle, /* the handle/transfer this concerns */ + curl_infotype type, /* what kind of data */ + char *data, /* points to the data */ + size_t size, /* size of the data pointed to */ + void *userptr); /* whatever the user please */ + +/* This is the CURLOPT_PREREQFUNCTION callback prototype. */ +typedef int (*curl_prereq_callback)(void *clientp, + char *conn_primary_ip, + char *conn_local_ip, + int conn_primary_port, + int conn_local_port); + +/* Return code for when the pre-request callback has terminated without + any errors */ +#define CURL_PREREQFUNC_OK 0 +/* Return code for when the pre-request callback wants to abort the + request */ +#define CURL_PREREQFUNC_ABORT 1 + +/* All possible error codes from all sorts of curl functions. Future versions + may return other values, stay prepared. + + Always add new return codes last. Never *EVER* remove any. The return + codes must remain the same! + */ + +typedef enum { + CURLE_OK = 0, + CURLE_UNSUPPORTED_PROTOCOL, /* 1 */ + CURLE_FAILED_INIT, /* 2 */ + CURLE_URL_MALFORMAT, /* 3 */ + CURLE_NOT_BUILT_IN, /* 4 - [was obsoleted in August 2007 for + 7.17.0, reused in April 2011 for 7.21.5] */ + CURLE_COULDNT_RESOLVE_PROXY, /* 5 */ + CURLE_COULDNT_RESOLVE_HOST, /* 6 */ + CURLE_COULDNT_CONNECT, /* 7 */ + CURLE_WEIRD_SERVER_REPLY, /* 8 */ + CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server + due to lack of access - when login fails + this is not returned. */ + CURLE_FTP_ACCEPT_FAILED, /* 10 - [was obsoleted in April 2006 for + 7.15.4, reused in Dec 2011 for 7.24.0]*/ + CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */ + CURLE_FTP_ACCEPT_TIMEOUT, /* 12 - timeout occurred accepting server + [was obsoleted in August 2007 for 7.17.0, + reused in Dec 2011 for 7.24.0]*/ + CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */ + CURLE_FTP_WEIRD_227_FORMAT, /* 14 */ + CURLE_FTP_CANT_GET_HOST, /* 15 */ + CURLE_HTTP2, /* 16 - A problem in the http2 framing layer. + [was obsoleted in August 2007 for 7.17.0, + reused in July 2014 for 7.38.0] */ + CURLE_FTP_COULDNT_SET_TYPE, /* 17 */ + CURLE_PARTIAL_FILE, /* 18 */ + CURLE_FTP_COULDNT_RETR_FILE, /* 19 */ + CURLE_OBSOLETE20, /* 20 - NOT USED */ + CURLE_QUOTE_ERROR, /* 21 - quote command failure */ + CURLE_HTTP_RETURNED_ERROR, /* 22 */ + CURLE_WRITE_ERROR, /* 23 */ + CURLE_OBSOLETE24, /* 24 - NOT USED */ + CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */ + CURLE_READ_ERROR, /* 26 - couldn't open/read from file */ + CURLE_OUT_OF_MEMORY, /* 27 */ + CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */ + CURLE_OBSOLETE29, /* 29 - NOT USED */ + CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */ + CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */ + CURLE_OBSOLETE32, /* 32 - NOT USED */ + CURLE_RANGE_ERROR, /* 33 - RANGE "command" didn't work */ + CURLE_HTTP_POST_ERROR, /* 34 */ + CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */ + CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */ + CURLE_FILE_COULDNT_READ_FILE, /* 37 */ + CURLE_LDAP_CANNOT_BIND, /* 38 */ + CURLE_LDAP_SEARCH_FAILED, /* 39 */ + CURLE_OBSOLETE40, /* 40 - NOT USED */ + CURLE_FUNCTION_NOT_FOUND, /* 41 - NOT USED starting with 7.53.0 */ + CURLE_ABORTED_BY_CALLBACK, /* 42 */ + CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */ + CURLE_OBSOLETE44, /* 44 - NOT USED */ + CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */ + CURLE_OBSOLETE46, /* 46 - NOT USED */ + CURLE_TOO_MANY_REDIRECTS, /* 47 - catch endless re-direct loops */ + CURLE_UNKNOWN_OPTION, /* 48 - User specified an unknown option */ + CURLE_SETOPT_OPTION_SYNTAX, /* 49 - Malformed setopt option */ + CURLE_OBSOLETE50, /* 50 - NOT USED */ + CURLE_OBSOLETE51, /* 51 - NOT USED */ + CURLE_GOT_NOTHING, /* 52 - when this is a specific error */ + CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */ + CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as + default */ + CURLE_SEND_ERROR, /* 55 - failed sending network data */ + CURLE_RECV_ERROR, /* 56 - failure in receiving network data */ + CURLE_OBSOLETE57, /* 57 - NOT IN USE */ + CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */ + CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */ + CURLE_PEER_FAILED_VERIFICATION, /* 60 - peer's certificate or fingerprint + wasn't verified fine */ + CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized/bad encoding */ + CURLE_OBSOLETE62, /* 62 - NOT IN USE since 7.82.0 */ + CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */ + CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */ + CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind + that failed */ + CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */ + CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not + accepted and we failed to login */ + CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */ + CURLE_TFTP_PERM, /* 69 - permission problem on server */ + CURLE_REMOTE_DISK_FULL, /* 70 - out of disk space on server */ + CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */ + CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */ + CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */ + CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */ + CURLE_OBSOLETE75, /* 75 - NOT IN USE since 7.82.0 */ + CURLE_OBSOLETE76, /* 76 - NOT IN USE since 7.82.0 */ + CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing + or wrong format */ + CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */ + CURLE_SSH, /* 79 - error from the SSH layer, somewhat + generic so the error message will be of + interest when this has happened */ + + CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL + connection */ + CURLE_AGAIN, /* 81 - socket is not ready for send/recv, + wait till it's ready and try again (Added + in 7.18.2) */ + CURLE_SSL_CRL_BADFILE, /* 82 - could not load CRL file, missing or + wrong format (Added in 7.19.0) */ + CURLE_SSL_ISSUER_ERROR, /* 83 - Issuer check failed. (Added in + 7.19.0) */ + CURLE_FTP_PRET_FAILED, /* 84 - a PRET command failed */ + CURLE_RTSP_CSEQ_ERROR, /* 85 - mismatch of RTSP CSeq numbers */ + CURLE_RTSP_SESSION_ERROR, /* 86 - mismatch of RTSP Session Ids */ + CURLE_FTP_BAD_FILE_LIST, /* 87 - unable to parse FTP file list */ + CURLE_CHUNK_FAILED, /* 88 - chunk callback reported error */ + CURLE_NO_CONNECTION_AVAILABLE, /* 89 - No connection available, the + session will be queued */ + CURLE_SSL_PINNEDPUBKEYNOTMATCH, /* 90 - specified pinned public key did not + match */ + CURLE_SSL_INVALIDCERTSTATUS, /* 91 - invalid certificate status */ + CURLE_HTTP2_STREAM, /* 92 - stream error in HTTP/2 framing layer + */ + CURLE_RECURSIVE_API_CALL, /* 93 - an api function was called from + inside a callback */ + CURLE_AUTH_ERROR, /* 94 - an authentication function returned an + error */ + CURLE_HTTP3, /* 95 - An HTTP/3 layer problem */ + CURLE_QUIC_CONNECT_ERROR, /* 96 - QUIC connection error */ + CURLE_PROXY, /* 97 - proxy handshake error */ + CURLE_SSL_CLIENTCERT, /* 98 - client-side certificate required */ + CURLE_UNRECOVERABLE_POLL, /* 99 - poll/select returned fatal error */ + CURL_LAST /* never use! */ +} CURLcode; + +#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all + the obsolete stuff removed! */ + +/* Previously obsolete error code re-used in 7.38.0 */ +#define CURLE_OBSOLETE16 CURLE_HTTP2 + +/* Previously obsolete error codes re-used in 7.24.0 */ +#define CURLE_OBSOLETE10 CURLE_FTP_ACCEPT_FAILED +#define CURLE_OBSOLETE12 CURLE_FTP_ACCEPT_TIMEOUT + +/* compatibility with older names */ +#define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING +#define CURLE_FTP_WEIRD_SERVER_REPLY CURLE_WEIRD_SERVER_REPLY + +/* The following were added in 7.62.0 */ +#define CURLE_SSL_CACERT CURLE_PEER_FAILED_VERIFICATION + +/* The following were added in 7.21.5, April 2011 */ +#define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION + +/* Added for 7.78.0 */ +#define CURLE_TELNET_OPTION_SYNTAX CURLE_SETOPT_OPTION_SYNTAX + +/* The following were added in 7.17.1 */ +/* These are scheduled to disappear by 2009 */ +#define CURLE_SSL_PEER_CERTIFICATE CURLE_PEER_FAILED_VERIFICATION + +/* The following were added in 7.17.0 */ +/* These are scheduled to disappear by 2009 */ +#define CURLE_OBSOLETE CURLE_OBSOLETE50 /* no one should be using this! */ +#define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46 +#define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44 +#define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10 +#define CURLE_FTP_CANT_RECONNECT CURLE_OBSOLETE16 +#define CURLE_FTP_COULDNT_GET_SIZE CURLE_OBSOLETE32 +#define CURLE_FTP_COULDNT_SET_ASCII CURLE_OBSOLETE29 +#define CURLE_FTP_WEIRD_USER_REPLY CURLE_OBSOLETE12 +#define CURLE_FTP_WRITE_ERROR CURLE_OBSOLETE20 +#define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40 +#define CURLE_MALFORMAT_USER CURLE_OBSOLETE24 +#define CURLE_SHARE_IN_USE CURLE_OBSOLETE57 +#define CURLE_URL_MALFORMAT_USER CURLE_NOT_BUILT_IN + +#define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED +#define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE +#define CURLE_FTP_QUOTE_ERROR CURLE_QUOTE_ERROR +#define CURLE_TFTP_DISKFULL CURLE_REMOTE_DISK_FULL +#define CURLE_TFTP_EXISTS CURLE_REMOTE_FILE_EXISTS +#define CURLE_HTTP_RANGE_ERROR CURLE_RANGE_ERROR +#define CURLE_FTP_SSL_FAILED CURLE_USE_SSL_FAILED + +/* The following were added earlier */ + +#define CURLE_OPERATION_TIMEOUTED CURLE_OPERATION_TIMEDOUT +#define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR +#define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED +#define CURLE_FTP_COULDNT_STOR_FILE CURLE_UPLOAD_FAILED +#define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE +#define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME +#define CURLE_LDAP_INVALID_URL CURLE_OBSOLETE62 +#define CURLE_CONV_REQD CURLE_OBSOLETE76 +#define CURLE_CONV_FAILED CURLE_OBSOLETE75 + +/* This was the error code 50 in 7.7.3 and a few earlier versions, this + is no longer used by libcurl but is instead #defined here only to not + make programs break */ +#define CURLE_ALREADY_COMPLETE 99999 + +/* Provide defines for really old option names */ +#define CURLOPT_FILE CURLOPT_WRITEDATA /* name changed in 7.9.7 */ +#define CURLOPT_INFILE CURLOPT_READDATA /* name changed in 7.9.7 */ +#define CURLOPT_WRITEHEADER CURLOPT_HEADERDATA + +/* Since long deprecated options with no code in the lib that does anything + with them. */ +#define CURLOPT_WRITEINFO CURLOPT_OBSOLETE40 +#define CURLOPT_CLOSEPOLICY CURLOPT_OBSOLETE72 + +#endif /*!CURL_NO_OLDIES*/ + +/* + * Proxy error codes. Returned in CURLINFO_PROXY_ERROR if CURLE_PROXY was + * return for the transfers. + */ +typedef enum { + CURLPX_OK, + CURLPX_BAD_ADDRESS_TYPE, + CURLPX_BAD_VERSION, + CURLPX_CLOSED, + CURLPX_GSSAPI, + CURLPX_GSSAPI_PERMSG, + CURLPX_GSSAPI_PROTECTION, + CURLPX_IDENTD, + CURLPX_IDENTD_DIFFER, + CURLPX_LONG_HOSTNAME, + CURLPX_LONG_PASSWD, + CURLPX_LONG_USER, + CURLPX_NO_AUTH, + CURLPX_RECV_ADDRESS, + CURLPX_RECV_AUTH, + CURLPX_RECV_CONNECT, + CURLPX_RECV_REQACK, + CURLPX_REPLY_ADDRESS_TYPE_NOT_SUPPORTED, + CURLPX_REPLY_COMMAND_NOT_SUPPORTED, + CURLPX_REPLY_CONNECTION_REFUSED, + CURLPX_REPLY_GENERAL_SERVER_FAILURE, + CURLPX_REPLY_HOST_UNREACHABLE, + CURLPX_REPLY_NETWORK_UNREACHABLE, + CURLPX_REPLY_NOT_ALLOWED, + CURLPX_REPLY_TTL_EXPIRED, + CURLPX_REPLY_UNASSIGNED, + CURLPX_REQUEST_FAILED, + CURLPX_RESOLVE_HOST, + CURLPX_SEND_AUTH, + CURLPX_SEND_CONNECT, + CURLPX_SEND_REQUEST, + CURLPX_UNKNOWN_FAIL, + CURLPX_UNKNOWN_MODE, + CURLPX_USER_REJECTED, + CURLPX_LAST /* never use */ +} CURLproxycode; + +/* This prototype applies to all conversion callbacks */ +typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length); + +typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl, /* easy handle */ + void *ssl_ctx, /* actually an OpenSSL + or WolfSSL SSL_CTX, + or an mbedTLS + mbedtls_ssl_config */ + void *userptr); + +typedef enum { + CURLPROXY_HTTP = 0, /* added in 7.10, new in 7.19.4 default is to use + CONNECT HTTP/1.1 */ + CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT + HTTP/1.0 */ + CURLPROXY_HTTPS = 2, /* added in 7.52.0 */ + CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already + in 7.10 */ + CURLPROXY_SOCKS5 = 5, /* added in 7.10 */ + CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */ + CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the + host name rather than the IP address. added + in 7.18.0 */ +} curl_proxytype; /* this enum was added in 7.10 */ + +/* + * Bitmasks for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH options: + * + * CURLAUTH_NONE - No HTTP authentication + * CURLAUTH_BASIC - HTTP Basic authentication (default) + * CURLAUTH_DIGEST - HTTP Digest authentication + * CURLAUTH_NEGOTIATE - HTTP Negotiate (SPNEGO) authentication + * CURLAUTH_GSSNEGOTIATE - Alias for CURLAUTH_NEGOTIATE (deprecated) + * CURLAUTH_NTLM - HTTP NTLM authentication + * CURLAUTH_DIGEST_IE - HTTP Digest authentication with IE flavour + * CURLAUTH_NTLM_WB - HTTP NTLM authentication delegated to winbind helper + * CURLAUTH_BEARER - HTTP Bearer token authentication + * CURLAUTH_ONLY - Use together with a single other type to force no + * authentication or just that single type + * CURLAUTH_ANY - All fine types set + * CURLAUTH_ANYSAFE - All fine types except Basic + */ + +#define CURLAUTH_NONE ((unsigned long)0) +#define CURLAUTH_BASIC (((unsigned long)1)<<0) +#define CURLAUTH_DIGEST (((unsigned long)1)<<1) +#define CURLAUTH_NEGOTIATE (((unsigned long)1)<<2) +/* Deprecated since the advent of CURLAUTH_NEGOTIATE */ +#define CURLAUTH_GSSNEGOTIATE CURLAUTH_NEGOTIATE +/* Used for CURLOPT_SOCKS5_AUTH to stay terminologically correct */ +#define CURLAUTH_GSSAPI CURLAUTH_NEGOTIATE +#define CURLAUTH_NTLM (((unsigned long)1)<<3) +#define CURLAUTH_DIGEST_IE (((unsigned long)1)<<4) +#define CURLAUTH_NTLM_WB (((unsigned long)1)<<5) +#define CURLAUTH_BEARER (((unsigned long)1)<<6) +#define CURLAUTH_AWS_SIGV4 (((unsigned long)1)<<7) +#define CURLAUTH_ONLY (((unsigned long)1)<<31) +#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE) +#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE)) + +#define CURLSSH_AUTH_ANY ~0 /* all types supported by the server */ +#define CURLSSH_AUTH_NONE 0 /* none allowed, silly but complete */ +#define CURLSSH_AUTH_PUBLICKEY (1<<0) /* public/private key files */ +#define CURLSSH_AUTH_PASSWORD (1<<1) /* password */ +#define CURLSSH_AUTH_HOST (1<<2) /* host key files */ +#define CURLSSH_AUTH_KEYBOARD (1<<3) /* keyboard interactive */ +#define CURLSSH_AUTH_AGENT (1<<4) /* agent (ssh-agent, pageant...) */ +#define CURLSSH_AUTH_GSSAPI (1<<5) /* gssapi (kerberos, ...) */ +#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY + +#define CURLGSSAPI_DELEGATION_NONE 0 /* no delegation (default) */ +#define CURLGSSAPI_DELEGATION_POLICY_FLAG (1<<0) /* if permitted by policy */ +#define CURLGSSAPI_DELEGATION_FLAG (1<<1) /* delegate always */ + +#define CURL_ERROR_SIZE 256 + +enum curl_khtype { + CURLKHTYPE_UNKNOWN, + CURLKHTYPE_RSA1, + CURLKHTYPE_RSA, + CURLKHTYPE_DSS, + CURLKHTYPE_ECDSA, + CURLKHTYPE_ED25519 +}; + +struct curl_khkey { + const char *key; /* points to a null-terminated string encoded with base64 + if len is zero, otherwise to the "raw" data */ + size_t len; + enum curl_khtype keytype; +}; + +/* this is the set of return values expected from the curl_sshkeycallback + callback */ +enum curl_khstat { + CURLKHSTAT_FINE_ADD_TO_FILE, + CURLKHSTAT_FINE, + CURLKHSTAT_REJECT, /* reject the connection, return an error */ + CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now. + Causes a CURLE_PEER_FAILED_VERIFICATION error but the + connection will be left intact etc */ + CURLKHSTAT_FINE_REPLACE, /* accept and replace the wrong key*/ + CURLKHSTAT_LAST /* not for use, only a marker for last-in-list */ +}; + +/* this is the set of status codes pass in to the callback */ +enum curl_khmatch { + CURLKHMATCH_OK, /* match */ + CURLKHMATCH_MISMATCH, /* host found, key mismatch! */ + CURLKHMATCH_MISSING, /* no matching host/key found */ + CURLKHMATCH_LAST /* not for use, only a marker for last-in-list */ +}; + +typedef int + (*curl_sshkeycallback) (CURL *easy, /* easy handle */ + const struct curl_khkey *knownkey, /* known */ + const struct curl_khkey *foundkey, /* found */ + enum curl_khmatch, /* libcurl's view on the keys */ + void *clientp); /* custom pointer passed with */ + /* CURLOPT_SSH_KEYDATA */ + +typedef int + (*curl_sshhostkeycallback) (void *clientp,/* custom pointer passed*/ + /* with CURLOPT_SSH_HOSTKEYDATA */ + int keytype, /* CURLKHTYPE */ + const char *key, /*hostkey to check*/ + size_t keylen); /*length of the key*/ + /*return CURLE_OK to accept*/ + /*or something else to refuse*/ + + +/* parameter for the CURLOPT_USE_SSL option */ +typedef enum { + CURLUSESSL_NONE, /* do not attempt to use SSL */ + CURLUSESSL_TRY, /* try using SSL, proceed anyway otherwise */ + CURLUSESSL_CONTROL, /* SSL for the control connection or fail */ + CURLUSESSL_ALL, /* SSL for all communication or fail */ + CURLUSESSL_LAST /* not an option, never use */ +} curl_usessl; + +/* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */ + +/* - ALLOW_BEAST tells libcurl to allow the BEAST SSL vulnerability in the + name of improving interoperability with older servers. Some SSL libraries + have introduced work-arounds for this flaw but those work-arounds sometimes + make the SSL communication fail. To regain functionality with those broken + servers, a user can this way allow the vulnerability back. */ +#define CURLSSLOPT_ALLOW_BEAST (1<<0) + +/* - NO_REVOKE tells libcurl to disable certificate revocation checks for those + SSL backends where such behavior is present. */ +#define CURLSSLOPT_NO_REVOKE (1<<1) + +/* - NO_PARTIALCHAIN tells libcurl to *NOT* accept a partial certificate chain + if possible. The OpenSSL backend has this ability. */ +#define CURLSSLOPT_NO_PARTIALCHAIN (1<<2) + +/* - REVOKE_BEST_EFFORT tells libcurl to ignore certificate revocation offline + checks and ignore missing revocation list for those SSL backends where such + behavior is present. */ +#define CURLSSLOPT_REVOKE_BEST_EFFORT (1<<3) + +/* - CURLSSLOPT_NATIVE_CA tells libcurl to use standard certificate store of + operating system. Currently implemented under MS-Windows. */ +#define CURLSSLOPT_NATIVE_CA (1<<4) + +/* - CURLSSLOPT_AUTO_CLIENT_CERT tells libcurl to automatically locate and use + a client certificate for authentication. (Schannel) */ +#define CURLSSLOPT_AUTO_CLIENT_CERT (1<<5) + +/* The default connection attempt delay in milliseconds for happy eyeballs. + CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.3 and happy-eyeballs-timeout-ms.d document + this value, keep them in sync. */ +#define CURL_HET_DEFAULT 200L + +/* The default connection upkeep interval in milliseconds. */ +#define CURL_UPKEEP_INTERVAL_DEFAULT 60000L + +#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all + the obsolete stuff removed! */ + +/* Backwards compatibility with older names */ +/* These are scheduled to disappear by 2009 */ + +#define CURLFTPSSL_NONE CURLUSESSL_NONE +#define CURLFTPSSL_TRY CURLUSESSL_TRY +#define CURLFTPSSL_CONTROL CURLUSESSL_CONTROL +#define CURLFTPSSL_ALL CURLUSESSL_ALL +#define CURLFTPSSL_LAST CURLUSESSL_LAST +#define curl_ftpssl curl_usessl +#endif /*!CURL_NO_OLDIES*/ + +/* parameter for the CURLOPT_FTP_SSL_CCC option */ +typedef enum { + CURLFTPSSL_CCC_NONE, /* do not send CCC */ + CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */ + CURLFTPSSL_CCC_ACTIVE, /* Initiate the shutdown */ + CURLFTPSSL_CCC_LAST /* not an option, never use */ +} curl_ftpccc; + +/* parameter for the CURLOPT_FTPSSLAUTH option */ +typedef enum { + CURLFTPAUTH_DEFAULT, /* let libcurl decide */ + CURLFTPAUTH_SSL, /* use "AUTH SSL" */ + CURLFTPAUTH_TLS, /* use "AUTH TLS" */ + CURLFTPAUTH_LAST /* not an option, never use */ +} curl_ftpauth; + +/* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */ +typedef enum { + CURLFTP_CREATE_DIR_NONE, /* do NOT create missing dirs! */ + CURLFTP_CREATE_DIR, /* (FTP/SFTP) if CWD fails, try MKD and then CWD + again if MKD succeeded, for SFTP this does + similar magic */ + CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD + again even if MKD failed! */ + CURLFTP_CREATE_DIR_LAST /* not an option, never use */ +} curl_ftpcreatedir; + +/* parameter for the CURLOPT_FTP_FILEMETHOD option */ +typedef enum { + CURLFTPMETHOD_DEFAULT, /* let libcurl pick */ + CURLFTPMETHOD_MULTICWD, /* single CWD operation for each path part */ + CURLFTPMETHOD_NOCWD, /* no CWD at all */ + CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */ + CURLFTPMETHOD_LAST /* not an option, never use */ +} curl_ftpmethod; + +/* bitmask defines for CURLOPT_HEADEROPT */ +#define CURLHEADER_UNIFIED 0 +#define CURLHEADER_SEPARATE (1<<0) + +/* CURLALTSVC_* are bits for the CURLOPT_ALTSVC_CTRL option */ +#define CURLALTSVC_READONLYFILE (1<<2) +#define CURLALTSVC_H1 (1<<3) +#define CURLALTSVC_H2 (1<<4) +#define CURLALTSVC_H3 (1<<5) + + +struct curl_hstsentry { + char *name; + size_t namelen; + unsigned int includeSubDomains:1; + char expire[18]; /* YYYYMMDD HH:MM:SS [null-terminated] */ +}; + +struct curl_index { + size_t index; /* the provided entry's "index" or count */ + size_t total; /* total number of entries to save */ +}; + +typedef enum { + CURLSTS_OK, + CURLSTS_DONE, + CURLSTS_FAIL +} CURLSTScode; + +typedef CURLSTScode (*curl_hstsread_callback)(CURL *easy, + struct curl_hstsentry *e, + void *userp); +typedef CURLSTScode (*curl_hstswrite_callback)(CURL *easy, + struct curl_hstsentry *e, + struct curl_index *i, + void *userp); + +/* CURLHSTS_* are bits for the CURLOPT_HSTS option */ +#define CURLHSTS_ENABLE (long)(1<<0) +#define CURLHSTS_READONLYFILE (long)(1<<1) + +/* The CURLPROTO_ defines below are for the **deprecated** CURLOPT_*PROTOCOLS + options. Do not use. */ +#define CURLPROTO_HTTP (1<<0) +#define CURLPROTO_HTTPS (1<<1) +#define CURLPROTO_FTP (1<<2) +#define CURLPROTO_FTPS (1<<3) +#define CURLPROTO_SCP (1<<4) +#define CURLPROTO_SFTP (1<<5) +#define CURLPROTO_TELNET (1<<6) +#define CURLPROTO_LDAP (1<<7) +#define CURLPROTO_LDAPS (1<<8) +#define CURLPROTO_DICT (1<<9) +#define CURLPROTO_FILE (1<<10) +#define CURLPROTO_TFTP (1<<11) +#define CURLPROTO_IMAP (1<<12) +#define CURLPROTO_IMAPS (1<<13) +#define CURLPROTO_POP3 (1<<14) +#define CURLPROTO_POP3S (1<<15) +#define CURLPROTO_SMTP (1<<16) +#define CURLPROTO_SMTPS (1<<17) +#define CURLPROTO_RTSP (1<<18) +#define CURLPROTO_RTMP (1<<19) +#define CURLPROTO_RTMPT (1<<20) +#define CURLPROTO_RTMPE (1<<21) +#define CURLPROTO_RTMPTE (1<<22) +#define CURLPROTO_RTMPS (1<<23) +#define CURLPROTO_RTMPTS (1<<24) +#define CURLPROTO_GOPHER (1<<25) +#define CURLPROTO_SMB (1<<26) +#define CURLPROTO_SMBS (1<<27) +#define CURLPROTO_MQTT (1<<28) +#define CURLPROTO_GOPHERS (1<<29) +#define CURLPROTO_ALL (~0) /* enable everything */ + +/* long may be 32 or 64 bits, but we should never depend on anything else + but 32 */ +#define CURLOPTTYPE_LONG 0 +#define CURLOPTTYPE_OBJECTPOINT 10000 +#define CURLOPTTYPE_FUNCTIONPOINT 20000 +#define CURLOPTTYPE_OFF_T 30000 +#define CURLOPTTYPE_BLOB 40000 + +/* *STRINGPOINT is an alias for OBJECTPOINT to allow tools to extract the + string options from the header file */ + + +#define CURLOPT(na,t,nu) na = t + nu + +/* CURLOPT aliases that make no run-time difference */ + +/* 'char *' argument to a string with a trailing zero */ +#define CURLOPTTYPE_STRINGPOINT CURLOPTTYPE_OBJECTPOINT + +/* 'struct curl_slist *' argument */ +#define CURLOPTTYPE_SLISTPOINT CURLOPTTYPE_OBJECTPOINT + +/* 'void *' argument passed untouched to callback */ +#define CURLOPTTYPE_CBPOINT CURLOPTTYPE_OBJECTPOINT + +/* 'long' argument with a set of values/bitmask */ +#define CURLOPTTYPE_VALUES CURLOPTTYPE_LONG + +/* + * All CURLOPT_* values. + */ + +typedef enum { + /* This is the FILE * or void * the regular output should be written to. */ + CURLOPT(CURLOPT_WRITEDATA, CURLOPTTYPE_CBPOINT, 1), + + /* The full URL to get/put */ + CURLOPT(CURLOPT_URL, CURLOPTTYPE_STRINGPOINT, 2), + + /* Port number to connect to, if other than default. */ + CURLOPT(CURLOPT_PORT, CURLOPTTYPE_LONG, 3), + + /* Name of proxy to use. */ + CURLOPT(CURLOPT_PROXY, CURLOPTTYPE_STRINGPOINT, 4), + + /* "user:password;options" to use when fetching. */ + CURLOPT(CURLOPT_USERPWD, CURLOPTTYPE_STRINGPOINT, 5), + + /* "user:password" to use with proxy. */ + CURLOPT(CURLOPT_PROXYUSERPWD, CURLOPTTYPE_STRINGPOINT, 6), + + /* Range to get, specified as an ASCII string. */ + CURLOPT(CURLOPT_RANGE, CURLOPTTYPE_STRINGPOINT, 7), + + /* not used */ + + /* Specified file stream to upload from (use as input): */ + CURLOPT(CURLOPT_READDATA, CURLOPTTYPE_CBPOINT, 9), + + /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE + * bytes big. */ + CURLOPT(CURLOPT_ERRORBUFFER, CURLOPTTYPE_OBJECTPOINT, 10), + + /* Function that will be called to store the output (instead of fwrite). The + * parameters will use fwrite() syntax, make sure to follow them. */ + CURLOPT(CURLOPT_WRITEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 11), + + /* Function that will be called to read the input (instead of fread). The + * parameters will use fread() syntax, make sure to follow them. */ + CURLOPT(CURLOPT_READFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 12), + + /* Time-out the read operation after this amount of seconds */ + CURLOPT(CURLOPT_TIMEOUT, CURLOPTTYPE_LONG, 13), + + /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about + * how large the file being sent really is. That allows better error + * checking and better verifies that the upload was successful. -1 means + * unknown size. + * + * For large file support, there is also a _LARGE version of the key + * which takes an off_t type, allowing platforms with larger off_t + * sizes to handle larger files. See below for INFILESIZE_LARGE. + */ + CURLOPT(CURLOPT_INFILESIZE, CURLOPTTYPE_LONG, 14), + + /* POST static input fields. */ + CURLOPT(CURLOPT_POSTFIELDS, CURLOPTTYPE_OBJECTPOINT, 15), + + /* Set the referrer page (needed by some CGIs) */ + CURLOPT(CURLOPT_REFERER, CURLOPTTYPE_STRINGPOINT, 16), + + /* Set the FTP PORT string (interface name, named or numerical IP address) + Use i.e '-' to use default address. */ + CURLOPT(CURLOPT_FTPPORT, CURLOPTTYPE_STRINGPOINT, 17), + + /* Set the User-Agent string (examined by some CGIs) */ + CURLOPT(CURLOPT_USERAGENT, CURLOPTTYPE_STRINGPOINT, 18), + + /* If the download receives less than "low speed limit" bytes/second + * during "low speed time" seconds, the operations is aborted. + * You could i.e if you have a pretty high speed connection, abort if + * it is less than 2000 bytes/sec during 20 seconds. + */ + + /* Set the "low speed limit" */ + CURLOPT(CURLOPT_LOW_SPEED_LIMIT, CURLOPTTYPE_LONG, 19), + + /* Set the "low speed time" */ + CURLOPT(CURLOPT_LOW_SPEED_TIME, CURLOPTTYPE_LONG, 20), + + /* Set the continuation offset. + * + * Note there is also a _LARGE version of this key which uses + * off_t types, allowing for large file offsets on platforms which + * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE. + */ + CURLOPT(CURLOPT_RESUME_FROM, CURLOPTTYPE_LONG, 21), + + /* Set cookie in request: */ + CURLOPT(CURLOPT_COOKIE, CURLOPTTYPE_STRINGPOINT, 22), + + /* This points to a linked list of headers, struct curl_slist kind. This + list is also used for RTSP (in spite of its name) */ + CURLOPT(CURLOPT_HTTPHEADER, CURLOPTTYPE_SLISTPOINT, 23), + + /* This points to a linked list of post entries, struct curl_httppost */ + CURLOPT(CURLOPT_HTTPPOST, CURLOPTTYPE_OBJECTPOINT, 24), + + /* name of the file keeping your private SSL-certificate */ + CURLOPT(CURLOPT_SSLCERT, CURLOPTTYPE_STRINGPOINT, 25), + + /* password for the SSL or SSH private key */ + CURLOPT(CURLOPT_KEYPASSWD, CURLOPTTYPE_STRINGPOINT, 26), + + /* send TYPE parameter? */ + CURLOPT(CURLOPT_CRLF, CURLOPTTYPE_LONG, 27), + + /* send linked-list of QUOTE commands */ + CURLOPT(CURLOPT_QUOTE, CURLOPTTYPE_SLISTPOINT, 28), + + /* send FILE * or void * to store headers to, if you use a callback it + is simply passed to the callback unmodified */ + CURLOPT(CURLOPT_HEADERDATA, CURLOPTTYPE_CBPOINT, 29), + + /* point to a file to read the initial cookies from, also enables + "cookie awareness" */ + CURLOPT(CURLOPT_COOKIEFILE, CURLOPTTYPE_STRINGPOINT, 31), + + /* What version to specifically try to use. + See CURL_SSLVERSION defines below. */ + CURLOPT(CURLOPT_SSLVERSION, CURLOPTTYPE_VALUES, 32), + + /* What kind of HTTP time condition to use, see defines */ + CURLOPT(CURLOPT_TIMECONDITION, CURLOPTTYPE_VALUES, 33), + + /* Time to use with the above condition. Specified in number of seconds + since 1 Jan 1970 */ + CURLOPT(CURLOPT_TIMEVALUE, CURLOPTTYPE_LONG, 34), + + /* 35 = OBSOLETE */ + + /* Custom request, for customizing the get command like + HTTP: DELETE, TRACE and others + FTP: to use a different list command + */ + CURLOPT(CURLOPT_CUSTOMREQUEST, CURLOPTTYPE_STRINGPOINT, 36), + + /* FILE handle to use instead of stderr */ + CURLOPT(CURLOPT_STDERR, CURLOPTTYPE_OBJECTPOINT, 37), + + /* 38 is not used */ + + /* send linked-list of post-transfer QUOTE commands */ + CURLOPT(CURLOPT_POSTQUOTE, CURLOPTTYPE_SLISTPOINT, 39), + + /* OBSOLETE, do not use! */ + CURLOPT(CURLOPT_OBSOLETE40, CURLOPTTYPE_OBJECTPOINT, 40), + + /* talk a lot */ + CURLOPT(CURLOPT_VERBOSE, CURLOPTTYPE_LONG, 41), + + /* throw the header out too */ + CURLOPT(CURLOPT_HEADER, CURLOPTTYPE_LONG, 42), + + /* shut off the progress meter */ + CURLOPT(CURLOPT_NOPROGRESS, CURLOPTTYPE_LONG, 43), + + /* use HEAD to get http document */ + CURLOPT(CURLOPT_NOBODY, CURLOPTTYPE_LONG, 44), + + /* no output on http error codes >= 400 */ + CURLOPT(CURLOPT_FAILONERROR, CURLOPTTYPE_LONG, 45), + + /* this is an upload */ + CURLOPT(CURLOPT_UPLOAD, CURLOPTTYPE_LONG, 46), + + /* HTTP POST method */ + CURLOPT(CURLOPT_POST, CURLOPTTYPE_LONG, 47), + + /* bare names when listing directories */ + CURLOPT(CURLOPT_DIRLISTONLY, CURLOPTTYPE_LONG, 48), + + /* Append instead of overwrite on upload! */ + CURLOPT(CURLOPT_APPEND, CURLOPTTYPE_LONG, 50), + + /* Specify whether to read the user+password from the .netrc or the URL. + * This must be one of the CURL_NETRC_* enums below. */ + CURLOPT(CURLOPT_NETRC, CURLOPTTYPE_VALUES, 51), + + /* use Location: Luke! */ + CURLOPT(CURLOPT_FOLLOWLOCATION, CURLOPTTYPE_LONG, 52), + + /* transfer data in text/ASCII format */ + CURLOPT(CURLOPT_TRANSFERTEXT, CURLOPTTYPE_LONG, 53), + + /* HTTP PUT */ + CURLOPT(CURLOPT_PUT, CURLOPTTYPE_LONG, 54), + + /* 55 = OBSOLETE */ + + /* DEPRECATED + * Function that will be called instead of the internal progress display + * function. This function should be defined as the curl_progress_callback + * prototype defines. */ + CURLOPT(CURLOPT_PROGRESSFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 56), + + /* Data passed to the CURLOPT_PROGRESSFUNCTION and CURLOPT_XFERINFOFUNCTION + callbacks */ + CURLOPT(CURLOPT_XFERINFODATA, CURLOPTTYPE_CBPOINT, 57), +#define CURLOPT_PROGRESSDATA CURLOPT_XFERINFODATA + + /* We want the referrer field set automatically when following locations */ + CURLOPT(CURLOPT_AUTOREFERER, CURLOPTTYPE_LONG, 58), + + /* Port of the proxy, can be set in the proxy string as well with: + "[host]:[port]" */ + CURLOPT(CURLOPT_PROXYPORT, CURLOPTTYPE_LONG, 59), + + /* size of the POST input data, if strlen() is not good to use */ + CURLOPT(CURLOPT_POSTFIELDSIZE, CURLOPTTYPE_LONG, 60), + + /* tunnel non-http operations through a HTTP proxy */ + CURLOPT(CURLOPT_HTTPPROXYTUNNEL, CURLOPTTYPE_LONG, 61), + + /* Set the interface string to use as outgoing network interface */ + CURLOPT(CURLOPT_INTERFACE, CURLOPTTYPE_STRINGPOINT, 62), + + /* Set the krb4/5 security level, this also enables krb4/5 awareness. This + * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string + * is set but doesn't match one of these, 'private' will be used. */ + CURLOPT(CURLOPT_KRBLEVEL, CURLOPTTYPE_STRINGPOINT, 63), + + /* Set if we should verify the peer in ssl handshake, set 1 to verify. */ + CURLOPT(CURLOPT_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 64), + + /* The CApath or CAfile used to validate the peer certificate + this option is used only if SSL_VERIFYPEER is true */ + CURLOPT(CURLOPT_CAINFO, CURLOPTTYPE_STRINGPOINT, 65), + + /* 66 = OBSOLETE */ + /* 67 = OBSOLETE */ + + /* Maximum number of http redirects to follow */ + CURLOPT(CURLOPT_MAXREDIRS, CURLOPTTYPE_LONG, 68), + + /* Pass a long set to 1 to get the date of the requested document (if + possible)! Pass a zero to shut it off. */ + CURLOPT(CURLOPT_FILETIME, CURLOPTTYPE_LONG, 69), + + /* This points to a linked list of telnet options */ + CURLOPT(CURLOPT_TELNETOPTIONS, CURLOPTTYPE_SLISTPOINT, 70), + + /* Max amount of cached alive connections */ + CURLOPT(CURLOPT_MAXCONNECTS, CURLOPTTYPE_LONG, 71), + + /* OBSOLETE, do not use! */ + CURLOPT(CURLOPT_OBSOLETE72, CURLOPTTYPE_LONG, 72), + + /* 73 = OBSOLETE */ + + /* Set to explicitly use a new connection for the upcoming transfer. + Do not use this unless you're absolutely sure of this, as it makes the + operation slower and is less friendly for the network. */ + CURLOPT(CURLOPT_FRESH_CONNECT, CURLOPTTYPE_LONG, 74), + + /* Set to explicitly forbid the upcoming transfer's connection to be re-used + when done. Do not use this unless you're absolutely sure of this, as it + makes the operation slower and is less friendly for the network. */ + CURLOPT(CURLOPT_FORBID_REUSE, CURLOPTTYPE_LONG, 75), + + /* Set to a file name that contains random data for libcurl to use to + seed the random engine when doing SSL connects. */ + CURLOPT(CURLOPT_RANDOM_FILE, CURLOPTTYPE_STRINGPOINT, 76), + + /* Set to the Entropy Gathering Daemon socket pathname */ + CURLOPT(CURLOPT_EGDSOCKET, CURLOPTTYPE_STRINGPOINT, 77), + + /* Time-out connect operations after this amount of seconds, if connects are + OK within this time, then fine... This only aborts the connect phase. */ + CURLOPT(CURLOPT_CONNECTTIMEOUT, CURLOPTTYPE_LONG, 78), + + /* Function that will be called to store headers (instead of fwrite). The + * parameters will use fwrite() syntax, make sure to follow them. */ + CURLOPT(CURLOPT_HEADERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 79), + + /* Set this to force the HTTP request to get back to GET. Only really usable + if POST, PUT or a custom request have been used first. + */ + CURLOPT(CURLOPT_HTTPGET, CURLOPTTYPE_LONG, 80), + + /* Set if we should verify the Common name from the peer certificate in ssl + * handshake, set 1 to check existence, 2 to ensure that it matches the + * provided hostname. */ + CURLOPT(CURLOPT_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 81), + + /* Specify which file name to write all known cookies in after completed + operation. Set file name to "-" (dash) to make it go to stdout. */ + CURLOPT(CURLOPT_COOKIEJAR, CURLOPTTYPE_STRINGPOINT, 82), + + /* Specify which SSL ciphers to use */ + CURLOPT(CURLOPT_SSL_CIPHER_LIST, CURLOPTTYPE_STRINGPOINT, 83), + + /* Specify which HTTP version to use! This must be set to one of the + CURL_HTTP_VERSION* enums set below. */ + CURLOPT(CURLOPT_HTTP_VERSION, CURLOPTTYPE_VALUES, 84), + + /* Specifically switch on or off the FTP engine's use of the EPSV command. By + default, that one will always be attempted before the more traditional + PASV command. */ + CURLOPT(CURLOPT_FTP_USE_EPSV, CURLOPTTYPE_LONG, 85), + + /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */ + CURLOPT(CURLOPT_SSLCERTTYPE, CURLOPTTYPE_STRINGPOINT, 86), + + /* name of the file keeping your private SSL-key */ + CURLOPT(CURLOPT_SSLKEY, CURLOPTTYPE_STRINGPOINT, 87), + + /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */ + CURLOPT(CURLOPT_SSLKEYTYPE, CURLOPTTYPE_STRINGPOINT, 88), + + /* crypto engine for the SSL-sub system */ + CURLOPT(CURLOPT_SSLENGINE, CURLOPTTYPE_STRINGPOINT, 89), + + /* set the crypto engine for the SSL-sub system as default + the param has no meaning... + */ + CURLOPT(CURLOPT_SSLENGINE_DEFAULT, CURLOPTTYPE_LONG, 90), + + /* Non-zero value means to use the global dns cache */ + /* DEPRECATED, do not use! */ + CURLOPT(CURLOPT_DNS_USE_GLOBAL_CACHE, CURLOPTTYPE_LONG, 91), + + /* DNS cache timeout */ + CURLOPT(CURLOPT_DNS_CACHE_TIMEOUT, CURLOPTTYPE_LONG, 92), + + /* send linked-list of pre-transfer QUOTE commands */ + CURLOPT(CURLOPT_PREQUOTE, CURLOPTTYPE_SLISTPOINT, 93), + + /* set the debug function */ + CURLOPT(CURLOPT_DEBUGFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 94), + + /* set the data for the debug function */ + CURLOPT(CURLOPT_DEBUGDATA, CURLOPTTYPE_CBPOINT, 95), + + /* mark this as start of a cookie session */ + CURLOPT(CURLOPT_COOKIESESSION, CURLOPTTYPE_LONG, 96), + + /* The CApath directory used to validate the peer certificate + this option is used only if SSL_VERIFYPEER is true */ + CURLOPT(CURLOPT_CAPATH, CURLOPTTYPE_STRINGPOINT, 97), + + /* Instruct libcurl to use a smaller receive buffer */ + CURLOPT(CURLOPT_BUFFERSIZE, CURLOPTTYPE_LONG, 98), + + /* Instruct libcurl to not use any signal/alarm handlers, even when using + timeouts. This option is useful for multi-threaded applications. + See libcurl-the-guide for more background information. */ + CURLOPT(CURLOPT_NOSIGNAL, CURLOPTTYPE_LONG, 99), + + /* Provide a CURLShare for mutexing non-ts data */ + CURLOPT(CURLOPT_SHARE, CURLOPTTYPE_OBJECTPOINT, 100), + + /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default), + CURLPROXY_HTTPS, CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and + CURLPROXY_SOCKS5. */ + CURLOPT(CURLOPT_PROXYTYPE, CURLOPTTYPE_VALUES, 101), + + /* Set the Accept-Encoding string. Use this to tell a server you would like + the response to be compressed. Before 7.21.6, this was known as + CURLOPT_ENCODING */ + CURLOPT(CURLOPT_ACCEPT_ENCODING, CURLOPTTYPE_STRINGPOINT, 102), + + /* Set pointer to private data */ + CURLOPT(CURLOPT_PRIVATE, CURLOPTTYPE_OBJECTPOINT, 103), + + /* Set aliases for HTTP 200 in the HTTP Response header */ + CURLOPT(CURLOPT_HTTP200ALIASES, CURLOPTTYPE_SLISTPOINT, 104), + + /* Continue to send authentication (user+password) when following locations, + even when hostname changed. This can potentially send off the name + and password to whatever host the server decides. */ + CURLOPT(CURLOPT_UNRESTRICTED_AUTH, CURLOPTTYPE_LONG, 105), + + /* Specifically switch on or off the FTP engine's use of the EPRT command ( + it also disables the LPRT attempt). By default, those ones will always be + attempted before the good old traditional PORT command. */ + CURLOPT(CURLOPT_FTP_USE_EPRT, CURLOPTTYPE_LONG, 106), + + /* Set this to a bitmask value to enable the particular authentications + methods you like. Use this in combination with CURLOPT_USERPWD. + Note that setting multiple bits may cause extra network round-trips. */ + CURLOPT(CURLOPT_HTTPAUTH, CURLOPTTYPE_VALUES, 107), + + /* Set the ssl context callback function, currently only for OpenSSL or + WolfSSL ssl_ctx, or mbedTLS mbedtls_ssl_config in the second argument. + The function must match the curl_ssl_ctx_callback prototype. */ + CURLOPT(CURLOPT_SSL_CTX_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 108), + + /* Set the userdata for the ssl context callback function's third + argument */ + CURLOPT(CURLOPT_SSL_CTX_DATA, CURLOPTTYPE_CBPOINT, 109), + + /* FTP Option that causes missing dirs to be created on the remote server. + In 7.19.4 we introduced the convenience enums for this option using the + CURLFTP_CREATE_DIR prefix. + */ + CURLOPT(CURLOPT_FTP_CREATE_MISSING_DIRS, CURLOPTTYPE_LONG, 110), + + /* Set this to a bitmask value to enable the particular authentications + methods you like. Use this in combination with CURLOPT_PROXYUSERPWD. + Note that setting multiple bits may cause extra network round-trips. */ + CURLOPT(CURLOPT_PROXYAUTH, CURLOPTTYPE_VALUES, 111), + + /* Option that changes the timeout, in seconds, associated with getting a + response. This is different from transfer timeout time and essentially + places a demand on the server to acknowledge commands in a timely + manner. For FTP, SMTP, IMAP and POP3. */ + CURLOPT(CURLOPT_SERVER_RESPONSE_TIMEOUT, CURLOPTTYPE_LONG, 112), + + /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to + tell libcurl to use those IP versions only. This only has effect on + systems with support for more than one, i.e IPv4 _and_ IPv6. */ + CURLOPT(CURLOPT_IPRESOLVE, CURLOPTTYPE_VALUES, 113), + + /* Set this option to limit the size of a file that will be downloaded from + an HTTP or FTP server. + + Note there is also _LARGE version which adds large file support for + platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */ + CURLOPT(CURLOPT_MAXFILESIZE, CURLOPTTYPE_LONG, 114), + + /* See the comment for INFILESIZE above, but in short, specifies + * the size of the file being uploaded. -1 means unknown. + */ + CURLOPT(CURLOPT_INFILESIZE_LARGE, CURLOPTTYPE_OFF_T, 115), + + /* Sets the continuation offset. There is also a CURLOPTTYPE_LONG version + * of this; look above for RESUME_FROM. + */ + CURLOPT(CURLOPT_RESUME_FROM_LARGE, CURLOPTTYPE_OFF_T, 116), + + /* Sets the maximum size of data that will be downloaded from + * an HTTP or FTP server. See MAXFILESIZE above for the LONG version. + */ + CURLOPT(CURLOPT_MAXFILESIZE_LARGE, CURLOPTTYPE_OFF_T, 117), + + /* Set this option to the file name of your .netrc file you want libcurl + to parse (using the CURLOPT_NETRC option). If not set, libcurl will do + a poor attempt to find the user's home directory and check for a .netrc + file in there. */ + CURLOPT(CURLOPT_NETRC_FILE, CURLOPTTYPE_STRINGPOINT, 118), + + /* Enable SSL/TLS for FTP, pick one of: + CURLUSESSL_TRY - try using SSL, proceed anyway otherwise + CURLUSESSL_CONTROL - SSL for the control connection or fail + CURLUSESSL_ALL - SSL for all communication or fail + */ + CURLOPT(CURLOPT_USE_SSL, CURLOPTTYPE_VALUES, 119), + + /* The _LARGE version of the standard POSTFIELDSIZE option */ + CURLOPT(CURLOPT_POSTFIELDSIZE_LARGE, CURLOPTTYPE_OFF_T, 120), + + /* Enable/disable the TCP Nagle algorithm */ + CURLOPT(CURLOPT_TCP_NODELAY, CURLOPTTYPE_LONG, 121), + + /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ + /* 123 OBSOLETE. Gone in 7.16.0 */ + /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ + /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ + /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ + /* 127 OBSOLETE. Gone in 7.16.0 */ + /* 128 OBSOLETE. Gone in 7.16.0 */ + + /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option + can be used to change libcurl's default action which is to first try + "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK + response has been received. + + Available parameters are: + CURLFTPAUTH_DEFAULT - let libcurl decide + CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS + CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL + */ + CURLOPT(CURLOPT_FTPSSLAUTH, CURLOPTTYPE_VALUES, 129), + + CURLOPT(CURLOPT_IOCTLFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 130), + CURLOPT(CURLOPT_IOCTLDATA, CURLOPTTYPE_CBPOINT, 131), + + /* 132 OBSOLETE. Gone in 7.16.0 */ + /* 133 OBSOLETE. Gone in 7.16.0 */ + + /* null-terminated string for pass on to the FTP server when asked for + "account" info */ + CURLOPT(CURLOPT_FTP_ACCOUNT, CURLOPTTYPE_STRINGPOINT, 134), + + /* feed cookie into cookie engine */ + CURLOPT(CURLOPT_COOKIELIST, CURLOPTTYPE_STRINGPOINT, 135), + + /* ignore Content-Length */ + CURLOPT(CURLOPT_IGNORE_CONTENT_LENGTH, CURLOPTTYPE_LONG, 136), + + /* Set to non-zero to skip the IP address received in a 227 PASV FTP server + response. Typically used for FTP-SSL purposes but is not restricted to + that. libcurl will then instead use the same IP address it used for the + control connection. */ + CURLOPT(CURLOPT_FTP_SKIP_PASV_IP, CURLOPTTYPE_LONG, 137), + + /* Select "file method" to use when doing FTP, see the curl_ftpmethod + above. */ + CURLOPT(CURLOPT_FTP_FILEMETHOD, CURLOPTTYPE_VALUES, 138), + + /* Local port number to bind the socket to */ + CURLOPT(CURLOPT_LOCALPORT, CURLOPTTYPE_LONG, 139), + + /* Number of ports to try, including the first one set with LOCALPORT. + Thus, setting it to 1 will make no additional attempts but the first. + */ + CURLOPT(CURLOPT_LOCALPORTRANGE, CURLOPTTYPE_LONG, 140), + + /* no transfer, set up connection and let application use the socket by + extracting it with CURLINFO_LASTSOCKET */ + CURLOPT(CURLOPT_CONNECT_ONLY, CURLOPTTYPE_LONG, 141), + + /* Function that will be called to convert from the + network encoding (instead of using the iconv calls in libcurl) */ + CURLOPT(CURLOPT_CONV_FROM_NETWORK_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 142), + + /* Function that will be called to convert to the + network encoding (instead of using the iconv calls in libcurl) */ + CURLOPT(CURLOPT_CONV_TO_NETWORK_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 143), + + /* Function that will be called to convert from UTF8 + (instead of using the iconv calls in libcurl) + Note that this is used only for SSL certificate processing */ + CURLOPT(CURLOPT_CONV_FROM_UTF8_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 144), + + /* if the connection proceeds too quickly then need to slow it down */ + /* limit-rate: maximum number of bytes per second to send or receive */ + CURLOPT(CURLOPT_MAX_SEND_SPEED_LARGE, CURLOPTTYPE_OFF_T, 145), + CURLOPT(CURLOPT_MAX_RECV_SPEED_LARGE, CURLOPTTYPE_OFF_T, 146), + + /* Pointer to command string to send if USER/PASS fails. */ + CURLOPT(CURLOPT_FTP_ALTERNATIVE_TO_USER, CURLOPTTYPE_STRINGPOINT, 147), + + /* callback function for setting socket options */ + CURLOPT(CURLOPT_SOCKOPTFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 148), + CURLOPT(CURLOPT_SOCKOPTDATA, CURLOPTTYPE_CBPOINT, 149), + + /* set to 0 to disable session ID re-use for this transfer, default is + enabled (== 1) */ + CURLOPT(CURLOPT_SSL_SESSIONID_CACHE, CURLOPTTYPE_LONG, 150), + + /* allowed SSH authentication methods */ + CURLOPT(CURLOPT_SSH_AUTH_TYPES, CURLOPTTYPE_VALUES, 151), + + /* Used by scp/sftp to do public/private key authentication */ + CURLOPT(CURLOPT_SSH_PUBLIC_KEYFILE, CURLOPTTYPE_STRINGPOINT, 152), + CURLOPT(CURLOPT_SSH_PRIVATE_KEYFILE, CURLOPTTYPE_STRINGPOINT, 153), + + /* Send CCC (Clear Command Channel) after authentication */ + CURLOPT(CURLOPT_FTP_SSL_CCC, CURLOPTTYPE_LONG, 154), + + /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */ + CURLOPT(CURLOPT_TIMEOUT_MS, CURLOPTTYPE_LONG, 155), + CURLOPT(CURLOPT_CONNECTTIMEOUT_MS, CURLOPTTYPE_LONG, 156), + + /* set to zero to disable the libcurl's decoding and thus pass the raw body + data to the application even when it is encoded/compressed */ + CURLOPT(CURLOPT_HTTP_TRANSFER_DECODING, CURLOPTTYPE_LONG, 157), + CURLOPT(CURLOPT_HTTP_CONTENT_DECODING, CURLOPTTYPE_LONG, 158), + + /* Permission used when creating new files and directories on the remote + server for protocols that support it, SFTP/SCP/FILE */ + CURLOPT(CURLOPT_NEW_FILE_PERMS, CURLOPTTYPE_LONG, 159), + CURLOPT(CURLOPT_NEW_DIRECTORY_PERMS, CURLOPTTYPE_LONG, 160), + + /* Set the behavior of POST when redirecting. Values must be set to one + of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */ + CURLOPT(CURLOPT_POSTREDIR, CURLOPTTYPE_VALUES, 161), + + /* used by scp/sftp to verify the host's public key */ + CURLOPT(CURLOPT_SSH_HOST_PUBLIC_KEY_MD5, CURLOPTTYPE_STRINGPOINT, 162), + + /* Callback function for opening socket (instead of socket(2)). Optionally, + callback is able change the address or refuse to connect returning + CURL_SOCKET_BAD. The callback should have type + curl_opensocket_callback */ + CURLOPT(CURLOPT_OPENSOCKETFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 163), + CURLOPT(CURLOPT_OPENSOCKETDATA, CURLOPTTYPE_CBPOINT, 164), + + /* POST volatile input fields. */ + CURLOPT(CURLOPT_COPYPOSTFIELDS, CURLOPTTYPE_OBJECTPOINT, 165), + + /* set transfer mode (;type=) when doing FTP via an HTTP proxy */ + CURLOPT(CURLOPT_PROXY_TRANSFER_MODE, CURLOPTTYPE_LONG, 166), + + /* Callback function for seeking in the input stream */ + CURLOPT(CURLOPT_SEEKFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 167), + CURLOPT(CURLOPT_SEEKDATA, CURLOPTTYPE_CBPOINT, 168), + + /* CRL file */ + CURLOPT(CURLOPT_CRLFILE, CURLOPTTYPE_STRINGPOINT, 169), + + /* Issuer certificate */ + CURLOPT(CURLOPT_ISSUERCERT, CURLOPTTYPE_STRINGPOINT, 170), + + /* (IPv6) Address scope */ + CURLOPT(CURLOPT_ADDRESS_SCOPE, CURLOPTTYPE_LONG, 171), + + /* Collect certificate chain info and allow it to get retrievable with + CURLINFO_CERTINFO after the transfer is complete. */ + CURLOPT(CURLOPT_CERTINFO, CURLOPTTYPE_LONG, 172), + + /* "name" and "pwd" to use when fetching. */ + CURLOPT(CURLOPT_USERNAME, CURLOPTTYPE_STRINGPOINT, 173), + CURLOPT(CURLOPT_PASSWORD, CURLOPTTYPE_STRINGPOINT, 174), + + /* "name" and "pwd" to use with Proxy when fetching. */ + CURLOPT(CURLOPT_PROXYUSERNAME, CURLOPTTYPE_STRINGPOINT, 175), + CURLOPT(CURLOPT_PROXYPASSWORD, CURLOPTTYPE_STRINGPOINT, 176), + + /* Comma separated list of hostnames defining no-proxy zones. These should + match both hostnames directly, and hostnames within a domain. For + example, local.com will match local.com and www.local.com, but NOT + notlocal.com or www.notlocal.com. For compatibility with other + implementations of this, .local.com will be considered to be the same as + local.com. A single * is the only valid wildcard, and effectively + disables the use of proxy. */ + CURLOPT(CURLOPT_NOPROXY, CURLOPTTYPE_STRINGPOINT, 177), + + /* block size for TFTP transfers */ + CURLOPT(CURLOPT_TFTP_BLKSIZE, CURLOPTTYPE_LONG, 178), + + /* Socks Service */ + /* DEPRECATED, do not use! */ + CURLOPT(CURLOPT_SOCKS5_GSSAPI_SERVICE, CURLOPTTYPE_STRINGPOINT, 179), + + /* Socks Service */ + CURLOPT(CURLOPT_SOCKS5_GSSAPI_NEC, CURLOPTTYPE_LONG, 180), + + /* set the bitmask for the protocols that are allowed to be used for the + transfer, which thus helps the app which takes URLs from users or other + external inputs and want to restrict what protocol(s) to deal + with. Defaults to CURLPROTO_ALL. */ + CURLOPT(CURLOPT_PROTOCOLS, CURLOPTTYPE_LONG, 181), + + /* set the bitmask for the protocols that libcurl is allowed to follow to, + as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs + to be set in both bitmasks to be allowed to get redirected to. */ + CURLOPT(CURLOPT_REDIR_PROTOCOLS, CURLOPTTYPE_LONG, 182), + + /* set the SSH knownhost file name to use */ + CURLOPT(CURLOPT_SSH_KNOWNHOSTS, CURLOPTTYPE_STRINGPOINT, 183), + + /* set the SSH host key callback, must point to a curl_sshkeycallback + function */ + CURLOPT(CURLOPT_SSH_KEYFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 184), + + /* set the SSH host key callback custom pointer */ + CURLOPT(CURLOPT_SSH_KEYDATA, CURLOPTTYPE_CBPOINT, 185), + + /* set the SMTP mail originator */ + CURLOPT(CURLOPT_MAIL_FROM, CURLOPTTYPE_STRINGPOINT, 186), + + /* set the list of SMTP mail receiver(s) */ + CURLOPT(CURLOPT_MAIL_RCPT, CURLOPTTYPE_SLISTPOINT, 187), + + /* FTP: send PRET before PASV */ + CURLOPT(CURLOPT_FTP_USE_PRET, CURLOPTTYPE_LONG, 188), + + /* RTSP request method (OPTIONS, SETUP, PLAY, etc...) */ + CURLOPT(CURLOPT_RTSP_REQUEST, CURLOPTTYPE_VALUES, 189), + + /* The RTSP session identifier */ + CURLOPT(CURLOPT_RTSP_SESSION_ID, CURLOPTTYPE_STRINGPOINT, 190), + + /* The RTSP stream URI */ + CURLOPT(CURLOPT_RTSP_STREAM_URI, CURLOPTTYPE_STRINGPOINT, 191), + + /* The Transport: header to use in RTSP requests */ + CURLOPT(CURLOPT_RTSP_TRANSPORT, CURLOPTTYPE_STRINGPOINT, 192), + + /* Manually initialize the client RTSP CSeq for this handle */ + CURLOPT(CURLOPT_RTSP_CLIENT_CSEQ, CURLOPTTYPE_LONG, 193), + + /* Manually initialize the server RTSP CSeq for this handle */ + CURLOPT(CURLOPT_RTSP_SERVER_CSEQ, CURLOPTTYPE_LONG, 194), + + /* The stream to pass to INTERLEAVEFUNCTION. */ + CURLOPT(CURLOPT_INTERLEAVEDATA, CURLOPTTYPE_CBPOINT, 195), + + /* Let the application define a custom write method for RTP data */ + CURLOPT(CURLOPT_INTERLEAVEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 196), + + /* Turn on wildcard matching */ + CURLOPT(CURLOPT_WILDCARDMATCH, CURLOPTTYPE_LONG, 197), + + /* Directory matching callback called before downloading of an + individual file (chunk) started */ + CURLOPT(CURLOPT_CHUNK_BGN_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 198), + + /* Directory matching callback called after the file (chunk) + was downloaded, or skipped */ + CURLOPT(CURLOPT_CHUNK_END_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 199), + + /* Change match (fnmatch-like) callback for wildcard matching */ + CURLOPT(CURLOPT_FNMATCH_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 200), + + /* Let the application define custom chunk data pointer */ + CURLOPT(CURLOPT_CHUNK_DATA, CURLOPTTYPE_CBPOINT, 201), + + /* FNMATCH_FUNCTION user pointer */ + CURLOPT(CURLOPT_FNMATCH_DATA, CURLOPTTYPE_CBPOINT, 202), + + /* send linked-list of name:port:address sets */ + CURLOPT(CURLOPT_RESOLVE, CURLOPTTYPE_SLISTPOINT, 203), + + /* Set a username for authenticated TLS */ + CURLOPT(CURLOPT_TLSAUTH_USERNAME, CURLOPTTYPE_STRINGPOINT, 204), + + /* Set a password for authenticated TLS */ + CURLOPT(CURLOPT_TLSAUTH_PASSWORD, CURLOPTTYPE_STRINGPOINT, 205), + + /* Set authentication type for authenticated TLS */ + CURLOPT(CURLOPT_TLSAUTH_TYPE, CURLOPTTYPE_STRINGPOINT, 206), + + /* Set to 1 to enable the "TE:" header in HTTP requests to ask for + compressed transfer-encoded responses. Set to 0 to disable the use of TE: + in outgoing requests. The current default is 0, but it might change in a + future libcurl release. + + libcurl will ask for the compressed methods it knows of, and if that + isn't any, it will not ask for transfer-encoding at all even if this + option is set to 1. + + */ + CURLOPT(CURLOPT_TRANSFER_ENCODING, CURLOPTTYPE_LONG, 207), + + /* Callback function for closing socket (instead of close(2)). The callback + should have type curl_closesocket_callback */ + CURLOPT(CURLOPT_CLOSESOCKETFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 208), + CURLOPT(CURLOPT_CLOSESOCKETDATA, CURLOPTTYPE_CBPOINT, 209), + + /* allow GSSAPI credential delegation */ + CURLOPT(CURLOPT_GSSAPI_DELEGATION, CURLOPTTYPE_VALUES, 210), + + /* Set the name servers to use for DNS resolution */ + CURLOPT(CURLOPT_DNS_SERVERS, CURLOPTTYPE_STRINGPOINT, 211), + + /* Time-out accept operations (currently for FTP only) after this amount + of milliseconds. */ + CURLOPT(CURLOPT_ACCEPTTIMEOUT_MS, CURLOPTTYPE_LONG, 212), + + /* Set TCP keepalive */ + CURLOPT(CURLOPT_TCP_KEEPALIVE, CURLOPTTYPE_LONG, 213), + + /* non-universal keepalive knobs (Linux, AIX, HP-UX, more) */ + CURLOPT(CURLOPT_TCP_KEEPIDLE, CURLOPTTYPE_LONG, 214), + CURLOPT(CURLOPT_TCP_KEEPINTVL, CURLOPTTYPE_LONG, 215), + + /* Enable/disable specific SSL features with a bitmask, see CURLSSLOPT_* */ + CURLOPT(CURLOPT_SSL_OPTIONS, CURLOPTTYPE_VALUES, 216), + + /* Set the SMTP auth originator */ + CURLOPT(CURLOPT_MAIL_AUTH, CURLOPTTYPE_STRINGPOINT, 217), + + /* Enable/disable SASL initial response */ + CURLOPT(CURLOPT_SASL_IR, CURLOPTTYPE_LONG, 218), + + /* Function that will be called instead of the internal progress display + * function. This function should be defined as the curl_xferinfo_callback + * prototype defines. (Deprecates CURLOPT_PROGRESSFUNCTION) */ + CURLOPT(CURLOPT_XFERINFOFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 219), + + /* The XOAUTH2 bearer token */ + CURLOPT(CURLOPT_XOAUTH2_BEARER, CURLOPTTYPE_STRINGPOINT, 220), + + /* Set the interface string to use as outgoing network + * interface for DNS requests. + * Only supported by the c-ares DNS backend */ + CURLOPT(CURLOPT_DNS_INTERFACE, CURLOPTTYPE_STRINGPOINT, 221), + + /* Set the local IPv4 address to use for outgoing DNS requests. + * Only supported by the c-ares DNS backend */ + CURLOPT(CURLOPT_DNS_LOCAL_IP4, CURLOPTTYPE_STRINGPOINT, 222), + + /* Set the local IPv6 address to use for outgoing DNS requests. + * Only supported by the c-ares DNS backend */ + CURLOPT(CURLOPT_DNS_LOCAL_IP6, CURLOPTTYPE_STRINGPOINT, 223), + + /* Set authentication options directly */ + CURLOPT(CURLOPT_LOGIN_OPTIONS, CURLOPTTYPE_STRINGPOINT, 224), + + /* Enable/disable TLS NPN extension (http2 over ssl might fail without) */ + CURLOPT(CURLOPT_SSL_ENABLE_NPN, CURLOPTTYPE_LONG, 225), + + /* Enable/disable TLS ALPN extension (http2 over ssl might fail without) */ + CURLOPT(CURLOPT_SSL_ENABLE_ALPN, CURLOPTTYPE_LONG, 226), + + /* Time to wait for a response to a HTTP request containing an + * Expect: 100-continue header before sending the data anyway. */ + CURLOPT(CURLOPT_EXPECT_100_TIMEOUT_MS, CURLOPTTYPE_LONG, 227), + + /* This points to a linked list of headers used for proxy requests only, + struct curl_slist kind */ + CURLOPT(CURLOPT_PROXYHEADER, CURLOPTTYPE_SLISTPOINT, 228), + + /* Pass in a bitmask of "header options" */ + CURLOPT(CURLOPT_HEADEROPT, CURLOPTTYPE_VALUES, 229), + + /* The public key in DER form used to validate the peer public key + this option is used only if SSL_VERIFYPEER is true */ + CURLOPT(CURLOPT_PINNEDPUBLICKEY, CURLOPTTYPE_STRINGPOINT, 230), + + /* Path to Unix domain socket */ + CURLOPT(CURLOPT_UNIX_SOCKET_PATH, CURLOPTTYPE_STRINGPOINT, 231), + + /* Set if we should verify the certificate status. */ + CURLOPT(CURLOPT_SSL_VERIFYSTATUS, CURLOPTTYPE_LONG, 232), + + /* Set if we should enable TLS false start. */ + CURLOPT(CURLOPT_SSL_FALSESTART, CURLOPTTYPE_LONG, 233), + + /* Do not squash dot-dot sequences */ + CURLOPT(CURLOPT_PATH_AS_IS, CURLOPTTYPE_LONG, 234), + + /* Proxy Service Name */ + CURLOPT(CURLOPT_PROXY_SERVICE_NAME, CURLOPTTYPE_STRINGPOINT, 235), + + /* Service Name */ + CURLOPT(CURLOPT_SERVICE_NAME, CURLOPTTYPE_STRINGPOINT, 236), + + /* Wait/don't wait for pipe/mutex to clarify */ + CURLOPT(CURLOPT_PIPEWAIT, CURLOPTTYPE_LONG, 237), + + /* Set the protocol used when curl is given a URL without a protocol */ + CURLOPT(CURLOPT_DEFAULT_PROTOCOL, CURLOPTTYPE_STRINGPOINT, 238), + + /* Set stream weight, 1 - 256 (default is 16) */ + CURLOPT(CURLOPT_STREAM_WEIGHT, CURLOPTTYPE_LONG, 239), + + /* Set stream dependency on another CURL handle */ + CURLOPT(CURLOPT_STREAM_DEPENDS, CURLOPTTYPE_OBJECTPOINT, 240), + + /* Set E-xclusive stream dependency on another CURL handle */ + CURLOPT(CURLOPT_STREAM_DEPENDS_E, CURLOPTTYPE_OBJECTPOINT, 241), + + /* Do not send any tftp option requests to the server */ + CURLOPT(CURLOPT_TFTP_NO_OPTIONS, CURLOPTTYPE_LONG, 242), + + /* Linked-list of host:port:connect-to-host:connect-to-port, + overrides the URL's host:port (only for the network layer) */ + CURLOPT(CURLOPT_CONNECT_TO, CURLOPTTYPE_SLISTPOINT, 243), + + /* Set TCP Fast Open */ + CURLOPT(CURLOPT_TCP_FASTOPEN, CURLOPTTYPE_LONG, 244), + + /* Continue to send data if the server responds early with an + * HTTP status code >= 300 */ + CURLOPT(CURLOPT_KEEP_SENDING_ON_ERROR, CURLOPTTYPE_LONG, 245), + + /* The CApath or CAfile used to validate the proxy certificate + this option is used only if PROXY_SSL_VERIFYPEER is true */ + CURLOPT(CURLOPT_PROXY_CAINFO, CURLOPTTYPE_STRINGPOINT, 246), + + /* The CApath directory used to validate the proxy certificate + this option is used only if PROXY_SSL_VERIFYPEER is true */ + CURLOPT(CURLOPT_PROXY_CAPATH, CURLOPTTYPE_STRINGPOINT, 247), + + /* Set if we should verify the proxy in ssl handshake, + set 1 to verify. */ + CURLOPT(CURLOPT_PROXY_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 248), + + /* Set if we should verify the Common name from the proxy certificate in ssl + * handshake, set 1 to check existence, 2 to ensure that it matches + * the provided hostname. */ + CURLOPT(CURLOPT_PROXY_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 249), + + /* What version to specifically try to use for proxy. + See CURL_SSLVERSION defines below. */ + CURLOPT(CURLOPT_PROXY_SSLVERSION, CURLOPTTYPE_VALUES, 250), + + /* Set a username for authenticated TLS for proxy */ + CURLOPT(CURLOPT_PROXY_TLSAUTH_USERNAME, CURLOPTTYPE_STRINGPOINT, 251), + + /* Set a password for authenticated TLS for proxy */ + CURLOPT(CURLOPT_PROXY_TLSAUTH_PASSWORD, CURLOPTTYPE_STRINGPOINT, 252), + + /* Set authentication type for authenticated TLS for proxy */ + CURLOPT(CURLOPT_PROXY_TLSAUTH_TYPE, CURLOPTTYPE_STRINGPOINT, 253), + + /* name of the file keeping your private SSL-certificate for proxy */ + CURLOPT(CURLOPT_PROXY_SSLCERT, CURLOPTTYPE_STRINGPOINT, 254), + + /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") for + proxy */ + CURLOPT(CURLOPT_PROXY_SSLCERTTYPE, CURLOPTTYPE_STRINGPOINT, 255), + + /* name of the file keeping your private SSL-key for proxy */ + CURLOPT(CURLOPT_PROXY_SSLKEY, CURLOPTTYPE_STRINGPOINT, 256), + + /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") for + proxy */ + CURLOPT(CURLOPT_PROXY_SSLKEYTYPE, CURLOPTTYPE_STRINGPOINT, 257), + + /* password for the SSL private key for proxy */ + CURLOPT(CURLOPT_PROXY_KEYPASSWD, CURLOPTTYPE_STRINGPOINT, 258), + + /* Specify which SSL ciphers to use for proxy */ + CURLOPT(CURLOPT_PROXY_SSL_CIPHER_LIST, CURLOPTTYPE_STRINGPOINT, 259), + + /* CRL file for proxy */ + CURLOPT(CURLOPT_PROXY_CRLFILE, CURLOPTTYPE_STRINGPOINT, 260), + + /* Enable/disable specific SSL features with a bitmask for proxy, see + CURLSSLOPT_* */ + CURLOPT(CURLOPT_PROXY_SSL_OPTIONS, CURLOPTTYPE_LONG, 261), + + /* Name of pre proxy to use. */ + CURLOPT(CURLOPT_PRE_PROXY, CURLOPTTYPE_STRINGPOINT, 262), + + /* The public key in DER form used to validate the proxy public key + this option is used only if PROXY_SSL_VERIFYPEER is true */ + CURLOPT(CURLOPT_PROXY_PINNEDPUBLICKEY, CURLOPTTYPE_STRINGPOINT, 263), + + /* Path to an abstract Unix domain socket */ + CURLOPT(CURLOPT_ABSTRACT_UNIX_SOCKET, CURLOPTTYPE_STRINGPOINT, 264), + + /* Suppress proxy CONNECT response headers from user callbacks */ + CURLOPT(CURLOPT_SUPPRESS_CONNECT_HEADERS, CURLOPTTYPE_LONG, 265), + + /* The request target, instead of extracted from the URL */ + CURLOPT(CURLOPT_REQUEST_TARGET, CURLOPTTYPE_STRINGPOINT, 266), + + /* bitmask of allowed auth methods for connections to SOCKS5 proxies */ + CURLOPT(CURLOPT_SOCKS5_AUTH, CURLOPTTYPE_LONG, 267), + + /* Enable/disable SSH compression */ + CURLOPT(CURLOPT_SSH_COMPRESSION, CURLOPTTYPE_LONG, 268), + + /* Post MIME data. */ + CURLOPT(CURLOPT_MIMEPOST, CURLOPTTYPE_OBJECTPOINT, 269), + + /* Time to use with the CURLOPT_TIMECONDITION. Specified in number of + seconds since 1 Jan 1970. */ + CURLOPT(CURLOPT_TIMEVALUE_LARGE, CURLOPTTYPE_OFF_T, 270), + + /* Head start in milliseconds to give happy eyeballs. */ + CURLOPT(CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS, CURLOPTTYPE_LONG, 271), + + /* Function that will be called before a resolver request is made */ + CURLOPT(CURLOPT_RESOLVER_START_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 272), + + /* User data to pass to the resolver start callback. */ + CURLOPT(CURLOPT_RESOLVER_START_DATA, CURLOPTTYPE_CBPOINT, 273), + + /* send HAProxy PROXY protocol header? */ + CURLOPT(CURLOPT_HAPROXYPROTOCOL, CURLOPTTYPE_LONG, 274), + + /* shuffle addresses before use when DNS returns multiple */ + CURLOPT(CURLOPT_DNS_SHUFFLE_ADDRESSES, CURLOPTTYPE_LONG, 275), + + /* Specify which TLS 1.3 ciphers suites to use */ + CURLOPT(CURLOPT_TLS13_CIPHERS, CURLOPTTYPE_STRINGPOINT, 276), + CURLOPT(CURLOPT_PROXY_TLS13_CIPHERS, CURLOPTTYPE_STRINGPOINT, 277), + + /* Disallow specifying username/login in URL. */ + CURLOPT(CURLOPT_DISALLOW_USERNAME_IN_URL, CURLOPTTYPE_LONG, 278), + + /* DNS-over-HTTPS URL */ + CURLOPT(CURLOPT_DOH_URL, CURLOPTTYPE_STRINGPOINT, 279), + + /* Preferred buffer size to use for uploads */ + CURLOPT(CURLOPT_UPLOAD_BUFFERSIZE, CURLOPTTYPE_LONG, 280), + + /* Time in ms between connection upkeep calls for long-lived connections. */ + CURLOPT(CURLOPT_UPKEEP_INTERVAL_MS, CURLOPTTYPE_LONG, 281), + + /* Specify URL using CURL URL API. */ + CURLOPT(CURLOPT_CURLU, CURLOPTTYPE_OBJECTPOINT, 282), + + /* add trailing data just after no more data is available */ + CURLOPT(CURLOPT_TRAILERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 283), + + /* pointer to be passed to HTTP_TRAILER_FUNCTION */ + CURLOPT(CURLOPT_TRAILERDATA, CURLOPTTYPE_CBPOINT, 284), + + /* set this to 1L to allow HTTP/0.9 responses or 0L to disallow */ + CURLOPT(CURLOPT_HTTP09_ALLOWED, CURLOPTTYPE_LONG, 285), + + /* alt-svc control bitmask */ + CURLOPT(CURLOPT_ALTSVC_CTRL, CURLOPTTYPE_LONG, 286), + + /* alt-svc cache file name to possibly read from/write to */ + CURLOPT(CURLOPT_ALTSVC, CURLOPTTYPE_STRINGPOINT, 287), + + /* maximum age (idle time) of a connection to consider it for reuse + * (in seconds) */ + CURLOPT(CURLOPT_MAXAGE_CONN, CURLOPTTYPE_LONG, 288), + + /* SASL authorization identity */ + CURLOPT(CURLOPT_SASL_AUTHZID, CURLOPTTYPE_STRINGPOINT, 289), + + /* allow RCPT TO command to fail for some recipients */ + CURLOPT(CURLOPT_MAIL_RCPT_ALLLOWFAILS, CURLOPTTYPE_LONG, 290), + + /* the private SSL-certificate as a "blob" */ + CURLOPT(CURLOPT_SSLCERT_BLOB, CURLOPTTYPE_BLOB, 291), + CURLOPT(CURLOPT_SSLKEY_BLOB, CURLOPTTYPE_BLOB, 292), + CURLOPT(CURLOPT_PROXY_SSLCERT_BLOB, CURLOPTTYPE_BLOB, 293), + CURLOPT(CURLOPT_PROXY_SSLKEY_BLOB, CURLOPTTYPE_BLOB, 294), + CURLOPT(CURLOPT_ISSUERCERT_BLOB, CURLOPTTYPE_BLOB, 295), + + /* Issuer certificate for proxy */ + CURLOPT(CURLOPT_PROXY_ISSUERCERT, CURLOPTTYPE_STRINGPOINT, 296), + CURLOPT(CURLOPT_PROXY_ISSUERCERT_BLOB, CURLOPTTYPE_BLOB, 297), + + /* the EC curves requested by the TLS client (RFC 8422, 5.1); + * OpenSSL support via 'set_groups'/'set_curves': + * https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_groups.html + */ + CURLOPT(CURLOPT_SSL_EC_CURVES, CURLOPTTYPE_STRINGPOINT, 298), + + /* HSTS bitmask */ + CURLOPT(CURLOPT_HSTS_CTRL, CURLOPTTYPE_LONG, 299), + /* HSTS file name */ + CURLOPT(CURLOPT_HSTS, CURLOPTTYPE_STRINGPOINT, 300), + + /* HSTS read callback */ + CURLOPT(CURLOPT_HSTSREADFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 301), + CURLOPT(CURLOPT_HSTSREADDATA, CURLOPTTYPE_CBPOINT, 302), + + /* HSTS write callback */ + CURLOPT(CURLOPT_HSTSWRITEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 303), + CURLOPT(CURLOPT_HSTSWRITEDATA, CURLOPTTYPE_CBPOINT, 304), + + /* Parameters for V4 signature */ + CURLOPT(CURLOPT_AWS_SIGV4, CURLOPTTYPE_STRINGPOINT, 305), + + /* Same as CURLOPT_SSL_VERIFYPEER but for DoH (DNS-over-HTTPS) servers. */ + CURLOPT(CURLOPT_DOH_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 306), + + /* Same as CURLOPT_SSL_VERIFYHOST but for DoH (DNS-over-HTTPS) servers. */ + CURLOPT(CURLOPT_DOH_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 307), + + /* Same as CURLOPT_SSL_VERIFYSTATUS but for DoH (DNS-over-HTTPS) servers. */ + CURLOPT(CURLOPT_DOH_SSL_VERIFYSTATUS, CURLOPTTYPE_LONG, 308), + + /* The CA certificates as "blob" used to validate the peer certificate + this option is used only if SSL_VERIFYPEER is true */ + CURLOPT(CURLOPT_CAINFO_BLOB, CURLOPTTYPE_BLOB, 309), + + /* The CA certificates as "blob" used to validate the proxy certificate + this option is used only if PROXY_SSL_VERIFYPEER is true */ + CURLOPT(CURLOPT_PROXY_CAINFO_BLOB, CURLOPTTYPE_BLOB, 310), + + /* used by scp/sftp to verify the host's public key */ + CURLOPT(CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256, CURLOPTTYPE_STRINGPOINT, 311), + + /* Function that will be called immediately before the initial request + is made on a connection (after any protocol negotiation step). */ + CURLOPT(CURLOPT_PREREQFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 312), + + /* Data passed to the CURLOPT_PREREQFUNCTION callback */ + CURLOPT(CURLOPT_PREREQDATA, CURLOPTTYPE_CBPOINT, 313), + + /* maximum age (since creation) of a connection to consider it for reuse + * (in seconds) */ + CURLOPT(CURLOPT_MAXLIFETIME_CONN, CURLOPTTYPE_LONG, 314), + + /* Set MIME option flags. */ + CURLOPT(CURLOPT_MIME_OPTIONS, CURLOPTTYPE_LONG, 315), + + /* set the SSH host key callback, must point to a curl_sshkeycallback + function */ + CURLOPT(CURLOPT_SSH_HOSTKEYFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 316), + + /* set the SSH host key callback custom pointer */ + CURLOPT(CURLOPT_SSH_HOSTKEYDATA, CURLOPTTYPE_CBPOINT, 317), + + /* specify which protocols that are allowed to be used for the transfer, + which thus helps the app which takes URLs from users or other external + inputs and want to restrict what protocol(s) to deal with. Defaults to + all built-in protocols. */ + CURLOPT(CURLOPT_PROTOCOLS_STR, CURLOPTTYPE_STRINGPOINT, 318), + + /* specify which protocols that libcurl is allowed to follow directs to */ + CURLOPT(CURLOPT_REDIR_PROTOCOLS_STR, CURLOPTTYPE_STRINGPOINT, 319), + + /* websockets options */ + CURLOPT(CURLOPT_WS_OPTIONS, CURLOPTTYPE_LONG, 320), + + CURLOPT_LASTENTRY /* the last unused */ +} CURLoption; + +#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all + the obsolete stuff removed! */ + +/* Backwards compatibility with older names */ +/* These are scheduled to disappear by 2011 */ + +/* This was added in version 7.19.1 */ +#define CURLOPT_POST301 CURLOPT_POSTREDIR + +/* These are scheduled to disappear by 2009 */ + +/* The following were added in 7.17.0 */ +#define CURLOPT_SSLKEYPASSWD CURLOPT_KEYPASSWD +#define CURLOPT_FTPAPPEND CURLOPT_APPEND +#define CURLOPT_FTPLISTONLY CURLOPT_DIRLISTONLY +#define CURLOPT_FTP_SSL CURLOPT_USE_SSL + +/* The following were added earlier */ + +#define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD +#define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL + +/* */ +#define CURLOPT_FTP_RESPONSE_TIMEOUT CURLOPT_SERVER_RESPONSE_TIMEOUT + +#else +/* This is set if CURL_NO_OLDIES is defined at compile-time */ +#undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */ +#endif + + + /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host + name resolves addresses using more than one IP protocol version, this + option might be handy to force libcurl to use a specific IP version. */ +#define CURL_IPRESOLVE_WHATEVER 0 /* default, uses addresses to all IP + versions that your system allows */ +#define CURL_IPRESOLVE_V4 1 /* uses only IPv4 addresses/connections */ +#define CURL_IPRESOLVE_V6 2 /* uses only IPv6 addresses/connections */ + + /* Convenient "aliases" */ +#define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER + + /* These enums are for use with the CURLOPT_HTTP_VERSION option. */ +enum { + CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd + like the library to choose the best possible + for us! */ + CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */ + CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */ + CURL_HTTP_VERSION_2_0, /* please use HTTP 2 in the request */ + CURL_HTTP_VERSION_2TLS, /* use version 2 for HTTPS, version 1.1 for HTTP */ + CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE, /* please use HTTP 2 without HTTP/1.1 + Upgrade */ + CURL_HTTP_VERSION_3 = 30, /* Makes use of explicit HTTP/3 without fallback. + Use CURLOPT_ALTSVC to enable HTTP/3 upgrade */ + CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */ +}; + +/* Convenience definition simple because the name of the version is HTTP/2 and + not 2.0. The 2_0 version of the enum name was set while the version was + still planned to be 2.0 and we stick to it for compatibility. */ +#define CURL_HTTP_VERSION_2 CURL_HTTP_VERSION_2_0 + +/* + * Public API enums for RTSP requests + */ +enum { + CURL_RTSPREQ_NONE, /* first in list */ + CURL_RTSPREQ_OPTIONS, + CURL_RTSPREQ_DESCRIBE, + CURL_RTSPREQ_ANNOUNCE, + CURL_RTSPREQ_SETUP, + CURL_RTSPREQ_PLAY, + CURL_RTSPREQ_PAUSE, + CURL_RTSPREQ_TEARDOWN, + CURL_RTSPREQ_GET_PARAMETER, + CURL_RTSPREQ_SET_PARAMETER, + CURL_RTSPREQ_RECORD, + CURL_RTSPREQ_RECEIVE, + CURL_RTSPREQ_LAST /* last in list */ +}; + + /* These enums are for use with the CURLOPT_NETRC option. */ +enum CURL_NETRC_OPTION { + CURL_NETRC_IGNORED, /* The .netrc will never be read. + * This is the default. */ + CURL_NETRC_OPTIONAL, /* A user:password in the URL will be preferred + * to one in the .netrc. */ + CURL_NETRC_REQUIRED, /* A user:password in the URL will be ignored. + * Unless one is set programmatically, the .netrc + * will be queried. */ + CURL_NETRC_LAST +}; + +enum { + CURL_SSLVERSION_DEFAULT, + CURL_SSLVERSION_TLSv1, /* TLS 1.x */ + CURL_SSLVERSION_SSLv2, + CURL_SSLVERSION_SSLv3, + CURL_SSLVERSION_TLSv1_0, + CURL_SSLVERSION_TLSv1_1, + CURL_SSLVERSION_TLSv1_2, + CURL_SSLVERSION_TLSv1_3, + + CURL_SSLVERSION_LAST /* never use, keep last */ +}; + +enum { + CURL_SSLVERSION_MAX_NONE = 0, + CURL_SSLVERSION_MAX_DEFAULT = (CURL_SSLVERSION_TLSv1 << 16), + CURL_SSLVERSION_MAX_TLSv1_0 = (CURL_SSLVERSION_TLSv1_0 << 16), + CURL_SSLVERSION_MAX_TLSv1_1 = (CURL_SSLVERSION_TLSv1_1 << 16), + CURL_SSLVERSION_MAX_TLSv1_2 = (CURL_SSLVERSION_TLSv1_2 << 16), + CURL_SSLVERSION_MAX_TLSv1_3 = (CURL_SSLVERSION_TLSv1_3 << 16), + + /* never use, keep last */ + CURL_SSLVERSION_MAX_LAST = (CURL_SSLVERSION_LAST << 16) +}; + +enum CURL_TLSAUTH { + CURL_TLSAUTH_NONE, + CURL_TLSAUTH_SRP, + CURL_TLSAUTH_LAST /* never use, keep last */ +}; + +/* symbols to use with CURLOPT_POSTREDIR. + CURL_REDIR_POST_301, CURL_REDIR_POST_302 and CURL_REDIR_POST_303 + can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_302 + | CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */ + +#define CURL_REDIR_GET_ALL 0 +#define CURL_REDIR_POST_301 1 +#define CURL_REDIR_POST_302 2 +#define CURL_REDIR_POST_303 4 +#define CURL_REDIR_POST_ALL \ + (CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303) + +typedef enum { + CURL_TIMECOND_NONE, + + CURL_TIMECOND_IFMODSINCE, + CURL_TIMECOND_IFUNMODSINCE, + CURL_TIMECOND_LASTMOD, + + CURL_TIMECOND_LAST +} curl_TimeCond; + +/* Special size_t value signaling a null-terminated string. */ +#define CURL_ZERO_TERMINATED ((size_t) -1) + +/* curl_strequal() and curl_strnequal() are subject for removal in a future + release */ +CURL_EXTERN int curl_strequal(const char *s1, const char *s2); +CURL_EXTERN int curl_strnequal(const char *s1, const char *s2, size_t n); + +/* Mime/form handling support. */ +typedef struct curl_mime curl_mime; /* Mime context. */ +typedef struct curl_mimepart curl_mimepart; /* Mime part context. */ + +/* CURLMIMEOPT_ defines are for the CURLOPT_MIME_OPTIONS option. */ +#define CURLMIMEOPT_FORMESCAPE (1<<0) /* Use backslash-escaping for forms. */ + +/* + * NAME curl_mime_init() + * + * DESCRIPTION + * + * Create a mime context and return its handle. The easy parameter is the + * target handle. + */ +CURL_EXTERN curl_mime *curl_mime_init(CURL *easy); + +/* + * NAME curl_mime_free() + * + * DESCRIPTION + * + * release a mime handle and its substructures. + */ +CURL_EXTERN void curl_mime_free(curl_mime *mime); + +/* + * NAME curl_mime_addpart() + * + * DESCRIPTION + * + * Append a new empty part to the given mime context and return a handle to + * the created part. + */ +CURL_EXTERN curl_mimepart *curl_mime_addpart(curl_mime *mime); + +/* + * NAME curl_mime_name() + * + * DESCRIPTION + * + * Set mime/form part name. + */ +CURL_EXTERN CURLcode curl_mime_name(curl_mimepart *part, const char *name); + +/* + * NAME curl_mime_filename() + * + * DESCRIPTION + * + * Set mime part remote file name. + */ +CURL_EXTERN CURLcode curl_mime_filename(curl_mimepart *part, + const char *filename); + +/* + * NAME curl_mime_type() + * + * DESCRIPTION + * + * Set mime part type. + */ +CURL_EXTERN CURLcode curl_mime_type(curl_mimepart *part, const char *mimetype); + +/* + * NAME curl_mime_encoder() + * + * DESCRIPTION + * + * Set mime data transfer encoder. + */ +CURL_EXTERN CURLcode curl_mime_encoder(curl_mimepart *part, + const char *encoding); + +/* + * NAME curl_mime_data() + * + * DESCRIPTION + * + * Set mime part data source from memory data, + */ +CURL_EXTERN CURLcode curl_mime_data(curl_mimepart *part, + const char *data, size_t datasize); + +/* + * NAME curl_mime_filedata() + * + * DESCRIPTION + * + * Set mime part data source from named file. + */ +CURL_EXTERN CURLcode curl_mime_filedata(curl_mimepart *part, + const char *filename); + +/* + * NAME curl_mime_data_cb() + * + * DESCRIPTION + * + * Set mime part data source from callback function. + */ +CURL_EXTERN CURLcode curl_mime_data_cb(curl_mimepart *part, + curl_off_t datasize, + curl_read_callback readfunc, + curl_seek_callback seekfunc, + curl_free_callback freefunc, + void *arg); + +/* + * NAME curl_mime_subparts() + * + * DESCRIPTION + * + * Set mime part data source from subparts. + */ +CURL_EXTERN CURLcode curl_mime_subparts(curl_mimepart *part, + curl_mime *subparts); +/* + * NAME curl_mime_headers() + * + * DESCRIPTION + * + * Set mime part headers. + */ +CURL_EXTERN CURLcode curl_mime_headers(curl_mimepart *part, + struct curl_slist *headers, + int take_ownership); + +typedef enum { + CURLFORM_NOTHING, /********* the first one is unused ************/ + CURLFORM_COPYNAME, + CURLFORM_PTRNAME, + CURLFORM_NAMELENGTH, + CURLFORM_COPYCONTENTS, + CURLFORM_PTRCONTENTS, + CURLFORM_CONTENTSLENGTH, + CURLFORM_FILECONTENT, + CURLFORM_ARRAY, + CURLFORM_OBSOLETE, + CURLFORM_FILE, + + CURLFORM_BUFFER, + CURLFORM_BUFFERPTR, + CURLFORM_BUFFERLENGTH, + + CURLFORM_CONTENTTYPE, + CURLFORM_CONTENTHEADER, + CURLFORM_FILENAME, + CURLFORM_END, + CURLFORM_OBSOLETE2, + + CURLFORM_STREAM, + CURLFORM_CONTENTLEN, /* added in 7.46.0, provide a curl_off_t length */ + + CURLFORM_LASTENTRY /* the last unused */ +} CURLformoption; + +/* structure to be used as parameter for CURLFORM_ARRAY */ +struct curl_forms { + CURLformoption option; + const char *value; +}; + +/* use this for multipart formpost building */ +/* Returns code for curl_formadd() + * + * Returns: + * CURL_FORMADD_OK on success + * CURL_FORMADD_MEMORY if the FormInfo allocation fails + * CURL_FORMADD_OPTION_TWICE if one option is given twice for one Form + * CURL_FORMADD_NULL if a null pointer was given for a char + * CURL_FORMADD_MEMORY if the allocation of a FormInfo struct failed + * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used + * CURL_FORMADD_INCOMPLETE if the some FormInfo is not complete (or error) + * CURL_FORMADD_MEMORY if a curl_httppost struct cannot be allocated + * CURL_FORMADD_MEMORY if some allocation for string copying failed. + * CURL_FORMADD_ILLEGAL_ARRAY if an illegal option is used in an array + * + ***************************************************************************/ +typedef enum { + CURL_FORMADD_OK, /* first, no error */ + + CURL_FORMADD_MEMORY, + CURL_FORMADD_OPTION_TWICE, + CURL_FORMADD_NULL, + CURL_FORMADD_UNKNOWN_OPTION, + CURL_FORMADD_INCOMPLETE, + CURL_FORMADD_ILLEGAL_ARRAY, + CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */ + + CURL_FORMADD_LAST /* last */ +} CURLFORMcode; + +/* + * NAME curl_formadd() + * + * DESCRIPTION + * + * Pretty advanced function for building multi-part formposts. Each invoke + * adds one part that together construct a full post. Then use + * CURLOPT_HTTPPOST to send it off to libcurl. + */ +CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost, + struct curl_httppost **last_post, + ...); + +/* + * callback function for curl_formget() + * The void *arg pointer will be the one passed as second argument to + * curl_formget(). + * The character buffer passed to it must not be freed. + * Should return the buffer length passed to it as the argument "len" on + * success. + */ +typedef size_t (*curl_formget_callback)(void *arg, const char *buf, + size_t len); + +/* + * NAME curl_formget() + * + * DESCRIPTION + * + * Serialize a curl_httppost struct built with curl_formadd(). + * Accepts a void pointer as second argument which will be passed to + * the curl_formget_callback function. + * Returns 0 on success. + */ +CURL_EXTERN int curl_formget(struct curl_httppost *form, void *arg, + curl_formget_callback append); +/* + * NAME curl_formfree() + * + * DESCRIPTION + * + * Free a multipart formpost previously built with curl_formadd(). + */ +CURL_EXTERN void curl_formfree(struct curl_httppost *form); + +/* + * NAME curl_getenv() + * + * DESCRIPTION + * + * Returns a malloc()'ed string that MUST be curl_free()ed after usage is + * complete. DEPRECATED - see lib/README.curlx + */ +CURL_EXTERN char *curl_getenv(const char *variable); + +/* + * NAME curl_version() + * + * DESCRIPTION + * + * Returns a static ascii string of the libcurl version. + */ +CURL_EXTERN char *curl_version(void); + +/* + * NAME curl_easy_escape() + * + * DESCRIPTION + * + * Escapes URL strings (converts all letters consider illegal in URLs to their + * %XX versions). This function returns a new allocated string or NULL if an + * error occurred. + */ +CURL_EXTERN char *curl_easy_escape(CURL *handle, + const char *string, + int length); + +/* the previous version: */ +CURL_EXTERN char *curl_escape(const char *string, + int length); + + +/* + * NAME curl_easy_unescape() + * + * DESCRIPTION + * + * Unescapes URL encoding in strings (converts all %XX codes to their 8bit + * versions). This function returns a new allocated string or NULL if an error + * occurred. + * Conversion Note: On non-ASCII platforms the ASCII %XX codes are + * converted into the host encoding. + */ +CURL_EXTERN char *curl_easy_unescape(CURL *handle, + const char *string, + int length, + int *outlength); + +/* the previous version */ +CURL_EXTERN char *curl_unescape(const char *string, + int length); + +/* + * NAME curl_free() + * + * DESCRIPTION + * + * Provided for de-allocation in the same translation unit that did the + * allocation. Added in libcurl 7.10 + */ +CURL_EXTERN void curl_free(void *p); + +/* + * NAME curl_global_init() + * + * DESCRIPTION + * + * curl_global_init() should be invoked exactly once for each application that + * uses libcurl and before any call of other libcurl functions. + + * This function is thread-safe if CURL_VERSION_THREADSAFE is set in the + * curl_version_info_data.features flag (fetch by curl_version_info()). + + */ +CURL_EXTERN CURLcode curl_global_init(long flags); + +/* + * NAME curl_global_init_mem() + * + * DESCRIPTION + * + * curl_global_init() or curl_global_init_mem() should be invoked exactly once + * for each application that uses libcurl. This function can be used to + * initialize libcurl and set user defined memory management callback + * functions. Users can implement memory management routines to check for + * memory leaks, check for mis-use of the curl library etc. User registered + * callback routines will be invoked by this library instead of the system + * memory management routines like malloc, free etc. + */ +CURL_EXTERN CURLcode curl_global_init_mem(long flags, + curl_malloc_callback m, + curl_free_callback f, + curl_realloc_callback r, + curl_strdup_callback s, + curl_calloc_callback c); + +/* + * NAME curl_global_cleanup() + * + * DESCRIPTION + * + * curl_global_cleanup() should be invoked exactly once for each application + * that uses libcurl + */ +CURL_EXTERN void curl_global_cleanup(void); + +/* linked-list structure for the CURLOPT_QUOTE option (and other) */ +struct curl_slist { + char *data; + struct curl_slist *next; +}; + +/* + * NAME curl_global_sslset() + * + * DESCRIPTION + * + * When built with multiple SSL backends, curl_global_sslset() allows to + * choose one. This function can only be called once, and it must be called + * *before* curl_global_init(). + * + * The backend can be identified by the id (e.g. CURLSSLBACKEND_OPENSSL). The + * backend can also be specified via the name parameter (passing -1 as id). + * If both id and name are specified, the name will be ignored. If neither id + * nor name are specified, the function will fail with + * CURLSSLSET_UNKNOWN_BACKEND and set the "avail" pointer to the + * NULL-terminated list of available backends. + * + * Upon success, the function returns CURLSSLSET_OK. + * + * If the specified SSL backend is not available, the function returns + * CURLSSLSET_UNKNOWN_BACKEND and sets the "avail" pointer to a NULL-terminated + * list of available SSL backends. + * + * The SSL backend can be set only once. If it has already been set, a + * subsequent attempt to change it will result in a CURLSSLSET_TOO_LATE. + */ + +struct curl_ssl_backend { + curl_sslbackend id; + const char *name; +}; +typedef struct curl_ssl_backend curl_ssl_backend; + +typedef enum { + CURLSSLSET_OK = 0, + CURLSSLSET_UNKNOWN_BACKEND, + CURLSSLSET_TOO_LATE, + CURLSSLSET_NO_BACKENDS /* libcurl was built without any SSL support */ +} CURLsslset; + +CURL_EXTERN CURLsslset curl_global_sslset(curl_sslbackend id, const char *name, + const curl_ssl_backend ***avail); + +/* + * NAME curl_slist_append() + * + * DESCRIPTION + * + * Appends a string to a linked list. If no list exists, it will be created + * first. Returns the new list, after appending. + */ +CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *, + const char *); + +/* + * NAME curl_slist_free_all() + * + * DESCRIPTION + * + * free a previously built curl_slist. + */ +CURL_EXTERN void curl_slist_free_all(struct curl_slist *); + +/* + * NAME curl_getdate() + * + * DESCRIPTION + * + * Returns the time, in seconds since 1 Jan 1970 of the time string given in + * the first argument. The time argument in the second parameter is unused + * and should be set to NULL. + */ +CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused); + +/* info about the certificate chain, only for OpenSSL, GnuTLS, Schannel, NSS + and GSKit builds. Asked for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */ +struct curl_certinfo { + int num_of_certs; /* number of certificates with information */ + struct curl_slist **certinfo; /* for each index in this array, there's a + linked list with textual information in the + format "name: value" */ +}; + +/* Information about the SSL library used and the respective internal SSL + handle, which can be used to obtain further information regarding the + connection. Asked for with CURLINFO_TLS_SSL_PTR or CURLINFO_TLS_SESSION. */ +struct curl_tlssessioninfo { + curl_sslbackend backend; + void *internals; +}; + +#define CURLINFO_STRING 0x100000 +#define CURLINFO_LONG 0x200000 +#define CURLINFO_DOUBLE 0x300000 +#define CURLINFO_SLIST 0x400000 +#define CURLINFO_PTR 0x400000 /* same as SLIST */ +#define CURLINFO_SOCKET 0x500000 +#define CURLINFO_OFF_T 0x600000 +#define CURLINFO_MASK 0x0fffff +#define CURLINFO_TYPEMASK 0xf00000 + +typedef enum { + CURLINFO_NONE, /* first, never use this */ + CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1, + CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2, + CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3, + CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4, + CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5, + CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6, + CURLINFO_SIZE_UPLOAD = CURLINFO_DOUBLE + 7, + CURLINFO_SIZE_UPLOAD_T = CURLINFO_OFF_T + 7, + CURLINFO_SIZE_DOWNLOAD = CURLINFO_DOUBLE + 8, + CURLINFO_SIZE_DOWNLOAD_T = CURLINFO_OFF_T + 8, + CURLINFO_SPEED_DOWNLOAD = CURLINFO_DOUBLE + 9, + CURLINFO_SPEED_DOWNLOAD_T = CURLINFO_OFF_T + 9, + CURLINFO_SPEED_UPLOAD = CURLINFO_DOUBLE + 10, + CURLINFO_SPEED_UPLOAD_T = CURLINFO_OFF_T + 10, + CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11, + CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12, + CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13, + CURLINFO_FILETIME = CURLINFO_LONG + 14, + CURLINFO_FILETIME_T = CURLINFO_OFF_T + 14, + CURLINFO_CONTENT_LENGTH_DOWNLOAD = CURLINFO_DOUBLE + 15, + CURLINFO_CONTENT_LENGTH_DOWNLOAD_T = CURLINFO_OFF_T + 15, + CURLINFO_CONTENT_LENGTH_UPLOAD = CURLINFO_DOUBLE + 16, + CURLINFO_CONTENT_LENGTH_UPLOAD_T = CURLINFO_OFF_T + 16, + CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17, + CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18, + CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19, + CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20, + CURLINFO_PRIVATE = CURLINFO_STRING + 21, + CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22, + CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23, + CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24, + CURLINFO_OS_ERRNO = CURLINFO_LONG + 25, + CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26, + CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27, + CURLINFO_COOKIELIST = CURLINFO_SLIST + 28, + CURLINFO_LASTSOCKET = CURLINFO_LONG + 29, + CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30, + CURLINFO_REDIRECT_URL = CURLINFO_STRING + 31, + CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32, + CURLINFO_APPCONNECT_TIME = CURLINFO_DOUBLE + 33, + CURLINFO_CERTINFO = CURLINFO_PTR + 34, + CURLINFO_CONDITION_UNMET = CURLINFO_LONG + 35, + CURLINFO_RTSP_SESSION_ID = CURLINFO_STRING + 36, + CURLINFO_RTSP_CLIENT_CSEQ = CURLINFO_LONG + 37, + CURLINFO_RTSP_SERVER_CSEQ = CURLINFO_LONG + 38, + CURLINFO_RTSP_CSEQ_RECV = CURLINFO_LONG + 39, + CURLINFO_PRIMARY_PORT = CURLINFO_LONG + 40, + CURLINFO_LOCAL_IP = CURLINFO_STRING + 41, + CURLINFO_LOCAL_PORT = CURLINFO_LONG + 42, + CURLINFO_TLS_SESSION = CURLINFO_PTR + 43, + CURLINFO_ACTIVESOCKET = CURLINFO_SOCKET + 44, + CURLINFO_TLS_SSL_PTR = CURLINFO_PTR + 45, + CURLINFO_HTTP_VERSION = CURLINFO_LONG + 46, + CURLINFO_PROXY_SSL_VERIFYRESULT = CURLINFO_LONG + 47, + CURLINFO_PROTOCOL = CURLINFO_LONG + 48, + CURLINFO_SCHEME = CURLINFO_STRING + 49, + CURLINFO_TOTAL_TIME_T = CURLINFO_OFF_T + 50, + CURLINFO_NAMELOOKUP_TIME_T = CURLINFO_OFF_T + 51, + CURLINFO_CONNECT_TIME_T = CURLINFO_OFF_T + 52, + CURLINFO_PRETRANSFER_TIME_T = CURLINFO_OFF_T + 53, + CURLINFO_STARTTRANSFER_TIME_T = CURLINFO_OFF_T + 54, + CURLINFO_REDIRECT_TIME_T = CURLINFO_OFF_T + 55, + CURLINFO_APPCONNECT_TIME_T = CURLINFO_OFF_T + 56, + CURLINFO_RETRY_AFTER = CURLINFO_OFF_T + 57, + CURLINFO_EFFECTIVE_METHOD = CURLINFO_STRING + 58, + CURLINFO_PROXY_ERROR = CURLINFO_LONG + 59, + CURLINFO_REFERER = CURLINFO_STRING + 60, + CURLINFO_CAINFO = CURLINFO_STRING + 61, + CURLINFO_CAPATH = CURLINFO_STRING + 62, + CURLINFO_LASTONE = 62 +} CURLINFO; + +/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as + CURLINFO_HTTP_CODE */ +#define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE + +typedef enum { + CURLCLOSEPOLICY_NONE, /* first, never use this */ + + CURLCLOSEPOLICY_OLDEST, + CURLCLOSEPOLICY_LEAST_RECENTLY_USED, + CURLCLOSEPOLICY_LEAST_TRAFFIC, + CURLCLOSEPOLICY_SLOWEST, + CURLCLOSEPOLICY_CALLBACK, + + CURLCLOSEPOLICY_LAST /* last, never use this */ +} curl_closepolicy; + +#define CURL_GLOBAL_SSL (1<<0) /* no purpose since 7.57.0 */ +#define CURL_GLOBAL_WIN32 (1<<1) +#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32) +#define CURL_GLOBAL_NOTHING 0 +#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL +#define CURL_GLOBAL_ACK_EINTR (1<<2) + + +/***************************************************************************** + * Setup defines, protos etc for the sharing stuff. + */ + +/* Different data locks for a single share */ +typedef enum { + CURL_LOCK_DATA_NONE = 0, + /* CURL_LOCK_DATA_SHARE is used internally to say that + * the locking is just made to change the internal state of the share + * itself. + */ + CURL_LOCK_DATA_SHARE, + CURL_LOCK_DATA_COOKIE, + CURL_LOCK_DATA_DNS, + CURL_LOCK_DATA_SSL_SESSION, + CURL_LOCK_DATA_CONNECT, + CURL_LOCK_DATA_PSL, + CURL_LOCK_DATA_LAST +} curl_lock_data; + +/* Different lock access types */ +typedef enum { + CURL_LOCK_ACCESS_NONE = 0, /* unspecified action */ + CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */ + CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */ + CURL_LOCK_ACCESS_LAST /* never use */ +} curl_lock_access; + +typedef void (*curl_lock_function)(CURL *handle, + curl_lock_data data, + curl_lock_access locktype, + void *userptr); +typedef void (*curl_unlock_function)(CURL *handle, + curl_lock_data data, + void *userptr); + + +typedef enum { + CURLSHE_OK, /* all is fine */ + CURLSHE_BAD_OPTION, /* 1 */ + CURLSHE_IN_USE, /* 2 */ + CURLSHE_INVALID, /* 3 */ + CURLSHE_NOMEM, /* 4 out of memory */ + CURLSHE_NOT_BUILT_IN, /* 5 feature not present in lib */ + CURLSHE_LAST /* never use */ +} CURLSHcode; + +typedef enum { + CURLSHOPT_NONE, /* don't use */ + CURLSHOPT_SHARE, /* specify a data type to share */ + CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */ + CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */ + CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */ + CURLSHOPT_USERDATA, /* pass in a user data pointer used in the lock/unlock + callback functions */ + CURLSHOPT_LAST /* never use */ +} CURLSHoption; + +CURL_EXTERN CURLSH *curl_share_init(void); +CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *, CURLSHoption option, ...); +CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *); + +/**************************************************************************** + * Structures for querying information about the curl library at runtime. + */ + +typedef enum { + CURLVERSION_FIRST, + CURLVERSION_SECOND, + CURLVERSION_THIRD, + CURLVERSION_FOURTH, + CURLVERSION_FIFTH, + CURLVERSION_SIXTH, + CURLVERSION_SEVENTH, + CURLVERSION_EIGHTH, + CURLVERSION_NINTH, + CURLVERSION_TENTH, + CURLVERSION_LAST /* never actually use this */ +} CURLversion; + +/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by + basically all programs ever that want to get version information. It is + meant to be a built-in version number for what kind of struct the caller + expects. If the struct ever changes, we redefine the NOW to another enum + from above. */ +#define CURLVERSION_NOW CURLVERSION_TENTH + +struct curl_version_info_data { + CURLversion age; /* age of the returned struct */ + const char *version; /* LIBCURL_VERSION */ + unsigned int version_num; /* LIBCURL_VERSION_NUM */ + const char *host; /* OS/host/cpu/machine when configured */ + int features; /* bitmask, see defines below */ + const char *ssl_version; /* human readable string */ + long ssl_version_num; /* not used anymore, always 0 */ + const char *libz_version; /* human readable string */ + /* protocols is terminated by an entry with a NULL protoname */ + const char * const *protocols; + + /* The fields below this were added in CURLVERSION_SECOND */ + const char *ares; + int ares_num; + + /* This field was added in CURLVERSION_THIRD */ + const char *libidn; + + /* These field were added in CURLVERSION_FOURTH */ + + /* Same as '_libiconv_version' if built with HAVE_ICONV */ + int iconv_ver_num; + + const char *libssh_version; /* human readable string */ + + /* These fields were added in CURLVERSION_FIFTH */ + unsigned int brotli_ver_num; /* Numeric Brotli version + (MAJOR << 24) | (MINOR << 12) | PATCH */ + const char *brotli_version; /* human readable string. */ + + /* These fields were added in CURLVERSION_SIXTH */ + unsigned int nghttp2_ver_num; /* Numeric nghttp2 version + (MAJOR << 16) | (MINOR << 8) | PATCH */ + const char *nghttp2_version; /* human readable string. */ + const char *quic_version; /* human readable quic (+ HTTP/3) library + + version or NULL */ + + /* These fields were added in CURLVERSION_SEVENTH */ + const char *cainfo; /* the built-in default CURLOPT_CAINFO, might + be NULL */ + const char *capath; /* the built-in default CURLOPT_CAPATH, might + be NULL */ + + /* These fields were added in CURLVERSION_EIGHTH */ + unsigned int zstd_ver_num; /* Numeric Zstd version + (MAJOR << 24) | (MINOR << 12) | PATCH */ + const char *zstd_version; /* human readable string. */ + + /* These fields were added in CURLVERSION_NINTH */ + const char *hyper_version; /* human readable string. */ + + /* These fields were added in CURLVERSION_TENTH */ + const char *gsasl_version; /* human readable string. */ +}; +typedef struct curl_version_info_data curl_version_info_data; + +#define CURL_VERSION_IPV6 (1<<0) /* IPv6-enabled */ +#define CURL_VERSION_KERBEROS4 (1<<1) /* Kerberos V4 auth is supported + (deprecated) */ +#define CURL_VERSION_SSL (1<<2) /* SSL options are present */ +#define CURL_VERSION_LIBZ (1<<3) /* libz features are present */ +#define CURL_VERSION_NTLM (1<<4) /* NTLM auth is supported */ +#define CURL_VERSION_GSSNEGOTIATE (1<<5) /* Negotiate auth is supported + (deprecated) */ +#define CURL_VERSION_DEBUG (1<<6) /* Built with debug capabilities */ +#define CURL_VERSION_ASYNCHDNS (1<<7) /* Asynchronous DNS resolves */ +#define CURL_VERSION_SPNEGO (1<<8) /* SPNEGO auth is supported */ +#define CURL_VERSION_LARGEFILE (1<<9) /* Supports files larger than 2GB */ +#define CURL_VERSION_IDN (1<<10) /* Internationized Domain Names are + supported */ +#define CURL_VERSION_SSPI (1<<11) /* Built against Windows SSPI */ +#define CURL_VERSION_CONV (1<<12) /* Character conversions supported */ +#define CURL_VERSION_CURLDEBUG (1<<13) /* Debug memory tracking supported */ +#define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */ +#define CURL_VERSION_NTLM_WB (1<<15) /* NTLM delegation to winbind helper + is supported */ +#define CURL_VERSION_HTTP2 (1<<16) /* HTTP2 support built-in */ +#define CURL_VERSION_GSSAPI (1<<17) /* Built against a GSS-API library */ +#define CURL_VERSION_KERBEROS5 (1<<18) /* Kerberos V5 auth is supported */ +#define CURL_VERSION_UNIX_SOCKETS (1<<19) /* Unix domain sockets support */ +#define CURL_VERSION_PSL (1<<20) /* Mozilla's Public Suffix List, used + for cookie domain verification */ +#define CURL_VERSION_HTTPS_PROXY (1<<21) /* HTTPS-proxy support built-in */ +#define CURL_VERSION_MULTI_SSL (1<<22) /* Multiple SSL backends available */ +#define CURL_VERSION_BROTLI (1<<23) /* Brotli features are present. */ +#define CURL_VERSION_ALTSVC (1<<24) /* Alt-Svc handling built-in */ +#define CURL_VERSION_HTTP3 (1<<25) /* HTTP3 support built-in */ +#define CURL_VERSION_ZSTD (1<<26) /* zstd features are present */ +#define CURL_VERSION_UNICODE (1<<27) /* Unicode support on Windows */ +#define CURL_VERSION_HSTS (1<<28) /* HSTS is supported */ +#define CURL_VERSION_GSASL (1<<29) /* libgsasl is supported */ +#define CURL_VERSION_THREADSAFE (1<<30) /* libcurl API is thread-safe */ + + /* + * NAME curl_version_info() + * + * DESCRIPTION + * + * This function returns a pointer to a static copy of the version info + * struct. See above. + */ +CURL_EXTERN curl_version_info_data *curl_version_info(CURLversion); + +/* + * NAME curl_easy_strerror() + * + * DESCRIPTION + * + * The curl_easy_strerror function may be used to turn a CURLcode value + * into the equivalent human readable error string. This is useful + * for printing meaningful error messages. + */ +CURL_EXTERN const char *curl_easy_strerror(CURLcode); + +/* + * NAME curl_share_strerror() + * + * DESCRIPTION + * + * The curl_share_strerror function may be used to turn a CURLSHcode value + * into the equivalent human readable error string. This is useful + * for printing meaningful error messages. + */ +CURL_EXTERN const char *curl_share_strerror(CURLSHcode); + +/* + * NAME curl_easy_pause() + * + * DESCRIPTION + * + * The curl_easy_pause function pauses or unpauses transfers. Select the new + * state by setting the bitmask, use the convenience defines below. + * + */ +CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask); + +#define CURLPAUSE_RECV (1<<0) +#define CURLPAUSE_RECV_CONT (0) + +#define CURLPAUSE_SEND (1<<2) +#define CURLPAUSE_SEND_CONT (0) + +#define CURLPAUSE_ALL (CURLPAUSE_RECV|CURLPAUSE_SEND) +#define CURLPAUSE_CONT (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT) + +#ifdef __cplusplus +} +#endif + +/* unfortunately, the easy.h and multi.h include files need options and info + stuff before they can be included! */ +#include "easy.h" /* nothing in curl is fun without the easy stuff */ +#include "multi.h" +#include "urlapi.h" +#include "options.h" +#include "header.h" +#include "websockets.h" + +/* the typechecker doesn't work in C++ (yet) */ +#if defined(__GNUC__) && defined(__GNUC_MINOR__) && \ + ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \ + !defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK) +#include "typecheck-gcc.h" +#else +#if defined(__STDC__) && (__STDC__ >= 1) +/* This preprocessor magic that replaces a call with the exact same call is + only done to make sure application authors pass exactly three arguments + to these functions. */ +#define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param) +#define curl_easy_getinfo(handle,info,arg) curl_easy_getinfo(handle,info,arg) +#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param) +#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param) +#endif /* __STDC__ >= 1 */ +#endif /* gcc >= 4.3 && !__cplusplus */ + +#endif /* CURLINC_CURL_H */ diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/curlver.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/curlver.h new file mode 100644 index 0000000..5b5a238 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/curlver.h @@ -0,0 +1,79 @@ +#ifndef CURLINC_CURLVER_H +#define CURLINC_CURLVER_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2022, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at https://curl.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * SPDX-License-Identifier: curl + * + ***************************************************************************/ + +/* This header file contains nothing but libcurl version info, generated by + a script at release-time. This was made its own header file in 7.11.2 */ + +/* This is the global package copyright */ +#define LIBCURL_COPYRIGHT "1996 - 2022 Daniel Stenberg, ." + +/* This is the version number of the libcurl package from which this header + file origins: */ +#define LIBCURL_VERSION "7.86.0-DEV" + +/* The numeric version number is also available "in parts" by using these + defines: */ +#define LIBCURL_VERSION_MAJOR 7 +#define LIBCURL_VERSION_MINOR 86 +#define LIBCURL_VERSION_PATCH 0 + +/* This is the numeric version of the libcurl version number, meant for easier + parsing and comparisons by programs. The LIBCURL_VERSION_NUM define will + always follow this syntax: + + 0xXXYYZZ + + Where XX, YY and ZZ are the main version, release and patch numbers in + hexadecimal (using 8 bits each). All three numbers are always represented + using two digits. 1.2 would appear as "0x010200" while version 9.11.7 + appears as "0x090b07". + + This 6-digit (24 bits) hexadecimal number does not show pre-release number, + and it is always a greater number in a more recent release. It makes + comparisons with greater than and less than work. + + Note: This define is the full hex number and _does not_ use the + CURL_VERSION_BITS() macro since curl's own configure script greps for it + and needs it to contain the full number. +*/ +#define LIBCURL_VERSION_NUM 0x075600 + +/* + * This is the date and time when the full source package was created. The + * timestamp is not stored in git, as the timestamp is properly set in the + * tarballs by the maketgz script. + * + * The format of the date follows this template: + * + * "2007-11-23" + */ +#define LIBCURL_TIMESTAMP "[unreleased]" + +#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|(z)) +#define CURL_AT_LEAST_VERSION(x,y,z) \ + (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z)) + +#endif /* CURLINC_CURLVER_H */ diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/easy.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/easy.h new file mode 100644 index 0000000..9c7e63a --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/easy.h @@ -0,0 +1,125 @@ +#ifndef CURLINC_EASY_H +#define CURLINC_EASY_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2022, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at https://curl.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * SPDX-License-Identifier: curl + * + ***************************************************************************/ +#ifdef __cplusplus +extern "C" { +#endif + +/* Flag bits in the curl_blob struct: */ +#define CURL_BLOB_COPY 1 /* tell libcurl to copy the data */ +#define CURL_BLOB_NOCOPY 0 /* tell libcurl to NOT copy the data */ + +struct curl_blob { + void *data; + size_t len; + unsigned int flags; /* bit 0 is defined, the rest are reserved and should be + left zeroes */ +}; + +CURL_EXTERN CURL *curl_easy_init(void); +CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...); +CURL_EXTERN CURLcode curl_easy_perform(CURL *curl); +CURL_EXTERN void curl_easy_cleanup(CURL *curl); + +/* + * NAME curl_easy_getinfo() + * + * DESCRIPTION + * + * Request internal information from the curl session with this function. The + * third argument MUST be a pointer to a long, a pointer to a char * or a + * pointer to a double (as the documentation describes elsewhere). The data + * pointed to will be filled in accordingly and can be relied upon only if the + * function returns CURLE_OK. This function is intended to get used *AFTER* a + * performed transfer, all results from this function are undefined until the + * transfer is completed. + */ +CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...); + + +/* + * NAME curl_easy_duphandle() + * + * DESCRIPTION + * + * Creates a new curl session handle with the same options set for the handle + * passed in. Duplicating a handle could only be a matter of cloning data and + * options, internal state info and things like persistent connections cannot + * be transferred. It is useful in multithreaded applications when you can run + * curl_easy_duphandle() for each new thread to avoid a series of identical + * curl_easy_setopt() invokes in every thread. + */ +CURL_EXTERN CURL *curl_easy_duphandle(CURL *curl); + +/* + * NAME curl_easy_reset() + * + * DESCRIPTION + * + * Re-initializes a CURL handle to the default values. This puts back the + * handle to the same state as it was in when it was just created. + * + * It does keep: live connections, the Session ID cache, the DNS cache and the + * cookies. + */ +CURL_EXTERN void curl_easy_reset(CURL *curl); + +/* + * NAME curl_easy_recv() + * + * DESCRIPTION + * + * Receives data from the connected socket. Use after successful + * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. + */ +CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen, + size_t *n); + +/* + * NAME curl_easy_send() + * + * DESCRIPTION + * + * Sends data over the connected socket. Use after successful + * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. + */ +CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer, + size_t buflen, size_t *n); + + +/* + * NAME curl_easy_upkeep() + * + * DESCRIPTION + * + * Performs connection upkeep for the given session handle. + */ +CURL_EXTERN CURLcode curl_easy_upkeep(CURL *curl); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/header.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/header.h new file mode 100644 index 0000000..1598c6f --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/header.h @@ -0,0 +1,74 @@ +#ifndef CURLINC_HEADER_H +#define CURLINC_HEADER_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 2018 - 2022, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at https://curl.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * SPDX-License-Identifier: curl + * + ***************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif + +struct curl_header { + char *name; /* this might not use the same case */ + char *value; + size_t amount; /* number of headers using this name */ + size_t index; /* ... of this instance, 0 or higher */ + unsigned int origin; /* see bits below */ + void *anchor; /* handle privately used by libcurl */ +}; + +/* 'origin' bits */ +#define CURLH_HEADER (1<<0) /* plain server header */ +#define CURLH_TRAILER (1<<1) /* trailers */ +#define CURLH_CONNECT (1<<2) /* CONNECT headers */ +#define CURLH_1XX (1<<3) /* 1xx headers */ +#define CURLH_PSEUDO (1<<4) /* pseudo headers */ + +typedef enum { + CURLHE_OK, + CURLHE_BADINDEX, /* header exists but not with this index */ + CURLHE_MISSING, /* no such header exists */ + CURLHE_NOHEADERS, /* no headers at all exist (yet) */ + CURLHE_NOREQUEST, /* no request with this number was used */ + CURLHE_OUT_OF_MEMORY, /* out of memory while processing */ + CURLHE_BAD_ARGUMENT, /* a function argument was not okay */ + CURLHE_NOT_BUILT_IN /* if API was disabled in the build */ +} CURLHcode; + +CURL_EXTERN CURLHcode curl_easy_header(CURL *easy, + const char *name, + size_t index, + unsigned int origin, + int request, + struct curl_header **hout); + +CURL_EXTERN struct curl_header *curl_easy_nextheader(CURL *easy, + unsigned int origin, + int request, + struct curl_header *prev); + +#ifdef __cplusplus +} /* end of extern "C" */ +#endif + +#endif /* CURLINC_HEADER_H */ diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/mprintf.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/mprintf.h new file mode 100644 index 0000000..cb948dc --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/mprintf.h @@ -0,0 +1,52 @@ +#ifndef CURLINC_MPRINTF_H +#define CURLINC_MPRINTF_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2022, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at https://curl.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * SPDX-License-Identifier: curl + * + ***************************************************************************/ + +#include +#include /* needed for FILE */ +#include "curl.h" /* for CURL_EXTERN */ + +#ifdef __cplusplus +extern "C" { +#endif + +CURL_EXTERN int curl_mprintf(const char *format, ...); +CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...); +CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...); +CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength, + const char *format, ...); +CURL_EXTERN int curl_mvprintf(const char *format, va_list args); +CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args); +CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args); +CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength, + const char *format, va_list args); +CURL_EXTERN char *curl_maprintf(const char *format, ...); +CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args); + +#ifdef __cplusplus +} +#endif + +#endif /* CURLINC_MPRINTF_H */ diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/multi.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/multi.h new file mode 100644 index 0000000..2f3ec37 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/multi.h @@ -0,0 +1,460 @@ +#ifndef CURLINC_MULTI_H +#define CURLINC_MULTI_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2022, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at https://curl.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * SPDX-License-Identifier: curl + * + ***************************************************************************/ +/* + This is an "external" header file. Don't give away any internals here! + + GOALS + + o Enable a "pull" interface. The application that uses libcurl decides where + and when to ask libcurl to get/send data. + + o Enable multiple simultaneous transfers in the same thread without making it + complicated for the application. + + o Enable the application to select() on its own file descriptors and curl's + file descriptors simultaneous easily. + +*/ + +/* + * This header file should not really need to include "curl.h" since curl.h + * itself includes this file and we expect user applications to do #include + * without the need for especially including multi.h. + * + * For some reason we added this include here at one point, and rather than to + * break existing (wrongly written) libcurl applications, we leave it as-is + * but with this warning attached. + */ +#include "curl.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(BUILDING_LIBCURL) || defined(CURL_STRICTER) +typedef struct Curl_multi CURLM; +#else +typedef void CURLM; +#endif + +typedef enum { + CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or + curl_multi_socket*() soon */ + CURLM_OK, + CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */ + CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */ + CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */ + CURLM_INTERNAL_ERROR, /* this is a libcurl bug */ + CURLM_BAD_SOCKET, /* the passed in socket argument did not match */ + CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */ + CURLM_ADDED_ALREADY, /* an easy handle already added to a multi handle was + attempted to get added - again */ + CURLM_RECURSIVE_API_CALL, /* an api function was called from inside a + callback */ + CURLM_WAKEUP_FAILURE, /* wakeup is unavailable or failed */ + CURLM_BAD_FUNCTION_ARGUMENT, /* function called with a bad parameter */ + CURLM_ABORTED_BY_CALLBACK, + CURLM_UNRECOVERABLE_POLL, + CURLM_LAST +} CURLMcode; + +/* just to make code nicer when using curl_multi_socket() you can now check + for CURLM_CALL_MULTI_SOCKET too in the same style it works for + curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */ +#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM + +/* bitmask bits for CURLMOPT_PIPELINING */ +#define CURLPIPE_NOTHING 0L +#define CURLPIPE_HTTP1 1L +#define CURLPIPE_MULTIPLEX 2L + +typedef enum { + CURLMSG_NONE, /* first, not used */ + CURLMSG_DONE, /* This easy handle has completed. 'result' contains + the CURLcode of the transfer */ + CURLMSG_LAST /* last, not used */ +} CURLMSG; + +struct CURLMsg { + CURLMSG msg; /* what this message means */ + CURL *easy_handle; /* the handle it concerns */ + union { + void *whatever; /* message-specific data */ + CURLcode result; /* return code for transfer */ + } data; +}; +typedef struct CURLMsg CURLMsg; + +/* Based on poll(2) structure and values. + * We don't use pollfd and POLL* constants explicitly + * to cover platforms without poll(). */ +#define CURL_WAIT_POLLIN 0x0001 +#define CURL_WAIT_POLLPRI 0x0002 +#define CURL_WAIT_POLLOUT 0x0004 + +struct curl_waitfd { + curl_socket_t fd; + short events; + short revents; /* not supported yet */ +}; + +/* + * Name: curl_multi_init() + * + * Desc: initialize multi-style curl usage + * + * Returns: a new CURLM handle to use in all 'curl_multi' functions. + */ +CURL_EXTERN CURLM *curl_multi_init(void); + +/* + * Name: curl_multi_add_handle() + * + * Desc: add a standard curl handle to the multi stack + * + * Returns: CURLMcode type, general multi error code. + */ +CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle, + CURL *curl_handle); + + /* + * Name: curl_multi_remove_handle() + * + * Desc: removes a curl handle from the multi stack again + * + * Returns: CURLMcode type, general multi error code. + */ +CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle, + CURL *curl_handle); + + /* + * Name: curl_multi_fdset() + * + * Desc: Ask curl for its fd_set sets. The app can use these to select() or + * poll() on. We want curl_multi_perform() called as soon as one of + * them are ready. + * + * Returns: CURLMcode type, general multi error code. + */ +CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle, + fd_set *read_fd_set, + fd_set *write_fd_set, + fd_set *exc_fd_set, + int *max_fd); + +/* + * Name: curl_multi_wait() + * + * Desc: Poll on all fds within a CURLM set as well as any + * additional fds passed to the function. + * + * Returns: CURLMcode type, general multi error code. + */ +CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle, + struct curl_waitfd extra_fds[], + unsigned int extra_nfds, + int timeout_ms, + int *ret); + +/* + * Name: curl_multi_poll() + * + * Desc: Poll on all fds within a CURLM set as well as any + * additional fds passed to the function. + * + * Returns: CURLMcode type, general multi error code. + */ +CURL_EXTERN CURLMcode curl_multi_poll(CURLM *multi_handle, + struct curl_waitfd extra_fds[], + unsigned int extra_nfds, + int timeout_ms, + int *ret); + +/* + * Name: curl_multi_wakeup() + * + * Desc: wakes up a sleeping curl_multi_poll call. + * + * Returns: CURLMcode type, general multi error code. + */ +CURL_EXTERN CURLMcode curl_multi_wakeup(CURLM *multi_handle); + + /* + * Name: curl_multi_perform() + * + * Desc: When the app thinks there's data available for curl it calls this + * function to read/write whatever there is right now. This returns + * as soon as the reads and writes are done. This function does not + * require that there actually is data available for reading or that + * data can be written, it can be called just in case. It returns + * the number of handles that still transfer data in the second + * argument's integer-pointer. + * + * Returns: CURLMcode type, general multi error code. *NOTE* that this only + * returns errors etc regarding the whole multi stack. There might + * still have occurred problems on individual transfers even when + * this returns OK. + */ +CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle, + int *running_handles); + + /* + * Name: curl_multi_cleanup() + * + * Desc: Cleans up and removes a whole multi stack. It does not free or + * touch any individual easy handles in any way. We need to define + * in what state those handles will be if this function is called + * in the middle of a transfer. + * + * Returns: CURLMcode type, general multi error code. + */ +CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle); + +/* + * Name: curl_multi_info_read() + * + * Desc: Ask the multi handle if there's any messages/informationals from + * the individual transfers. Messages include informationals such as + * error code from the transfer or just the fact that a transfer is + * completed. More details on these should be written down as well. + * + * Repeated calls to this function will return a new struct each + * time, until a special "end of msgs" struct is returned as a signal + * that there is no more to get at this point. + * + * The data the returned pointer points to will not survive calling + * curl_multi_cleanup(). + * + * The 'CURLMsg' struct is meant to be very simple and only contain + * very basic information. If more involved information is wanted, + * we will provide the particular "transfer handle" in that struct + * and that should/could/would be used in subsequent + * curl_easy_getinfo() calls (or similar). The point being that we + * must never expose complex structs to applications, as then we'll + * undoubtably get backwards compatibility problems in the future. + * + * Returns: A pointer to a filled-in struct, or NULL if it failed or ran out + * of structs. It also writes the number of messages left in the + * queue (after this read) in the integer the second argument points + * to. + */ +CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle, + int *msgs_in_queue); + +/* + * Name: curl_multi_strerror() + * + * Desc: The curl_multi_strerror function may be used to turn a CURLMcode + * value into the equivalent human readable error string. This is + * useful for printing meaningful error messages. + * + * Returns: A pointer to a null-terminated error message. + */ +CURL_EXTERN const char *curl_multi_strerror(CURLMcode); + +/* + * Name: curl_multi_socket() and + * curl_multi_socket_all() + * + * Desc: An alternative version of curl_multi_perform() that allows the + * application to pass in one of the file descriptors that have been + * detected to have "action" on them and let libcurl perform. + * See man page for details. + */ +#define CURL_POLL_NONE 0 +#define CURL_POLL_IN 1 +#define CURL_POLL_OUT 2 +#define CURL_POLL_INOUT 3 +#define CURL_POLL_REMOVE 4 + +#define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD + +#define CURL_CSELECT_IN 0x01 +#define CURL_CSELECT_OUT 0x02 +#define CURL_CSELECT_ERR 0x04 + +typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */ + curl_socket_t s, /* socket */ + int what, /* see above */ + void *userp, /* private callback + pointer */ + void *socketp); /* private socket + pointer */ +/* + * Name: curl_multi_timer_callback + * + * Desc: Called by libcurl whenever the library detects a change in the + * maximum number of milliseconds the app is allowed to wait before + * curl_multi_socket() or curl_multi_perform() must be called + * (to allow libcurl's timed events to take place). + * + * Returns: The callback should return zero. + */ +typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */ + long timeout_ms, /* see above */ + void *userp); /* private callback + pointer */ + +CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s, + int *running_handles); + +CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle, + curl_socket_t s, + int ev_bitmask, + int *running_handles); + +CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle, + int *running_handles); + +#ifndef CURL_ALLOW_OLD_MULTI_SOCKET +/* This macro below was added in 7.16.3 to push users who recompile to use + the new curl_multi_socket_action() instead of the old curl_multi_socket() +*/ +#define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z) +#endif + +/* + * Name: curl_multi_timeout() + * + * Desc: Returns the maximum number of milliseconds the app is allowed to + * wait before curl_multi_socket() or curl_multi_perform() must be + * called (to allow libcurl's timed events to take place). + * + * Returns: CURLM error code. + */ +CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle, + long *milliseconds); + +typedef enum { + /* This is the socket callback function pointer */ + CURLOPT(CURLMOPT_SOCKETFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 1), + + /* This is the argument passed to the socket callback */ + CURLOPT(CURLMOPT_SOCKETDATA, CURLOPTTYPE_OBJECTPOINT, 2), + + /* set to 1 to enable pipelining for this multi handle */ + CURLOPT(CURLMOPT_PIPELINING, CURLOPTTYPE_LONG, 3), + + /* This is the timer callback function pointer */ + CURLOPT(CURLMOPT_TIMERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 4), + + /* This is the argument passed to the timer callback */ + CURLOPT(CURLMOPT_TIMERDATA, CURLOPTTYPE_OBJECTPOINT, 5), + + /* maximum number of entries in the connection cache */ + CURLOPT(CURLMOPT_MAXCONNECTS, CURLOPTTYPE_LONG, 6), + + /* maximum number of (pipelining) connections to one host */ + CURLOPT(CURLMOPT_MAX_HOST_CONNECTIONS, CURLOPTTYPE_LONG, 7), + + /* maximum number of requests in a pipeline */ + CURLOPT(CURLMOPT_MAX_PIPELINE_LENGTH, CURLOPTTYPE_LONG, 8), + + /* a connection with a content-length longer than this + will not be considered for pipelining */ + CURLOPT(CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE, CURLOPTTYPE_OFF_T, 9), + + /* a connection with a chunk length longer than this + will not be considered for pipelining */ + CURLOPT(CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE, CURLOPTTYPE_OFF_T, 10), + + /* a list of site names(+port) that are blocked from pipelining */ + CURLOPT(CURLMOPT_PIPELINING_SITE_BL, CURLOPTTYPE_OBJECTPOINT, 11), + + /* a list of server types that are blocked from pipelining */ + CURLOPT(CURLMOPT_PIPELINING_SERVER_BL, CURLOPTTYPE_OBJECTPOINT, 12), + + /* maximum number of open connections in total */ + CURLOPT(CURLMOPT_MAX_TOTAL_CONNECTIONS, CURLOPTTYPE_LONG, 13), + + /* This is the server push callback function pointer */ + CURLOPT(CURLMOPT_PUSHFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 14), + + /* This is the argument passed to the server push callback */ + CURLOPT(CURLMOPT_PUSHDATA, CURLOPTTYPE_OBJECTPOINT, 15), + + /* maximum number of concurrent streams to support on a connection */ + CURLOPT(CURLMOPT_MAX_CONCURRENT_STREAMS, CURLOPTTYPE_LONG, 16), + + CURLMOPT_LASTENTRY /* the last unused */ +} CURLMoption; + + +/* + * Name: curl_multi_setopt() + * + * Desc: Sets options for the multi handle. + * + * Returns: CURLM error code. + */ +CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle, + CURLMoption option, ...); + + +/* + * Name: curl_multi_assign() + * + * Desc: This function sets an association in the multi handle between the + * given socket and a private pointer of the application. This is + * (only) useful for curl_multi_socket uses. + * + * Returns: CURLM error code. + */ +CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle, + curl_socket_t sockfd, void *sockp); + + +/* + * Name: curl_push_callback + * + * Desc: This callback gets called when a new stream is being pushed by the + * server. It approves or denies the new stream. It can also decide + * to completely fail the connection. + * + * Returns: CURL_PUSH_OK, CURL_PUSH_DENY or CURL_PUSH_ERROROUT + */ +#define CURL_PUSH_OK 0 +#define CURL_PUSH_DENY 1 +#define CURL_PUSH_ERROROUT 2 /* added in 7.72.0 */ + +struct curl_pushheaders; /* forward declaration only */ + +CURL_EXTERN char *curl_pushheader_bynum(struct curl_pushheaders *h, + size_t num); +CURL_EXTERN char *curl_pushheader_byname(struct curl_pushheaders *h, + const char *name); + +typedef int (*curl_push_callback)(CURL *parent, + CURL *easy, + size_t num_headers, + struct curl_pushheaders *headers, + void *userp); + +#ifdef __cplusplus +} /* end of extern "C" */ +#endif + +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/options.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/options.h new file mode 100644 index 0000000..a792687 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/options.h @@ -0,0 +1,70 @@ +#ifndef CURLINC_OPTIONS_H +#define CURLINC_OPTIONS_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 2018 - 2022, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at https://curl.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * SPDX-License-Identifier: curl + * + ***************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + CURLOT_LONG, /* long (a range of values) */ + CURLOT_VALUES, /* (a defined set or bitmask) */ + CURLOT_OFF_T, /* curl_off_t (a range of values) */ + CURLOT_OBJECT, /* pointer (void *) */ + CURLOT_STRING, /* (char * to null-terminated buffer) */ + CURLOT_SLIST, /* (struct curl_slist *) */ + CURLOT_CBPTR, /* (void * passed as-is to a callback) */ + CURLOT_BLOB, /* blob (struct curl_blob *) */ + CURLOT_FUNCTION /* function pointer */ +} curl_easytype; + +/* Flag bits */ + +/* "alias" means it is provided for old programs to remain functional, + we prefer another name */ +#define CURLOT_FLAG_ALIAS (1<<0) + +/* The CURLOPTTYPE_* id ranges can still be used to figure out what type/size + to use for curl_easy_setopt() for the given id */ +struct curl_easyoption { + const char *name; + CURLoption id; + curl_easytype type; + unsigned int flags; +}; + +CURL_EXTERN const struct curl_easyoption * +curl_easy_option_by_name(const char *name); + +CURL_EXTERN const struct curl_easyoption * +curl_easy_option_by_id(CURLoption id); + +CURL_EXTERN const struct curl_easyoption * +curl_easy_option_next(const struct curl_easyoption *prev); + +#ifdef __cplusplus +} /* end of extern "C" */ +#endif +#endif /* CURLINC_OPTIONS_H */ diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/stdcheaders.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/stdcheaders.h new file mode 100644 index 0000000..82e1b5f --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/stdcheaders.h @@ -0,0 +1,35 @@ +#ifndef CURLINC_STDCHEADERS_H +#define CURLINC_STDCHEADERS_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2022, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at https://curl.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * SPDX-License-Identifier: curl + * + ***************************************************************************/ + +#include + +size_t fread(void *, size_t, size_t, FILE *); +size_t fwrite(const void *, size_t, size_t, FILE *); + +int strcasecmp(const char *, const char *); +int strncasecmp(const char *, const char *, size_t); + +#endif /* CURLINC_STDCHEADERS_H */ diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/system.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/system.h new file mode 100644 index 0000000..8d56b8a --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/system.h @@ -0,0 +1,490 @@ +#ifndef CURLINC_SYSTEM_H +#define CURLINC_SYSTEM_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2022, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at https://curl.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * SPDX-License-Identifier: curl + * + ***************************************************************************/ + +/* + * Try to keep one section per platform, compiler and architecture, otherwise, + * if an existing section is reused for a different one and later on the + * original is adjusted, probably the piggybacking one can be adversely + * changed. + * + * In order to differentiate between platforms/compilers/architectures use + * only compiler built in predefined preprocessor symbols. + * + * curl_off_t + * ---------- + * + * For any given platform/compiler curl_off_t must be typedef'ed to a 64-bit + * wide signed integral data type. The width of this data type must remain + * constant and independent of any possible large file support settings. + * + * As an exception to the above, curl_off_t shall be typedef'ed to a 32-bit + * wide signed integral data type if there is no 64-bit type. + * + * As a general rule, curl_off_t shall not be mapped to off_t. This rule shall + * only be violated if off_t is the only 64-bit data type available and the + * size of off_t is independent of large file support settings. Keep your + * build on the safe side avoiding an off_t gating. If you have a 64-bit + * off_t then take for sure that another 64-bit data type exists, dig deeper + * and you will find it. + * + */ + +#if defined(__DJGPP__) || defined(__GO32__) +# if defined(__DJGPP__) && (__DJGPP__ > 1) +# define CURL_TYPEOF_CURL_OFF_T long long +# define CURL_FORMAT_CURL_OFF_T "lld" +# define CURL_FORMAT_CURL_OFF_TU "llu" +# define CURL_SUFFIX_CURL_OFF_T LL +# define CURL_SUFFIX_CURL_OFF_TU ULL +# else +# define CURL_TYPEOF_CURL_OFF_T long +# define CURL_FORMAT_CURL_OFF_T "ld" +# define CURL_FORMAT_CURL_OFF_TU "lu" +# define CURL_SUFFIX_CURL_OFF_T L +# define CURL_SUFFIX_CURL_OFF_TU UL +# endif +# define CURL_TYPEOF_CURL_SOCKLEN_T int + +#elif defined(__SALFORDC__) +# define CURL_TYPEOF_CURL_OFF_T long +# define CURL_FORMAT_CURL_OFF_T "ld" +# define CURL_FORMAT_CURL_OFF_TU "lu" +# define CURL_SUFFIX_CURL_OFF_T L +# define CURL_SUFFIX_CURL_OFF_TU UL +# define CURL_TYPEOF_CURL_SOCKLEN_T int + +#elif defined(__BORLANDC__) +# if (__BORLANDC__ < 0x520) +# define CURL_TYPEOF_CURL_OFF_T long +# define CURL_FORMAT_CURL_OFF_T "ld" +# define CURL_FORMAT_CURL_OFF_TU "lu" +# define CURL_SUFFIX_CURL_OFF_T L +# define CURL_SUFFIX_CURL_OFF_TU UL +# else +# define CURL_TYPEOF_CURL_OFF_T __int64 +# define CURL_FORMAT_CURL_OFF_T "I64d" +# define CURL_FORMAT_CURL_OFF_TU "I64u" +# define CURL_SUFFIX_CURL_OFF_T i64 +# define CURL_SUFFIX_CURL_OFF_TU ui64 +# endif +# define CURL_TYPEOF_CURL_SOCKLEN_T int + +#elif defined(__TURBOC__) +# define CURL_TYPEOF_CURL_OFF_T long +# define CURL_FORMAT_CURL_OFF_T "ld" +# define CURL_FORMAT_CURL_OFF_TU "lu" +# define CURL_SUFFIX_CURL_OFF_T L +# define CURL_SUFFIX_CURL_OFF_TU UL +# define CURL_TYPEOF_CURL_SOCKLEN_T int + +#elif defined(__POCC__) +# if (__POCC__ < 280) +# define CURL_TYPEOF_CURL_OFF_T long +# define CURL_FORMAT_CURL_OFF_T "ld" +# define CURL_FORMAT_CURL_OFF_TU "lu" +# define CURL_SUFFIX_CURL_OFF_T L +# define CURL_SUFFIX_CURL_OFF_TU UL +# elif defined(_MSC_VER) +# define CURL_TYPEOF_CURL_OFF_T __int64 +# define CURL_FORMAT_CURL_OFF_T "I64d" +# define CURL_FORMAT_CURL_OFF_TU "I64u" +# define CURL_SUFFIX_CURL_OFF_T i64 +# define CURL_SUFFIX_CURL_OFF_TU ui64 +# else +# define CURL_TYPEOF_CURL_OFF_T long long +# define CURL_FORMAT_CURL_OFF_T "lld" +# define CURL_FORMAT_CURL_OFF_TU "llu" +# define CURL_SUFFIX_CURL_OFF_T LL +# define CURL_SUFFIX_CURL_OFF_TU ULL +# endif +# define CURL_TYPEOF_CURL_SOCKLEN_T int + +#elif defined(__LCC__) +# if defined(__MCST__) /* MCST eLbrus Compiler Collection */ +# define CURL_TYPEOF_CURL_OFF_T long +# define CURL_FORMAT_CURL_OFF_T "ld" +# define CURL_FORMAT_CURL_OFF_TU "lu" +# define CURL_SUFFIX_CURL_OFF_T L +# define CURL_SUFFIX_CURL_OFF_TU UL +# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t +# define CURL_PULL_SYS_TYPES_H 1 +# define CURL_PULL_SYS_SOCKET_H 1 +# else /* Local (or Little) C Compiler */ +# define CURL_TYPEOF_CURL_OFF_T long +# define CURL_FORMAT_CURL_OFF_T "ld" +# define CURL_FORMAT_CURL_OFF_TU "lu" +# define CURL_SUFFIX_CURL_OFF_T L +# define CURL_SUFFIX_CURL_OFF_TU UL +# define CURL_TYPEOF_CURL_SOCKLEN_T int +# endif + +#elif defined(__SYMBIAN32__) +# if defined(__EABI__) /* Treat all ARM compilers equally */ +# define CURL_TYPEOF_CURL_OFF_T long long +# define CURL_FORMAT_CURL_OFF_T "lld" +# define CURL_FORMAT_CURL_OFF_TU "llu" +# define CURL_SUFFIX_CURL_OFF_T LL +# define CURL_SUFFIX_CURL_OFF_TU ULL +# elif defined(__CW32__) +# pragma longlong on +# define CURL_TYPEOF_CURL_OFF_T long long +# define CURL_FORMAT_CURL_OFF_T "lld" +# define CURL_FORMAT_CURL_OFF_TU "llu" +# define CURL_SUFFIX_CURL_OFF_T LL +# define CURL_SUFFIX_CURL_OFF_TU ULL +# elif defined(__VC32__) +# define CURL_TYPEOF_CURL_OFF_T __int64 +# define CURL_FORMAT_CURL_OFF_T "lld" +# define CURL_FORMAT_CURL_OFF_TU "llu" +# define CURL_SUFFIX_CURL_OFF_T LL +# define CURL_SUFFIX_CURL_OFF_TU ULL +# endif +# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int + +#elif defined(__MWERKS__) +# define CURL_TYPEOF_CURL_OFF_T long long +# define CURL_FORMAT_CURL_OFF_T "lld" +# define CURL_FORMAT_CURL_OFF_TU "llu" +# define CURL_SUFFIX_CURL_OFF_T LL +# define CURL_SUFFIX_CURL_OFF_TU ULL +# define CURL_TYPEOF_CURL_SOCKLEN_T int + +#elif defined(_WIN32_WCE) +# define CURL_TYPEOF_CURL_OFF_T __int64 +# define CURL_FORMAT_CURL_OFF_T "I64d" +# define CURL_FORMAT_CURL_OFF_TU "I64u" +# define CURL_SUFFIX_CURL_OFF_T i64 +# define CURL_SUFFIX_CURL_OFF_TU ui64 +# define CURL_TYPEOF_CURL_SOCKLEN_T int + +#elif defined(__MINGW32__) +# define CURL_TYPEOF_CURL_OFF_T long long +# define CURL_FORMAT_CURL_OFF_T "I64d" +# define CURL_FORMAT_CURL_OFF_TU "I64u" +# define CURL_SUFFIX_CURL_OFF_T LL +# define CURL_SUFFIX_CURL_OFF_TU ULL +# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t +# define CURL_PULL_SYS_TYPES_H 1 +# define CURL_PULL_WS2TCPIP_H 1 + +#elif defined(__VMS) +# if defined(__VAX) +# define CURL_TYPEOF_CURL_OFF_T long +# define CURL_FORMAT_CURL_OFF_T "ld" +# define CURL_FORMAT_CURL_OFF_TU "lu" +# define CURL_SUFFIX_CURL_OFF_T L +# define CURL_SUFFIX_CURL_OFF_TU UL +# else +# define CURL_TYPEOF_CURL_OFF_T long long +# define CURL_FORMAT_CURL_OFF_T "lld" +# define CURL_FORMAT_CURL_OFF_TU "llu" +# define CURL_SUFFIX_CURL_OFF_T LL +# define CURL_SUFFIX_CURL_OFF_TU ULL +# endif +# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int + +#elif defined(__OS400__) +# if defined(__ILEC400__) +# define CURL_TYPEOF_CURL_OFF_T long long +# define CURL_FORMAT_CURL_OFF_T "lld" +# define CURL_FORMAT_CURL_OFF_TU "llu" +# define CURL_SUFFIX_CURL_OFF_T LL +# define CURL_SUFFIX_CURL_OFF_TU ULL +# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t +# define CURL_PULL_SYS_TYPES_H 1 +# define CURL_PULL_SYS_SOCKET_H 1 +# endif + +#elif defined(__MVS__) +# if defined(__IBMC__) || defined(__IBMCPP__) +# if defined(_ILP32) +# elif defined(_LP64) +# endif +# if defined(_LONG_LONG) +# define CURL_TYPEOF_CURL_OFF_T long long +# define CURL_FORMAT_CURL_OFF_T "lld" +# define CURL_FORMAT_CURL_OFF_TU "llu" +# define CURL_SUFFIX_CURL_OFF_T LL +# define CURL_SUFFIX_CURL_OFF_TU ULL +# elif defined(_LP64) +# define CURL_TYPEOF_CURL_OFF_T long +# define CURL_FORMAT_CURL_OFF_T "ld" +# define CURL_FORMAT_CURL_OFF_TU "lu" +# define CURL_SUFFIX_CURL_OFF_T L +# define CURL_SUFFIX_CURL_OFF_TU UL +# else +# define CURL_TYPEOF_CURL_OFF_T long +# define CURL_FORMAT_CURL_OFF_T "ld" +# define CURL_FORMAT_CURL_OFF_TU "lu" +# define CURL_SUFFIX_CURL_OFF_T L +# define CURL_SUFFIX_CURL_OFF_TU UL +# endif +# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t +# define CURL_PULL_SYS_TYPES_H 1 +# define CURL_PULL_SYS_SOCKET_H 1 +# endif + +#elif defined(__370__) +# if defined(__IBMC__) || defined(__IBMCPP__) +# if defined(_ILP32) +# elif defined(_LP64) +# endif +# if defined(_LONG_LONG) +# define CURL_TYPEOF_CURL_OFF_T long long +# define CURL_FORMAT_CURL_OFF_T "lld" +# define CURL_FORMAT_CURL_OFF_TU "llu" +# define CURL_SUFFIX_CURL_OFF_T LL +# define CURL_SUFFIX_CURL_OFF_TU ULL +# elif defined(_LP64) +# define CURL_TYPEOF_CURL_OFF_T long +# define CURL_FORMAT_CURL_OFF_T "ld" +# define CURL_FORMAT_CURL_OFF_TU "lu" +# define CURL_SUFFIX_CURL_OFF_T L +# define CURL_SUFFIX_CURL_OFF_TU UL +# else +# define CURL_TYPEOF_CURL_OFF_T long +# define CURL_FORMAT_CURL_OFF_T "ld" +# define CURL_FORMAT_CURL_OFF_TU "lu" +# define CURL_SUFFIX_CURL_OFF_T L +# define CURL_SUFFIX_CURL_OFF_TU UL +# endif +# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t +# define CURL_PULL_SYS_TYPES_H 1 +# define CURL_PULL_SYS_SOCKET_H 1 +# endif + +#elif defined(TPF) +# define CURL_TYPEOF_CURL_OFF_T long +# define CURL_FORMAT_CURL_OFF_T "ld" +# define CURL_FORMAT_CURL_OFF_TU "lu" +# define CURL_SUFFIX_CURL_OFF_T L +# define CURL_SUFFIX_CURL_OFF_TU UL +# define CURL_TYPEOF_CURL_SOCKLEN_T int + +#elif defined(__TINYC__) /* also known as tcc */ +# define CURL_TYPEOF_CURL_OFF_T long long +# define CURL_FORMAT_CURL_OFF_T "lld" +# define CURL_FORMAT_CURL_OFF_TU "llu" +# define CURL_SUFFIX_CURL_OFF_T LL +# define CURL_SUFFIX_CURL_OFF_TU ULL +# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t +# define CURL_PULL_SYS_TYPES_H 1 +# define CURL_PULL_SYS_SOCKET_H 1 + +#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* Oracle Solaris Studio */ +# if !defined(__LP64) && (defined(__ILP32) || \ + defined(__i386) || \ + defined(__sparcv8) || \ + defined(__sparcv8plus)) +# define CURL_TYPEOF_CURL_OFF_T long long +# define CURL_FORMAT_CURL_OFF_T "lld" +# define CURL_FORMAT_CURL_OFF_TU "llu" +# define CURL_SUFFIX_CURL_OFF_T LL +# define CURL_SUFFIX_CURL_OFF_TU ULL +# elif defined(__LP64) || \ + defined(__amd64) || defined(__sparcv9) +# define CURL_TYPEOF_CURL_OFF_T long +# define CURL_FORMAT_CURL_OFF_T "ld" +# define CURL_FORMAT_CURL_OFF_TU "lu" +# define CURL_SUFFIX_CURL_OFF_T L +# define CURL_SUFFIX_CURL_OFF_TU UL +# endif +# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t +# define CURL_PULL_SYS_TYPES_H 1 +# define CURL_PULL_SYS_SOCKET_H 1 + +#elif defined(__xlc__) /* IBM xlc compiler */ +# if !defined(_LP64) +# define CURL_TYPEOF_CURL_OFF_T long long +# define CURL_FORMAT_CURL_OFF_T "lld" +# define CURL_FORMAT_CURL_OFF_TU "llu" +# define CURL_SUFFIX_CURL_OFF_T LL +# define CURL_SUFFIX_CURL_OFF_TU ULL +# else +# define CURL_TYPEOF_CURL_OFF_T long +# define CURL_FORMAT_CURL_OFF_T "ld" +# define CURL_FORMAT_CURL_OFF_TU "lu" +# define CURL_SUFFIX_CURL_OFF_T L +# define CURL_SUFFIX_CURL_OFF_TU UL +# endif +# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t +# define CURL_PULL_SYS_TYPES_H 1 +# define CURL_PULL_SYS_SOCKET_H 1 + +/* ===================================== */ +/* KEEP MSVC THE PENULTIMATE ENTRY */ +/* ===================================== */ + +#elif defined(_MSC_VER) +# if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64) +# define CURL_TYPEOF_CURL_OFF_T __int64 +# define CURL_FORMAT_CURL_OFF_T "I64d" +# define CURL_FORMAT_CURL_OFF_TU "I64u" +# define CURL_SUFFIX_CURL_OFF_T i64 +# define CURL_SUFFIX_CURL_OFF_TU ui64 +# else +# define CURL_TYPEOF_CURL_OFF_T long +# define CURL_FORMAT_CURL_OFF_T "ld" +# define CURL_FORMAT_CURL_OFF_TU "lu" +# define CURL_SUFFIX_CURL_OFF_T L +# define CURL_SUFFIX_CURL_OFF_TU UL +# endif +# define CURL_TYPEOF_CURL_SOCKLEN_T int + +/* ===================================== */ +/* KEEP GENERIC GCC THE LAST ENTRY */ +/* ===================================== */ + +#elif defined(__GNUC__) && !defined(_SCO_DS) +# if !defined(__LP64__) && \ + (defined(__ILP32__) || defined(__i386__) || defined(__hppa__) || \ + defined(__ppc__) || defined(__powerpc__) || defined(__arm__) || \ + defined(__sparc__) || defined(__mips__) || defined(__sh__) || \ + defined(__XTENSA__) || \ + (defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 4) || \ + (defined(__LONG_MAX__) && __LONG_MAX__ == 2147483647L)) +# define CURL_TYPEOF_CURL_OFF_T long long +# define CURL_FORMAT_CURL_OFF_T "lld" +# define CURL_FORMAT_CURL_OFF_TU "llu" +# define CURL_SUFFIX_CURL_OFF_T LL +# define CURL_SUFFIX_CURL_OFF_TU ULL +# elif defined(__LP64__) || \ + defined(__x86_64__) || defined(__ppc64__) || defined(__sparc64__) || \ + defined(__e2k__) || \ + (defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 8) || \ + (defined(__LONG_MAX__) && __LONG_MAX__ == 9223372036854775807L) +# define CURL_TYPEOF_CURL_OFF_T long +# define CURL_FORMAT_CURL_OFF_T "ld" +# define CURL_FORMAT_CURL_OFF_TU "lu" +# define CURL_SUFFIX_CURL_OFF_T L +# define CURL_SUFFIX_CURL_OFF_TU UL +# endif +# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t +# define CURL_PULL_SYS_TYPES_H 1 +# define CURL_PULL_SYS_SOCKET_H 1 + +#else +/* generic "safe guess" on old 32 bit style */ +# define CURL_TYPEOF_CURL_OFF_T long +# define CURL_FORMAT_CURL_OFF_T "ld" +# define CURL_FORMAT_CURL_OFF_TU "lu" +# define CURL_SUFFIX_CURL_OFF_T L +# define CURL_SUFFIX_CURL_OFF_TU UL +# define CURL_TYPEOF_CURL_SOCKLEN_T int +#endif + +#ifdef _AIX +/* AIX needs */ +#define CURL_PULL_SYS_POLL_H +#endif + + +/* CURL_PULL_WS2TCPIP_H is defined above when inclusion of header file */ +/* ws2tcpip.h is required here to properly make type definitions below. */ +#ifdef CURL_PULL_WS2TCPIP_H +# include +# include +# include +#endif + +/* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file */ +/* sys/types.h is required here to properly make type definitions below. */ +#ifdef CURL_PULL_SYS_TYPES_H +# include +#endif + +/* CURL_PULL_SYS_SOCKET_H is defined above when inclusion of header file */ +/* sys/socket.h is required here to properly make type definitions below. */ +#ifdef CURL_PULL_SYS_SOCKET_H +# include +#endif + +/* CURL_PULL_SYS_POLL_H is defined above when inclusion of header file */ +/* sys/poll.h is required here to properly make type definitions below. */ +#ifdef CURL_PULL_SYS_POLL_H +# include +#endif + +/* Data type definition of curl_socklen_t. */ +#ifdef CURL_TYPEOF_CURL_SOCKLEN_T + typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t; +#endif + +/* Data type definition of curl_off_t. */ + +#ifdef CURL_TYPEOF_CURL_OFF_T + typedef CURL_TYPEOF_CURL_OFF_T curl_off_t; +#endif + +/* + * CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow + * these to be visible and exported by the external libcurl interface API, + * while also making them visible to the library internals, simply including + * curl_setup.h, without actually needing to include curl.h internally. + * If some day this section would grow big enough, all this should be moved + * to its own header file. + */ + +/* + * Figure out if we can use the ## preprocessor operator, which is supported + * by ISO/ANSI C and C++. Some compilers support it without setting __STDC__ + * or __cplusplus so we need to carefully check for them too. + */ + +#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \ + defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \ + defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \ + defined(__ILEC400__) + /* This compiler is believed to have an ISO compatible preprocessor */ +#define CURL_ISOCPP +#else + /* This compiler is believed NOT to have an ISO compatible preprocessor */ +#undef CURL_ISOCPP +#endif + +/* + * Macros for minimum-width signed and unsigned curl_off_t integer constants. + */ + +#if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551) +# define CURLINC_OFF_T_C_HLPR2(x) x +# define CURLINC_OFF_T_C_HLPR1(x) CURLINC_OFF_T_C_HLPR2(x) +# define CURL_OFF_T_C(Val) CURLINC_OFF_T_C_HLPR1(Val) ## \ + CURLINC_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T) +# define CURL_OFF_TU_C(Val) CURLINC_OFF_T_C_HLPR1(Val) ## \ + CURLINC_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU) +#else +# ifdef CURL_ISOCPP +# define CURLINC_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix +# else +# define CURLINC_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix +# endif +# define CURLINC_OFF_T_C_HLPR1(Val,Suffix) CURLINC_OFF_T_C_HLPR2(Val,Suffix) +# define CURL_OFF_T_C(Val) CURLINC_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T) +# define CURL_OFF_TU_C(Val) CURLINC_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU) +#endif + +#endif /* CURLINC_SYSTEM_H */ diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/typecheck-gcc.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/typecheck-gcc.h new file mode 100644 index 0000000..2dabcb4 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/typecheck-gcc.h @@ -0,0 +1,712 @@ +#ifndef CURLINC_TYPECHECK_GCC_H +#define CURLINC_TYPECHECK_GCC_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2022, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at https://curl.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * SPDX-License-Identifier: curl + * + ***************************************************************************/ + +/* wraps curl_easy_setopt() with typechecking */ + +/* To add a new kind of warning, add an + * if(curlcheck_sometype_option(_curl_opt)) + * if(!curlcheck_sometype(value)) + * _curl_easy_setopt_err_sometype(); + * block and define curlcheck_sometype_option, curlcheck_sometype and + * _curl_easy_setopt_err_sometype below + * + * NOTE: We use two nested 'if' statements here instead of the && operator, in + * order to work around gcc bug #32061. It affects only gcc 4.3.x/4.4.x + * when compiling with -Wlogical-op. + * + * To add an option that uses the same type as an existing option, you'll just + * need to extend the appropriate _curl_*_option macro + */ +#define curl_easy_setopt(handle, option, value) \ + __extension__({ \ + __typeof__(option) _curl_opt = option; \ + if(__builtin_constant_p(_curl_opt)) { \ + if(curlcheck_long_option(_curl_opt)) \ + if(!curlcheck_long(value)) \ + _curl_easy_setopt_err_long(); \ + if(curlcheck_off_t_option(_curl_opt)) \ + if(!curlcheck_off_t(value)) \ + _curl_easy_setopt_err_curl_off_t(); \ + if(curlcheck_string_option(_curl_opt)) \ + if(!curlcheck_string(value)) \ + _curl_easy_setopt_err_string(); \ + if(curlcheck_write_cb_option(_curl_opt)) \ + if(!curlcheck_write_cb(value)) \ + _curl_easy_setopt_err_write_callback(); \ + if((_curl_opt) == CURLOPT_RESOLVER_START_FUNCTION) \ + if(!curlcheck_resolver_start_callback(value)) \ + _curl_easy_setopt_err_resolver_start_callback(); \ + if((_curl_opt) == CURLOPT_READFUNCTION) \ + if(!curlcheck_read_cb(value)) \ + _curl_easy_setopt_err_read_cb(); \ + if((_curl_opt) == CURLOPT_IOCTLFUNCTION) \ + if(!curlcheck_ioctl_cb(value)) \ + _curl_easy_setopt_err_ioctl_cb(); \ + if((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \ + if(!curlcheck_sockopt_cb(value)) \ + _curl_easy_setopt_err_sockopt_cb(); \ + if((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \ + if(!curlcheck_opensocket_cb(value)) \ + _curl_easy_setopt_err_opensocket_cb(); \ + if((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \ + if(!curlcheck_progress_cb(value)) \ + _curl_easy_setopt_err_progress_cb(); \ + if((_curl_opt) == CURLOPT_DEBUGFUNCTION) \ + if(!curlcheck_debug_cb(value)) \ + _curl_easy_setopt_err_debug_cb(); \ + if((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \ + if(!curlcheck_ssl_ctx_cb(value)) \ + _curl_easy_setopt_err_ssl_ctx_cb(); \ + if(curlcheck_conv_cb_option(_curl_opt)) \ + if(!curlcheck_conv_cb(value)) \ + _curl_easy_setopt_err_conv_cb(); \ + if((_curl_opt) == CURLOPT_SEEKFUNCTION) \ + if(!curlcheck_seek_cb(value)) \ + _curl_easy_setopt_err_seek_cb(); \ + if(curlcheck_cb_data_option(_curl_opt)) \ + if(!curlcheck_cb_data(value)) \ + _curl_easy_setopt_err_cb_data(); \ + if((_curl_opt) == CURLOPT_ERRORBUFFER) \ + if(!curlcheck_error_buffer(value)) \ + _curl_easy_setopt_err_error_buffer(); \ + if((_curl_opt) == CURLOPT_STDERR) \ + if(!curlcheck_FILE(value)) \ + _curl_easy_setopt_err_FILE(); \ + if(curlcheck_postfields_option(_curl_opt)) \ + if(!curlcheck_postfields(value)) \ + _curl_easy_setopt_err_postfields(); \ + if((_curl_opt) == CURLOPT_HTTPPOST) \ + if(!curlcheck_arr((value), struct curl_httppost)) \ + _curl_easy_setopt_err_curl_httpost(); \ + if((_curl_opt) == CURLOPT_MIMEPOST) \ + if(!curlcheck_ptr((value), curl_mime)) \ + _curl_easy_setopt_err_curl_mimepost(); \ + if(curlcheck_slist_option(_curl_opt)) \ + if(!curlcheck_arr((value), struct curl_slist)) \ + _curl_easy_setopt_err_curl_slist(); \ + if((_curl_opt) == CURLOPT_SHARE) \ + if(!curlcheck_ptr((value), CURLSH)) \ + _curl_easy_setopt_err_CURLSH(); \ + } \ + curl_easy_setopt(handle, _curl_opt, value); \ + }) + +/* wraps curl_easy_getinfo() with typechecking */ +#define curl_easy_getinfo(handle, info, arg) \ + __extension__({ \ + __typeof__(info) _curl_info = info; \ + if(__builtin_constant_p(_curl_info)) { \ + if(curlcheck_string_info(_curl_info)) \ + if(!curlcheck_arr((arg), char *)) \ + _curl_easy_getinfo_err_string(); \ + if(curlcheck_long_info(_curl_info)) \ + if(!curlcheck_arr((arg), long)) \ + _curl_easy_getinfo_err_long(); \ + if(curlcheck_double_info(_curl_info)) \ + if(!curlcheck_arr((arg), double)) \ + _curl_easy_getinfo_err_double(); \ + if(curlcheck_slist_info(_curl_info)) \ + if(!curlcheck_arr((arg), struct curl_slist *)) \ + _curl_easy_getinfo_err_curl_slist(); \ + if(curlcheck_tlssessioninfo_info(_curl_info)) \ + if(!curlcheck_arr((arg), struct curl_tlssessioninfo *)) \ + _curl_easy_getinfo_err_curl_tlssesssioninfo(); \ + if(curlcheck_certinfo_info(_curl_info)) \ + if(!curlcheck_arr((arg), struct curl_certinfo *)) \ + _curl_easy_getinfo_err_curl_certinfo(); \ + if(curlcheck_socket_info(_curl_info)) \ + if(!curlcheck_arr((arg), curl_socket_t)) \ + _curl_easy_getinfo_err_curl_socket(); \ + if(curlcheck_off_t_info(_curl_info)) \ + if(!curlcheck_arr((arg), curl_off_t)) \ + _curl_easy_getinfo_err_curl_off_t(); \ + } \ + curl_easy_getinfo(handle, _curl_info, arg); \ + }) + +/* + * For now, just make sure that the functions are called with three arguments + */ +#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param) +#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param) + + +/* the actual warnings, triggered by calling the _curl_easy_setopt_err* + * functions */ + +/* To define a new warning, use _CURL_WARNING(identifier, "message") */ +#define CURLWARNING(id, message) \ + static void __attribute__((__warning__(message))) \ + __attribute__((__unused__)) __attribute__((__noinline__)) \ + id(void) { __asm__(""); } + +CURLWARNING(_curl_easy_setopt_err_long, + "curl_easy_setopt expects a long argument for this option") +CURLWARNING(_curl_easy_setopt_err_curl_off_t, + "curl_easy_setopt expects a curl_off_t argument for this option") +CURLWARNING(_curl_easy_setopt_err_string, + "curl_easy_setopt expects a " + "string ('char *' or char[]) argument for this option" + ) +CURLWARNING(_curl_easy_setopt_err_write_callback, + "curl_easy_setopt expects a curl_write_callback argument for this option") +CURLWARNING(_curl_easy_setopt_err_resolver_start_callback, + "curl_easy_setopt expects a " + "curl_resolver_start_callback argument for this option" + ) +CURLWARNING(_curl_easy_setopt_err_read_cb, + "curl_easy_setopt expects a curl_read_callback argument for this option") +CURLWARNING(_curl_easy_setopt_err_ioctl_cb, + "curl_easy_setopt expects a curl_ioctl_callback argument for this option") +CURLWARNING(_curl_easy_setopt_err_sockopt_cb, + "curl_easy_setopt expects a curl_sockopt_callback argument for this option") +CURLWARNING(_curl_easy_setopt_err_opensocket_cb, + "curl_easy_setopt expects a " + "curl_opensocket_callback argument for this option" + ) +CURLWARNING(_curl_easy_setopt_err_progress_cb, + "curl_easy_setopt expects a curl_progress_callback argument for this option") +CURLWARNING(_curl_easy_setopt_err_debug_cb, + "curl_easy_setopt expects a curl_debug_callback argument for this option") +CURLWARNING(_curl_easy_setopt_err_ssl_ctx_cb, + "curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option") +CURLWARNING(_curl_easy_setopt_err_conv_cb, + "curl_easy_setopt expects a curl_conv_callback argument for this option") +CURLWARNING(_curl_easy_setopt_err_seek_cb, + "curl_easy_setopt expects a curl_seek_callback argument for this option") +CURLWARNING(_curl_easy_setopt_err_cb_data, + "curl_easy_setopt expects a " + "private data pointer as argument for this option") +CURLWARNING(_curl_easy_setopt_err_error_buffer, + "curl_easy_setopt expects a " + "char buffer of CURL_ERROR_SIZE as argument for this option") +CURLWARNING(_curl_easy_setopt_err_FILE, + "curl_easy_setopt expects a 'FILE *' argument for this option") +CURLWARNING(_curl_easy_setopt_err_postfields, + "curl_easy_setopt expects a 'void *' or 'char *' argument for this option") +CURLWARNING(_curl_easy_setopt_err_curl_httpost, + "curl_easy_setopt expects a 'struct curl_httppost *' " + "argument for this option") +CURLWARNING(_curl_easy_setopt_err_curl_mimepost, + "curl_easy_setopt expects a 'curl_mime *' " + "argument for this option") +CURLWARNING(_curl_easy_setopt_err_curl_slist, + "curl_easy_setopt expects a 'struct curl_slist *' argument for this option") +CURLWARNING(_curl_easy_setopt_err_CURLSH, + "curl_easy_setopt expects a CURLSH* argument for this option") + +CURLWARNING(_curl_easy_getinfo_err_string, + "curl_easy_getinfo expects a pointer to 'char *' for this info") +CURLWARNING(_curl_easy_getinfo_err_long, + "curl_easy_getinfo expects a pointer to long for this info") +CURLWARNING(_curl_easy_getinfo_err_double, + "curl_easy_getinfo expects a pointer to double for this info") +CURLWARNING(_curl_easy_getinfo_err_curl_slist, + "curl_easy_getinfo expects a pointer to 'struct curl_slist *' for this info") +CURLWARNING(_curl_easy_getinfo_err_curl_tlssesssioninfo, + "curl_easy_getinfo expects a pointer to " + "'struct curl_tlssessioninfo *' for this info") +CURLWARNING(_curl_easy_getinfo_err_curl_certinfo, + "curl_easy_getinfo expects a pointer to " + "'struct curl_certinfo *' for this info") +CURLWARNING(_curl_easy_getinfo_err_curl_socket, + "curl_easy_getinfo expects a pointer to curl_socket_t for this info") +CURLWARNING(_curl_easy_getinfo_err_curl_off_t, + "curl_easy_getinfo expects a pointer to curl_off_t for this info") + +/* groups of curl_easy_setops options that take the same type of argument */ + +/* To add a new option to one of the groups, just add + * (option) == CURLOPT_SOMETHING + * to the or-expression. If the option takes a long or curl_off_t, you don't + * have to do anything + */ + +/* evaluates to true if option takes a long argument */ +#define curlcheck_long_option(option) \ + (0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT) + +#define curlcheck_off_t_option(option) \ + (((option) > CURLOPTTYPE_OFF_T) && ((option) < CURLOPTTYPE_BLOB)) + +/* evaluates to true if option takes a char* argument */ +#define curlcheck_string_option(option) \ + ((option) == CURLOPT_ABSTRACT_UNIX_SOCKET || \ + (option) == CURLOPT_ACCEPT_ENCODING || \ + (option) == CURLOPT_ALTSVC || \ + (option) == CURLOPT_CAINFO || \ + (option) == CURLOPT_CAPATH || \ + (option) == CURLOPT_COOKIE || \ + (option) == CURLOPT_COOKIEFILE || \ + (option) == CURLOPT_COOKIEJAR || \ + (option) == CURLOPT_COOKIELIST || \ + (option) == CURLOPT_CRLFILE || \ + (option) == CURLOPT_CUSTOMREQUEST || \ + (option) == CURLOPT_DEFAULT_PROTOCOL || \ + (option) == CURLOPT_DNS_INTERFACE || \ + (option) == CURLOPT_DNS_LOCAL_IP4 || \ + (option) == CURLOPT_DNS_LOCAL_IP6 || \ + (option) == CURLOPT_DNS_SERVERS || \ + (option) == CURLOPT_DOH_URL || \ + (option) == CURLOPT_EGDSOCKET || \ + (option) == CURLOPT_FTP_ACCOUNT || \ + (option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \ + (option) == CURLOPT_FTPPORT || \ + (option) == CURLOPT_HSTS || \ + (option) == CURLOPT_INTERFACE || \ + (option) == CURLOPT_ISSUERCERT || \ + (option) == CURLOPT_KEYPASSWD || \ + (option) == CURLOPT_KRBLEVEL || \ + (option) == CURLOPT_LOGIN_OPTIONS || \ + (option) == CURLOPT_MAIL_AUTH || \ + (option) == CURLOPT_MAIL_FROM || \ + (option) == CURLOPT_NETRC_FILE || \ + (option) == CURLOPT_NOPROXY || \ + (option) == CURLOPT_PASSWORD || \ + (option) == CURLOPT_PINNEDPUBLICKEY || \ + (option) == CURLOPT_PRE_PROXY || \ + (option) == CURLOPT_PROTOCOLS_STR || \ + (option) == CURLOPT_PROXY || \ + (option) == CURLOPT_PROXY_CAINFO || \ + (option) == CURLOPT_PROXY_CAPATH || \ + (option) == CURLOPT_PROXY_CRLFILE || \ + (option) == CURLOPT_PROXY_ISSUERCERT || \ + (option) == CURLOPT_PROXY_KEYPASSWD || \ + (option) == CURLOPT_PROXY_PINNEDPUBLICKEY || \ + (option) == CURLOPT_PROXY_SERVICE_NAME || \ + (option) == CURLOPT_PROXY_SSL_CIPHER_LIST || \ + (option) == CURLOPT_PROXY_SSLCERT || \ + (option) == CURLOPT_PROXY_SSLCERTTYPE || \ + (option) == CURLOPT_PROXY_SSLKEY || \ + (option) == CURLOPT_PROXY_SSLKEYTYPE || \ + (option) == CURLOPT_PROXY_TLS13_CIPHERS || \ + (option) == CURLOPT_PROXY_TLSAUTH_PASSWORD || \ + (option) == CURLOPT_PROXY_TLSAUTH_TYPE || \ + (option) == CURLOPT_PROXY_TLSAUTH_USERNAME || \ + (option) == CURLOPT_PROXYPASSWORD || \ + (option) == CURLOPT_PROXYUSERNAME || \ + (option) == CURLOPT_PROXYUSERPWD || \ + (option) == CURLOPT_RANDOM_FILE || \ + (option) == CURLOPT_RANGE || \ + (option) == CURLOPT_REDIR_PROTOCOLS_STR || \ + (option) == CURLOPT_REFERER || \ + (option) == CURLOPT_REQUEST_TARGET || \ + (option) == CURLOPT_RTSP_SESSION_ID || \ + (option) == CURLOPT_RTSP_STREAM_URI || \ + (option) == CURLOPT_RTSP_TRANSPORT || \ + (option) == CURLOPT_SASL_AUTHZID || \ + (option) == CURLOPT_SERVICE_NAME || \ + (option) == CURLOPT_SOCKS5_GSSAPI_SERVICE || \ + (option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 || \ + (option) == CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256 || \ + (option) == CURLOPT_SSH_KNOWNHOSTS || \ + (option) == CURLOPT_SSH_PRIVATE_KEYFILE || \ + (option) == CURLOPT_SSH_PUBLIC_KEYFILE || \ + (option) == CURLOPT_SSLCERT || \ + (option) == CURLOPT_SSLCERTTYPE || \ + (option) == CURLOPT_SSLENGINE || \ + (option) == CURLOPT_SSLKEY || \ + (option) == CURLOPT_SSLKEYTYPE || \ + (option) == CURLOPT_SSL_CIPHER_LIST || \ + (option) == CURLOPT_TLS13_CIPHERS || \ + (option) == CURLOPT_TLSAUTH_PASSWORD || \ + (option) == CURLOPT_TLSAUTH_TYPE || \ + (option) == CURLOPT_TLSAUTH_USERNAME || \ + (option) == CURLOPT_UNIX_SOCKET_PATH || \ + (option) == CURLOPT_URL || \ + (option) == CURLOPT_USERAGENT || \ + (option) == CURLOPT_USERNAME || \ + (option) == CURLOPT_AWS_SIGV4 || \ + (option) == CURLOPT_USERPWD || \ + (option) == CURLOPT_XOAUTH2_BEARER || \ + (option) == CURLOPT_SSL_EC_CURVES || \ + 0) + +/* evaluates to true if option takes a curl_write_callback argument */ +#define curlcheck_write_cb_option(option) \ + ((option) == CURLOPT_HEADERFUNCTION || \ + (option) == CURLOPT_WRITEFUNCTION) + +/* evaluates to true if option takes a curl_conv_callback argument */ +#define curlcheck_conv_cb_option(option) \ + ((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION || \ + (option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION || \ + (option) == CURLOPT_CONV_FROM_UTF8_FUNCTION) + +/* evaluates to true if option takes a data argument to pass to a callback */ +#define curlcheck_cb_data_option(option) \ + ((option) == CURLOPT_CHUNK_DATA || \ + (option) == CURLOPT_CLOSESOCKETDATA || \ + (option) == CURLOPT_DEBUGDATA || \ + (option) == CURLOPT_FNMATCH_DATA || \ + (option) == CURLOPT_HEADERDATA || \ + (option) == CURLOPT_HSTSREADDATA || \ + (option) == CURLOPT_HSTSWRITEDATA || \ + (option) == CURLOPT_INTERLEAVEDATA || \ + (option) == CURLOPT_IOCTLDATA || \ + (option) == CURLOPT_OPENSOCKETDATA || \ + (option) == CURLOPT_PREREQDATA || \ + (option) == CURLOPT_PROGRESSDATA || \ + (option) == CURLOPT_READDATA || \ + (option) == CURLOPT_SEEKDATA || \ + (option) == CURLOPT_SOCKOPTDATA || \ + (option) == CURLOPT_SSH_KEYDATA || \ + (option) == CURLOPT_SSL_CTX_DATA || \ + (option) == CURLOPT_WRITEDATA || \ + (option) == CURLOPT_RESOLVER_START_DATA || \ + (option) == CURLOPT_TRAILERDATA || \ + (option) == CURLOPT_SSH_HOSTKEYDATA || \ + 0) + +/* evaluates to true if option takes a POST data argument (void* or char*) */ +#define curlcheck_postfields_option(option) \ + ((option) == CURLOPT_POSTFIELDS || \ + (option) == CURLOPT_COPYPOSTFIELDS || \ + 0) + +/* evaluates to true if option takes a struct curl_slist * argument */ +#define curlcheck_slist_option(option) \ + ((option) == CURLOPT_HTTP200ALIASES || \ + (option) == CURLOPT_HTTPHEADER || \ + (option) == CURLOPT_MAIL_RCPT || \ + (option) == CURLOPT_POSTQUOTE || \ + (option) == CURLOPT_PREQUOTE || \ + (option) == CURLOPT_PROXYHEADER || \ + (option) == CURLOPT_QUOTE || \ + (option) == CURLOPT_RESOLVE || \ + (option) == CURLOPT_TELNETOPTIONS || \ + (option) == CURLOPT_CONNECT_TO || \ + 0) + +/* groups of curl_easy_getinfo infos that take the same type of argument */ + +/* evaluates to true if info expects a pointer to char * argument */ +#define curlcheck_string_info(info) \ + (CURLINFO_STRING < (info) && (info) < CURLINFO_LONG && \ + (info) != CURLINFO_PRIVATE) + +/* evaluates to true if info expects a pointer to long argument */ +#define curlcheck_long_info(info) \ + (CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE) + +/* evaluates to true if info expects a pointer to double argument */ +#define curlcheck_double_info(info) \ + (CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST) + +/* true if info expects a pointer to struct curl_slist * argument */ +#define curlcheck_slist_info(info) \ + (((info) == CURLINFO_SSL_ENGINES) || ((info) == CURLINFO_COOKIELIST)) + +/* true if info expects a pointer to struct curl_tlssessioninfo * argument */ +#define curlcheck_tlssessioninfo_info(info) \ + (((info) == CURLINFO_TLS_SSL_PTR) || ((info) == CURLINFO_TLS_SESSION)) + +/* true if info expects a pointer to struct curl_certinfo * argument */ +#define curlcheck_certinfo_info(info) ((info) == CURLINFO_CERTINFO) + +/* true if info expects a pointer to struct curl_socket_t argument */ +#define curlcheck_socket_info(info) \ + (CURLINFO_SOCKET < (info) && (info) < CURLINFO_OFF_T) + +/* true if info expects a pointer to curl_off_t argument */ +#define curlcheck_off_t_info(info) \ + (CURLINFO_OFF_T < (info)) + + +/* typecheck helpers -- check whether given expression has requested type*/ + +/* For pointers, you can use the curlcheck_ptr/curlcheck_arr macros, + * otherwise define a new macro. Search for __builtin_types_compatible_p + * in the GCC manual. + * NOTE: these macros MUST NOT EVALUATE their arguments! The argument is + * the actual expression passed to the curl_easy_setopt macro. This + * means that you can only apply the sizeof and __typeof__ operators, no + * == or whatsoever. + */ + +/* XXX: should evaluate to true if expr is a pointer */ +#define curlcheck_any_ptr(expr) \ + (sizeof(expr) == sizeof(void *)) + +/* evaluates to true if expr is NULL */ +/* XXX: must not evaluate expr, so this check is not accurate */ +#define curlcheck_NULL(expr) \ + (__builtin_types_compatible_p(__typeof__(expr), __typeof__(NULL))) + +/* evaluates to true if expr is type*, const type* or NULL */ +#define curlcheck_ptr(expr, type) \ + (curlcheck_NULL(expr) || \ + __builtin_types_compatible_p(__typeof__(expr), type *) || \ + __builtin_types_compatible_p(__typeof__(expr), const type *)) + +/* evaluates to true if expr is one of type[], type*, NULL or const type* */ +#define curlcheck_arr(expr, type) \ + (curlcheck_ptr((expr), type) || \ + __builtin_types_compatible_p(__typeof__(expr), type [])) + +/* evaluates to true if expr is a string */ +#define curlcheck_string(expr) \ + (curlcheck_arr((expr), char) || \ + curlcheck_arr((expr), signed char) || \ + curlcheck_arr((expr), unsigned char)) + +/* evaluates to true if expr is a long (no matter the signedness) + * XXX: for now, int is also accepted (and therefore short and char, which + * are promoted to int when passed to a variadic function) */ +#define curlcheck_long(expr) \ + (__builtin_types_compatible_p(__typeof__(expr), long) || \ + __builtin_types_compatible_p(__typeof__(expr), signed long) || \ + __builtin_types_compatible_p(__typeof__(expr), unsigned long) || \ + __builtin_types_compatible_p(__typeof__(expr), int) || \ + __builtin_types_compatible_p(__typeof__(expr), signed int) || \ + __builtin_types_compatible_p(__typeof__(expr), unsigned int) || \ + __builtin_types_compatible_p(__typeof__(expr), short) || \ + __builtin_types_compatible_p(__typeof__(expr), signed short) || \ + __builtin_types_compatible_p(__typeof__(expr), unsigned short) || \ + __builtin_types_compatible_p(__typeof__(expr), char) || \ + __builtin_types_compatible_p(__typeof__(expr), signed char) || \ + __builtin_types_compatible_p(__typeof__(expr), unsigned char)) + +/* evaluates to true if expr is of type curl_off_t */ +#define curlcheck_off_t(expr) \ + (__builtin_types_compatible_p(__typeof__(expr), curl_off_t)) + +/* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */ +/* XXX: also check size of an char[] array? */ +#define curlcheck_error_buffer(expr) \ + (curlcheck_NULL(expr) || \ + __builtin_types_compatible_p(__typeof__(expr), char *) || \ + __builtin_types_compatible_p(__typeof__(expr), char[])) + +/* evaluates to true if expr is of type (const) void* or (const) FILE* */ +#if 0 +#define curlcheck_cb_data(expr) \ + (curlcheck_ptr((expr), void) || \ + curlcheck_ptr((expr), FILE)) +#else /* be less strict */ +#define curlcheck_cb_data(expr) \ + curlcheck_any_ptr(expr) +#endif + +/* evaluates to true if expr is of type FILE* */ +#define curlcheck_FILE(expr) \ + (curlcheck_NULL(expr) || \ + (__builtin_types_compatible_p(__typeof__(expr), FILE *))) + +/* evaluates to true if expr can be passed as POST data (void* or char*) */ +#define curlcheck_postfields(expr) \ + (curlcheck_ptr((expr), void) || \ + curlcheck_arr((expr), char) || \ + curlcheck_arr((expr), unsigned char)) + +/* helper: __builtin_types_compatible_p distinguishes between functions and + * function pointers, hide it */ +#define curlcheck_cb_compatible(func, type) \ + (__builtin_types_compatible_p(__typeof__(func), type) || \ + __builtin_types_compatible_p(__typeof__(func) *, type)) + +/* evaluates to true if expr is of type curl_resolver_start_callback */ +#define curlcheck_resolver_start_callback(expr) \ + (curlcheck_NULL(expr) || \ + curlcheck_cb_compatible((expr), curl_resolver_start_callback)) + +/* evaluates to true if expr is of type curl_read_callback or "similar" */ +#define curlcheck_read_cb(expr) \ + (curlcheck_NULL(expr) || \ + curlcheck_cb_compatible((expr), __typeof__(fread) *) || \ + curlcheck_cb_compatible((expr), curl_read_callback) || \ + curlcheck_cb_compatible((expr), _curl_read_callback1) || \ + curlcheck_cb_compatible((expr), _curl_read_callback2) || \ + curlcheck_cb_compatible((expr), _curl_read_callback3) || \ + curlcheck_cb_compatible((expr), _curl_read_callback4) || \ + curlcheck_cb_compatible((expr), _curl_read_callback5) || \ + curlcheck_cb_compatible((expr), _curl_read_callback6)) +typedef size_t (*_curl_read_callback1)(char *, size_t, size_t, void *); +typedef size_t (*_curl_read_callback2)(char *, size_t, size_t, const void *); +typedef size_t (*_curl_read_callback3)(char *, size_t, size_t, FILE *); +typedef size_t (*_curl_read_callback4)(void *, size_t, size_t, void *); +typedef size_t (*_curl_read_callback5)(void *, size_t, size_t, const void *); +typedef size_t (*_curl_read_callback6)(void *, size_t, size_t, FILE *); + +/* evaluates to true if expr is of type curl_write_callback or "similar" */ +#define curlcheck_write_cb(expr) \ + (curlcheck_read_cb(expr) || \ + curlcheck_cb_compatible((expr), __typeof__(fwrite) *) || \ + curlcheck_cb_compatible((expr), curl_write_callback) || \ + curlcheck_cb_compatible((expr), _curl_write_callback1) || \ + curlcheck_cb_compatible((expr), _curl_write_callback2) || \ + curlcheck_cb_compatible((expr), _curl_write_callback3) || \ + curlcheck_cb_compatible((expr), _curl_write_callback4) || \ + curlcheck_cb_compatible((expr), _curl_write_callback5) || \ + curlcheck_cb_compatible((expr), _curl_write_callback6)) +typedef size_t (*_curl_write_callback1)(const char *, size_t, size_t, void *); +typedef size_t (*_curl_write_callback2)(const char *, size_t, size_t, + const void *); +typedef size_t (*_curl_write_callback3)(const char *, size_t, size_t, FILE *); +typedef size_t (*_curl_write_callback4)(const void *, size_t, size_t, void *); +typedef size_t (*_curl_write_callback5)(const void *, size_t, size_t, + const void *); +typedef size_t (*_curl_write_callback6)(const void *, size_t, size_t, FILE *); + +/* evaluates to true if expr is of type curl_ioctl_callback or "similar" */ +#define curlcheck_ioctl_cb(expr) \ + (curlcheck_NULL(expr) || \ + curlcheck_cb_compatible((expr), curl_ioctl_callback) || \ + curlcheck_cb_compatible((expr), _curl_ioctl_callback1) || \ + curlcheck_cb_compatible((expr), _curl_ioctl_callback2) || \ + curlcheck_cb_compatible((expr), _curl_ioctl_callback3) || \ + curlcheck_cb_compatible((expr), _curl_ioctl_callback4)) +typedef curlioerr (*_curl_ioctl_callback1)(CURL *, int, void *); +typedef curlioerr (*_curl_ioctl_callback2)(CURL *, int, const void *); +typedef curlioerr (*_curl_ioctl_callback3)(CURL *, curliocmd, void *); +typedef curlioerr (*_curl_ioctl_callback4)(CURL *, curliocmd, const void *); + +/* evaluates to true if expr is of type curl_sockopt_callback or "similar" */ +#define curlcheck_sockopt_cb(expr) \ + (curlcheck_NULL(expr) || \ + curlcheck_cb_compatible((expr), curl_sockopt_callback) || \ + curlcheck_cb_compatible((expr), _curl_sockopt_callback1) || \ + curlcheck_cb_compatible((expr), _curl_sockopt_callback2)) +typedef int (*_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype); +typedef int (*_curl_sockopt_callback2)(const void *, curl_socket_t, + curlsocktype); + +/* evaluates to true if expr is of type curl_opensocket_callback or + "similar" */ +#define curlcheck_opensocket_cb(expr) \ + (curlcheck_NULL(expr) || \ + curlcheck_cb_compatible((expr), curl_opensocket_callback) || \ + curlcheck_cb_compatible((expr), _curl_opensocket_callback1) || \ + curlcheck_cb_compatible((expr), _curl_opensocket_callback2) || \ + curlcheck_cb_compatible((expr), _curl_opensocket_callback3) || \ + curlcheck_cb_compatible((expr), _curl_opensocket_callback4)) +typedef curl_socket_t (*_curl_opensocket_callback1) + (void *, curlsocktype, struct curl_sockaddr *); +typedef curl_socket_t (*_curl_opensocket_callback2) + (void *, curlsocktype, const struct curl_sockaddr *); +typedef curl_socket_t (*_curl_opensocket_callback3) + (const void *, curlsocktype, struct curl_sockaddr *); +typedef curl_socket_t (*_curl_opensocket_callback4) + (const void *, curlsocktype, const struct curl_sockaddr *); + +/* evaluates to true if expr is of type curl_progress_callback or "similar" */ +#define curlcheck_progress_cb(expr) \ + (curlcheck_NULL(expr) || \ + curlcheck_cb_compatible((expr), curl_progress_callback) || \ + curlcheck_cb_compatible((expr), _curl_progress_callback1) || \ + curlcheck_cb_compatible((expr), _curl_progress_callback2)) +typedef int (*_curl_progress_callback1)(void *, + double, double, double, double); +typedef int (*_curl_progress_callback2)(const void *, + double, double, double, double); + +/* evaluates to true if expr is of type curl_debug_callback or "similar" */ +#define curlcheck_debug_cb(expr) \ + (curlcheck_NULL(expr) || \ + curlcheck_cb_compatible((expr), curl_debug_callback) || \ + curlcheck_cb_compatible((expr), _curl_debug_callback1) || \ + curlcheck_cb_compatible((expr), _curl_debug_callback2) || \ + curlcheck_cb_compatible((expr), _curl_debug_callback3) || \ + curlcheck_cb_compatible((expr), _curl_debug_callback4) || \ + curlcheck_cb_compatible((expr), _curl_debug_callback5) || \ + curlcheck_cb_compatible((expr), _curl_debug_callback6) || \ + curlcheck_cb_compatible((expr), _curl_debug_callback7) || \ + curlcheck_cb_compatible((expr), _curl_debug_callback8)) +typedef int (*_curl_debug_callback1) (CURL *, + curl_infotype, char *, size_t, void *); +typedef int (*_curl_debug_callback2) (CURL *, + curl_infotype, char *, size_t, const void *); +typedef int (*_curl_debug_callback3) (CURL *, + curl_infotype, const char *, size_t, void *); +typedef int (*_curl_debug_callback4) (CURL *, + curl_infotype, const char *, size_t, const void *); +typedef int (*_curl_debug_callback5) (CURL *, + curl_infotype, unsigned char *, size_t, void *); +typedef int (*_curl_debug_callback6) (CURL *, + curl_infotype, unsigned char *, size_t, const void *); +typedef int (*_curl_debug_callback7) (CURL *, + curl_infotype, const unsigned char *, size_t, void *); +typedef int (*_curl_debug_callback8) (CURL *, + curl_infotype, const unsigned char *, size_t, const void *); + +/* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */ +/* this is getting even messier... */ +#define curlcheck_ssl_ctx_cb(expr) \ + (curlcheck_NULL(expr) || \ + curlcheck_cb_compatible((expr), curl_ssl_ctx_callback) || \ + curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback1) || \ + curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback2) || \ + curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback3) || \ + curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback4) || \ + curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback5) || \ + curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback6) || \ + curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback7) || \ + curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback8)) +typedef CURLcode (*_curl_ssl_ctx_callback1)(CURL *, void *, void *); +typedef CURLcode (*_curl_ssl_ctx_callback2)(CURL *, void *, const void *); +typedef CURLcode (*_curl_ssl_ctx_callback3)(CURL *, const void *, void *); +typedef CURLcode (*_curl_ssl_ctx_callback4)(CURL *, const void *, + const void *); +#ifdef HEADER_SSL_H +/* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX + * this will of course break if we're included before OpenSSL headers... + */ +typedef CURLcode (*_curl_ssl_ctx_callback5)(CURL *, SSL_CTX *, void *); +typedef CURLcode (*_curl_ssl_ctx_callback6)(CURL *, SSL_CTX *, const void *); +typedef CURLcode (*_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX *, void *); +typedef CURLcode (*_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX *, + const void *); +#else +typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5; +typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6; +typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback7; +typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8; +#endif + +/* evaluates to true if expr is of type curl_conv_callback or "similar" */ +#define curlcheck_conv_cb(expr) \ + (curlcheck_NULL(expr) || \ + curlcheck_cb_compatible((expr), curl_conv_callback) || \ + curlcheck_cb_compatible((expr), _curl_conv_callback1) || \ + curlcheck_cb_compatible((expr), _curl_conv_callback2) || \ + curlcheck_cb_compatible((expr), _curl_conv_callback3) || \ + curlcheck_cb_compatible((expr), _curl_conv_callback4)) +typedef CURLcode (*_curl_conv_callback1)(char *, size_t length); +typedef CURLcode (*_curl_conv_callback2)(const char *, size_t length); +typedef CURLcode (*_curl_conv_callback3)(void *, size_t length); +typedef CURLcode (*_curl_conv_callback4)(const void *, size_t length); + +/* evaluates to true if expr is of type curl_seek_callback or "similar" */ +#define curlcheck_seek_cb(expr) \ + (curlcheck_NULL(expr) || \ + curlcheck_cb_compatible((expr), curl_seek_callback) || \ + curlcheck_cb_compatible((expr), _curl_seek_callback1) || \ + curlcheck_cb_compatible((expr), _curl_seek_callback2)) +typedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int); +typedef CURLcode (*_curl_seek_callback2)(const void *, curl_off_t, int); + + +#endif /* CURLINC_TYPECHECK_GCC_H */ diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/urlapi.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/urlapi.h new file mode 100644 index 0000000..e15c213 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/urlapi.h @@ -0,0 +1,147 @@ +#ifndef CURLINC_URLAPI_H +#define CURLINC_URLAPI_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 2018 - 2022, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at https://curl.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * SPDX-License-Identifier: curl + * + ***************************************************************************/ + +#include "curl.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* the error codes for the URL API */ +typedef enum { + CURLUE_OK, + CURLUE_BAD_HANDLE, /* 1 */ + CURLUE_BAD_PARTPOINTER, /* 2 */ + CURLUE_MALFORMED_INPUT, /* 3 */ + CURLUE_BAD_PORT_NUMBER, /* 4 */ + CURLUE_UNSUPPORTED_SCHEME, /* 5 */ + CURLUE_URLDECODE, /* 6 */ + CURLUE_OUT_OF_MEMORY, /* 7 */ + CURLUE_USER_NOT_ALLOWED, /* 8 */ + CURLUE_UNKNOWN_PART, /* 9 */ + CURLUE_NO_SCHEME, /* 10 */ + CURLUE_NO_USER, /* 11 */ + CURLUE_NO_PASSWORD, /* 12 */ + CURLUE_NO_OPTIONS, /* 13 */ + CURLUE_NO_HOST, /* 14 */ + CURLUE_NO_PORT, /* 15 */ + CURLUE_NO_QUERY, /* 16 */ + CURLUE_NO_FRAGMENT, /* 17 */ + CURLUE_NO_ZONEID, /* 18 */ + CURLUE_BAD_FILE_URL, /* 19 */ + CURLUE_BAD_FRAGMENT, /* 20 */ + CURLUE_BAD_HOSTNAME, /* 21 */ + CURLUE_BAD_IPV6, /* 22 */ + CURLUE_BAD_LOGIN, /* 23 */ + CURLUE_BAD_PASSWORD, /* 24 */ + CURLUE_BAD_PATH, /* 25 */ + CURLUE_BAD_QUERY, /* 26 */ + CURLUE_BAD_SCHEME, /* 27 */ + CURLUE_BAD_SLASHES, /* 28 */ + CURLUE_BAD_USER, /* 29 */ + CURLUE_LAST +} CURLUcode; + +typedef enum { + CURLUPART_URL, + CURLUPART_SCHEME, + CURLUPART_USER, + CURLUPART_PASSWORD, + CURLUPART_OPTIONS, + CURLUPART_HOST, + CURLUPART_PORT, + CURLUPART_PATH, + CURLUPART_QUERY, + CURLUPART_FRAGMENT, + CURLUPART_ZONEID /* added in 7.65.0 */ +} CURLUPart; + +#define CURLU_DEFAULT_PORT (1<<0) /* return default port number */ +#define CURLU_NO_DEFAULT_PORT (1<<1) /* act as if no port number was set, + if the port number matches the + default for the scheme */ +#define CURLU_DEFAULT_SCHEME (1<<2) /* return default scheme if + missing */ +#define CURLU_NON_SUPPORT_SCHEME (1<<3) /* allow non-supported scheme */ +#define CURLU_PATH_AS_IS (1<<4) /* leave dot sequences */ +#define CURLU_DISALLOW_USER (1<<5) /* no user+password allowed */ +#define CURLU_URLDECODE (1<<6) /* URL decode on get */ +#define CURLU_URLENCODE (1<<7) /* URL encode on set */ +#define CURLU_APPENDQUERY (1<<8) /* append a form style part */ +#define CURLU_GUESS_SCHEME (1<<9) /* legacy curl-style guessing */ +#define CURLU_NO_AUTHORITY (1<<10) /* Allow empty authority when the + scheme is unknown. */ +#define CURLU_ALLOW_SPACE (1<<11) /* Allow spaces in the URL */ + +typedef struct Curl_URL CURLU; + +/* + * curl_url() creates a new CURLU handle and returns a pointer to it. + * Must be freed with curl_url_cleanup(). + */ +CURL_EXTERN CURLU *curl_url(void); + +/* + * curl_url_cleanup() frees the CURLU handle and related resources used for + * the URL parsing. It will not free strings previously returned with the URL + * API. + */ +CURL_EXTERN void curl_url_cleanup(CURLU *handle); + +/* + * curl_url_dup() duplicates a CURLU handle and returns a new copy. The new + * handle must also be freed with curl_url_cleanup(). + */ +CURL_EXTERN CURLU *curl_url_dup(CURLU *in); + +/* + * curl_url_get() extracts a specific part of the URL from a CURLU + * handle. Returns error code. The returned pointer MUST be freed with + * curl_free() afterwards. + */ +CURL_EXTERN CURLUcode curl_url_get(CURLU *handle, CURLUPart what, + char **part, unsigned int flags); + +/* + * curl_url_set() sets a specific part of the URL in a CURLU handle. Returns + * error code. The passed in string will be copied. Passing a NULL instead of + * a part string, clears that part. + */ +CURL_EXTERN CURLUcode curl_url_set(CURLU *handle, CURLUPart what, + const char *part, unsigned int flags); + +/* + * curl_url_strerror() turns a CURLUcode value into the equivalent human + * readable error string. This is useful for printing meaningful error + * messages. + */ +CURL_EXTERN const char *curl_url_strerror(CURLUcode); + +#ifdef __cplusplus +} /* end of extern "C" */ +#endif + +#endif /* CURLINC_URLAPI_H */ diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/websockets.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/websockets.h new file mode 100644 index 0000000..4d57f91 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/curl/websockets.h @@ -0,0 +1,83 @@ +#ifndef CURLINC_WEBSOCKETS_H +#define CURLINC_WEBSOCKETS_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2022, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at https://curl.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * SPDX-License-Identifier: curl + * + ***************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif + +struct curl_ws_frame { + int age; /* zero */ + int flags; /* See the CURLWS_* defines */ + curl_off_t offset; /* the offset of this data into the frame */ + curl_off_t bytesleft; /* number of pending bytes left of the payload */ +}; + +/* flag bits */ +#define CURLWS_TEXT (1<<0) +#define CURLWS_BINARY (1<<1) +#define CURLWS_CONT (1<<2) +#define CURLWS_CLOSE (1<<3) +#define CURLWS_PING (1<<4) +#define CURLWS_OFFSET (1<<5) + +/* + * NAME curl_ws_recv() + * + * DESCRIPTION + * + * Receives data from the websocket connection. Use after successful + * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. + */ +CURL_EXTERN CURLcode curl_ws_recv(CURL *curl, void *buffer, size_t buflen, + size_t *recv, + struct curl_ws_frame **metap); + +/* sendflags for curl_ws_send() */ +#define CURLWS_PONG (1<<6) + +/* + * NAME curl_easy_send() + * + * DESCRIPTION + * + * Sends data over the websocket connection. Use after successful + * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. + */ +CURL_EXTERN CURLcode curl_ws_send(CURL *curl, const void *buffer, + size_t buflen, size_t *sent, + curl_off_t framesize, + unsigned int sendflags); + +/* bits for the CURLOPT_WS_OPTIONS bitmask: */ +#define CURLWS_RAW_MODE (1<<0) + +CURL_EXTERN struct curl_ws_frame *curl_ws_meta(CURL *curl); + +#ifdef __cplusplus +} +#endif + +#endif /* CURLINC_WEBSOCKETS_H */ diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12.h new file mode 100644 index 0000000..07355f5 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12.h @@ -0,0 +1,28706 @@ +/*------------------------------------------------------------------------------------- + * + * Copyright (c) Microsoft Corporation + * Licensed under the MIT license + * + *-------------------------------------------------------------------------------------*/ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 8.01.0628 */ + + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 500 +#endif + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif /* __RPCNDR_H_VERSION__ */ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __d3d12_h__ +#define __d3d12_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +#ifndef DECLSPEC_XFGVIRT +#if defined(_CONTROL_FLOW_GUARD_XFG) +#define DECLSPEC_XFGVIRT(base, func) __declspec(xfg_virtual(base, func)) +#else +#define DECLSPEC_XFGVIRT(base, func) +#endif +#endif + +/* Forward Declarations */ + +#ifndef __ID3D12Object_FWD_DEFINED__ +#define __ID3D12Object_FWD_DEFINED__ +typedef interface ID3D12Object ID3D12Object; + +#endif /* __ID3D12Object_FWD_DEFINED__ */ + + +#ifndef __ID3D12DeviceChild_FWD_DEFINED__ +#define __ID3D12DeviceChild_FWD_DEFINED__ +typedef interface ID3D12DeviceChild ID3D12DeviceChild; + +#endif /* __ID3D12DeviceChild_FWD_DEFINED__ */ + + +#ifndef __ID3D12RootSignature_FWD_DEFINED__ +#define __ID3D12RootSignature_FWD_DEFINED__ +typedef interface ID3D12RootSignature ID3D12RootSignature; + +#endif /* __ID3D12RootSignature_FWD_DEFINED__ */ + + +#ifndef __ID3D12RootSignatureDeserializer_FWD_DEFINED__ +#define __ID3D12RootSignatureDeserializer_FWD_DEFINED__ +typedef interface ID3D12RootSignatureDeserializer ID3D12RootSignatureDeserializer; + +#endif /* __ID3D12RootSignatureDeserializer_FWD_DEFINED__ */ + + +#ifndef __ID3D12VersionedRootSignatureDeserializer_FWD_DEFINED__ +#define __ID3D12VersionedRootSignatureDeserializer_FWD_DEFINED__ +typedef interface ID3D12VersionedRootSignatureDeserializer ID3D12VersionedRootSignatureDeserializer; + +#endif /* __ID3D12VersionedRootSignatureDeserializer_FWD_DEFINED__ */ + + +#ifndef __ID3D12Pageable_FWD_DEFINED__ +#define __ID3D12Pageable_FWD_DEFINED__ +typedef interface ID3D12Pageable ID3D12Pageable; + +#endif /* __ID3D12Pageable_FWD_DEFINED__ */ + + +#ifndef __ID3D12Heap_FWD_DEFINED__ +#define __ID3D12Heap_FWD_DEFINED__ +typedef interface ID3D12Heap ID3D12Heap; + +#endif /* __ID3D12Heap_FWD_DEFINED__ */ + + +#ifndef __ID3D12Resource_FWD_DEFINED__ +#define __ID3D12Resource_FWD_DEFINED__ +typedef interface ID3D12Resource ID3D12Resource; + +#endif /* __ID3D12Resource_FWD_DEFINED__ */ + + +#ifndef __ID3D12CommandAllocator_FWD_DEFINED__ +#define __ID3D12CommandAllocator_FWD_DEFINED__ +typedef interface ID3D12CommandAllocator ID3D12CommandAllocator; + +#endif /* __ID3D12CommandAllocator_FWD_DEFINED__ */ + + +#ifndef __ID3D12Fence_FWD_DEFINED__ +#define __ID3D12Fence_FWD_DEFINED__ +typedef interface ID3D12Fence ID3D12Fence; + +#endif /* __ID3D12Fence_FWD_DEFINED__ */ + + +#ifndef __ID3D12Fence1_FWD_DEFINED__ +#define __ID3D12Fence1_FWD_DEFINED__ +typedef interface ID3D12Fence1 ID3D12Fence1; + +#endif /* __ID3D12Fence1_FWD_DEFINED__ */ + + +#ifndef __ID3D12PipelineState_FWD_DEFINED__ +#define __ID3D12PipelineState_FWD_DEFINED__ +typedef interface ID3D12PipelineState ID3D12PipelineState; + +#endif /* __ID3D12PipelineState_FWD_DEFINED__ */ + + +#ifndef __ID3D12DescriptorHeap_FWD_DEFINED__ +#define __ID3D12DescriptorHeap_FWD_DEFINED__ +typedef interface ID3D12DescriptorHeap ID3D12DescriptorHeap; + +#endif /* __ID3D12DescriptorHeap_FWD_DEFINED__ */ + + +#ifndef __ID3D12QueryHeap_FWD_DEFINED__ +#define __ID3D12QueryHeap_FWD_DEFINED__ +typedef interface ID3D12QueryHeap ID3D12QueryHeap; + +#endif /* __ID3D12QueryHeap_FWD_DEFINED__ */ + + +#ifndef __ID3D12CommandSignature_FWD_DEFINED__ +#define __ID3D12CommandSignature_FWD_DEFINED__ +typedef interface ID3D12CommandSignature ID3D12CommandSignature; + +#endif /* __ID3D12CommandSignature_FWD_DEFINED__ */ + + +#ifndef __ID3D12CommandList_FWD_DEFINED__ +#define __ID3D12CommandList_FWD_DEFINED__ +typedef interface ID3D12CommandList ID3D12CommandList; + +#endif /* __ID3D12CommandList_FWD_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList_FWD_DEFINED__ +#define __ID3D12GraphicsCommandList_FWD_DEFINED__ +typedef interface ID3D12GraphicsCommandList ID3D12GraphicsCommandList; + +#endif /* __ID3D12GraphicsCommandList_FWD_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList1_FWD_DEFINED__ +#define __ID3D12GraphicsCommandList1_FWD_DEFINED__ +typedef interface ID3D12GraphicsCommandList1 ID3D12GraphicsCommandList1; + +#endif /* __ID3D12GraphicsCommandList1_FWD_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList2_FWD_DEFINED__ +#define __ID3D12GraphicsCommandList2_FWD_DEFINED__ +typedef interface ID3D12GraphicsCommandList2 ID3D12GraphicsCommandList2; + +#endif /* __ID3D12GraphicsCommandList2_FWD_DEFINED__ */ + + +#ifndef __ID3D12CommandQueue_FWD_DEFINED__ +#define __ID3D12CommandQueue_FWD_DEFINED__ +typedef interface ID3D12CommandQueue ID3D12CommandQueue; + +#endif /* __ID3D12CommandQueue_FWD_DEFINED__ */ + + +#ifndef __ID3D12Device_FWD_DEFINED__ +#define __ID3D12Device_FWD_DEFINED__ +typedef interface ID3D12Device ID3D12Device; + +#endif /* __ID3D12Device_FWD_DEFINED__ */ + + +#ifndef __ID3D12PipelineLibrary_FWD_DEFINED__ +#define __ID3D12PipelineLibrary_FWD_DEFINED__ +typedef interface ID3D12PipelineLibrary ID3D12PipelineLibrary; + +#endif /* __ID3D12PipelineLibrary_FWD_DEFINED__ */ + + +#ifndef __ID3D12PipelineLibrary1_FWD_DEFINED__ +#define __ID3D12PipelineLibrary1_FWD_DEFINED__ +typedef interface ID3D12PipelineLibrary1 ID3D12PipelineLibrary1; + +#endif /* __ID3D12PipelineLibrary1_FWD_DEFINED__ */ + + +#ifndef __ID3D12Device1_FWD_DEFINED__ +#define __ID3D12Device1_FWD_DEFINED__ +typedef interface ID3D12Device1 ID3D12Device1; + +#endif /* __ID3D12Device1_FWD_DEFINED__ */ + + +#ifndef __ID3D12Device2_FWD_DEFINED__ +#define __ID3D12Device2_FWD_DEFINED__ +typedef interface ID3D12Device2 ID3D12Device2; + +#endif /* __ID3D12Device2_FWD_DEFINED__ */ + + +#ifndef __ID3D12Device3_FWD_DEFINED__ +#define __ID3D12Device3_FWD_DEFINED__ +typedef interface ID3D12Device3 ID3D12Device3; + +#endif /* __ID3D12Device3_FWD_DEFINED__ */ + + +#ifndef __ID3D12ProtectedSession_FWD_DEFINED__ +#define __ID3D12ProtectedSession_FWD_DEFINED__ +typedef interface ID3D12ProtectedSession ID3D12ProtectedSession; + +#endif /* __ID3D12ProtectedSession_FWD_DEFINED__ */ + + +#ifndef __ID3D12ProtectedResourceSession_FWD_DEFINED__ +#define __ID3D12ProtectedResourceSession_FWD_DEFINED__ +typedef interface ID3D12ProtectedResourceSession ID3D12ProtectedResourceSession; + +#endif /* __ID3D12ProtectedResourceSession_FWD_DEFINED__ */ + + +#ifndef __ID3D12Device4_FWD_DEFINED__ +#define __ID3D12Device4_FWD_DEFINED__ +typedef interface ID3D12Device4 ID3D12Device4; + +#endif /* __ID3D12Device4_FWD_DEFINED__ */ + + +#ifndef __ID3D12LifetimeOwner_FWD_DEFINED__ +#define __ID3D12LifetimeOwner_FWD_DEFINED__ +typedef interface ID3D12LifetimeOwner ID3D12LifetimeOwner; + +#endif /* __ID3D12LifetimeOwner_FWD_DEFINED__ */ + + +#ifndef __ID3D12SwapChainAssistant_FWD_DEFINED__ +#define __ID3D12SwapChainAssistant_FWD_DEFINED__ +typedef interface ID3D12SwapChainAssistant ID3D12SwapChainAssistant; + +#endif /* __ID3D12SwapChainAssistant_FWD_DEFINED__ */ + + +#ifndef __ID3D12LifetimeTracker_FWD_DEFINED__ +#define __ID3D12LifetimeTracker_FWD_DEFINED__ +typedef interface ID3D12LifetimeTracker ID3D12LifetimeTracker; + +#endif /* __ID3D12LifetimeTracker_FWD_DEFINED__ */ + + +#ifndef __ID3D12StateObject_FWD_DEFINED__ +#define __ID3D12StateObject_FWD_DEFINED__ +typedef interface ID3D12StateObject ID3D12StateObject; + +#endif /* __ID3D12StateObject_FWD_DEFINED__ */ + + +#ifndef __ID3D12StateObjectProperties_FWD_DEFINED__ +#define __ID3D12StateObjectProperties_FWD_DEFINED__ +typedef interface ID3D12StateObjectProperties ID3D12StateObjectProperties; + +#endif /* __ID3D12StateObjectProperties_FWD_DEFINED__ */ + + +#ifndef __ID3D12Device5_FWD_DEFINED__ +#define __ID3D12Device5_FWD_DEFINED__ +typedef interface ID3D12Device5 ID3D12Device5; + +#endif /* __ID3D12Device5_FWD_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedDataSettings_FWD_DEFINED__ +#define __ID3D12DeviceRemovedExtendedDataSettings_FWD_DEFINED__ +typedef interface ID3D12DeviceRemovedExtendedDataSettings ID3D12DeviceRemovedExtendedDataSettings; + +#endif /* __ID3D12DeviceRemovedExtendedDataSettings_FWD_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedDataSettings1_FWD_DEFINED__ +#define __ID3D12DeviceRemovedExtendedDataSettings1_FWD_DEFINED__ +typedef interface ID3D12DeviceRemovedExtendedDataSettings1 ID3D12DeviceRemovedExtendedDataSettings1; + +#endif /* __ID3D12DeviceRemovedExtendedDataSettings1_FWD_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedDataSettings2_FWD_DEFINED__ +#define __ID3D12DeviceRemovedExtendedDataSettings2_FWD_DEFINED__ +typedef interface ID3D12DeviceRemovedExtendedDataSettings2 ID3D12DeviceRemovedExtendedDataSettings2; + +#endif /* __ID3D12DeviceRemovedExtendedDataSettings2_FWD_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedData_FWD_DEFINED__ +#define __ID3D12DeviceRemovedExtendedData_FWD_DEFINED__ +typedef interface ID3D12DeviceRemovedExtendedData ID3D12DeviceRemovedExtendedData; + +#endif /* __ID3D12DeviceRemovedExtendedData_FWD_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedData1_FWD_DEFINED__ +#define __ID3D12DeviceRemovedExtendedData1_FWD_DEFINED__ +typedef interface ID3D12DeviceRemovedExtendedData1 ID3D12DeviceRemovedExtendedData1; + +#endif /* __ID3D12DeviceRemovedExtendedData1_FWD_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedData2_FWD_DEFINED__ +#define __ID3D12DeviceRemovedExtendedData2_FWD_DEFINED__ +typedef interface ID3D12DeviceRemovedExtendedData2 ID3D12DeviceRemovedExtendedData2; + +#endif /* __ID3D12DeviceRemovedExtendedData2_FWD_DEFINED__ */ + + +#ifndef __ID3D12Device6_FWD_DEFINED__ +#define __ID3D12Device6_FWD_DEFINED__ +typedef interface ID3D12Device6 ID3D12Device6; + +#endif /* __ID3D12Device6_FWD_DEFINED__ */ + + +#ifndef __ID3D12ProtectedResourceSession1_FWD_DEFINED__ +#define __ID3D12ProtectedResourceSession1_FWD_DEFINED__ +typedef interface ID3D12ProtectedResourceSession1 ID3D12ProtectedResourceSession1; + +#endif /* __ID3D12ProtectedResourceSession1_FWD_DEFINED__ */ + + +#ifndef __ID3D12Device7_FWD_DEFINED__ +#define __ID3D12Device7_FWD_DEFINED__ +typedef interface ID3D12Device7 ID3D12Device7; + +#endif /* __ID3D12Device7_FWD_DEFINED__ */ + + +#ifndef __ID3D12Device8_FWD_DEFINED__ +#define __ID3D12Device8_FWD_DEFINED__ +typedef interface ID3D12Device8 ID3D12Device8; + +#endif /* __ID3D12Device8_FWD_DEFINED__ */ + + +#ifndef __ID3D12Resource1_FWD_DEFINED__ +#define __ID3D12Resource1_FWD_DEFINED__ +typedef interface ID3D12Resource1 ID3D12Resource1; + +#endif /* __ID3D12Resource1_FWD_DEFINED__ */ + + +#ifndef __ID3D12Resource2_FWD_DEFINED__ +#define __ID3D12Resource2_FWD_DEFINED__ +typedef interface ID3D12Resource2 ID3D12Resource2; + +#endif /* __ID3D12Resource2_FWD_DEFINED__ */ + + +#ifndef __ID3D12Heap1_FWD_DEFINED__ +#define __ID3D12Heap1_FWD_DEFINED__ +typedef interface ID3D12Heap1 ID3D12Heap1; + +#endif /* __ID3D12Heap1_FWD_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList3_FWD_DEFINED__ +#define __ID3D12GraphicsCommandList3_FWD_DEFINED__ +typedef interface ID3D12GraphicsCommandList3 ID3D12GraphicsCommandList3; + +#endif /* __ID3D12GraphicsCommandList3_FWD_DEFINED__ */ + + +#ifndef __ID3D12MetaCommand_FWD_DEFINED__ +#define __ID3D12MetaCommand_FWD_DEFINED__ +typedef interface ID3D12MetaCommand ID3D12MetaCommand; + +#endif /* __ID3D12MetaCommand_FWD_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList4_FWD_DEFINED__ +#define __ID3D12GraphicsCommandList4_FWD_DEFINED__ +typedef interface ID3D12GraphicsCommandList4 ID3D12GraphicsCommandList4; + +#endif /* __ID3D12GraphicsCommandList4_FWD_DEFINED__ */ + + +#ifndef __ID3D12ShaderCacheSession_FWD_DEFINED__ +#define __ID3D12ShaderCacheSession_FWD_DEFINED__ +typedef interface ID3D12ShaderCacheSession ID3D12ShaderCacheSession; + +#endif /* __ID3D12ShaderCacheSession_FWD_DEFINED__ */ + + +#ifndef __ID3D12Device9_FWD_DEFINED__ +#define __ID3D12Device9_FWD_DEFINED__ +typedef interface ID3D12Device9 ID3D12Device9; + +#endif /* __ID3D12Device9_FWD_DEFINED__ */ + + +#ifndef __ID3D12Device10_FWD_DEFINED__ +#define __ID3D12Device10_FWD_DEFINED__ +typedef interface ID3D12Device10 ID3D12Device10; + +#endif /* __ID3D12Device10_FWD_DEFINED__ */ + + +#ifndef __ID3D12Device11_FWD_DEFINED__ +#define __ID3D12Device11_FWD_DEFINED__ +typedef interface ID3D12Device11 ID3D12Device11; + +#endif /* __ID3D12Device11_FWD_DEFINED__ */ + + +#ifndef __ID3D12VirtualizationGuestDevice_FWD_DEFINED__ +#define __ID3D12VirtualizationGuestDevice_FWD_DEFINED__ +typedef interface ID3D12VirtualizationGuestDevice ID3D12VirtualizationGuestDevice; + +#endif /* __ID3D12VirtualizationGuestDevice_FWD_DEFINED__ */ + + +#ifndef __ID3D12Tools_FWD_DEFINED__ +#define __ID3D12Tools_FWD_DEFINED__ +typedef interface ID3D12Tools ID3D12Tools; + +#endif /* __ID3D12Tools_FWD_DEFINED__ */ + + +#ifndef __ID3D12SDKConfiguration_FWD_DEFINED__ +#define __ID3D12SDKConfiguration_FWD_DEFINED__ +typedef interface ID3D12SDKConfiguration ID3D12SDKConfiguration; + +#endif /* __ID3D12SDKConfiguration_FWD_DEFINED__ */ + + +#ifndef __ID3D12SDKConfiguration1_FWD_DEFINED__ +#define __ID3D12SDKConfiguration1_FWD_DEFINED__ +typedef interface ID3D12SDKConfiguration1 ID3D12SDKConfiguration1; + +#endif /* __ID3D12SDKConfiguration1_FWD_DEFINED__ */ + + +#ifndef __ID3D12DeviceFactory_FWD_DEFINED__ +#define __ID3D12DeviceFactory_FWD_DEFINED__ +typedef interface ID3D12DeviceFactory ID3D12DeviceFactory; + +#endif /* __ID3D12DeviceFactory_FWD_DEFINED__ */ + + +#ifndef __ID3D12DeviceConfiguration_FWD_DEFINED__ +#define __ID3D12DeviceConfiguration_FWD_DEFINED__ +typedef interface ID3D12DeviceConfiguration ID3D12DeviceConfiguration; + +#endif /* __ID3D12DeviceConfiguration_FWD_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList5_FWD_DEFINED__ +#define __ID3D12GraphicsCommandList5_FWD_DEFINED__ +typedef interface ID3D12GraphicsCommandList5 ID3D12GraphicsCommandList5; + +#endif /* __ID3D12GraphicsCommandList5_FWD_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList6_FWD_DEFINED__ +#define __ID3D12GraphicsCommandList6_FWD_DEFINED__ +typedef interface ID3D12GraphicsCommandList6 ID3D12GraphicsCommandList6; + +#endif /* __ID3D12GraphicsCommandList6_FWD_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList7_FWD_DEFINED__ +#define __ID3D12GraphicsCommandList7_FWD_DEFINED__ +typedef interface ID3D12GraphicsCommandList7 ID3D12GraphicsCommandList7; + +#endif /* __ID3D12GraphicsCommandList7_FWD_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList8_FWD_DEFINED__ +#define __ID3D12GraphicsCommandList8_FWD_DEFINED__ +typedef interface ID3D12GraphicsCommandList8 ID3D12GraphicsCommandList8; + +#endif /* __ID3D12GraphicsCommandList8_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" +#include "dxgicommon.h" +#include "dxgiformat.h" +#include "d3dcommon.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_d3d12_0000_0000 */ +/* [local] */ + +#include +#pragma region App Family +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) +#ifndef _D3D12_CONSTANTS +#define _D3D12_CONSTANTS +#define D3D12_16BIT_INDEX_STRIP_CUT_VALUE ( 0xffff ) + +#define D3D12_32BIT_INDEX_STRIP_CUT_VALUE ( 0xffffffff ) + +#define D3D12_8BIT_INDEX_STRIP_CUT_VALUE ( 0xff ) + +#define D3D12_APPEND_ALIGNED_ELEMENT ( 0xffffffff ) + +#define D3D12_ARRAY_AXIS_ADDRESS_RANGE_BIT_COUNT ( 9 ) + +#define D3D12_CLIP_OR_CULL_DISTANCE_COUNT ( 8 ) + +#define D3D12_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT ( 2 ) + +#define D3D12_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT ( 14 ) + +#define D3D12_COMMONSHADER_CONSTANT_BUFFER_COMPONENTS ( 4 ) + +#define D3D12_COMMONSHADER_CONSTANT_BUFFER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_COMMONSHADER_CONSTANT_BUFFER_HW_SLOT_COUNT ( 15 ) + +#define D3D12_COMMONSHADER_CONSTANT_BUFFER_PARTIAL_UPDATE_EXTENTS_BYTE_ALIGNMENT ( 16 ) + +#define D3D12_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COUNT ( 15 ) + +#define D3D12_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READS_PER_INST ( 1 ) + +#define D3D12_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_COMMONSHADER_FLOWCONTROL_NESTING_LIMIT ( 64 ) + +#define D3D12_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COUNT ( 1 ) + +#define D3D12_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READS_PER_INST ( 1 ) + +#define D3D12_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_COMMONSHADER_IMMEDIATE_VALUE_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_COMMONSHADER_INPUT_RESOURCE_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_COMMONSHADER_INPUT_RESOURCE_REGISTER_COUNT ( 128 ) + +#define D3D12_COMMONSHADER_INPUT_RESOURCE_REGISTER_READS_PER_INST ( 1 ) + +#define D3D12_COMMONSHADER_INPUT_RESOURCE_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT ( 128 ) + +#define D3D12_COMMONSHADER_SAMPLER_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_COMMONSHADER_SAMPLER_REGISTER_COUNT ( 16 ) + +#define D3D12_COMMONSHADER_SAMPLER_REGISTER_READS_PER_INST ( 1 ) + +#define D3D12_COMMONSHADER_SAMPLER_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_COMMONSHADER_SAMPLER_SLOT_COUNT ( 16 ) + +#define D3D12_COMMONSHADER_SUBROUTINE_NESTING_LIMIT ( 32 ) + +#define D3D12_COMMONSHADER_TEMP_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_COMMONSHADER_TEMP_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_COMMONSHADER_TEMP_REGISTER_COUNT ( 4096 ) + +#define D3D12_COMMONSHADER_TEMP_REGISTER_READS_PER_INST ( 3 ) + +#define D3D12_COMMONSHADER_TEMP_REGISTER_READ_PORTS ( 3 ) + +#define D3D12_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MAX ( 10 ) + +#define D3D12_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MIN ( -10 ) + +#define D3D12_COMMONSHADER_TEXEL_OFFSET_MAX_NEGATIVE ( -8 ) + +#define D3D12_COMMONSHADER_TEXEL_OFFSET_MAX_POSITIVE ( 7 ) + +#define D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT ( 256 ) + +#define D3D12_CS_4_X_BUCKET00_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 256 ) + +#define D3D12_CS_4_X_BUCKET00_MAX_NUM_THREADS_PER_GROUP ( 64 ) + +#define D3D12_CS_4_X_BUCKET01_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 240 ) + +#define D3D12_CS_4_X_BUCKET01_MAX_NUM_THREADS_PER_GROUP ( 68 ) + +#define D3D12_CS_4_X_BUCKET02_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 224 ) + +#define D3D12_CS_4_X_BUCKET02_MAX_NUM_THREADS_PER_GROUP ( 72 ) + +#define D3D12_CS_4_X_BUCKET03_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 208 ) + +#define D3D12_CS_4_X_BUCKET03_MAX_NUM_THREADS_PER_GROUP ( 76 ) + +#define D3D12_CS_4_X_BUCKET04_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 192 ) + +#define D3D12_CS_4_X_BUCKET04_MAX_NUM_THREADS_PER_GROUP ( 84 ) + +#define D3D12_CS_4_X_BUCKET05_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 176 ) + +#define D3D12_CS_4_X_BUCKET05_MAX_NUM_THREADS_PER_GROUP ( 92 ) + +#define D3D12_CS_4_X_BUCKET06_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 160 ) + +#define D3D12_CS_4_X_BUCKET06_MAX_NUM_THREADS_PER_GROUP ( 100 ) + +#define D3D12_CS_4_X_BUCKET07_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 144 ) + +#define D3D12_CS_4_X_BUCKET07_MAX_NUM_THREADS_PER_GROUP ( 112 ) + +#define D3D12_CS_4_X_BUCKET08_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 128 ) + +#define D3D12_CS_4_X_BUCKET08_MAX_NUM_THREADS_PER_GROUP ( 128 ) + +#define D3D12_CS_4_X_BUCKET09_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 112 ) + +#define D3D12_CS_4_X_BUCKET09_MAX_NUM_THREADS_PER_GROUP ( 144 ) + +#define D3D12_CS_4_X_BUCKET10_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 96 ) + +#define D3D12_CS_4_X_BUCKET10_MAX_NUM_THREADS_PER_GROUP ( 168 ) + +#define D3D12_CS_4_X_BUCKET11_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 80 ) + +#define D3D12_CS_4_X_BUCKET11_MAX_NUM_THREADS_PER_GROUP ( 204 ) + +#define D3D12_CS_4_X_BUCKET12_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 64 ) + +#define D3D12_CS_4_X_BUCKET12_MAX_NUM_THREADS_PER_GROUP ( 256 ) + +#define D3D12_CS_4_X_BUCKET13_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 48 ) + +#define D3D12_CS_4_X_BUCKET13_MAX_NUM_THREADS_PER_GROUP ( 340 ) + +#define D3D12_CS_4_X_BUCKET14_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 32 ) + +#define D3D12_CS_4_X_BUCKET14_MAX_NUM_THREADS_PER_GROUP ( 512 ) + +#define D3D12_CS_4_X_BUCKET15_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 16 ) + +#define D3D12_CS_4_X_BUCKET15_MAX_NUM_THREADS_PER_GROUP ( 768 ) + +#define D3D12_CS_4_X_DISPATCH_MAX_THREAD_GROUPS_IN_Z_DIMENSION ( 1 ) + +#define D3D12_CS_4_X_RAW_UAV_BYTE_ALIGNMENT ( 256 ) + +#define D3D12_CS_4_X_THREAD_GROUP_MAX_THREADS_PER_GROUP ( 768 ) + +#define D3D12_CS_4_X_THREAD_GROUP_MAX_X ( 768 ) + +#define D3D12_CS_4_X_THREAD_GROUP_MAX_Y ( 768 ) + +#define D3D12_CS_4_X_UAV_REGISTER_COUNT ( 1 ) + +#define D3D12_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION ( 65535 ) + +#define D3D12_CS_TGSM_REGISTER_COUNT ( 8192 ) + +#define D3D12_CS_TGSM_REGISTER_READS_PER_INST ( 1 ) + +#define D3D12_CS_TGSM_RESOURCE_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_CS_TGSM_RESOURCE_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_CS_THREADGROUPID_REGISTER_COMPONENTS ( 3 ) + +#define D3D12_CS_THREADGROUPID_REGISTER_COUNT ( 1 ) + +#define D3D12_CS_THREADIDINGROUPFLATTENED_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_CS_THREADIDINGROUPFLATTENED_REGISTER_COUNT ( 1 ) + +#define D3D12_CS_THREADIDINGROUP_REGISTER_COMPONENTS ( 3 ) + +#define D3D12_CS_THREADIDINGROUP_REGISTER_COUNT ( 1 ) + +#define D3D12_CS_THREADID_REGISTER_COMPONENTS ( 3 ) + +#define D3D12_CS_THREADID_REGISTER_COUNT ( 1 ) + +#define D3D12_CS_THREAD_GROUP_MAX_THREADS_PER_GROUP ( 1024 ) + +#define D3D12_CS_THREAD_GROUP_MAX_X ( 1024 ) + +#define D3D12_CS_THREAD_GROUP_MAX_Y ( 1024 ) + +#define D3D12_CS_THREAD_GROUP_MAX_Z ( 64 ) + +#define D3D12_CS_THREAD_GROUP_MIN_X ( 1 ) + +#define D3D12_CS_THREAD_GROUP_MIN_Y ( 1 ) + +#define D3D12_CS_THREAD_GROUP_MIN_Z ( 1 ) + +#define D3D12_CS_THREAD_LOCAL_TEMP_REGISTER_POOL ( 16384 ) + +#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_BORDER_COLOR_COMPONENT ( 0.0f ) +#define D3D12_DEFAULT_DEPTH_BIAS ( 0 ) + +#define D3D12_DEFAULT_DEPTH_BIAS_CLAMP ( 0.0f ) +#define D3D12_DEFAULT_MAX_ANISOTROPY ( 16 ) + +#define D3D12_DEFAULT_MIP_LOD_BIAS ( 0.0f ) +#define D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT ( 4194304 ) + +#define D3D12_DEFAULT_RENDER_TARGET_ARRAY_INDEX ( 0 ) + +#define D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT ( 65536 ) + +#define D3D12_DEFAULT_SAMPLE_MASK ( 0xffffffff ) + +#define D3D12_DEFAULT_SCISSOR_ENDX ( 0 ) + +#define D3D12_DEFAULT_SCISSOR_ENDY ( 0 ) + +#define D3D12_DEFAULT_SCISSOR_STARTX ( 0 ) + +#define D3D12_DEFAULT_SCISSOR_STARTY ( 0 ) + +#define D3D12_DEFAULT_SLOPE_SCALED_DEPTH_BIAS ( 0.0f ) +#define D3D12_DEFAULT_STENCIL_READ_MASK ( 0xff ) + +#define D3D12_DEFAULT_STENCIL_REFERENCE ( 0 ) + +#define D3D12_DEFAULT_STENCIL_WRITE_MASK ( 0xff ) + +#define D3D12_DEFAULT_VIEWPORT_AND_SCISSORRECT_INDEX ( 0 ) + +#define D3D12_DEFAULT_VIEWPORT_HEIGHT ( 0 ) + +#define D3D12_DEFAULT_VIEWPORT_MAX_DEPTH ( 0.0f ) +#define D3D12_DEFAULT_VIEWPORT_MIN_DEPTH ( 0.0f ) +#define D3D12_DEFAULT_VIEWPORT_TOPLEFTX ( 0 ) + +#define D3D12_DEFAULT_VIEWPORT_TOPLEFTY ( 0 ) + +#define D3D12_DEFAULT_VIEWPORT_WIDTH ( 0 ) + +#define D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND ( 0xffffffff ) + +#define D3D12_DRIVER_RESERVED_REGISTER_SPACE_VALUES_END ( 0xfffffff7 ) + +#define D3D12_DRIVER_RESERVED_REGISTER_SPACE_VALUES_START ( 0xfffffff0 ) + +#define D3D12_DS_INPUT_CONTROL_POINTS_MAX_TOTAL_SCALARS ( 3968 ) + +#define D3D12_DS_INPUT_CONTROL_POINT_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_DS_INPUT_CONTROL_POINT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_DS_INPUT_CONTROL_POINT_REGISTER_COUNT ( 32 ) + +#define D3D12_DS_INPUT_CONTROL_POINT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_DS_INPUT_CONTROL_POINT_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_COMPONENTS ( 3 ) + +#define D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_COUNT ( 1 ) + +#define D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_COUNT ( 32 ) + +#define D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_COUNT ( 1 ) + +#define D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_DS_OUTPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_DS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_DS_OUTPUT_REGISTER_COUNT ( 32 ) + +#define D3D12_FLOAT16_FUSED_TOLERANCE_IN_ULP ( 0.6 ) +#define D3D12_FLOAT32_MAX ( 3.402823466e+38f ) +#define D3D12_FLOAT32_TO_INTEGER_TOLERANCE_IN_ULP ( 0.6f ) +#define D3D12_FLOAT_TO_SRGB_EXPONENT_DENOMINATOR ( 2.4f ) +#define D3D12_FLOAT_TO_SRGB_EXPONENT_NUMERATOR ( 1.0f ) +#define D3D12_FLOAT_TO_SRGB_OFFSET ( 0.055f ) +#define D3D12_FLOAT_TO_SRGB_SCALE_1 ( 12.92f ) +#define D3D12_FLOAT_TO_SRGB_SCALE_2 ( 1.055f ) +#define D3D12_FLOAT_TO_SRGB_THRESHOLD ( 0.0031308f ) +#define D3D12_FTOI_INSTRUCTION_MAX_INPUT ( 2147483647.999f ) +#define D3D12_FTOI_INSTRUCTION_MIN_INPUT ( -2147483648.999f ) +#define D3D12_FTOU_INSTRUCTION_MAX_INPUT ( 4294967295.999f ) +#define D3D12_FTOU_INSTRUCTION_MIN_INPUT ( 0.0f ) +#define D3D12_GS_INPUT_INSTANCE_ID_READS_PER_INST ( 2 ) + +#define D3D12_GS_INPUT_INSTANCE_ID_READ_PORTS ( 1 ) + +#define D3D12_GS_INPUT_INSTANCE_ID_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_GS_INPUT_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_GS_INPUT_INSTANCE_ID_REGISTER_COUNT ( 1 ) + +#define D3D12_GS_INPUT_PRIM_CONST_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_GS_INPUT_PRIM_CONST_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_GS_INPUT_PRIM_CONST_REGISTER_COUNT ( 1 ) + +#define D3D12_GS_INPUT_PRIM_CONST_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_GS_INPUT_PRIM_CONST_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_GS_INPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_GS_INPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_GS_INPUT_REGISTER_COUNT ( 32 ) + +#define D3D12_GS_INPUT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_GS_INPUT_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_GS_INPUT_REGISTER_VERTICES ( 32 ) + +#define D3D12_GS_MAX_INSTANCE_COUNT ( 32 ) + +#define D3D12_GS_MAX_OUTPUT_VERTEX_COUNT_ACROSS_INSTANCES ( 1024 ) + +#define D3D12_GS_OUTPUT_ELEMENTS ( 32 ) + +#define D3D12_GS_OUTPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_GS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_GS_OUTPUT_REGISTER_COUNT ( 32 ) + +#define D3D12_HS_CONTROL_POINT_PHASE_INPUT_REGISTER_COUNT ( 32 ) + +#define D3D12_HS_CONTROL_POINT_PHASE_OUTPUT_REGISTER_COUNT ( 32 ) + +#define D3D12_HS_CONTROL_POINT_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_HS_CONTROL_POINT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_HS_CONTROL_POINT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_HS_CONTROL_POINT_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_HS_FORK_PHASE_INSTANCE_COUNT_UPPER_BOUND ( 0xffffffff ) + +#define D3D12_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COUNT ( 1 ) + +#define D3D12_HS_INPUT_FORK_INSTANCE_ID_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_HS_INPUT_FORK_INSTANCE_ID_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COUNT ( 1 ) + +#define D3D12_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_HS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_HS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_HS_INPUT_PRIMITIVE_ID_REGISTER_COUNT ( 1 ) + +#define D3D12_HS_INPUT_PRIMITIVE_ID_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_HS_INPUT_PRIMITIVE_ID_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_HS_JOIN_PHASE_INSTANCE_COUNT_UPPER_BOUND ( 0xffffffff ) + +#define D3D12_HS_MAXTESSFACTOR_LOWER_BOUND ( 1.0f ) +#define D3D12_HS_MAXTESSFACTOR_UPPER_BOUND ( 64.0f ) +#define D3D12_HS_OUTPUT_CONTROL_POINTS_MAX_TOTAL_SCALARS ( 3968 ) + +#define D3D12_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COUNT ( 1 ) + +#define D3D12_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COUNT ( 32 ) + +#define D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_SCALAR_COMPONENTS ( 128 ) + +#define D3D12_IA_DEFAULT_INDEX_BUFFER_OFFSET_IN_BYTES ( 0 ) + +#define D3D12_IA_DEFAULT_PRIMITIVE_TOPOLOGY ( 0 ) + +#define D3D12_IA_DEFAULT_VERTEX_BUFFER_OFFSET_IN_BYTES ( 0 ) + +#define D3D12_IA_INDEX_INPUT_RESOURCE_SLOT_COUNT ( 1 ) + +#define D3D12_IA_INSTANCE_ID_BIT_COUNT ( 32 ) + +#define D3D12_IA_INTEGER_ARITHMETIC_BIT_COUNT ( 32 ) + +#define D3D12_IA_PATCH_MAX_CONTROL_POINT_COUNT ( 32 ) + +#define D3D12_IA_PRIMITIVE_ID_BIT_COUNT ( 32 ) + +#define D3D12_IA_VERTEX_ID_BIT_COUNT ( 32 ) + +#define D3D12_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT ( 32 ) + +#define D3D12_IA_VERTEX_INPUT_STRUCTURE_ELEMENTS_COMPONENTS ( 128 ) + +#define D3D12_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ( 32 ) + +#define D3D12_INTEGER_DIVIDE_BY_ZERO_QUOTIENT ( 0xffffffff ) + +#define D3D12_INTEGER_DIVIDE_BY_ZERO_REMAINDER ( 0xffffffff ) + +#define D3D12_KEEP_RENDER_TARGETS_AND_DEPTH_STENCIL ( 0xffffffff ) + +#define D3D12_KEEP_UNORDERED_ACCESS_VIEWS ( 0xffffffff ) + +#define D3D12_LINEAR_GAMMA ( 1.0f ) +#define D3D12_MAJOR_VERSION ( 12 ) + +#define D3D12_MAX_BORDER_COLOR_COMPONENT ( 1.0f ) +#define D3D12_MAX_DEPTH ( 1.0f ) +#define D3D12_MAX_LIVE_STATIC_SAMPLERS ( 2032 ) + +#define D3D12_MAX_MAXANISOTROPY ( 16 ) + +#define D3D12_MAX_MULTISAMPLE_SAMPLE_COUNT ( 32 ) + +#define D3D12_MAX_POSITION_VALUE ( 3.402823466e+34f ) +#define D3D12_MAX_ROOT_COST ( 64 ) + +#define D3D12_MAX_SHADER_VISIBLE_DESCRIPTOR_HEAP_SIZE_TIER_1 ( 1000000 ) + +#define D3D12_MAX_SHADER_VISIBLE_DESCRIPTOR_HEAP_SIZE_TIER_2 ( 1000000 ) + +#define D3D12_MAX_SHADER_VISIBLE_SAMPLER_HEAP_SIZE ( 2048 ) + +#define D3D12_MAX_TEXTURE_DIMENSION_2_TO_EXP ( 17 ) + +#define D3D12_MAX_VIEW_INSTANCE_COUNT ( 4 ) + +#define D3D12_MINOR_VERSION ( 0 ) + +#define D3D12_MIN_BORDER_COLOR_COMPONENT ( 0.0f ) +#define D3D12_MIN_DEPTH ( 0.0f ) +#define D3D12_MIN_MAXANISOTROPY ( 0 ) + +#define D3D12_MIP_LOD_BIAS_MAX ( 15.99f ) +#define D3D12_MIP_LOD_BIAS_MIN ( -16.0f ) +#define D3D12_MIP_LOD_FRACTIONAL_BIT_COUNT ( 8 ) + +#define D3D12_MIP_LOD_RANGE_BIT_COUNT ( 8 ) + +#define D3D12_MULTISAMPLE_ANTIALIAS_LINE_WIDTH ( 1.4f ) +#define D3D12_NONSAMPLE_FETCH_OUT_OF_RANGE_ACCESS_RESULT ( 0 ) + +#define D3D12_OS_RESERVED_REGISTER_SPACE_VALUES_END ( 0xffffffff ) + +#define D3D12_OS_RESERVED_REGISTER_SPACE_VALUES_START ( 0xfffffff8 ) + +#define D3D12_PACKED_TILE ( 0xffffffff ) + +#define D3D12_PIXEL_ADDRESS_RANGE_BIT_COUNT ( 15 ) + +#define D3D12_PREVIEW_SDK_VERSION ( 706 ) + +#define D3D12_PRE_SCISSOR_PIXEL_ADDRESS_RANGE_BIT_COUNT ( 16 ) + +#define D3D12_PS_CS_UAV_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_PS_CS_UAV_REGISTER_COUNT ( 8 ) + +#define D3D12_PS_CS_UAV_REGISTER_READS_PER_INST ( 1 ) + +#define D3D12_PS_CS_UAV_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_PS_FRONTFACING_DEFAULT_VALUE ( 0xffffffff ) + +#define D3D12_PS_FRONTFACING_FALSE_VALUE ( 0 ) + +#define D3D12_PS_FRONTFACING_TRUE_VALUE ( 0xffffffff ) + +#define D3D12_PS_INPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_PS_INPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_PS_INPUT_REGISTER_COUNT ( 32 ) + +#define D3D12_PS_INPUT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_PS_INPUT_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_PS_LEGACY_PIXEL_CENTER_FRACTIONAL_COMPONENT ( 0.0f ) +#define D3D12_PS_OUTPUT_DEPTH_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_PS_OUTPUT_DEPTH_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_PS_OUTPUT_DEPTH_REGISTER_COUNT ( 1 ) + +#define D3D12_PS_OUTPUT_MASK_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_PS_OUTPUT_MASK_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_PS_OUTPUT_MASK_REGISTER_COUNT ( 1 ) + +#define D3D12_PS_OUTPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_PS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_PS_OUTPUT_REGISTER_COUNT ( 8 ) + +#define D3D12_PS_PIXEL_CENTER_FRACTIONAL_COMPONENT ( 0.5f ) +#define D3D12_RAW_UAV_SRV_BYTE_ALIGNMENT ( 16 ) + +#define D3D12_RAYTRACING_AABB_BYTE_ALIGNMENT ( 8 ) + +#define D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BYTE_ALIGNMENT ( 256 ) + +#define D3D12_RAYTRACING_INSTANCE_DESCS_BYTE_ALIGNMENT ( 16 ) + +#define D3D12_RAYTRACING_MAX_ATTRIBUTE_SIZE_IN_BYTES ( 32 ) + +#define D3D12_RAYTRACING_MAX_DECLARABLE_TRACE_RECURSION_DEPTH ( 31 ) + +#define D3D12_RAYTRACING_MAX_GEOMETRIES_PER_BOTTOM_LEVEL_ACCELERATION_STRUCTURE ( 16777216 ) + +#define D3D12_RAYTRACING_MAX_INSTANCES_PER_TOP_LEVEL_ACCELERATION_STRUCTURE ( 16777216 ) + +#define D3D12_RAYTRACING_MAX_PRIMITIVES_PER_BOTTOM_LEVEL_ACCELERATION_STRUCTURE ( 536870912 ) + +#define D3D12_RAYTRACING_MAX_RAY_GENERATION_SHADER_THREADS ( 1073741824 ) + +#define D3D12_RAYTRACING_MAX_SHADER_RECORD_STRIDE ( 4096 ) + +#define D3D12_RAYTRACING_SHADER_RECORD_BYTE_ALIGNMENT ( 32 ) + +#define D3D12_RAYTRACING_SHADER_TABLE_BYTE_ALIGNMENT ( 64 ) + +#define D3D12_RAYTRACING_TRANSFORM3X4_BYTE_ALIGNMENT ( 16 ) + +#define D3D12_REQ_BLEND_OBJECT_COUNT_PER_DEVICE ( 4096 ) + +#define D3D12_REQ_BUFFER_RESOURCE_TEXEL_COUNT_2_TO_EXP ( 27 ) + +#define D3D12_REQ_CONSTANT_BUFFER_ELEMENT_COUNT ( 4096 ) + +#define D3D12_REQ_DEPTH_STENCIL_OBJECT_COUNT_PER_DEVICE ( 4096 ) + +#define D3D12_REQ_DRAWINDEXED_INDEX_COUNT_2_TO_EXP ( 32 ) + +#define D3D12_REQ_DRAW_VERTEX_COUNT_2_TO_EXP ( 32 ) + +#define D3D12_REQ_FILTERING_HW_ADDRESSABLE_RESOURCE_DIMENSION ( 16384 ) + +#define D3D12_REQ_GS_INVOCATION_32BIT_OUTPUT_COMPONENT_LIMIT ( 1024 ) + +#define D3D12_REQ_IMMEDIATE_CONSTANT_BUFFER_ELEMENT_COUNT ( 4096 ) + +#define D3D12_REQ_MAXANISOTROPY ( 16 ) + +#define D3D12_REQ_MIP_LEVELS ( 15 ) + +#define D3D12_REQ_MULTI_ELEMENT_STRUCTURE_SIZE_IN_BYTES ( 2048 ) + +#define D3D12_REQ_RASTERIZER_OBJECT_COUNT_PER_DEVICE ( 4096 ) + +#define D3D12_REQ_RENDER_TO_BUFFER_WINDOW_WIDTH ( 16384 ) + +#define D3D12_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_A_TERM ( 128 ) + +#define D3D12_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_B_TERM ( 0.25f ) +#define D3D12_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_C_TERM ( 2048 ) + +#define D3D12_REQ_RESOURCE_VIEW_COUNT_PER_DEVICE_2_TO_EXP ( 20 ) + +#define D3D12_REQ_SAMPLER_OBJECT_COUNT_PER_DEVICE ( 4096 ) + +#define D3D12_REQ_SUBRESOURCES ( 30720 ) + +#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_RESINFO_INSTRUCTION_MISSING_COMPONENT_RETVAL ( 0 ) + +#define D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES ( 0xffffffff ) + +#define D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT ( 2 ) + +#define D3D12_SDK_VERSION ( 606 ) + +#define D3D12_SHADER_IDENTIFIER_SIZE_IN_BYTES ( 32 ) + +#define D3D12_SHADER_MAJOR_VERSION ( 5 ) + +#define D3D12_SHADER_MAX_INSTANCES ( 65535 ) + +#define D3D12_SHADER_MAX_INTERFACES ( 253 ) + +#define D3D12_SHADER_MAX_INTERFACE_CALL_SITES ( 4096 ) + +#define D3D12_SHADER_MAX_TYPES ( 65535 ) + +#define D3D12_SHADER_MINOR_VERSION ( 1 ) + +#define D3D12_SHIFT_INSTRUCTION_PAD_VALUE ( 0 ) + +#define D3D12_SHIFT_INSTRUCTION_SHIFT_VALUE_BIT_COUNT ( 5 ) + +#define D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT ( 8 ) + +#define D3D12_SMALL_MSAA_RESOURCE_PLACEMENT_ALIGNMENT ( 65536 ) + +#define D3D12_SMALL_RESOURCE_PLACEMENT_ALIGNMENT ( 4096 ) + +#define D3D12_SO_BUFFER_MAX_STRIDE_IN_BYTES ( 2048 ) + +#define D3D12_SO_BUFFER_MAX_WRITE_WINDOW_IN_BYTES ( 512 ) + +#define D3D12_SO_BUFFER_SLOT_COUNT ( 4 ) + +#define D3D12_SO_DDI_REGISTER_INDEX_DENOTING_GAP ( 0xffffffff ) + +#define D3D12_SO_NO_RASTERIZED_STREAM ( 0xffffffff ) + +#define D3D12_SO_OUTPUT_COMPONENT_COUNT ( 128 ) + +#define D3D12_SO_STREAM_COUNT ( 4 ) + +#define D3D12_SPEC_DATE_DAY ( 14 ) + +#define D3D12_SPEC_DATE_MONTH ( 11 ) + +#define D3D12_SPEC_DATE_YEAR ( 2014 ) + +#define D3D12_SPEC_VERSION ( 1.16 ) +#define D3D12_SRGB_GAMMA ( 2.2f ) +#define D3D12_SRGB_TO_FLOAT_DENOMINATOR_1 ( 12.92f ) +#define D3D12_SRGB_TO_FLOAT_DENOMINATOR_2 ( 1.055f ) +#define D3D12_SRGB_TO_FLOAT_EXPONENT ( 2.4f ) +#define D3D12_SRGB_TO_FLOAT_OFFSET ( 0.055f ) +#define D3D12_SRGB_TO_FLOAT_THRESHOLD ( 0.04045f ) +#define D3D12_SRGB_TO_FLOAT_TOLERANCE_IN_ULP ( 0.5f ) +#define D3D12_STANDARD_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_STANDARD_COMPONENT_BIT_COUNT_DOUBLED ( 64 ) + +#define D3D12_STANDARD_MAXIMUM_ELEMENT_ALIGNMENT_BYTE_MULTIPLE ( 4 ) + +#define D3D12_STANDARD_PIXEL_COMPONENT_COUNT ( 128 ) + +#define D3D12_STANDARD_PIXEL_ELEMENT_COUNT ( 32 ) + +#define D3D12_STANDARD_VECTOR_SIZE ( 4 ) + +#define D3D12_STANDARD_VERTEX_ELEMENT_COUNT ( 32 ) + +#define D3D12_STANDARD_VERTEX_TOTAL_COMPONENT_COUNT ( 64 ) + +#define D3D12_SUBPIXEL_FRACTIONAL_BIT_COUNT ( 8 ) + +#define D3D12_SUBTEXEL_FRACTIONAL_BIT_COUNT ( 8 ) + +#define D3D12_SYSTEM_RESERVED_REGISTER_SPACE_VALUES_END ( 0xffffffff ) + +#define D3D12_SYSTEM_RESERVED_REGISTER_SPACE_VALUES_START ( 0xfffffff0 ) + +#define D3D12_TESSELLATOR_MAX_EVEN_TESSELLATION_FACTOR ( 64 ) + +#define D3D12_TESSELLATOR_MAX_ISOLINE_DENSITY_TESSELLATION_FACTOR ( 64 ) + +#define D3D12_TESSELLATOR_MAX_ODD_TESSELLATION_FACTOR ( 63 ) + +#define D3D12_TESSELLATOR_MAX_TESSELLATION_FACTOR ( 64 ) + +#define D3D12_TESSELLATOR_MIN_EVEN_TESSELLATION_FACTOR ( 2 ) + +#define D3D12_TESSELLATOR_MIN_ISOLINE_DENSITY_TESSELLATION_FACTOR ( 1 ) + +#define D3D12_TESSELLATOR_MIN_ODD_TESSELLATION_FACTOR ( 1 ) + +#define D3D12_TEXEL_ADDRESS_RANGE_BIT_COUNT ( 16 ) + +#define D3D12_TEXTURE_DATA_PITCH_ALIGNMENT ( 256 ) + +#define D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT ( 512 ) + +#define D3D12_TILED_RESOURCE_TILE_SIZE_IN_BYTES ( 65536 ) + +#define D3D12_TRACKED_WORKLOAD_MAX_INSTANCES ( 32 ) + +#define D3D12_UAV_COUNTER_PLACEMENT_ALIGNMENT ( 4096 ) + +#define D3D12_UAV_SLOT_COUNT ( 64 ) + +#define D3D12_UNBOUND_MEMORY_ACCESS_RESULT ( 0 ) + +#define D3D12_VIDEO_DECODE_MAX_ARGUMENTS ( 10 ) + +#define D3D12_VIDEO_DECODE_MAX_HISTOGRAM_COMPONENTS ( 4 ) + +#define D3D12_VIDEO_DECODE_MIN_BITSTREAM_OFFSET_ALIGNMENT ( 256 ) + +#define D3D12_VIDEO_DECODE_MIN_HISTOGRAM_OFFSET_ALIGNMENT ( 256 ) + +#define D3D12_VIDEO_DECODE_STATUS_MACROBLOCKS_AFFECTED_UNKNOWN ( 0xffffffff ) + +#define D3D12_VIDEO_PROCESS_MAX_FILTERS ( 32 ) + +#define D3D12_VIDEO_PROCESS_STEREO_VIEWS ( 2 ) + +#define D3D12_VIEWPORT_AND_SCISSORRECT_MAX_INDEX ( 15 ) + +#define D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE ( 16 ) + +#define D3D12_VIEWPORT_BOUNDS_MAX ( 32767 ) + +#define D3D12_VIEWPORT_BOUNDS_MIN ( -32768 ) + +#define D3D12_VS_INPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_VS_INPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_VS_INPUT_REGISTER_COUNT ( 32 ) + +#define D3D12_VS_INPUT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_VS_INPUT_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_VS_OUTPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_VS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_VS_OUTPUT_REGISTER_COUNT ( 32 ) + +#define D3D12_WHQL_CONTEXT_COUNT_FOR_RESOURCE_LIMIT ( 10 ) + +#define D3D12_WHQL_DRAWINDEXED_INDEX_COUNT_2_TO_EXP ( 25 ) + +#define D3D12_WHQL_DRAW_VERTEX_COUNT_2_TO_EXP ( 25 ) + +#endif + +typedef UINT64 D3D12_GPU_VIRTUAL_ADDRESS; + +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_VIDEO_DECODE = 4, + D3D12_COMMAND_LIST_TYPE_VIDEO_PROCESS = 5, + D3D12_COMMAND_LIST_TYPE_VIDEO_ENCODE = 6, + D3D12_COMMAND_LIST_TYPE_NONE = -1 + } D3D12_COMMAND_LIST_TYPE; + +typedef +enum D3D12_COMMAND_QUEUE_FLAGS + { + D3D12_COMMAND_QUEUE_FLAG_NONE = 0, + D3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT = 0x1 + } D3D12_COMMAND_QUEUE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_QUEUE_FLAGS ); +typedef +enum D3D12_COMMAND_QUEUE_PRIORITY + { + D3D12_COMMAND_QUEUE_PRIORITY_NORMAL = 0, + D3D12_COMMAND_QUEUE_PRIORITY_HIGH = 100, + D3D12_COMMAND_QUEUE_PRIORITY_GLOBAL_REALTIME = 10000 + } D3D12_COMMAND_QUEUE_PRIORITY; + +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 +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 +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 + { + LPCSTR SemanticName; + UINT SemanticIndex; + DXGI_FORMAT Format; + UINT InputSlot; + UINT AlignedByteOffset; + D3D12_INPUT_CLASSIFICATION InputSlotClass; + UINT InstanceDataStepRate; + } D3D12_INPUT_ELEMENT_DESC; + +typedef +enum D3D12_FILL_MODE + { + D3D12_FILL_MODE_WIREFRAME = 2, + D3D12_FILL_MODE_SOLID = 3 + } D3D12_FILL_MODE; + +typedef D3D_PRIMITIVE_TOPOLOGY D3D12_PRIMITIVE_TOPOLOGY; + +typedef D3D_PRIMITIVE D3D12_PRIMITIVE; + +typedef +enum D3D12_CULL_MODE + { + D3D12_CULL_MODE_NONE = 1, + D3D12_CULL_MODE_FRONT = 2, + D3D12_CULL_MODE_BACK = 3 + } D3D12_CULL_MODE; + +typedef struct D3D12_SO_DECLARATION_ENTRY + { + UINT Stream; + LPCSTR SemanticName; + UINT SemanticIndex; + BYTE StartComponent; + BYTE ComponentCount; + BYTE OutputSlot; + } D3D12_SO_DECLARATION_ENTRY; + +typedef struct D3D12_VIEWPORT + { + FLOAT TopLeftX; + FLOAT TopLeftY; + FLOAT Width; + FLOAT Height; + FLOAT MinDepth; + FLOAT MaxDepth; + } D3D12_VIEWPORT; + +typedef RECT D3D12_RECT; + +typedef struct D3D12_BOX + { + UINT left; + UINT top; + UINT front; + UINT right; + UINT bottom; + UINT back; + } D3D12_BOX; + +typedef +enum D3D12_COMPARISON_FUNC + { + D3D12_COMPARISON_FUNC_NONE = 0, + 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 +enum D3D12_DEPTH_WRITE_MASK + { + D3D12_DEPTH_WRITE_MASK_ZERO = 0, + D3D12_DEPTH_WRITE_MASK_ALL = 1 + } D3D12_DEPTH_WRITE_MASK; + +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 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 struct D3D12_DEPTH_STENCIL_DESC1 + { + 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; + BOOL DepthBoundsTestEnable; + } D3D12_DEPTH_STENCIL_DESC1; + +typedef struct D3D12_DEPTH_STENCILOP_DESC1 + { + D3D12_STENCIL_OP StencilFailOp; + D3D12_STENCIL_OP StencilDepthFailOp; + D3D12_STENCIL_OP StencilPassOp; + D3D12_COMPARISON_FUNC StencilFunc; + UINT8 StencilReadMask; + UINT8 StencilWriteMask; + } D3D12_DEPTH_STENCILOP_DESC1; + +typedef struct D3D12_DEPTH_STENCIL_DESC2 + { + BOOL DepthEnable; + D3D12_DEPTH_WRITE_MASK DepthWriteMask; + D3D12_COMPARISON_FUNC DepthFunc; + BOOL StencilEnable; + D3D12_DEPTH_STENCILOP_DESC1 FrontFace; + D3D12_DEPTH_STENCILOP_DESC1 BackFace; + BOOL DepthBoundsTestEnable; + } D3D12_DEPTH_STENCIL_DESC2; + +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_ALPHA_FACTOR = 20, + D3D12_BLEND_INV_ALPHA_FACTOR = 21 + } 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_COLOR_WRITE_ENABLE + { + D3D12_COLOR_WRITE_ENABLE_RED = 1, + D3D12_COLOR_WRITE_ENABLE_GREEN = 2, + D3D12_COLOR_WRITE_ENABLE_BLUE = 4, + D3D12_COLOR_WRITE_ENABLE_ALPHA = 8, + 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 +enum D3D12_LOGIC_OP + { + D3D12_LOGIC_OP_CLEAR = 0, + D3D12_LOGIC_OP_SET = ( D3D12_LOGIC_OP_CLEAR + 1 ) , + D3D12_LOGIC_OP_COPY = ( D3D12_LOGIC_OP_SET + 1 ) , + D3D12_LOGIC_OP_COPY_INVERTED = ( D3D12_LOGIC_OP_COPY + 1 ) , + D3D12_LOGIC_OP_NOOP = ( D3D12_LOGIC_OP_COPY_INVERTED + 1 ) , + D3D12_LOGIC_OP_INVERT = ( D3D12_LOGIC_OP_NOOP + 1 ) , + D3D12_LOGIC_OP_AND = ( D3D12_LOGIC_OP_INVERT + 1 ) , + D3D12_LOGIC_OP_NAND = ( D3D12_LOGIC_OP_AND + 1 ) , + D3D12_LOGIC_OP_OR = ( D3D12_LOGIC_OP_NAND + 1 ) , + D3D12_LOGIC_OP_NOR = ( D3D12_LOGIC_OP_OR + 1 ) , + D3D12_LOGIC_OP_XOR = ( D3D12_LOGIC_OP_NOR + 1 ) , + D3D12_LOGIC_OP_EQUIV = ( D3D12_LOGIC_OP_XOR + 1 ) , + D3D12_LOGIC_OP_AND_REVERSE = ( D3D12_LOGIC_OP_EQUIV + 1 ) , + D3D12_LOGIC_OP_AND_INVERTED = ( D3D12_LOGIC_OP_AND_REVERSE + 1 ) , + D3D12_LOGIC_OP_OR_REVERSE = ( D3D12_LOGIC_OP_AND_INVERTED + 1 ) , + D3D12_LOGIC_OP_OR_INVERTED = ( D3D12_LOGIC_OP_OR_REVERSE + 1 ) + } D3D12_LOGIC_OP; + +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; + +/* Note, the array size for RenderTarget[] above is D3D12_SIMULTANEOUS_RENDERTARGET_COUNT. + IDL processing/generation of this header replaces the define; this comment is merely explaining what happened. */ +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; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0000_v0_0_s_ifspec; + +#ifndef __ID3D12Object_INTERFACE_DEFINED__ +#define __ID3D12Object_INTERFACE_DEFINED__ + +/* interface ID3D12Object */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Object; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("c4fec28f-7966-4e95-9f94-f431cb56c3b8") + ID3D12Object : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetPrivateData( + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPrivateData( + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface( + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetName( + _In_z_ LPCWSTR Name) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12ObjectVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Object * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Object * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Object * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Object * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Object * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Object * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Object * This, + _In_z_ LPCWSTR Name); + + END_INTERFACE + } ID3D12ObjectVtbl; + + interface ID3D12Object + { + CONST_VTBL struct ID3D12ObjectVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#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) ) + + +#define ID3D12Object_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Object_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Object_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Object_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Object_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DeviceChild_INTERFACE_DEFINED__ +#define __ID3D12DeviceChild_INTERFACE_DEFINED__ + +/* interface ID3D12DeviceChild */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DeviceChild; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("905db94b-a00c-4140-9df5-2b64ca9ea357") + ID3D12DeviceChild : public ID3D12Object + { + public: + virtual HRESULT STDMETHODCALLTYPE GetDevice( + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceChildVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceChild * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceChild * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceChild * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12DeviceChild * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12DeviceChild * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12DeviceChild * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12DeviceChild * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12DeviceChild * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + END_INTERFACE + } ID3D12DeviceChildVtbl; + + interface ID3D12DeviceChild + { + CONST_VTBL struct ID3D12DeviceChildVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#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) ) + + +#define ID3D12DeviceChild_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12DeviceChild_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12DeviceChild_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12DeviceChild_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12DeviceChild_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DeviceChild_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12RootSignature_INTERFACE_DEFINED__ +#define __ID3D12RootSignature_INTERFACE_DEFINED__ + +/* interface ID3D12RootSignature */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12RootSignature; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("c54a6b66-72df-4ee8-8be5-a946a1429214") + ID3D12RootSignature : public ID3D12DeviceChild + { + public: + }; + + +#else /* C style interface */ + + typedef struct ID3D12RootSignatureVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12RootSignature * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12RootSignature * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12RootSignature * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12RootSignature * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12RootSignature * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12RootSignature * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12RootSignature * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12RootSignature * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + END_INTERFACE + } ID3D12RootSignatureVtbl; + + interface ID3D12RootSignature + { + CONST_VTBL struct ID3D12RootSignatureVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#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) ) + + +#define ID3D12RootSignature_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12RootSignature_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12RootSignature_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12RootSignature_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12RootSignature_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12RootSignature_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0001 */ +/* [local] */ + +typedef struct D3D12_SHADER_BYTECODE + { + _Field_size_bytes_full_(BytecodeLength) const void *pShaderBytecode; + SIZE_T BytecodeLength; + } D3D12_SHADER_BYTECODE; + +typedef struct D3D12_STREAM_OUTPUT_DESC + { + _Field_size_full_(NumEntries) const D3D12_SO_DECLARATION_ENTRY *pSODeclaration; + UINT NumEntries; + _Field_size_full_(NumStrides) const UINT *pBufferStrides; + UINT NumStrides; + UINT RasterizedStream; + } D3D12_STREAM_OUTPUT_DESC; + +typedef struct D3D12_INPUT_LAYOUT_DESC + { + _Field_size_full_(NumElements) 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 struct D3D12_CACHED_PIPELINE_STATE + { + _Field_size_bytes_full_(CachedBlobSizeInBytes) const void *pCachedBlob; + SIZE_T CachedBlobSizeInBytes; + } D3D12_CACHED_PIPELINE_STATE; + +typedef +enum D3D12_PIPELINE_STATE_FLAGS + { + D3D12_PIPELINE_STATE_FLAG_NONE = 0, + D3D12_PIPELINE_STATE_FLAG_TOOL_DEBUG = 0x1 + } D3D12_PIPELINE_STATE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( 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; + +struct D3D12_RT_FORMAT_ARRAY + { + DXGI_FORMAT RTFormats[ 8 ]; + UINT NumRenderTargets; + } ; +typedef struct D3D12_PIPELINE_STATE_STREAM_DESC + { + _In_ SIZE_T SizeInBytes; + _In_reads_(_Inexpressible_("Dependent on size of subobjects")) void *pPipelineStateSubobjectStream; + } D3D12_PIPELINE_STATE_STREAM_DESC; + +typedef +enum D3D12_PIPELINE_STATE_SUBOBJECT_TYPE + { + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_ROOT_SIGNATURE = 0, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VS = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_ROOT_SIGNATURE + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PS = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VS + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DS = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PS + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_HS = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DS + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_GS = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_HS + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CS = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_GS + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_STREAM_OUTPUT = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CS + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_BLEND = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_STREAM_OUTPUT + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_MASK = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_BLEND + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_MASK + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_INPUT_LAYOUT = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_IB_STRIP_CUT_VALUE = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_INPUT_LAYOUT + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PRIMITIVE_TOPOLOGY = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_IB_STRIP_CUT_VALUE + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RENDER_TARGET_FORMATS = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PRIMITIVE_TOPOLOGY + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL_FORMAT = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RENDER_TARGET_FORMATS + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_DESC = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL_FORMAT + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_NODE_MASK = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_DESC + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CACHED_PSO = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_NODE_MASK + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_FLAGS = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CACHED_PSO + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1 = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_FLAGS + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VIEW_INSTANCING = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1 + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_AS = 24, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MS = 25, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2 = 26, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MAX_VALID = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2 + 1 ) + } D3D12_PIPELINE_STATE_SUBOBJECT_TYPE; + +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_MULTISAMPLE_QUALITY_LEVELS = 4, + D3D12_FEATURE_FORMAT_INFO = 5, + D3D12_FEATURE_GPU_VIRTUAL_ADDRESS_SUPPORT = 6, + D3D12_FEATURE_SHADER_MODEL = 7, + D3D12_FEATURE_D3D12_OPTIONS1 = 8, + D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_SUPPORT = 10, + D3D12_FEATURE_ROOT_SIGNATURE = 12, + D3D12_FEATURE_ARCHITECTURE1 = 16, + D3D12_FEATURE_D3D12_OPTIONS2 = 18, + D3D12_FEATURE_SHADER_CACHE = 19, + D3D12_FEATURE_COMMAND_QUEUE_PRIORITY = 20, + D3D12_FEATURE_D3D12_OPTIONS3 = 21, + D3D12_FEATURE_EXISTING_HEAPS = 22, + D3D12_FEATURE_D3D12_OPTIONS4 = 23, + D3D12_FEATURE_SERIALIZATION = 24, + D3D12_FEATURE_CROSS_NODE = 25, + D3D12_FEATURE_D3D12_OPTIONS5 = 27, + D3D12_FEATURE_DISPLAYABLE = 28, + D3D12_FEATURE_D3D12_OPTIONS6 = 30, + D3D12_FEATURE_QUERY_META_COMMAND = 31, + D3D12_FEATURE_D3D12_OPTIONS7 = 32, + D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_TYPE_COUNT = 33, + D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_TYPES = 34, + D3D12_FEATURE_D3D12_OPTIONS8 = 36, + D3D12_FEATURE_D3D12_OPTIONS9 = 37, + D3D12_FEATURE_D3D12_OPTIONS10 = 39, + D3D12_FEATURE_D3D12_OPTIONS11 = 40, + D3D12_FEATURE_D3D12_OPTIONS12 = 41, + D3D12_FEATURE_D3D12_OPTIONS13 = 42, + D3D12_FEATURE_D3D12_OPTIONS14 = 43, + D3D12_FEATURE_D3D12_OPTIONS15 = 44 + } D3D12_FEATURE; + +typedef +enum D3D12_SHADER_MIN_PRECISION_SUPPORT + { + D3D12_SHADER_MIN_PRECISION_SUPPORT_NONE = 0, + D3D12_SHADER_MIN_PRECISION_SUPPORT_10_BIT = 0x1, + D3D12_SHADER_MIN_PRECISION_SUPPORT_16_BIT = 0x2 + } D3D12_SHADER_MIN_PRECISION_SUPPORT; + +DEFINE_ENUM_FLAG_OPERATORS( 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_4 = 4 + } 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_FORMAT_SUPPORT1 + { + D3D12_FORMAT_SUPPORT1_NONE = 0, + 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; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_FORMAT_SUPPORT1 ); +typedef +enum D3D12_FORMAT_SUPPORT2 + { + D3D12_FORMAT_SUPPORT2_NONE = 0, + 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_SAMPLER_FEEDBACK = 0x8000 + } D3D12_FORMAT_SUPPORT2; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_FORMAT_SUPPORT2 ); +typedef +enum D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS + { + D3D12_MULTISAMPLE_QUALITY_LEVELS_FLAG_NONE = 0, + D3D12_MULTISAMPLE_QUALITY_LEVELS_FLAG_TILED_RESOURCE = 0x1 + } D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS ); +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_3 = 4 + } 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_PROGRAMMABLE_SAMPLE_POSITIONS_TIER + { + D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_NOT_SUPPORTED = 0, + D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_1 = 1, + D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_2 = 2 + } D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER; + +typedef +enum D3D12_VIEW_INSTANCING_TIER + { + D3D12_VIEW_INSTANCING_TIER_NOT_SUPPORTED = 0, + D3D12_VIEW_INSTANCING_TIER_1 = 1, + D3D12_VIEW_INSTANCING_TIER_2 = 2, + D3D12_VIEW_INSTANCING_TIER_3 = 3 + } D3D12_VIEW_INSTANCING_TIER; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS + { + _Out_ BOOL DoublePrecisionFloatShaderOps; + _Out_ BOOL OutputMergerLogicOp; + _Out_ D3D12_SHADER_MIN_PRECISION_SUPPORT MinPrecisionSupport; + _Out_ D3D12_TILED_RESOURCES_TIER TiledResourcesTier; + _Out_ D3D12_RESOURCE_BINDING_TIER ResourceBindingTier; + _Out_ BOOL PSSpecifiedStencilRefSupported; + _Out_ BOOL TypedUAVLoadAdditionalFormats; + _Out_ BOOL ROVsSupported; + _Out_ D3D12_CONSERVATIVE_RASTERIZATION_TIER ConservativeRasterizationTier; + _Out_ UINT MaxGPUVirtualAddressBitsPerResource; + _Out_ BOOL StandardSwizzle64KBSupported; + _Out_ D3D12_CROSS_NODE_SHARING_TIER CrossNodeSharingTier; + _Out_ BOOL CrossAdapterRowMajorTextureSupported; + _Out_ BOOL VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation; + _Out_ D3D12_RESOURCE_HEAP_TIER ResourceHeapTier; + } D3D12_FEATURE_DATA_D3D12_OPTIONS; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS1 + { + _Out_ BOOL WaveOps; + _Out_ UINT WaveLaneCountMin; + _Out_ UINT WaveLaneCountMax; + _Out_ UINT TotalLaneCount; + _Out_ BOOL ExpandedComputeResourceStates; + _Out_ BOOL Int64ShaderOps; + } D3D12_FEATURE_DATA_D3D12_OPTIONS1; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS2 + { + _Out_ BOOL DepthBoundsTestSupported; + _Out_ D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER ProgrammableSamplePositionsTier; + } D3D12_FEATURE_DATA_D3D12_OPTIONS2; + +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_FEATURE_DATA_ROOT_SIGNATURE + { + _Inout_ D3D_ROOT_SIGNATURE_VERSION HighestVersion; + } D3D12_FEATURE_DATA_ROOT_SIGNATURE; + +typedef struct D3D12_FEATURE_DATA_ARCHITECTURE + { + _In_ UINT NodeIndex; + _Out_ BOOL TileBasedRenderer; + _Out_ BOOL UMA; + _Out_ BOOL CacheCoherentUMA; + } D3D12_FEATURE_DATA_ARCHITECTURE; + +typedef struct D3D12_FEATURE_DATA_ARCHITECTURE1 + { + _In_ UINT NodeIndex; + _Out_ BOOL TileBasedRenderer; + _Out_ BOOL UMA; + _Out_ BOOL CacheCoherentUMA; + _Out_ BOOL IsolatedMMU; + } D3D12_FEATURE_DATA_ARCHITECTURE1; + +typedef struct D3D12_FEATURE_DATA_FEATURE_LEVELS + { + _In_ UINT NumFeatureLevels; + _In_reads_(NumFeatureLevels) const D3D_FEATURE_LEVEL *pFeatureLevelsRequested; + _Out_ D3D_FEATURE_LEVEL MaxSupportedFeatureLevel; + } D3D12_FEATURE_DATA_FEATURE_LEVELS; + +typedef +enum D3D_SHADER_MODEL + { + D3D_SHADER_MODEL_5_1 = 0x51, + D3D_SHADER_MODEL_6_0 = 0x60, + D3D_SHADER_MODEL_6_1 = 0x61, + D3D_SHADER_MODEL_6_2 = 0x62, + D3D_SHADER_MODEL_6_3 = 0x63, + D3D_SHADER_MODEL_6_4 = 0x64, + D3D_SHADER_MODEL_6_5 = 0x65, + D3D_SHADER_MODEL_6_6 = 0x66, + D3D_SHADER_MODEL_6_7 = 0x67, + D3D_SHADER_MODEL_6_8 = 0x68, + D3D_HIGHEST_SHADER_MODEL = D3D_SHADER_MODEL_6_8 + } D3D_SHADER_MODEL; + +typedef struct D3D12_FEATURE_DATA_SHADER_MODEL + { + _Inout_ D3D_SHADER_MODEL HighestShaderModel; + } D3D12_FEATURE_DATA_SHADER_MODEL; + +typedef struct D3D12_FEATURE_DATA_FORMAT_SUPPORT + { + _In_ DXGI_FORMAT Format; + _Out_ D3D12_FORMAT_SUPPORT1 Support1; + _Out_ D3D12_FORMAT_SUPPORT2 Support2; + } D3D12_FEATURE_DATA_FORMAT_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS + { + _In_ DXGI_FORMAT Format; + _In_ UINT SampleCount; + _In_ D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS Flags; + _Out_ UINT NumQualityLevels; + } D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS; + +typedef struct D3D12_FEATURE_DATA_FORMAT_INFO + { + DXGI_FORMAT Format; + UINT8 PlaneCount; + } D3D12_FEATURE_DATA_FORMAT_INFO; + +typedef struct D3D12_FEATURE_DATA_GPU_VIRTUAL_ADDRESS_SUPPORT + { + UINT MaxGPUVirtualAddressBitsPerResource; + UINT MaxGPUVirtualAddressBitsPerProcess; + } D3D12_FEATURE_DATA_GPU_VIRTUAL_ADDRESS_SUPPORT; + +typedef +enum D3D12_SHADER_CACHE_SUPPORT_FLAGS + { + D3D12_SHADER_CACHE_SUPPORT_NONE = 0, + D3D12_SHADER_CACHE_SUPPORT_SINGLE_PSO = 0x1, + D3D12_SHADER_CACHE_SUPPORT_LIBRARY = 0x2, + D3D12_SHADER_CACHE_SUPPORT_AUTOMATIC_INPROC_CACHE = 0x4, + D3D12_SHADER_CACHE_SUPPORT_AUTOMATIC_DISK_CACHE = 0x8, + D3D12_SHADER_CACHE_SUPPORT_DRIVER_MANAGED_CACHE = 0x10, + D3D12_SHADER_CACHE_SUPPORT_SHADER_CONTROL_CLEAR = 0x20, + D3D12_SHADER_CACHE_SUPPORT_SHADER_SESSION_DELETE = 0x40 + } D3D12_SHADER_CACHE_SUPPORT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_SUPPORT_FLAGS ); +typedef struct D3D12_FEATURE_DATA_SHADER_CACHE + { + _Out_ D3D12_SHADER_CACHE_SUPPORT_FLAGS SupportFlags; + } D3D12_FEATURE_DATA_SHADER_CACHE; + +typedef struct D3D12_FEATURE_DATA_COMMAND_QUEUE_PRIORITY + { + _In_ D3D12_COMMAND_LIST_TYPE CommandListType; + _In_ UINT Priority; + _Out_ BOOL PriorityForTypeIsSupported; + } D3D12_FEATURE_DATA_COMMAND_QUEUE_PRIORITY; + +typedef +enum D3D12_COMMAND_LIST_SUPPORT_FLAGS + { + D3D12_COMMAND_LIST_SUPPORT_FLAG_NONE = 0, + D3D12_COMMAND_LIST_SUPPORT_FLAG_DIRECT = ( 1 << D3D12_COMMAND_LIST_TYPE_DIRECT ) , + D3D12_COMMAND_LIST_SUPPORT_FLAG_BUNDLE = ( 1 << D3D12_COMMAND_LIST_TYPE_BUNDLE ) , + D3D12_COMMAND_LIST_SUPPORT_FLAG_COMPUTE = ( 1 << D3D12_COMMAND_LIST_TYPE_COMPUTE ) , + D3D12_COMMAND_LIST_SUPPORT_FLAG_COPY = ( 1 << D3D12_COMMAND_LIST_TYPE_COPY ) , + D3D12_COMMAND_LIST_SUPPORT_FLAG_VIDEO_DECODE = ( 1 << D3D12_COMMAND_LIST_TYPE_VIDEO_DECODE ) , + D3D12_COMMAND_LIST_SUPPORT_FLAG_VIDEO_PROCESS = ( 1 << D3D12_COMMAND_LIST_TYPE_VIDEO_PROCESS ) , + D3D12_COMMAND_LIST_SUPPORT_FLAG_VIDEO_ENCODE = ( 1 << D3D12_COMMAND_LIST_TYPE_VIDEO_ENCODE ) + } D3D12_COMMAND_LIST_SUPPORT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_LIST_SUPPORT_FLAGS ); +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS3 + { + _Out_ BOOL CopyQueueTimestampQueriesSupported; + _Out_ BOOL CastingFullyTypedFormatSupported; + _Out_ D3D12_COMMAND_LIST_SUPPORT_FLAGS WriteBufferImmediateSupportFlags; + _Out_ D3D12_VIEW_INSTANCING_TIER ViewInstancingTier; + _Out_ BOOL BarycentricsSupported; + } D3D12_FEATURE_DATA_D3D12_OPTIONS3; + +typedef struct D3D12_FEATURE_DATA_EXISTING_HEAPS + { + _Out_ BOOL Supported; + } D3D12_FEATURE_DATA_EXISTING_HEAPS; + +typedef +enum D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER + { + D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_0 = 0, + D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_1 = ( D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_0 + 1 ) , + D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_2 = ( D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_1 + 1 ) + } D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER; + +typedef struct D3D12_FEATURE_DATA_DISPLAYABLE + { + _Out_ BOOL DisplayableTexture; + _Out_ D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER SharedResourceCompatibilityTier; + } D3D12_FEATURE_DATA_DISPLAYABLE; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS4 + { + _Out_ BOOL MSAA64KBAlignedTextureSupported; + _Out_ D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER SharedResourceCompatibilityTier; + _Out_ BOOL Native16BitShaderOpsSupported; + } D3D12_FEATURE_DATA_D3D12_OPTIONS4; + +typedef +enum D3D12_HEAP_SERIALIZATION_TIER + { + D3D12_HEAP_SERIALIZATION_TIER_0 = 0, + D3D12_HEAP_SERIALIZATION_TIER_10 = 10 + } D3D12_HEAP_SERIALIZATION_TIER; + +typedef struct D3D12_FEATURE_DATA_SERIALIZATION + { + _In_ UINT NodeIndex; + _Out_ D3D12_HEAP_SERIALIZATION_TIER HeapSerializationTier; + } D3D12_FEATURE_DATA_SERIALIZATION; + +typedef struct D3D12_FEATURE_DATA_CROSS_NODE + { + D3D12_CROSS_NODE_SHARING_TIER SharingTier; + BOOL AtomicShaderInstructions; + } D3D12_FEATURE_DATA_CROSS_NODE; + +typedef +enum D3D12_RENDER_PASS_TIER + { + D3D12_RENDER_PASS_TIER_0 = 0, + D3D12_RENDER_PASS_TIER_1 = 1, + D3D12_RENDER_PASS_TIER_2 = 2 + } D3D12_RENDER_PASS_TIER; + +typedef +enum D3D12_RAYTRACING_TIER + { + D3D12_RAYTRACING_TIER_NOT_SUPPORTED = 0, + D3D12_RAYTRACING_TIER_1_0 = 10, + D3D12_RAYTRACING_TIER_1_1 = 11 + } D3D12_RAYTRACING_TIER; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS5 + { + _Out_ BOOL SRVOnlyTiledResourceTier3; + _Out_ D3D12_RENDER_PASS_TIER RenderPassesTier; + _Out_ D3D12_RAYTRACING_TIER RaytracingTier; + } D3D12_FEATURE_DATA_D3D12_OPTIONS5; + +typedef +enum D3D12_VARIABLE_SHADING_RATE_TIER + { + D3D12_VARIABLE_SHADING_RATE_TIER_NOT_SUPPORTED = 0, + D3D12_VARIABLE_SHADING_RATE_TIER_1 = 1, + D3D12_VARIABLE_SHADING_RATE_TIER_2 = 2 + } D3D12_VARIABLE_SHADING_RATE_TIER; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS6 + { + _Out_ BOOL AdditionalShadingRatesSupported; + _Out_ BOOL PerPrimitiveShadingRateSupportedWithViewportIndexing; + _Out_ D3D12_VARIABLE_SHADING_RATE_TIER VariableShadingRateTier; + _Out_ UINT ShadingRateImageTileSize; + _Out_ BOOL BackgroundProcessingSupported; + } D3D12_FEATURE_DATA_D3D12_OPTIONS6; + +typedef +enum D3D12_MESH_SHADER_TIER + { + D3D12_MESH_SHADER_TIER_NOT_SUPPORTED = 0, + D3D12_MESH_SHADER_TIER_1 = 10 + } D3D12_MESH_SHADER_TIER; + +typedef +enum D3D12_SAMPLER_FEEDBACK_TIER + { + D3D12_SAMPLER_FEEDBACK_TIER_NOT_SUPPORTED = 0, + D3D12_SAMPLER_FEEDBACK_TIER_0_9 = 90, + D3D12_SAMPLER_FEEDBACK_TIER_1_0 = 100 + } D3D12_SAMPLER_FEEDBACK_TIER; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS7 + { + _Out_ D3D12_MESH_SHADER_TIER MeshShaderTier; + _Out_ D3D12_SAMPLER_FEEDBACK_TIER SamplerFeedbackTier; + } D3D12_FEATURE_DATA_D3D12_OPTIONS7; + +typedef struct D3D12_FEATURE_DATA_QUERY_META_COMMAND + { + _In_ GUID CommandId; + _In_ UINT NodeMask; + _Field_size_bytes_full_opt_( QueryInputDataSizeInBytes ) const void *pQueryInputData; + _In_ SIZE_T QueryInputDataSizeInBytes; + _Field_size_bytes_full_( QueryOutputDataSizeInBytes ) void *pQueryOutputData; + _In_ SIZE_T QueryOutputDataSizeInBytes; + } D3D12_FEATURE_DATA_QUERY_META_COMMAND; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS8 + { + _Out_ BOOL UnalignedBlockTexturesSupported; + } D3D12_FEATURE_DATA_D3D12_OPTIONS8; + +typedef +enum D3D12_WAVE_MMA_TIER + { + D3D12_WAVE_MMA_TIER_NOT_SUPPORTED = 0, + D3D12_WAVE_MMA_TIER_1_0 = 10 + } D3D12_WAVE_MMA_TIER; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS9 + { + _Out_ BOOL MeshShaderPipelineStatsSupported; + _Out_ BOOL MeshShaderSupportsFullRangeRenderTargetArrayIndex; + _Out_ BOOL AtomicInt64OnTypedResourceSupported; + _Out_ BOOL AtomicInt64OnGroupSharedSupported; + _Out_ BOOL DerivativesInMeshAndAmplificationShadersSupported; + _Out_ D3D12_WAVE_MMA_TIER WaveMMATier; + } D3D12_FEATURE_DATA_D3D12_OPTIONS9; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS10 + { + _Out_ BOOL VariableRateShadingSumCombinerSupported; + _Out_ BOOL MeshShaderPerPrimitiveShadingRateSupported; + } D3D12_FEATURE_DATA_D3D12_OPTIONS10; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS11 + { + _Out_ BOOL AtomicInt64OnDescriptorHeapResourceSupported; + } D3D12_FEATURE_DATA_D3D12_OPTIONS11; + +typedef +enum D3D12_TRI_STATE + { + D3D12_TRI_STATE_UNKNOWN = -1, + D3D12_TRI_STATE_FALSE = 0, + D3D12_TRI_STATE_TRUE = 1 + } D3D12_TRI_STATE; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS12 + { + _Out_ D3D12_TRI_STATE MSPrimitivesPipelineStatisticIncludesCulledPrimitives; + _Out_ BOOL EnhancedBarriersSupported; + _Out_ BOOL RelaxedFormatCastingSupported; + } D3D12_FEATURE_DATA_D3D12_OPTIONS12; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS13 + { + _Out_ BOOL UnrestrictedBufferTextureCopyPitchSupported; + _Out_ BOOL UnrestrictedVertexElementAlignmentSupported; + _Out_ BOOL InvertedViewportHeightFlipsYSupported; + _Out_ BOOL InvertedViewportDepthFlipsZSupported; + _Out_ BOOL TextureCopyBetweenDimensionsSupported; + _Out_ BOOL AlphaBlendFactorSupported; + } D3D12_FEATURE_DATA_D3D12_OPTIONS13; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS14 + { + _Out_ BOOL AdvancedTextureOpsSupported; + _Out_ BOOL WriteableMSAATexturesSupported; + _Out_ BOOL IndependentFrontAndBackStencilRefMaskSupported; + } D3D12_FEATURE_DATA_D3D12_OPTIONS14; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS15 + { + _Out_ BOOL TriangleFanSupported; + _Out_ BOOL DynamicIndexBufferStripCutSupported; + } D3D12_FEATURE_DATA_D3D12_OPTIONS15; + +typedef struct D3D12_RESOURCE_ALLOCATION_INFO + { + UINT64 SizeInBytes; + UINT64 Alignment; + } D3D12_RESOURCE_ALLOCATION_INFO; + +typedef struct D3D12_RESOURCE_ALLOCATION_INFO1 + { + UINT64 Offset; + UINT64 Alignment; + UINT64 SizeInBytes; + } D3D12_RESOURCE_ALLOCATION_INFO1; + +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_NOT_AVAILABLE = 1, + 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 = 0, + 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_HARDWARE_PROTECTED = 0x100, + D3D12_HEAP_FLAG_ALLOW_WRITE_WATCH = 0x200, + D3D12_HEAP_FLAG_ALLOW_SHADER_ATOMICS = 0x400, + D3D12_HEAP_FLAG_CREATE_NOT_RESIDENT = 0x800, + D3D12_HEAP_FLAG_CREATE_NOT_ZEROED = 0x1000, + D3D12_HEAP_FLAG_ALLOW_ALL_BUFFERS_AND_TEXTURES = 0, + D3D12_HEAP_FLAG_ALLOW_ONLY_BUFFERS = 0xc0, + D3D12_HEAP_FLAG_ALLOW_ONLY_NON_RT_DS_TEXTURES = 0x44, + D3D12_HEAP_FLAG_ALLOW_ONLY_RT_DS_TEXTURES = 0x84 + } D3D12_HEAP_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_HEAP_FLAGS ); +typedef struct D3D12_HEAP_DESC + { + UINT64 SizeInBytes; + D3D12_HEAP_PROPERTIES Properties; + UINT64 Alignment; + D3D12_HEAP_FLAGS Flags; + } D3D12_HEAP_DESC; + +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 = 0, + 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_FLAG_VIDEO_DECODE_REFERENCE_ONLY = 0x40, + D3D12_RESOURCE_FLAG_VIDEO_ENCODE_REFERENCE_ONLY = 0x80, + D3D12_RESOURCE_FLAG_RAYTRACING_ACCELERATION_STRUCTURE = 0x100 + } D3D12_RESOURCE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_FLAGS ); +typedef struct D3D12_MIP_REGION + { + UINT Width; + UINT Height; + UINT Depth; + } D3D12_MIP_REGION; + +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 struct D3D12_RESOURCE_DESC1 + { + 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_MIP_REGION SamplerFeedbackMipRegion; + } D3D12_RESOURCE_DESC1; + +typedef struct D3D12_DEPTH_STENCIL_VALUE + { + FLOAT Depth; + UINT8 Stencil; + } D3D12_DEPTH_STENCIL_VALUE; + +typedef struct D3D12_CLEAR_VALUE + { + DXGI_FORMAT Format; + union + { + FLOAT Color[ 4 ]; + D3D12_DEPTH_STENCIL_VALUE DepthStencil; + } ; + } D3D12_CLEAR_VALUE; + +typedef struct D3D12_RANGE + { + SIZE_T Begin; + SIZE_T End; + } D3D12_RANGE; + +typedef struct D3D12_RANGE_UINT64 + { + UINT64 Begin; + UINT64 End; + } D3D12_RANGE_UINT64; + +typedef struct D3D12_SUBRESOURCE_RANGE_UINT64 + { + UINT Subresource; + D3D12_RANGE_UINT64 Range; + } D3D12_SUBRESOURCE_RANGE_UINT64; + +typedef struct D3D12_SUBRESOURCE_INFO + { + UINT64 Offset; + UINT RowPitch; + UINT DepthPitch; + } D3D12_SUBRESOURCE_INFO; + +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 +enum D3D12_TILE_RANGE_FLAGS + { + D3D12_TILE_RANGE_FLAG_NONE = 0, + D3D12_TILE_RANGE_FLAG_NULL = 1, + D3D12_TILE_RANGE_FLAG_SKIP = 2, + D3D12_TILE_RANGE_FLAG_REUSE_SINGLE_TILE = 4 + } D3D12_TILE_RANGE_FLAGS; + +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_PACKED_MIP_INFO + { + UINT8 NumStandardMips; + UINT8 NumPackedMips; + UINT NumTilesForPackedMips; + UINT StartTileIndexInOverallResource; + } D3D12_PACKED_MIP_INFO; + +typedef +enum D3D12_TILE_MAPPING_FLAGS + { + D3D12_TILE_MAPPING_FLAG_NONE = 0, + D3D12_TILE_MAPPING_FLAG_NO_HAZARD = 0x1 + } D3D12_TILE_MAPPING_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_TILE_MAPPING_FLAGS ); +typedef +enum D3D12_TILE_COPY_FLAGS + { + D3D12_TILE_COPY_FLAG_NONE = 0, + 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; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_TILE_COPY_FLAGS ); +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_RAYTRACING_ACCELERATION_STRUCTURE = 0x400000, + D3D12_RESOURCE_STATE_SHADING_RATE_SOURCE = 0x1000000, + D3D12_RESOURCE_STATE_GENERIC_READ = ( ( ( ( ( 0x1 | 0x2 ) | 0x40 ) | 0x80 ) | 0x200 ) | 0x800 ) , + D3D12_RESOURCE_STATE_ALL_SHADER_RESOURCE = ( 0x40 | 0x80 ) , + D3D12_RESOURCE_STATE_PRESENT = 0, + D3D12_RESOURCE_STATE_PREDICATION = 0x200, + D3D12_RESOURCE_STATE_VIDEO_DECODE_READ = 0x10000, + D3D12_RESOURCE_STATE_VIDEO_DECODE_WRITE = 0x20000, + D3D12_RESOURCE_STATE_VIDEO_PROCESS_READ = 0x40000, + D3D12_RESOURCE_STATE_VIDEO_PROCESS_WRITE = 0x80000, + D3D12_RESOURCE_STATE_VIDEO_ENCODE_READ = 0x200000, + D3D12_RESOURCE_STATE_VIDEO_ENCODE_WRITE = 0x800000 + } 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 = ( D3D12_RESOURCE_BARRIER_TYPE_TRANSITION + 1 ) , + D3D12_RESOURCE_BARRIER_TYPE_UAV = ( D3D12_RESOURCE_BARRIER_TYPE_ALIASING + 1 ) + } D3D12_RESOURCE_BARRIER_TYPE; + + +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 + { + ID3D12Resource *pResourceBefore; + ID3D12Resource *pResourceAfter; + } D3D12_RESOURCE_ALIASING_BARRIER; + +typedef struct D3D12_RESOURCE_UAV_BARRIER + { + ID3D12Resource *pResource; + } D3D12_RESOURCE_UAV_BARRIER; + +typedef +enum D3D12_RESOURCE_BARRIER_FLAGS + { + D3D12_RESOURCE_BARRIER_FLAG_NONE = 0, + D3D12_RESOURCE_BARRIER_FLAG_BEGIN_ONLY = 0x1, + D3D12_RESOURCE_BARRIER_FLAG_END_ONLY = 0x2 + } D3D12_RESOURCE_BARRIER_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_BARRIER_FLAGS ); +typedef struct D3D12_RESOURCE_BARRIER + { + D3D12_RESOURCE_BARRIER_TYPE Type; + D3D12_RESOURCE_BARRIER_FLAGS Flags; + union + { + D3D12_RESOURCE_TRANSITION_BARRIER Transition; + D3D12_RESOURCE_ALIASING_BARRIER Aliasing; + D3D12_RESOURCE_UAV_BARRIER UAV; + } ; + } D3D12_RESOURCE_BARRIER; + +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 +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_TEXTURE_COPY_LOCATION + { + ID3D12Resource *pResource; + D3D12_TEXTURE_COPY_TYPE Type; + union + { + D3D12_PLACED_SUBRESOURCE_FOOTPRINT PlacedFootprint; + UINT SubresourceIndex; + } ; + } D3D12_TEXTURE_COPY_LOCATION; + +typedef +enum D3D12_RESOLVE_MODE + { + D3D12_RESOLVE_MODE_DECOMPRESS = 0, + D3D12_RESOLVE_MODE_MIN = 1, + D3D12_RESOLVE_MODE_MAX = 2, + D3D12_RESOLVE_MODE_AVERAGE = 3, + D3D12_RESOLVE_MODE_ENCODE_SAMPLER_FEEDBACK = 4, + D3D12_RESOLVE_MODE_DECODE_SAMPLER_FEEDBACK = 5 + } D3D12_RESOLVE_MODE; + +typedef struct D3D12_SAMPLE_POSITION + { + INT8 X; + INT8 Y; + } D3D12_SAMPLE_POSITION; + +typedef struct D3D12_VIEW_INSTANCE_LOCATION + { + UINT ViewportArrayIndex; + UINT RenderTargetArrayIndex; + } D3D12_VIEW_INSTANCE_LOCATION; + +typedef +enum D3D12_VIEW_INSTANCING_FLAGS + { + D3D12_VIEW_INSTANCING_FLAG_NONE = 0, + D3D12_VIEW_INSTANCING_FLAG_ENABLE_VIEW_INSTANCE_MASKING = 0x1 + } D3D12_VIEW_INSTANCING_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_VIEW_INSTANCING_FLAGS ); +typedef struct D3D12_VIEW_INSTANCING_DESC + { + UINT ViewInstanceCount; + _Field_size_full_(ViewInstanceCount) const D3D12_VIEW_INSTANCE_LOCATION *pViewInstanceLocations; + D3D12_VIEW_INSTANCING_FLAGS Flags; + } D3D12_VIEW_INSTANCING_DESC; + +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_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)) +#define D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(Src0,Src1,Src2,Src3) ((((Src0)&D3D12_SHADER_COMPONENT_MAPPING_MASK)| \ + (((Src1)&D3D12_SHADER_COMPONENT_MAPPING_MASK)<> (D3D12_SHADER_COMPONENT_MAPPING_SHIFT*ComponentToExtract) & D3D12_SHADER_COMPONENT_MAPPING_MASK)) +#define D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(0,1,2,3) +typedef +enum D3D12_BUFFER_SRV_FLAGS + { + D3D12_BUFFER_SRV_FLAG_NONE = 0, + D3D12_BUFFER_SRV_FLAG_RAW = 0x1 + } D3D12_BUFFER_SRV_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_BUFFER_SRV_FLAGS ); +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_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_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_RAYTRACING_ACCELERATION_STRUCTURE_SRV + { + D3D12_GPU_VIRTUAL_ADDRESS Location; + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_SRV; + +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_RAYTRACING_ACCELERATION_STRUCTURE = 11 + } D3D12_SRV_DIMENSION; + +typedef struct D3D12_SHADER_RESOURCE_VIEW_DESC + { + DXGI_FORMAT Format; + D3D12_SRV_DIMENSION ViewDimension; + UINT Shader4ComponentMapping; + 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; + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_SRV RaytracingAccelerationStructure; + } ; + } D3D12_SHADER_RESOURCE_VIEW_DESC; + +typedef struct D3D12_CONSTANT_BUFFER_VIEW_DESC + { + D3D12_GPU_VIRTUAL_ADDRESS BufferLocation; + UINT SizeInBytes; + } D3D12_CONSTANT_BUFFER_VIEW_DESC; + +typedef +enum D3D12_FILTER + { + D3D12_FILTER_MIN_MAG_MIP_POINT = 0, + 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; + +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_FILTER_TYPE_MASK ( 0x3 ) + +#define D3D12_MIN_FILTER_SHIFT ( 4 ) + +#define D3D12_MAG_FILTER_SHIFT ( 2 ) + +#define D3D12_MIP_FILTER_SHIFT ( 0 ) + +#define D3D12_ANISOTROPIC_FILTERING_BIT ( 0x40 ) + +#define D3D12_ENCODE_BASIC_FILTER( min, mag, mip, reduction ) \ + ( ( D3D12_FILTER ) ( \ + ( ( ( min ) & D3D12_FILTER_TYPE_MASK ) << D3D12_MIN_FILTER_SHIFT ) | \ + ( ( ( mag ) & D3D12_FILTER_TYPE_MASK ) << D3D12_MAG_FILTER_SHIFT ) | \ + ( ( ( mip ) & D3D12_FILTER_TYPE_MASK ) << D3D12_MIP_FILTER_SHIFT ) | \ + ( ( ( reduction ) & D3D12_FILTER_REDUCTION_TYPE_MASK ) << D3D12_FILTER_REDUCTION_TYPE_SHIFT ) ) ) +#define D3D12_ENCODE_ANISOTROPIC_FILTER( reduction ) \ + ( ( D3D12_FILTER ) ( \ + D3D12_ANISOTROPIC_FILTERING_BIT | \ + D3D12_ENCODE_BASIC_FILTER( D3D12_FILTER_TYPE_LINEAR, \ + D3D12_FILTER_TYPE_LINEAR, \ + D3D12_FILTER_TYPE_LINEAR, \ + reduction ) ) ) +#define D3D12_DECODE_MIN_FILTER( D3D12Filter ) \ + ( ( D3D12_FILTER_TYPE ) \ + ( ( ( D3D12Filter ) >> D3D12_MIN_FILTER_SHIFT ) & D3D12_FILTER_TYPE_MASK ) ) +#define D3D12_DECODE_MAG_FILTER( D3D12Filter ) \ + ( ( D3D12_FILTER_TYPE ) \ + ( ( ( D3D12Filter ) >> D3D12_MAG_FILTER_SHIFT ) & D3D12_FILTER_TYPE_MASK ) ) +#define D3D12_DECODE_MIP_FILTER( D3D12Filter ) \ + ( ( D3D12_FILTER_TYPE ) \ + ( ( ( D3D12Filter ) >> D3D12_MIP_FILTER_SHIFT ) & D3D12_FILTER_TYPE_MASK ) ) +#define D3D12_DECODE_FILTER_REDUCTION( D3D12Filter ) \ + ( ( D3D12_FILTER_REDUCTION_TYPE ) \ + ( ( ( D3D12Filter ) >> D3D12_FILTER_REDUCTION_TYPE_SHIFT ) & D3D12_FILTER_REDUCTION_TYPE_MASK ) ) +#define D3D12_DECODE_IS_COMPARISON_FILTER( D3D12Filter ) \ + ( D3D12_DECODE_FILTER_REDUCTION( D3D12Filter ) == D3D12_FILTER_REDUCTION_TYPE_COMPARISON ) +#define D3D12_DECODE_IS_ANISOTROPIC_FILTER( D3D12Filter ) \ + ( ( ( D3D12Filter ) & D3D12_ANISOTROPIC_FILTERING_BIT ) && \ + ( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MIN_FILTER( D3D12Filter ) ) && \ + ( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MAG_FILTER( D3D12Filter ) ) && \ + ( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MIP_FILTER( D3D12Filter ) ) ) +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 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 +enum D3D12_SAMPLER_FLAGS + { + D3D12_SAMPLER_FLAG_NONE = 0, + D3D12_SAMPLER_FLAG_UINT_BORDER_COLOR = 0x1 + } D3D12_SAMPLER_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_SAMPLER_FLAGS ); +typedef struct D3D12_SAMPLER_DESC2 + { + 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; + union + { + FLOAT FloatBorderColor[ 4 ]; + UINT UintBorderColor[ 4 ]; + } ; + FLOAT MinLOD; + FLOAT MaxLOD; + D3D12_SAMPLER_FLAGS Flags; + } D3D12_SAMPLER_DESC2; + +typedef +enum D3D12_BUFFER_UAV_FLAGS + { + D3D12_BUFFER_UAV_FLAG_NONE = 0, + D3D12_BUFFER_UAV_FLAG_RAW = 0x1 + } D3D12_BUFFER_UAV_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( 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_TEX2DMS_UAV + { + UINT UnusedField_NothingToDefine; + } D3D12_TEX2DMS_UAV; + +typedef struct D3D12_TEX2DMS_ARRAY_UAV + { + UINT FirstArraySlice; + UINT ArraySize; + } D3D12_TEX2DMS_ARRAY_UAV; + +typedef struct D3D12_TEX3D_UAV + { + UINT MipSlice; + UINT FirstWSlice; + UINT WSize; + } D3D12_TEX3D_UAV; + +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_TEXTURE2DMS = 6, + D3D12_UAV_DIMENSION_TEXTURE2DMSARRAY = 7, + D3D12_UAV_DIMENSION_TEXTURE3D = 8 + } D3D12_UAV_DIMENSION; + +typedef struct D3D12_UNORDERED_ACCESS_VIEW_DESC + { + DXGI_FORMAT Format; + D3D12_UAV_DIMENSION ViewDimension; + union + { + D3D12_BUFFER_UAV Buffer; + D3D12_TEX1D_UAV Texture1D; + D3D12_TEX1D_ARRAY_UAV Texture1DArray; + D3D12_TEX2D_UAV Texture2D; + D3D12_TEX2D_ARRAY_UAV Texture2DArray; + D3D12_TEX2DMS_UAV Texture2DMS; + D3D12_TEX2DMS_ARRAY_UAV Texture2DMSArray; + D3D12_TEX3D_UAV Texture3D; + } ; + } D3D12_UNORDERED_ACCESS_VIEW_DESC; + +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_TEX2DMS_RTV + { + UINT UnusedField_NothingToDefine; + } D3D12_TEX2DMS_RTV; + +typedef struct D3D12_TEX2D_ARRAY_RTV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + UINT PlaneSlice; + } D3D12_TEX2D_ARRAY_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 +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_RENDER_TARGET_VIEW_DESC + { + DXGI_FORMAT Format; + D3D12_RTV_DIMENSION ViewDimension; + 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; + } ; + } D3D12_RENDER_TARGET_VIEW_DESC; + +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 +enum D3D12_DSV_FLAGS + { + D3D12_DSV_FLAG_NONE = 0, + 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 +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 struct D3D12_DEPTH_STENCIL_VIEW_DESC + { + DXGI_FORMAT Format; + D3D12_DSV_DIMENSION ViewDimension; + D3D12_DSV_FLAGS Flags; + 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; + } ; + } D3D12_DEPTH_STENCIL_VIEW_DESC; + +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 +enum D3D12_FENCE_FLAGS + { + D3D12_FENCE_FLAG_NONE = 0, + D3D12_FENCE_FLAG_SHARED = 0x1, + D3D12_FENCE_FLAG_SHARED_CROSS_ADAPTER = 0x2, + D3D12_FENCE_FLAG_NON_MONITORED = 0x4 + } D3D12_FENCE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_FENCE_FLAGS ); +typedef +enum D3D12_DESCRIPTOR_HEAP_TYPE + { + D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV = 0, + D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER = ( D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV + 1 ) , + D3D12_DESCRIPTOR_HEAP_TYPE_RTV = ( D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER + 1 ) , + D3D12_DESCRIPTOR_HEAP_TYPE_DSV = ( D3D12_DESCRIPTOR_HEAP_TYPE_RTV + 1 ) , + D3D12_DESCRIPTOR_HEAP_TYPE_NUM_TYPES = ( D3D12_DESCRIPTOR_HEAP_TYPE_DSV + 1 ) + } D3D12_DESCRIPTOR_HEAP_TYPE; + +typedef +enum D3D12_DESCRIPTOR_HEAP_FLAGS + { + D3D12_DESCRIPTOR_HEAP_FLAG_NONE = 0, + D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE = 0x1 + } D3D12_DESCRIPTOR_HEAP_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( 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 +enum D3D12_DESCRIPTOR_RANGE_TYPE + { + D3D12_DESCRIPTOR_RANGE_TYPE_SRV = 0, + D3D12_DESCRIPTOR_RANGE_TYPE_UAV = ( D3D12_DESCRIPTOR_RANGE_TYPE_SRV + 1 ) , + D3D12_DESCRIPTOR_RANGE_TYPE_CBV = ( D3D12_DESCRIPTOR_RANGE_TYPE_UAV + 1 ) , + D3D12_DESCRIPTOR_RANGE_TYPE_SAMPLER = ( D3D12_DESCRIPTOR_RANGE_TYPE_CBV + 1 ) + } 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 struct D3D12_ROOT_DESCRIPTOR_TABLE + { + UINT NumDescriptorRanges; + _Field_size_full_(NumDescriptorRanges) const D3D12_DESCRIPTOR_RANGE *pDescriptorRanges; + } D3D12_ROOT_DESCRIPTOR_TABLE; + +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_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_AMPLIFICATION = 6, + D3D12_SHADER_VISIBILITY_MESH = 7 + } D3D12_SHADER_VISIBILITY; + +typedef +enum D3D12_ROOT_PARAMETER_TYPE + { + D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE = 0, + D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS = ( D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE + 1 ) , + D3D12_ROOT_PARAMETER_TYPE_CBV = ( D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS + 1 ) , + D3D12_ROOT_PARAMETER_TYPE_SRV = ( D3D12_ROOT_PARAMETER_TYPE_CBV + 1 ) , + D3D12_ROOT_PARAMETER_TYPE_UAV = ( D3D12_ROOT_PARAMETER_TYPE_SRV + 1 ) + } D3D12_ROOT_PARAMETER_TYPE; + +typedef struct D3D12_ROOT_PARAMETER + { + D3D12_ROOT_PARAMETER_TYPE ParameterType; + union + { + D3D12_ROOT_DESCRIPTOR_TABLE DescriptorTable; + D3D12_ROOT_CONSTANTS Constants; + D3D12_ROOT_DESCRIPTOR Descriptor; + } ; + D3D12_SHADER_VISIBILITY ShaderVisibility; + } D3D12_ROOT_PARAMETER; + +typedef +enum D3D12_ROOT_SIGNATURE_FLAGS + { + D3D12_ROOT_SIGNATURE_FLAG_NONE = 0, + 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_FLAG_LOCAL_ROOT_SIGNATURE = 0x80, + D3D12_ROOT_SIGNATURE_FLAG_DENY_AMPLIFICATION_SHADER_ROOT_ACCESS = 0x100, + D3D12_ROOT_SIGNATURE_FLAG_DENY_MESH_SHADER_ROOT_ACCESS = 0x200, + D3D12_ROOT_SIGNATURE_FLAG_CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED = 0x400, + D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXED = 0x800 + } D3D12_ROOT_SIGNATURE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_ROOT_SIGNATURE_FLAGS ); +typedef +enum D3D12_STATIC_BORDER_COLOR + { + D3D12_STATIC_BORDER_COLOR_TRANSPARENT_BLACK = 0, + D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK = ( D3D12_STATIC_BORDER_COLOR_TRANSPARENT_BLACK + 1 ) , + D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE = ( D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK + 1 ) , + D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK_UINT = ( D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE + 1 ) , + D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE_UINT = ( D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK_UINT + 1 ) + } D3D12_STATIC_BORDER_COLOR; + +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 struct D3D12_ROOT_SIGNATURE_DESC + { + UINT NumParameters; + _Field_size_full_(NumParameters) const D3D12_ROOT_PARAMETER *pParameters; + UINT NumStaticSamplers; + _Field_size_full_(NumStaticSamplers) const D3D12_STATIC_SAMPLER_DESC *pStaticSamplers; + D3D12_ROOT_SIGNATURE_FLAGS Flags; + } D3D12_ROOT_SIGNATURE_DESC; + +typedef +enum D3D12_DESCRIPTOR_RANGE_FLAGS + { + D3D12_DESCRIPTOR_RANGE_FLAG_NONE = 0, + D3D12_DESCRIPTOR_RANGE_FLAG_DESCRIPTORS_VOLATILE = 0x1, + D3D12_DESCRIPTOR_RANGE_FLAG_DATA_VOLATILE = 0x2, + D3D12_DESCRIPTOR_RANGE_FLAG_DATA_STATIC_WHILE_SET_AT_EXECUTE = 0x4, + D3D12_DESCRIPTOR_RANGE_FLAG_DATA_STATIC = 0x8, + D3D12_DESCRIPTOR_RANGE_FLAG_DESCRIPTORS_STATIC_KEEPING_BUFFER_BOUNDS_CHECKS = 0x10000 + } D3D12_DESCRIPTOR_RANGE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( 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_TABLE1 + { + UINT NumDescriptorRanges; + _Field_size_full_(NumDescriptorRanges) const D3D12_DESCRIPTOR_RANGE1 *pDescriptorRanges; + } D3D12_ROOT_DESCRIPTOR_TABLE1; + +typedef +enum D3D12_ROOT_DESCRIPTOR_FLAGS + { + D3D12_ROOT_DESCRIPTOR_FLAG_NONE = 0, + D3D12_ROOT_DESCRIPTOR_FLAG_DATA_VOLATILE = 0x2, + D3D12_ROOT_DESCRIPTOR_FLAG_DATA_STATIC_WHILE_SET_AT_EXECUTE = 0x4, + D3D12_ROOT_DESCRIPTOR_FLAG_DATA_STATIC = 0x8 + } D3D12_ROOT_DESCRIPTOR_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_ROOT_DESCRIPTOR_FLAGS ); +typedef struct D3D12_ROOT_DESCRIPTOR1 + { + UINT ShaderRegister; + UINT RegisterSpace; + D3D12_ROOT_DESCRIPTOR_FLAGS Flags; + } D3D12_ROOT_DESCRIPTOR1; + +typedef struct D3D12_ROOT_PARAMETER1 + { + D3D12_ROOT_PARAMETER_TYPE ParameterType; + union + { + D3D12_ROOT_DESCRIPTOR_TABLE1 DescriptorTable; + D3D12_ROOT_CONSTANTS Constants; + D3D12_ROOT_DESCRIPTOR1 Descriptor; + } ; + D3D12_SHADER_VISIBILITY ShaderVisibility; + } D3D12_ROOT_PARAMETER1; + +typedef struct D3D12_ROOT_SIGNATURE_DESC1 + { + UINT NumParameters; + _Field_size_full_(NumParameters) const D3D12_ROOT_PARAMETER1 *pParameters; + UINT NumStaticSamplers; + _Field_size_full_(NumStaticSamplers) const D3D12_STATIC_SAMPLER_DESC *pStaticSamplers; + D3D12_ROOT_SIGNATURE_FLAGS Flags; + } D3D12_ROOT_SIGNATURE_DESC1; + +typedef struct D3D12_VERSIONED_ROOT_SIGNATURE_DESC + { + D3D_ROOT_SIGNATURE_VERSION Version; + union + { + D3D12_ROOT_SIGNATURE_DESC Desc_1_0; + D3D12_ROOT_SIGNATURE_DESC1 Desc_1_1; + } ; + } D3D12_VERSIONED_ROOT_SIGNATURE_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0001_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0001_v0_0_s_ifspec; + +#ifndef __ID3D12RootSignatureDeserializer_INTERFACE_DEFINED__ +#define __ID3D12RootSignatureDeserializer_INTERFACE_DEFINED__ + +/* interface ID3D12RootSignatureDeserializer */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12RootSignatureDeserializer; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("34AB647B-3CC8-46AC-841B-C0965645C046") + ID3D12RootSignatureDeserializer : public IUnknown + { + public: + virtual const D3D12_ROOT_SIGNATURE_DESC *STDMETHODCALLTYPE GetRootSignatureDesc( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12RootSignatureDeserializerVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12RootSignatureDeserializer * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12RootSignatureDeserializer * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12RootSignatureDeserializer * This); + + DECLSPEC_XFGVIRT(ID3D12RootSignatureDeserializer, GetRootSignatureDesc) + const D3D12_ROOT_SIGNATURE_DESC *( STDMETHODCALLTYPE *GetRootSignatureDesc )( + ID3D12RootSignatureDeserializer * This); + + END_INTERFACE + } ID3D12RootSignatureDeserializerVtbl; + + interface ID3D12RootSignatureDeserializer + { + CONST_VTBL struct ID3D12RootSignatureDeserializerVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#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) ) + + +#define ID3D12RootSignatureDeserializer_GetRootSignatureDesc(This) \ + ( (This)->lpVtbl -> GetRootSignatureDesc(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12RootSignatureDeserializer_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VersionedRootSignatureDeserializer_INTERFACE_DEFINED__ +#define __ID3D12VersionedRootSignatureDeserializer_INTERFACE_DEFINED__ + +/* interface ID3D12VersionedRootSignatureDeserializer */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VersionedRootSignatureDeserializer; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("7F91CE67-090C-4BB7-B78E-ED8FF2E31DA0") + ID3D12VersionedRootSignatureDeserializer : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetRootSignatureDescAtVersion( + D3D_ROOT_SIGNATURE_VERSION convertToVersion, + _Out_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC **ppDesc) = 0; + + virtual const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *STDMETHODCALLTYPE GetUnconvertedRootSignatureDesc( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VersionedRootSignatureDeserializerVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VersionedRootSignatureDeserializer * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VersionedRootSignatureDeserializer * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VersionedRootSignatureDeserializer * This); + + DECLSPEC_XFGVIRT(ID3D12VersionedRootSignatureDeserializer, GetRootSignatureDescAtVersion) + HRESULT ( STDMETHODCALLTYPE *GetRootSignatureDescAtVersion )( + ID3D12VersionedRootSignatureDeserializer * This, + D3D_ROOT_SIGNATURE_VERSION convertToVersion, + _Out_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC **ppDesc); + + DECLSPEC_XFGVIRT(ID3D12VersionedRootSignatureDeserializer, GetUnconvertedRootSignatureDesc) + const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *( STDMETHODCALLTYPE *GetUnconvertedRootSignatureDesc )( + ID3D12VersionedRootSignatureDeserializer * This); + + END_INTERFACE + } ID3D12VersionedRootSignatureDeserializerVtbl; + + interface ID3D12VersionedRootSignatureDeserializer + { + CONST_VTBL struct ID3D12VersionedRootSignatureDeserializerVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VersionedRootSignatureDeserializer_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VersionedRootSignatureDeserializer_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VersionedRootSignatureDeserializer_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VersionedRootSignatureDeserializer_GetRootSignatureDescAtVersion(This,convertToVersion,ppDesc) \ + ( (This)->lpVtbl -> GetRootSignatureDescAtVersion(This,convertToVersion,ppDesc) ) + +#define ID3D12VersionedRootSignatureDeserializer_GetUnconvertedRootSignatureDesc(This) \ + ( (This)->lpVtbl -> GetUnconvertedRootSignatureDesc(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VersionedRootSignatureDeserializer_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0003 */ +/* [local] */ + +typedef HRESULT (WINAPI* PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)( + _In_ const D3D12_ROOT_SIGNATURE_DESC* pRootSignature, + _In_ D3D_ROOT_SIGNATURE_VERSION Version, + _Out_ ID3DBlob** ppBlob, + _Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorBlob); + +HRESULT WINAPI D3D12SerializeRootSignature( + _In_ const D3D12_ROOT_SIGNATURE_DESC* pRootSignature, + _In_ D3D_ROOT_SIGNATURE_VERSION Version, + _Out_ ID3DBlob** ppBlob, + _Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorBlob); + +typedef HRESULT (WINAPI* PFN_D3D12_CREATE_ROOT_SIGNATURE_DESERIALIZER)( + _In_reads_bytes_(SrcDataSizeInBytes) LPCVOID pSrcData, + _In_ SIZE_T SrcDataSizeInBytes, + _In_ REFIID pRootSignatureDeserializerInterface, + _Out_ void** ppRootSignatureDeserializer); + +HRESULT WINAPI D3D12CreateRootSignatureDeserializer( + _In_reads_bytes_(SrcDataSizeInBytes) LPCVOID pSrcData, + _In_ SIZE_T SrcDataSizeInBytes, + _In_ REFIID pRootSignatureDeserializerInterface, + _Out_ void** ppRootSignatureDeserializer); + +typedef HRESULT (WINAPI* PFN_D3D12_SERIALIZE_VERSIONED_ROOT_SIGNATURE)( + _In_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC* pRootSignature, + _Out_ ID3DBlob** ppBlob, + _Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorBlob); + +HRESULT WINAPI D3D12SerializeVersionedRootSignature( + _In_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC* pRootSignature, + _Out_ ID3DBlob** ppBlob, + _Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorBlob); + +typedef HRESULT (WINAPI* PFN_D3D12_CREATE_VERSIONED_ROOT_SIGNATURE_DESERIALIZER)( + _In_reads_bytes_(SrcDataSizeInBytes) LPCVOID pSrcData, + _In_ SIZE_T SrcDataSizeInBytes, + _In_ REFIID pRootSignatureDeserializerInterface, + _Out_ void** ppRootSignatureDeserializer); + +HRESULT WINAPI D3D12CreateVersionedRootSignatureDeserializer( + _In_reads_bytes_(SrcDataSizeInBytes) LPCVOID pSrcData, + _In_ SIZE_T SrcDataSizeInBytes, + _In_ REFIID pRootSignatureDeserializerInterface, + _Out_ void** ppRootSignatureDeserializer); + +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; + +// If rects are supplied in D3D12_DISCARD_REGION, below, the resource +// must have 2D subresources with all specified subresources the same dimension. +typedef struct D3D12_DISCARD_REGION + { + UINT NumRects; + _In_reads_(NumRects) const D3D12_RECT *pRects; + UINT FirstSubresource; + UINT NumSubresources; + } D3D12_DISCARD_REGION; + +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_VIDEO_DECODE_STATISTICS = 4, + D3D12_QUERY_HEAP_TYPE_COPY_QUEUE_TIMESTAMP = 5, + D3D12_QUERY_HEAP_TYPE_PIPELINE_STATISTICS1 = 7 + } 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_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_VIDEO_DECODE_STATISTICS = 8, + D3D12_QUERY_TYPE_PIPELINE_STATISTICS1 = 10 + } D3D12_QUERY_TYPE; + +typedef +enum D3D12_PREDICATION_OP + { + D3D12_PREDICATION_OP_EQUAL_ZERO = 0, + D3D12_PREDICATION_OP_NOT_EQUAL_ZERO = 1 + } D3D12_PREDICATION_OP; + +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 struct D3D12_QUERY_DATA_PIPELINE_STATISTICS1 + { + UINT64 IAVertices; + UINT64 IAPrimitives; + UINT64 VSInvocations; + UINT64 GSInvocations; + UINT64 GSPrimitives; + UINT64 CInvocations; + UINT64 CPrimitives; + UINT64 PSInvocations; + UINT64 HSInvocations; + UINT64 DSInvocations; + UINT64 CSInvocations; + UINT64 ASInvocations; + UINT64 MSInvocations; + UINT64 MSPrimitives; + } D3D12_QUERY_DATA_PIPELINE_STATISTICS1; + +typedef struct D3D12_QUERY_DATA_SO_STATISTICS + { + UINT64 NumPrimitivesWritten; + UINT64 PrimitivesStorageNeeded; + } D3D12_QUERY_DATA_SO_STATISTICS; + +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 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_VERTEX_BUFFER_VIEW + { + D3D12_GPU_VIRTUAL_ADDRESS BufferLocation; + UINT SizeInBytes; + UINT StrideInBytes; + } D3D12_VERTEX_BUFFER_VIEW; + +typedef struct D3D12_INDEX_BUFFER_VIEW + { + D3D12_GPU_VIRTUAL_ADDRESS BufferLocation; + UINT SizeInBytes; + DXGI_FORMAT Format; + } D3D12_INDEX_BUFFER_VIEW; + +typedef +enum D3D12_INDIRECT_ARGUMENT_TYPE + { + D3D12_INDIRECT_ARGUMENT_TYPE_DRAW = 0, + D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED = ( D3D12_INDIRECT_ARGUMENT_TYPE_DRAW + 1 ) , + D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH = ( D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED + 1 ) , + D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW = ( D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH + 1 ) , + D3D12_INDIRECT_ARGUMENT_TYPE_INDEX_BUFFER_VIEW = ( D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW + 1 ) , + D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT = ( D3D12_INDIRECT_ARGUMENT_TYPE_INDEX_BUFFER_VIEW + 1 ) , + D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT_BUFFER_VIEW = ( D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT + 1 ) , + D3D12_INDIRECT_ARGUMENT_TYPE_SHADER_RESOURCE_VIEW = ( D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT_BUFFER_VIEW + 1 ) , + D3D12_INDIRECT_ARGUMENT_TYPE_UNORDERED_ACCESS_VIEW = ( D3D12_INDIRECT_ARGUMENT_TYPE_SHADER_RESOURCE_VIEW + 1 ) , + D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_RAYS = ( D3D12_INDIRECT_ARGUMENT_TYPE_UNORDERED_ACCESS_VIEW + 1 ) , + D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESH = ( D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_RAYS + 1 ) + } D3D12_INDIRECT_ARGUMENT_TYPE; + +typedef struct D3D12_INDIRECT_ARGUMENT_DESC + { + D3D12_INDIRECT_ARGUMENT_TYPE Type; + 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; + } ; + } D3D12_INDIRECT_ARGUMENT_DESC; + +typedef struct D3D12_COMMAND_SIGNATURE_DESC + { + UINT ByteStride; + UINT NumArgumentDescs; + _Field_size_full_(NumArgumentDescs) const D3D12_INDIRECT_ARGUMENT_DESC *pArgumentDescs; + UINT NodeMask; + } D3D12_COMMAND_SIGNATURE_DESC; + + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0003_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0003_v0_0_s_ifspec; + +#ifndef __ID3D12Pageable_INTERFACE_DEFINED__ +#define __ID3D12Pageable_INTERFACE_DEFINED__ + +/* interface ID3D12Pageable */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Pageable; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("63ee58fb-1268-4835-86da-f008ce62f0d6") + ID3D12Pageable : public ID3D12DeviceChild + { + public: + }; + + +#else /* C style interface */ + + typedef struct ID3D12PageableVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Pageable * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Pageable * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Pageable * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Pageable * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Pageable * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Pageable * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Pageable * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12Pageable * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + END_INTERFACE + } ID3D12PageableVtbl; + + interface ID3D12Pageable + { + CONST_VTBL struct ID3D12PageableVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#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) ) + + +#define ID3D12Pageable_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Pageable_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Pageable_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Pageable_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Pageable_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Pageable_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Heap_INTERFACE_DEFINED__ +#define __ID3D12Heap_INTERFACE_DEFINED__ + +/* interface ID3D12Heap */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Heap; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6b3b2502-6e51-45b3-90ee-9884265e8df3") + ID3D12Heap : public ID3D12Pageable + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_HEAP_DESC STDMETHODCALLTYPE GetDesc( void) = 0; +#else + virtual D3D12_HEAP_DESC *STDMETHODCALLTYPE GetDesc( + D3D12_HEAP_DESC * RetVal) = 0; +#endif + + }; + + +#else /* C style interface */ + + typedef struct ID3D12HeapVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Heap * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Heap * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Heap * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Heap * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Heap * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Heap * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Heap * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12Heap * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12Heap, GetDesc) +#if !defined(_WIN32) + D3D12_HEAP_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12Heap * This); + +#else + D3D12_HEAP_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12Heap * This, + D3D12_HEAP_DESC * RetVal); + +#endif + + END_INTERFACE + } ID3D12HeapVtbl; + + interface ID3D12Heap + { + CONST_VTBL struct ID3D12HeapVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Heap_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Heap_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Heap_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Heap_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Heap_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Heap_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Heap_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Heap_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#if !defined(_WIN32) + +#define ID3D12Heap_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12Heap_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Heap_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Resource_INTERFACE_DEFINED__ +#define __ID3D12Resource_INTERFACE_DEFINED__ + +/* interface ID3D12Resource */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Resource; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("696442be-a72e-4059-bc79-5b5c98040fad") + ID3D12Resource : public ID3D12Pageable + { + public: + virtual HRESULT STDMETHODCALLTYPE Map( + UINT Subresource, + _In_opt_ const D3D12_RANGE *pReadRange, + _Outptr_opt_result_bytebuffer_(_Inexpressible_("Dependent on resource")) void **ppData) = 0; + + virtual void STDMETHODCALLTYPE Unmap( + UINT Subresource, + _In_opt_ const D3D12_RANGE *pWrittenRange) = 0; + +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_RESOURCE_DESC STDMETHODCALLTYPE GetDesc( void) = 0; +#else + virtual D3D12_RESOURCE_DESC *STDMETHODCALLTYPE GetDesc( + D3D12_RESOURCE_DESC * RetVal) = 0; +#endif + + virtual D3D12_GPU_VIRTUAL_ADDRESS STDMETHODCALLTYPE GetGPUVirtualAddress( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE WriteToSubresource( + UINT DstSubresource, + _In_opt_ const D3D12_BOX *pDstBox, + _In_ const void *pSrcData, + UINT SrcRowPitch, + UINT SrcDepthPitch) = 0; + + virtual HRESULT STDMETHODCALLTYPE ReadFromSubresource( + _Out_ void *pDstData, + UINT DstRowPitch, + UINT DstDepthPitch, + UINT SrcSubresource, + _In_opt_ const D3D12_BOX *pSrcBox) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetHeapProperties( + _Out_opt_ D3D12_HEAP_PROPERTIES *pHeapProperties, + _Out_opt_ D3D12_HEAP_FLAGS *pHeapFlags) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12ResourceVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Resource * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Resource * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Resource * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Resource * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Resource * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Resource * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Resource * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12Resource * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12Resource, Map) + HRESULT ( STDMETHODCALLTYPE *Map )( + ID3D12Resource * This, + UINT Subresource, + _In_opt_ const D3D12_RANGE *pReadRange, + _Outptr_opt_result_bytebuffer_(_Inexpressible_("Dependent on resource")) void **ppData); + + DECLSPEC_XFGVIRT(ID3D12Resource, Unmap) + void ( STDMETHODCALLTYPE *Unmap )( + ID3D12Resource * This, + UINT Subresource, + _In_opt_ const D3D12_RANGE *pWrittenRange); + + DECLSPEC_XFGVIRT(ID3D12Resource, GetDesc) +#if !defined(_WIN32) + D3D12_RESOURCE_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12Resource * This); + +#else + D3D12_RESOURCE_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12Resource * This, + D3D12_RESOURCE_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Resource, GetGPUVirtualAddress) + D3D12_GPU_VIRTUAL_ADDRESS ( STDMETHODCALLTYPE *GetGPUVirtualAddress )( + ID3D12Resource * This); + + DECLSPEC_XFGVIRT(ID3D12Resource, WriteToSubresource) + HRESULT ( STDMETHODCALLTYPE *WriteToSubresource )( + ID3D12Resource * This, + UINT DstSubresource, + _In_opt_ const D3D12_BOX *pDstBox, + _In_ const void *pSrcData, + UINT SrcRowPitch, + UINT SrcDepthPitch); + + DECLSPEC_XFGVIRT(ID3D12Resource, ReadFromSubresource) + HRESULT ( STDMETHODCALLTYPE *ReadFromSubresource )( + ID3D12Resource * This, + _Out_ void *pDstData, + UINT DstRowPitch, + UINT DstDepthPitch, + UINT SrcSubresource, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12Resource, GetHeapProperties) + HRESULT ( STDMETHODCALLTYPE *GetHeapProperties )( + ID3D12Resource * This, + _Out_opt_ D3D12_HEAP_PROPERTIES *pHeapProperties, + _Out_opt_ D3D12_HEAP_FLAGS *pHeapFlags); + + END_INTERFACE + } ID3D12ResourceVtbl; + + interface ID3D12Resource + { + CONST_VTBL struct ID3D12ResourceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#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) ) + + +#define ID3D12Resource_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Resource_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Resource_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Resource_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Resource_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#define ID3D12Resource_Map(This,Subresource,pReadRange,ppData) \ + ( (This)->lpVtbl -> Map(This,Subresource,pReadRange,ppData) ) + +#define ID3D12Resource_Unmap(This,Subresource,pWrittenRange) \ + ( (This)->lpVtbl -> Unmap(This,Subresource,pWrittenRange) ) +#if !defined(_WIN32) + +#define ID3D12Resource_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12Resource_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#define ID3D12Resource_GetGPUVirtualAddress(This) \ + ( (This)->lpVtbl -> GetGPUVirtualAddress(This) ) + +#define ID3D12Resource_WriteToSubresource(This,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) \ + ( (This)->lpVtbl -> WriteToSubresource(This,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) ) + +#define ID3D12Resource_ReadFromSubresource(This,pDstData,DstRowPitch,DstDepthPitch,SrcSubresource,pSrcBox) \ + ( (This)->lpVtbl -> ReadFromSubresource(This,pDstData,DstRowPitch,DstDepthPitch,SrcSubresource,pSrcBox) ) + +#define ID3D12Resource_GetHeapProperties(This,pHeapProperties,pHeapFlags) \ + ( (This)->lpVtbl -> GetHeapProperties(This,pHeapProperties,pHeapFlags) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Resource_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12CommandAllocator_INTERFACE_DEFINED__ +#define __ID3D12CommandAllocator_INTERFACE_DEFINED__ + +/* interface ID3D12CommandAllocator */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12CommandAllocator; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6102dee4-af59-4b09-b999-b44d73f09b24") + ID3D12CommandAllocator : public ID3D12Pageable + { + public: + virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12CommandAllocatorVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12CommandAllocator * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12CommandAllocator * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12CommandAllocator * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12CommandAllocator * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12CommandAllocator * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12CommandAllocator * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12CommandAllocator * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12CommandAllocator * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandAllocator, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12CommandAllocator * This); + + END_INTERFACE + } ID3D12CommandAllocatorVtbl; + + interface ID3D12CommandAllocator + { + CONST_VTBL struct ID3D12CommandAllocatorVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#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) ) + + +#define ID3D12CommandAllocator_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12CommandAllocator_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12CommandAllocator_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12CommandAllocator_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12CommandAllocator_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#define ID3D12CommandAllocator_Reset(This) \ + ( (This)->lpVtbl -> Reset(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12CommandAllocator_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Fence_INTERFACE_DEFINED__ +#define __ID3D12Fence_INTERFACE_DEFINED__ + +/* interface ID3D12Fence */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Fence; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0a753dcf-c4d8-4b91-adf6-be5a60d95a76") + ID3D12Fence : public ID3D12Pageable + { + public: + virtual UINT64 STDMETHODCALLTYPE GetCompletedValue( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetEventOnCompletion( + UINT64 Value, + HANDLE hEvent) = 0; + + virtual HRESULT STDMETHODCALLTYPE Signal( + UINT64 Value) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12FenceVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Fence * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Fence * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Fence * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Fence * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Fence * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Fence * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Fence * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12Fence * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12Fence, GetCompletedValue) + UINT64 ( STDMETHODCALLTYPE *GetCompletedValue )( + ID3D12Fence * This); + + DECLSPEC_XFGVIRT(ID3D12Fence, SetEventOnCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnCompletion )( + ID3D12Fence * This, + UINT64 Value, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Fence, Signal) + HRESULT ( STDMETHODCALLTYPE *Signal )( + ID3D12Fence * This, + UINT64 Value); + + END_INTERFACE + } ID3D12FenceVtbl; + + interface ID3D12Fence + { + CONST_VTBL struct ID3D12FenceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#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) ) + + +#define ID3D12Fence_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Fence_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Fence_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Fence_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Fence_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#define ID3D12Fence_GetCompletedValue(This) \ + ( (This)->lpVtbl -> GetCompletedValue(This) ) + +#define ID3D12Fence_SetEventOnCompletion(This,Value,hEvent) \ + ( (This)->lpVtbl -> SetEventOnCompletion(This,Value,hEvent) ) + +#define ID3D12Fence_Signal(This,Value) \ + ( (This)->lpVtbl -> Signal(This,Value) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Fence_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Fence1_INTERFACE_DEFINED__ +#define __ID3D12Fence1_INTERFACE_DEFINED__ + +/* interface ID3D12Fence1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Fence1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("433685fe-e22b-4ca0-a8db-b5b4f4dd0e4a") + ID3D12Fence1 : public ID3D12Fence + { + public: + virtual D3D12_FENCE_FLAGS STDMETHODCALLTYPE GetCreationFlags( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Fence1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Fence1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Fence1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Fence1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Fence1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Fence1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Fence1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Fence1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12Fence1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12Fence, GetCompletedValue) + UINT64 ( STDMETHODCALLTYPE *GetCompletedValue )( + ID3D12Fence1 * This); + + DECLSPEC_XFGVIRT(ID3D12Fence, SetEventOnCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnCompletion )( + ID3D12Fence1 * This, + UINT64 Value, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Fence, Signal) + HRESULT ( STDMETHODCALLTYPE *Signal )( + ID3D12Fence1 * This, + UINT64 Value); + + DECLSPEC_XFGVIRT(ID3D12Fence1, GetCreationFlags) + D3D12_FENCE_FLAGS ( STDMETHODCALLTYPE *GetCreationFlags )( + ID3D12Fence1 * This); + + END_INTERFACE + } ID3D12Fence1Vtbl; + + interface ID3D12Fence1 + { + CONST_VTBL struct ID3D12Fence1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Fence1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Fence1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Fence1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Fence1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Fence1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Fence1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Fence1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Fence1_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#define ID3D12Fence1_GetCompletedValue(This) \ + ( (This)->lpVtbl -> GetCompletedValue(This) ) + +#define ID3D12Fence1_SetEventOnCompletion(This,Value,hEvent) \ + ( (This)->lpVtbl -> SetEventOnCompletion(This,Value,hEvent) ) + +#define ID3D12Fence1_Signal(This,Value) \ + ( (This)->lpVtbl -> Signal(This,Value) ) + + +#define ID3D12Fence1_GetCreationFlags(This) \ + ( (This)->lpVtbl -> GetCreationFlags(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Fence1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12PipelineState_INTERFACE_DEFINED__ +#define __ID3D12PipelineState_INTERFACE_DEFINED__ + +/* interface ID3D12PipelineState */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12PipelineState; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("765a30f3-f624-4c6f-a828-ace948622445") + ID3D12PipelineState : public ID3D12Pageable + { + public: + virtual HRESULT STDMETHODCALLTYPE GetCachedBlob( + _COM_Outptr_ ID3DBlob **ppBlob) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12PipelineStateVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12PipelineState * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12PipelineState * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12PipelineState * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12PipelineState * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12PipelineState * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12PipelineState * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12PipelineState * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12PipelineState * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12PipelineState, GetCachedBlob) + HRESULT ( STDMETHODCALLTYPE *GetCachedBlob )( + ID3D12PipelineState * This, + _COM_Outptr_ ID3DBlob **ppBlob); + + END_INTERFACE + } ID3D12PipelineStateVtbl; + + interface ID3D12PipelineState + { + CONST_VTBL struct ID3D12PipelineStateVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#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) ) + + +#define ID3D12PipelineState_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12PipelineState_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12PipelineState_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12PipelineState_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12PipelineState_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#define ID3D12PipelineState_GetCachedBlob(This,ppBlob) \ + ( (This)->lpVtbl -> GetCachedBlob(This,ppBlob) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12PipelineState_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DescriptorHeap_INTERFACE_DEFINED__ +#define __ID3D12DescriptorHeap_INTERFACE_DEFINED__ + +/* interface ID3D12DescriptorHeap */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DescriptorHeap; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("8efb471d-616c-4f49-90f7-127bb763fa51") + ID3D12DescriptorHeap : public ID3D12Pageable + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_DESCRIPTOR_HEAP_DESC STDMETHODCALLTYPE GetDesc( void) = 0; +#else + virtual D3D12_DESCRIPTOR_HEAP_DESC *STDMETHODCALLTYPE GetDesc( + D3D12_DESCRIPTOR_HEAP_DESC * RetVal) = 0; +#endif + +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_CPU_DESCRIPTOR_HANDLE STDMETHODCALLTYPE GetCPUDescriptorHandleForHeapStart( void) = 0; +#else + virtual D3D12_CPU_DESCRIPTOR_HANDLE *STDMETHODCALLTYPE GetCPUDescriptorHandleForHeapStart( + D3D12_CPU_DESCRIPTOR_HANDLE * RetVal) = 0; +#endif + +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_GPU_DESCRIPTOR_HANDLE STDMETHODCALLTYPE GetGPUDescriptorHandleForHeapStart( void) = 0; +#else + virtual D3D12_GPU_DESCRIPTOR_HANDLE *STDMETHODCALLTYPE GetGPUDescriptorHandleForHeapStart( + D3D12_GPU_DESCRIPTOR_HANDLE * RetVal) = 0; +#endif + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DescriptorHeapVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DescriptorHeap * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DescriptorHeap * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DescriptorHeap * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12DescriptorHeap * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12DescriptorHeap * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12DescriptorHeap * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12DescriptorHeap * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12DescriptorHeap * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12DescriptorHeap, GetDesc) +#if !defined(_WIN32) + D3D12_DESCRIPTOR_HEAP_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12DescriptorHeap * This); + +#else + D3D12_DESCRIPTOR_HEAP_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12DescriptorHeap * This, + D3D12_DESCRIPTOR_HEAP_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12DescriptorHeap, GetCPUDescriptorHandleForHeapStart) +#if !defined(_WIN32) + D3D12_CPU_DESCRIPTOR_HANDLE ( STDMETHODCALLTYPE *GetCPUDescriptorHandleForHeapStart )( + ID3D12DescriptorHeap * This); + +#else + D3D12_CPU_DESCRIPTOR_HANDLE *( STDMETHODCALLTYPE *GetCPUDescriptorHandleForHeapStart )( + ID3D12DescriptorHeap * This, + D3D12_CPU_DESCRIPTOR_HANDLE * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12DescriptorHeap, GetGPUDescriptorHandleForHeapStart) +#if !defined(_WIN32) + D3D12_GPU_DESCRIPTOR_HANDLE ( STDMETHODCALLTYPE *GetGPUDescriptorHandleForHeapStart )( + ID3D12DescriptorHeap * This); + +#else + D3D12_GPU_DESCRIPTOR_HANDLE *( STDMETHODCALLTYPE *GetGPUDescriptorHandleForHeapStart )( + ID3D12DescriptorHeap * This, + D3D12_GPU_DESCRIPTOR_HANDLE * RetVal); + +#endif + + END_INTERFACE + } ID3D12DescriptorHeapVtbl; + + interface ID3D12DescriptorHeap + { + CONST_VTBL struct ID3D12DescriptorHeapVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#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) ) + + +#define ID3D12DescriptorHeap_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12DescriptorHeap_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12DescriptorHeap_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12DescriptorHeap_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12DescriptorHeap_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#if !defined(_WIN32) + +#define ID3D12DescriptorHeap_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12DescriptorHeap_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif +#if !defined(_WIN32) + +#define ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(This) \ + ( (This)->lpVtbl -> GetCPUDescriptorHandleForHeapStart(This) ) +#else +#define ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(This,RetVal) \ + ( (This)->lpVtbl -> GetCPUDescriptorHandleForHeapStart(This,RetVal) ) +#endif +#if !defined(_WIN32) + +#define ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart(This) \ + ( (This)->lpVtbl -> GetGPUDescriptorHandleForHeapStart(This) ) +#else +#define ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart(This,RetVal) \ + ( (This)->lpVtbl -> GetGPUDescriptorHandleForHeapStart(This,RetVal) ) +#endif + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DescriptorHeap_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12QueryHeap_INTERFACE_DEFINED__ +#define __ID3D12QueryHeap_INTERFACE_DEFINED__ + +/* interface ID3D12QueryHeap */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12QueryHeap; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0d9658ae-ed45-469e-a61d-970ec583cab4") + ID3D12QueryHeap : public ID3D12Pageable + { + public: + }; + + +#else /* C style interface */ + + typedef struct ID3D12QueryHeapVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12QueryHeap * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12QueryHeap * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12QueryHeap * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12QueryHeap * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12QueryHeap * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12QueryHeap * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12QueryHeap * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12QueryHeap * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + END_INTERFACE + } ID3D12QueryHeapVtbl; + + interface ID3D12QueryHeap + { + CONST_VTBL struct ID3D12QueryHeapVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#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) ) + + +#define ID3D12QueryHeap_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12QueryHeap_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12QueryHeap_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12QueryHeap_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12QueryHeap_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12QueryHeap_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12CommandSignature_INTERFACE_DEFINED__ +#define __ID3D12CommandSignature_INTERFACE_DEFINED__ + +/* interface ID3D12CommandSignature */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12CommandSignature; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("c36a797c-ec80-4f0a-8985-a7b2475082d1") + ID3D12CommandSignature : public ID3D12Pageable + { + public: + }; + + +#else /* C style interface */ + + typedef struct ID3D12CommandSignatureVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12CommandSignature * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12CommandSignature * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12CommandSignature * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12CommandSignature * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12CommandSignature * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12CommandSignature * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12CommandSignature * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12CommandSignature * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + END_INTERFACE + } ID3D12CommandSignatureVtbl; + + interface ID3D12CommandSignature + { + CONST_VTBL struct ID3D12CommandSignatureVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#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) ) + + +#define ID3D12CommandSignature_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12CommandSignature_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12CommandSignature_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12CommandSignature_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12CommandSignature_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12CommandSignature_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12CommandList_INTERFACE_DEFINED__ +#define __ID3D12CommandList_INTERFACE_DEFINED__ + +/* interface ID3D12CommandList */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12CommandList; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("7116d91c-e7e4-47ce-b8c6-ec8168f437e5") + ID3D12CommandList : public ID3D12DeviceChild + { + public: + virtual D3D12_COMMAND_LIST_TYPE STDMETHODCALLTYPE GetType( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12CommandListVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12CommandList * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12CommandList * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12CommandList * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12CommandList * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12CommandList * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12CommandList * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12CommandList * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12CommandList * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12CommandList * This); + + END_INTERFACE + } ID3D12CommandListVtbl; + + interface ID3D12CommandList + { + CONST_VTBL struct ID3D12CommandListVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#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) ) + + +#define ID3D12CommandList_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12CommandList_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12CommandList_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12CommandList_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12CommandList_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12CommandList_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12CommandList_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList_INTERFACE_DEFINED__ + +/* interface ID3D12GraphicsCommandList */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12GraphicsCommandList; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("5b160d0f-ac1b-4185-8ba8-b3ae42a5a455") + ID3D12GraphicsCommandList : public ID3D12CommandList + { + public: + virtual HRESULT STDMETHODCALLTYPE Close( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Reset( + _In_ ID3D12CommandAllocator *pAllocator, + _In_opt_ ID3D12PipelineState *pInitialState) = 0; + + virtual void STDMETHODCALLTYPE ClearState( + _In_opt_ ID3D12PipelineState *pPipelineState) = 0; + + virtual void STDMETHODCALLTYPE DrawInstanced( + _In_ UINT VertexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartVertexLocation, + _In_ UINT StartInstanceLocation) = 0; + + virtual void STDMETHODCALLTYPE DrawIndexedInstanced( + _In_ UINT IndexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartIndexLocation, + _In_ INT BaseVertexLocation, + _In_ UINT StartInstanceLocation) = 0; + + virtual void STDMETHODCALLTYPE Dispatch( + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ) = 0; + + virtual void STDMETHODCALLTYPE CopyBufferRegion( + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT64 NumBytes) = 0; + + virtual void STDMETHODCALLTYPE CopyTextureRegion( + _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, + UINT DstX, + UINT DstY, + UINT DstZ, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc, + _In_opt_ const D3D12_BOX *pSrcBox) = 0; + + virtual void STDMETHODCALLTYPE CopyResource( + _In_ ID3D12Resource *pDstResource, + _In_ ID3D12Resource *pSrcResource) = 0; + + virtual void STDMETHODCALLTYPE CopyTiles( + _In_ ID3D12Resource *pTiledResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, + _In_ ID3D12Resource *pBuffer, + UINT64 BufferStartOffsetInBytes, + D3D12_TILE_COPY_FLAGS Flags) = 0; + + virtual void STDMETHODCALLTYPE ResolveSubresource( + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_ DXGI_FORMAT Format) = 0; + + virtual void STDMETHODCALLTYPE IASetPrimitiveTopology( + _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology) = 0; + + virtual void STDMETHODCALLTYPE RSSetViewports( + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports) = 0; + + virtual void STDMETHODCALLTYPE RSSetScissorRects( + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + _In_reads_( NumRects) const D3D12_RECT *pRects) = 0; + + virtual void STDMETHODCALLTYPE OMSetBlendFactor( + _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]) = 0; + + virtual void STDMETHODCALLTYPE OMSetStencilRef( + _In_ UINT StencilRef) = 0; + + virtual void STDMETHODCALLTYPE SetPipelineState( + _In_ ID3D12PipelineState *pPipelineState) = 0; + + virtual void STDMETHODCALLTYPE ResourceBarrier( + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers) = 0; + + virtual void STDMETHODCALLTYPE ExecuteBundle( + _In_ ID3D12GraphicsCommandList *pCommandList) = 0; + + virtual void STDMETHODCALLTYPE SetDescriptorHeaps( + _In_ UINT NumDescriptorHeaps, + _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps) = 0; + + virtual void STDMETHODCALLTYPE SetComputeRootSignature( + _In_opt_ ID3D12RootSignature *pRootSignature) = 0; + + virtual void STDMETHODCALLTYPE SetGraphicsRootSignature( + _In_opt_ ID3D12RootSignature *pRootSignature) = 0; + + virtual void STDMETHODCALLTYPE SetComputeRootDescriptorTable( + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor) = 0; + + virtual void STDMETHODCALLTYPE SetGraphicsRootDescriptorTable( + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor) = 0; + + virtual void STDMETHODCALLTYPE SetComputeRoot32BitConstant( + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues) = 0; + + virtual void STDMETHODCALLTYPE SetGraphicsRoot32BitConstant( + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues) = 0; + + virtual void STDMETHODCALLTYPE SetComputeRoot32BitConstants( + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues) = 0; + + virtual void STDMETHODCALLTYPE SetGraphicsRoot32BitConstants( + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues) = 0; + + virtual void STDMETHODCALLTYPE SetComputeRootConstantBufferView( + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation) = 0; + + virtual void STDMETHODCALLTYPE SetGraphicsRootConstantBufferView( + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation) = 0; + + virtual void STDMETHODCALLTYPE SetComputeRootShaderResourceView( + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation) = 0; + + virtual void STDMETHODCALLTYPE SetGraphicsRootShaderResourceView( + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation) = 0; + + virtual void STDMETHODCALLTYPE SetComputeRootUnorderedAccessView( + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation) = 0; + + virtual void STDMETHODCALLTYPE SetGraphicsRootUnorderedAccessView( + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation) = 0; + + virtual void STDMETHODCALLTYPE IASetIndexBuffer( + _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView) = 0; + + virtual void STDMETHODCALLTYPE IASetVertexBuffers( + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews) = 0; + + virtual void STDMETHODCALLTYPE SOSetTargets( + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews) = 0; + + virtual void STDMETHODCALLTYPE OMSetRenderTargets( + _In_ UINT NumRenderTargetDescriptors, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, + _In_ BOOL RTsSingleHandleToDescriptorRange, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor) = 0; + + virtual void STDMETHODCALLTYPE ClearDepthStencilView( + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, + _In_ D3D12_CLEAR_FLAGS ClearFlags, + _In_ FLOAT Depth, + _In_ UINT8 Stencil, + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects) = 0; + + virtual void STDMETHODCALLTYPE ClearRenderTargetView( + _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, + _In_ const FLOAT ColorRGBA[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects) = 0; + + virtual void STDMETHODCALLTYPE ClearUnorderedAccessViewUint( + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const UINT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects) = 0; + + virtual void STDMETHODCALLTYPE ClearUnorderedAccessViewFloat( + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const FLOAT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects) = 0; + + virtual void STDMETHODCALLTYPE DiscardResource( + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion) = 0; + + virtual void STDMETHODCALLTYPE BeginQuery( + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index) = 0; + + virtual void STDMETHODCALLTYPE EndQuery( + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index) = 0; + + virtual void STDMETHODCALLTYPE ResolveQueryData( + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset) = 0; + + virtual void STDMETHODCALLTYPE SetPredication( + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation) = 0; + + virtual void STDMETHODCALLTYPE SetMarker( + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size) = 0; + + virtual void STDMETHODCALLTYPE BeginEvent( + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size) = 0; + + virtual void STDMETHODCALLTYPE EndEvent( void) = 0; + + virtual void STDMETHODCALLTYPE ExecuteIndirect( + _In_ ID3D12CommandSignature *pCommandSignature, + _In_ UINT MaxCommandCount, + _In_ ID3D12Resource *pArgumentBuffer, + _In_ UINT64 ArgumentBufferOffset, + _In_opt_ ID3D12Resource *pCountBuffer, + _In_ UINT64 CountBufferOffset) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12GraphicsCommandListVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12GraphicsCommandList * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12GraphicsCommandList * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12GraphicsCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12GraphicsCommandList * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12GraphicsCommandList * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12GraphicsCommandList * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12GraphicsCommandList * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12GraphicsCommandList * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12GraphicsCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12GraphicsCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12GraphicsCommandList * This, + _In_ ID3D12CommandAllocator *pAllocator, + _In_opt_ ID3D12PipelineState *pInitialState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12GraphicsCommandList * This, + _In_opt_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D12GraphicsCommandList * This, + _In_ UINT VertexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D12GraphicsCommandList * This, + _In_ UINT IndexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartIndexLocation, + _In_ INT BaseVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) + void ( STDMETHODCALLTYPE *Dispatch )( + ID3D12GraphicsCommandList * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) + void ( STDMETHODCALLTYPE *CopyBufferRegion )( + ID3D12GraphicsCommandList * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT64 NumBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) + void ( STDMETHODCALLTYPE *CopyTextureRegion )( + ID3D12GraphicsCommandList * This, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, + UINT DstX, + UINT DstY, + UINT DstZ, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D12GraphicsCommandList * This, + _In_ ID3D12Resource *pDstResource, + _In_ ID3D12Resource *pSrcResource); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) + void ( STDMETHODCALLTYPE *CopyTiles )( + ID3D12GraphicsCommandList * This, + _In_ ID3D12Resource *pTiledResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, + _In_ ID3D12Resource *pBuffer, + UINT64 BufferStartOffsetInBytes, + D3D12_TILE_COPY_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D12GraphicsCommandList * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_ DXGI_FORMAT Format); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D12GraphicsCommandList * This, + _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D12GraphicsCommandList * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D12GraphicsCommandList * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + _In_reads_( NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) + void ( STDMETHODCALLTYPE *OMSetBlendFactor )( + ID3D12GraphicsCommandList * This, + _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) + void ( STDMETHODCALLTYPE *OMSetStencilRef )( + ID3D12GraphicsCommandList * This, + _In_ UINT StencilRef); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) + void ( STDMETHODCALLTYPE *SetPipelineState )( + ID3D12GraphicsCommandList * This, + _In_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12GraphicsCommandList * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) + void ( STDMETHODCALLTYPE *ExecuteBundle )( + ID3D12GraphicsCommandList * This, + _In_ ID3D12GraphicsCommandList *pCommandList); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) + void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( + ID3D12GraphicsCommandList * This, + _In_ UINT NumDescriptorHeaps, + _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) + void ( STDMETHODCALLTYPE *SetComputeRootSignature )( + ID3D12GraphicsCommandList * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) + void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( + ID3D12GraphicsCommandList * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( + ID3D12GraphicsCommandList * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( + ID3D12GraphicsCommandList * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( + ID3D12GraphicsCommandList * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( + ID3D12GraphicsCommandList * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( + ID3D12GraphicsCommandList * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( + ID3D12GraphicsCommandList * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( + ID3D12GraphicsCommandList * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( + ID3D12GraphicsCommandList * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( + ID3D12GraphicsCommandList * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( + ID3D12GraphicsCommandList * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( + ID3D12GraphicsCommandList * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( + ID3D12GraphicsCommandList * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D12GraphicsCommandList * This, + _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D12GraphicsCommandList * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D12GraphicsCommandList * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D12GraphicsCommandList * This, + _In_ UINT NumRenderTargetDescriptors, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, + _In_ BOOL RTsSingleHandleToDescriptorRange, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D12GraphicsCommandList * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, + _In_ D3D12_CLEAR_FLAGS ClearFlags, + _In_ FLOAT Depth, + _In_ UINT8 Stencil, + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D12GraphicsCommandList * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, + _In_ const FLOAT ColorRGBA[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( + ID3D12GraphicsCommandList * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const UINT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( + ID3D12GraphicsCommandList * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const FLOAT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12GraphicsCommandList * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12GraphicsCommandList * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12GraphicsCommandList * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12GraphicsCommandList * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12GraphicsCommandList * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12GraphicsCommandList * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12GraphicsCommandList * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12GraphicsCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) + void ( STDMETHODCALLTYPE *ExecuteIndirect )( + ID3D12GraphicsCommandList * This, + _In_ ID3D12CommandSignature *pCommandSignature, + _In_ UINT MaxCommandCount, + _In_ ID3D12Resource *pArgumentBuffer, + _In_ UINT64 ArgumentBufferOffset, + _In_opt_ ID3D12Resource *pCountBuffer, + _In_ UINT64 CountBufferOffset); + + END_INTERFACE + } ID3D12GraphicsCommandListVtbl; + + interface ID3D12GraphicsCommandList + { + CONST_VTBL struct ID3D12GraphicsCommandListVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#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) ) + + +#define ID3D12GraphicsCommandList_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12GraphicsCommandList_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12GraphicsCommandList_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12GraphicsCommandList_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12GraphicsCommandList_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12GraphicsCommandList_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12GraphicsCommandList_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12GraphicsCommandList_Reset(This,pAllocator,pInitialState) \ + ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) + +#define ID3D12GraphicsCommandList_ClearState(This,pPipelineState) \ + ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + +#define ID3D12GraphicsCommandList_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ + ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) + +#define ID3D12GraphicsCommandList_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ + ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) + +#define ID3D12GraphicsCommandList_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) + +#define ID3D12GraphicsCommandList_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ + ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) + +#define ID3D12GraphicsCommandList_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) + +#define ID3D12GraphicsCommandList_IASetPrimitiveTopology(This,PrimitiveTopology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) + +#define ID3D12GraphicsCommandList_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) + +#define ID3D12GraphicsCommandList_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList_OMSetBlendFactor(This,BlendFactor) \ + ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) + +#define ID3D12GraphicsCommandList_OMSetStencilRef(This,StencilRef) \ + ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) + +#define ID3D12GraphicsCommandList_SetPipelineState(This,pPipelineState) \ + ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12GraphicsCommandList_ExecuteBundle(This,pCommandList) \ + ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) + +#define ID3D12GraphicsCommandList_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ + ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) + +#define ID3D12GraphicsCommandList_SetComputeRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList_SetGraphicsRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList_IASetIndexBuffer(This,pView) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) + +#define ID3D12GraphicsCommandList_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList_SOSetTargets(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) + +#define ID3D12GraphicsCommandList_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12GraphicsCommandList_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12GraphicsCommandList_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12GraphicsCommandList_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12GraphicsCommandList_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ + ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12GraphicsCommandList_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList1_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList1_INTERFACE_DEFINED__ + +/* interface ID3D12GraphicsCommandList1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12GraphicsCommandList1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("553103fb-1fe7-4557-bb38-946d7d0e7ca7") + ID3D12GraphicsCommandList1 : public ID3D12GraphicsCommandList + { + public: + virtual void STDMETHODCALLTYPE AtomicCopyBufferUINT( + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges) = 0; + + virtual void STDMETHODCALLTYPE AtomicCopyBufferUINT64( + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges) = 0; + + virtual void STDMETHODCALLTYPE OMSetDepthBounds( + _In_ FLOAT Min, + _In_ FLOAT Max) = 0; + + virtual void STDMETHODCALLTYPE SetSamplePositions( + _In_ UINT NumSamplesPerPixel, + _In_ UINT NumPixels, + _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions) = 0; + + virtual void STDMETHODCALLTYPE ResolveSubresourceRegion( + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ UINT DstX, + _In_ UINT DstY, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_opt_ D3D12_RECT *pSrcRect, + _In_ DXGI_FORMAT Format, + _In_ D3D12_RESOLVE_MODE ResolveMode) = 0; + + virtual void STDMETHODCALLTYPE SetViewInstanceMask( + _In_ UINT Mask) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12GraphicsCommandList1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12GraphicsCommandList1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12GraphicsCommandList1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12GraphicsCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12GraphicsCommandList1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12GraphicsCommandList1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12GraphicsCommandList1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12GraphicsCommandList1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12GraphicsCommandList1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12GraphicsCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12GraphicsCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12CommandAllocator *pAllocator, + _In_opt_ ID3D12PipelineState *pInitialState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12GraphicsCommandList1 * This, + _In_opt_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT VertexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT IndexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartIndexLocation, + _In_ INT BaseVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) + void ( STDMETHODCALLTYPE *Dispatch )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) + void ( STDMETHODCALLTYPE *CopyBufferRegion )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT64 NumBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) + void ( STDMETHODCALLTYPE *CopyTextureRegion )( + ID3D12GraphicsCommandList1 * This, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, + UINT DstX, + UINT DstY, + UINT DstZ, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12Resource *pDstResource, + _In_ ID3D12Resource *pSrcResource); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) + void ( STDMETHODCALLTYPE *CopyTiles )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12Resource *pTiledResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, + _In_ ID3D12Resource *pBuffer, + UINT64 BufferStartOffsetInBytes, + D3D12_TILE_COPY_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_ DXGI_FORMAT Format); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D12GraphicsCommandList1 * This, + _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D12GraphicsCommandList1 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D12GraphicsCommandList1 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + _In_reads_( NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) + void ( STDMETHODCALLTYPE *OMSetBlendFactor )( + ID3D12GraphicsCommandList1 * This, + _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) + void ( STDMETHODCALLTYPE *OMSetStencilRef )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT StencilRef); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) + void ( STDMETHODCALLTYPE *SetPipelineState )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) + void ( STDMETHODCALLTYPE *ExecuteBundle )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12GraphicsCommandList *pCommandList); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) + void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT NumDescriptorHeaps, + _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) + void ( STDMETHODCALLTYPE *SetComputeRootSignature )( + ID3D12GraphicsCommandList1 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) + void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( + ID3D12GraphicsCommandList1 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D12GraphicsCommandList1 * This, + _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT NumRenderTargetDescriptors, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, + _In_ BOOL RTsSingleHandleToDescriptorRange, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D12GraphicsCommandList1 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, + _In_ D3D12_CLEAR_FLAGS ClearFlags, + _In_ FLOAT Depth, + _In_ UINT8 Stencil, + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D12GraphicsCommandList1 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, + _In_ const FLOAT ColorRGBA[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( + ID3D12GraphicsCommandList1 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const UINT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( + ID3D12GraphicsCommandList1 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const FLOAT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12GraphicsCommandList1 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12GraphicsCommandList1 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12GraphicsCommandList1 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12GraphicsCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) + void ( STDMETHODCALLTYPE *ExecuteIndirect )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12CommandSignature *pCommandSignature, + _In_ UINT MaxCommandCount, + _In_ ID3D12Resource *pArgumentBuffer, + _In_ UINT64 ArgumentBufferOffset, + _In_opt_ ID3D12Resource *pCountBuffer, + _In_ UINT64 CountBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds) + void ( STDMETHODCALLTYPE *OMSetDepthBounds )( + ID3D12GraphicsCommandList1 * This, + _In_ FLOAT Min, + _In_ FLOAT Max); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions) + void ( STDMETHODCALLTYPE *SetSamplePositions )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT NumSamplesPerPixel, + _In_ UINT NumPixels, + _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion) + void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ UINT DstX, + _In_ UINT DstY, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_opt_ D3D12_RECT *pSrcRect, + _In_ DXGI_FORMAT Format, + _In_ D3D12_RESOLVE_MODE ResolveMode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask) + void ( STDMETHODCALLTYPE *SetViewInstanceMask )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT Mask); + + END_INTERFACE + } ID3D12GraphicsCommandList1Vtbl; + + interface ID3D12GraphicsCommandList1 + { + CONST_VTBL struct ID3D12GraphicsCommandList1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12GraphicsCommandList1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12GraphicsCommandList1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12GraphicsCommandList1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12GraphicsCommandList1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12GraphicsCommandList1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12GraphicsCommandList1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12GraphicsCommandList1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12GraphicsCommandList1_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12GraphicsCommandList1_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12GraphicsCommandList1_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12GraphicsCommandList1_Reset(This,pAllocator,pInitialState) \ + ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) + +#define ID3D12GraphicsCommandList1_ClearState(This,pPipelineState) \ + ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList1_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList1_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList1_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + +#define ID3D12GraphicsCommandList1_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ + ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) + +#define ID3D12GraphicsCommandList1_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ + ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) + +#define ID3D12GraphicsCommandList1_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) + +#define ID3D12GraphicsCommandList1_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ + ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) + +#define ID3D12GraphicsCommandList1_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) + +#define ID3D12GraphicsCommandList1_IASetPrimitiveTopology(This,PrimitiveTopology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) + +#define ID3D12GraphicsCommandList1_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) + +#define ID3D12GraphicsCommandList1_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList1_OMSetBlendFactor(This,BlendFactor) \ + ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) + +#define ID3D12GraphicsCommandList1_OMSetStencilRef(This,StencilRef) \ + ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) + +#define ID3D12GraphicsCommandList1_SetPipelineState(This,pPipelineState) \ + ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList1_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12GraphicsCommandList1_ExecuteBundle(This,pCommandList) \ + ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) + +#define ID3D12GraphicsCommandList1_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ + ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) + +#define ID3D12GraphicsCommandList1_SetComputeRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList1_SetGraphicsRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList1_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList1_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList1_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList1_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList1_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList1_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList1_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList1_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList1_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList1_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList1_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList1_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList1_IASetIndexBuffer(This,pView) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) + +#define ID3D12GraphicsCommandList1_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList1_SOSetTargets(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList1_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) + +#define ID3D12GraphicsCommandList1_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList1_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList1_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList1_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList1_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12GraphicsCommandList1_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList1_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList1_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12GraphicsCommandList1_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12GraphicsCommandList1_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList1_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList1_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12GraphicsCommandList1_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ + ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) + + +#define ID3D12GraphicsCommandList1_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList1_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList1_OMSetDepthBounds(This,Min,Max) \ + ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) ) + +#define ID3D12GraphicsCommandList1_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ + ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) ) + +#define ID3D12GraphicsCommandList1_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ + ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) ) + +#define ID3D12GraphicsCommandList1_SetViewInstanceMask(This,Mask) \ + ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12GraphicsCommandList1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0018 */ +/* [local] */ + +typedef struct D3D12_WRITEBUFFERIMMEDIATE_PARAMETER + { + D3D12_GPU_VIRTUAL_ADDRESS Dest; + UINT32 Value; + } D3D12_WRITEBUFFERIMMEDIATE_PARAMETER; + +typedef +enum D3D12_WRITEBUFFERIMMEDIATE_MODE + { + D3D12_WRITEBUFFERIMMEDIATE_MODE_DEFAULT = 0, + D3D12_WRITEBUFFERIMMEDIATE_MODE_MARKER_IN = 0x1, + D3D12_WRITEBUFFERIMMEDIATE_MODE_MARKER_OUT = 0x2 + } D3D12_WRITEBUFFERIMMEDIATE_MODE; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0018_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0018_v0_0_s_ifspec; + +#ifndef __ID3D12GraphicsCommandList2_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList2_INTERFACE_DEFINED__ + +/* interface ID3D12GraphicsCommandList2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12GraphicsCommandList2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("38C3E585-FF17-412C-9150-4FC6F9D72A28") + ID3D12GraphicsCommandList2 : public ID3D12GraphicsCommandList1 + { + public: + virtual void STDMETHODCALLTYPE WriteBufferImmediate( + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12GraphicsCommandList2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12GraphicsCommandList2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12GraphicsCommandList2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12GraphicsCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12GraphicsCommandList2 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12GraphicsCommandList2 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12GraphicsCommandList2 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12GraphicsCommandList2 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12GraphicsCommandList2 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12GraphicsCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12GraphicsCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12CommandAllocator *pAllocator, + _In_opt_ ID3D12PipelineState *pInitialState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12GraphicsCommandList2 * This, + _In_opt_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT VertexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT IndexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartIndexLocation, + _In_ INT BaseVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) + void ( STDMETHODCALLTYPE *Dispatch )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) + void ( STDMETHODCALLTYPE *CopyBufferRegion )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT64 NumBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) + void ( STDMETHODCALLTYPE *CopyTextureRegion )( + ID3D12GraphicsCommandList2 * This, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, + UINT DstX, + UINT DstY, + UINT DstZ, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12Resource *pDstResource, + _In_ ID3D12Resource *pSrcResource); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) + void ( STDMETHODCALLTYPE *CopyTiles )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12Resource *pTiledResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, + _In_ ID3D12Resource *pBuffer, + UINT64 BufferStartOffsetInBytes, + D3D12_TILE_COPY_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_ DXGI_FORMAT Format); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D12GraphicsCommandList2 * This, + _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D12GraphicsCommandList2 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D12GraphicsCommandList2 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + _In_reads_( NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) + void ( STDMETHODCALLTYPE *OMSetBlendFactor )( + ID3D12GraphicsCommandList2 * This, + _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) + void ( STDMETHODCALLTYPE *OMSetStencilRef )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT StencilRef); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) + void ( STDMETHODCALLTYPE *SetPipelineState )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) + void ( STDMETHODCALLTYPE *ExecuteBundle )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12GraphicsCommandList *pCommandList); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) + void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT NumDescriptorHeaps, + _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) + void ( STDMETHODCALLTYPE *SetComputeRootSignature )( + ID3D12GraphicsCommandList2 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) + void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( + ID3D12GraphicsCommandList2 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D12GraphicsCommandList2 * This, + _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT NumRenderTargetDescriptors, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, + _In_ BOOL RTsSingleHandleToDescriptorRange, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D12GraphicsCommandList2 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, + _In_ D3D12_CLEAR_FLAGS ClearFlags, + _In_ FLOAT Depth, + _In_ UINT8 Stencil, + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D12GraphicsCommandList2 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, + _In_ const FLOAT ColorRGBA[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( + ID3D12GraphicsCommandList2 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const UINT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( + ID3D12GraphicsCommandList2 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const FLOAT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12GraphicsCommandList2 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12GraphicsCommandList2 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12GraphicsCommandList2 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12GraphicsCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) + void ( STDMETHODCALLTYPE *ExecuteIndirect )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12CommandSignature *pCommandSignature, + _In_ UINT MaxCommandCount, + _In_ ID3D12Resource *pArgumentBuffer, + _In_ UINT64 ArgumentBufferOffset, + _In_opt_ ID3D12Resource *pCountBuffer, + _In_ UINT64 CountBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds) + void ( STDMETHODCALLTYPE *OMSetDepthBounds )( + ID3D12GraphicsCommandList2 * This, + _In_ FLOAT Min, + _In_ FLOAT Max); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions) + void ( STDMETHODCALLTYPE *SetSamplePositions )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT NumSamplesPerPixel, + _In_ UINT NumPixels, + _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion) + void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ UINT DstX, + _In_ UINT DstY, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_opt_ D3D12_RECT *pSrcRect, + _In_ DXGI_FORMAT Format, + _In_ D3D12_RESOLVE_MODE ResolveMode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask) + void ( STDMETHODCALLTYPE *SetViewInstanceMask )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT Mask); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12GraphicsCommandList2 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + END_INTERFACE + } ID3D12GraphicsCommandList2Vtbl; + + interface ID3D12GraphicsCommandList2 + { + CONST_VTBL struct ID3D12GraphicsCommandList2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12GraphicsCommandList2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12GraphicsCommandList2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12GraphicsCommandList2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12GraphicsCommandList2_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12GraphicsCommandList2_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12GraphicsCommandList2_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12GraphicsCommandList2_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12GraphicsCommandList2_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12GraphicsCommandList2_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12GraphicsCommandList2_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12GraphicsCommandList2_Reset(This,pAllocator,pInitialState) \ + ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) + +#define ID3D12GraphicsCommandList2_ClearState(This,pPipelineState) \ + ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList2_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList2_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList2_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + +#define ID3D12GraphicsCommandList2_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ + ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) + +#define ID3D12GraphicsCommandList2_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ + ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) + +#define ID3D12GraphicsCommandList2_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) + +#define ID3D12GraphicsCommandList2_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ + ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) + +#define ID3D12GraphicsCommandList2_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) + +#define ID3D12GraphicsCommandList2_IASetPrimitiveTopology(This,PrimitiveTopology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) + +#define ID3D12GraphicsCommandList2_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) + +#define ID3D12GraphicsCommandList2_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList2_OMSetBlendFactor(This,BlendFactor) \ + ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) + +#define ID3D12GraphicsCommandList2_OMSetStencilRef(This,StencilRef) \ + ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) + +#define ID3D12GraphicsCommandList2_SetPipelineState(This,pPipelineState) \ + ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList2_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12GraphicsCommandList2_ExecuteBundle(This,pCommandList) \ + ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) + +#define ID3D12GraphicsCommandList2_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ + ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) + +#define ID3D12GraphicsCommandList2_SetComputeRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList2_SetGraphicsRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList2_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList2_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList2_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList2_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList2_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList2_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList2_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList2_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList2_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList2_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList2_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList2_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList2_IASetIndexBuffer(This,pView) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) + +#define ID3D12GraphicsCommandList2_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList2_SOSetTargets(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList2_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) + +#define ID3D12GraphicsCommandList2_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList2_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList2_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList2_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList2_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12GraphicsCommandList2_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList2_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList2_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12GraphicsCommandList2_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12GraphicsCommandList2_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList2_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList2_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12GraphicsCommandList2_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ + ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) + + +#define ID3D12GraphicsCommandList2_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList2_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList2_OMSetDepthBounds(This,Min,Max) \ + ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) ) + +#define ID3D12GraphicsCommandList2_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ + ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) ) + +#define ID3D12GraphicsCommandList2_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ + ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) ) + +#define ID3D12GraphicsCommandList2_SetViewInstanceMask(This,Mask) \ + ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) ) + + +#define ID3D12GraphicsCommandList2_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12GraphicsCommandList2_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12CommandQueue_INTERFACE_DEFINED__ +#define __ID3D12CommandQueue_INTERFACE_DEFINED__ + +/* interface ID3D12CommandQueue */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12CommandQueue; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0ec870a6-5d7e-4c22-8cfc-5baae07616ed") + ID3D12CommandQueue : public ID3D12Pageable + { + public: + virtual void STDMETHODCALLTYPE UpdateTileMappings( + _In_ ID3D12Resource *pResource, + UINT NumResourceRegions, + _In_reads_opt_(NumResourceRegions) const D3D12_TILED_RESOURCE_COORDINATE *pResourceRegionStartCoordinates, + _In_reads_opt_(NumResourceRegions) const D3D12_TILE_REGION_SIZE *pResourceRegionSizes, + _In_opt_ ID3D12Heap *pHeap, + UINT NumRanges, + _In_reads_opt_(NumRanges) const D3D12_TILE_RANGE_FLAGS *pRangeFlags, + _In_reads_opt_(NumRanges) const UINT *pHeapRangeStartOffsets, + _In_reads_opt_(NumRanges) const UINT *pRangeTileCounts, + D3D12_TILE_MAPPING_FLAGS Flags) = 0; + + virtual void STDMETHODCALLTYPE CopyTileMappings( + _In_ ID3D12Resource *pDstResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pDstRegionStartCoordinate, + _In_ ID3D12Resource *pSrcResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pSrcRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pRegionSize, + D3D12_TILE_MAPPING_FLAGS Flags) = 0; + + virtual void STDMETHODCALLTYPE ExecuteCommandLists( + _In_ UINT NumCommandLists, + _In_reads_(NumCommandLists) ID3D12CommandList *const *ppCommandLists) = 0; + + virtual void STDMETHODCALLTYPE SetMarker( + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size) = 0; + + virtual void STDMETHODCALLTYPE BeginEvent( + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size) = 0; + + virtual void STDMETHODCALLTYPE EndEvent( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Signal( + ID3D12Fence *pFence, + UINT64 Value) = 0; + + virtual HRESULT STDMETHODCALLTYPE Wait( + ID3D12Fence *pFence, + UINT64 Value) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetTimestampFrequency( + _Out_ UINT64 *pFrequency) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetClockCalibration( + _Out_ UINT64 *pGpuTimestamp, + _Out_ UINT64 *pCpuTimestamp) = 0; + +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_COMMAND_QUEUE_DESC STDMETHODCALLTYPE GetDesc( void) = 0; +#else + virtual D3D12_COMMAND_QUEUE_DESC *STDMETHODCALLTYPE GetDesc( + D3D12_COMMAND_QUEUE_DESC * RetVal) = 0; +#endif + + }; + + +#else /* C style interface */ + + typedef struct ID3D12CommandQueueVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12CommandQueue * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12CommandQueue * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12CommandQueue * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12CommandQueue * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12CommandQueue * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12CommandQueue * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12CommandQueue * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12CommandQueue * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandQueue, UpdateTileMappings) + void ( STDMETHODCALLTYPE *UpdateTileMappings )( + ID3D12CommandQueue * This, + _In_ ID3D12Resource *pResource, + UINT NumResourceRegions, + _In_reads_opt_(NumResourceRegions) const D3D12_TILED_RESOURCE_COORDINATE *pResourceRegionStartCoordinates, + _In_reads_opt_(NumResourceRegions) const D3D12_TILE_REGION_SIZE *pResourceRegionSizes, + _In_opt_ ID3D12Heap *pHeap, + UINT NumRanges, + _In_reads_opt_(NumRanges) const D3D12_TILE_RANGE_FLAGS *pRangeFlags, + _In_reads_opt_(NumRanges) const UINT *pHeapRangeStartOffsets, + _In_reads_opt_(NumRanges) const UINT *pRangeTileCounts, + D3D12_TILE_MAPPING_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12CommandQueue, CopyTileMappings) + void ( STDMETHODCALLTYPE *CopyTileMappings )( + ID3D12CommandQueue * This, + _In_ ID3D12Resource *pDstResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pDstRegionStartCoordinate, + _In_ ID3D12Resource *pSrcResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pSrcRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pRegionSize, + D3D12_TILE_MAPPING_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12CommandQueue, ExecuteCommandLists) + void ( STDMETHODCALLTYPE *ExecuteCommandLists )( + ID3D12CommandQueue * This, + _In_ UINT NumCommandLists, + _In_reads_(NumCommandLists) ID3D12CommandList *const *ppCommandLists); + + DECLSPEC_XFGVIRT(ID3D12CommandQueue, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12CommandQueue * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12CommandQueue, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12CommandQueue * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12CommandQueue, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12CommandQueue * This); + + DECLSPEC_XFGVIRT(ID3D12CommandQueue, Signal) + HRESULT ( STDMETHODCALLTYPE *Signal )( + ID3D12CommandQueue * This, + ID3D12Fence *pFence, + UINT64 Value); + + DECLSPEC_XFGVIRT(ID3D12CommandQueue, Wait) + HRESULT ( STDMETHODCALLTYPE *Wait )( + ID3D12CommandQueue * This, + ID3D12Fence *pFence, + UINT64 Value); + + DECLSPEC_XFGVIRT(ID3D12CommandQueue, GetTimestampFrequency) + HRESULT ( STDMETHODCALLTYPE *GetTimestampFrequency )( + ID3D12CommandQueue * This, + _Out_ UINT64 *pFrequency); + + DECLSPEC_XFGVIRT(ID3D12CommandQueue, GetClockCalibration) + HRESULT ( STDMETHODCALLTYPE *GetClockCalibration )( + ID3D12CommandQueue * This, + _Out_ UINT64 *pGpuTimestamp, + _Out_ UINT64 *pCpuTimestamp); + + DECLSPEC_XFGVIRT(ID3D12CommandQueue, GetDesc) +#if !defined(_WIN32) + D3D12_COMMAND_QUEUE_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12CommandQueue * This); + +#else + D3D12_COMMAND_QUEUE_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12CommandQueue * This, + D3D12_COMMAND_QUEUE_DESC * RetVal); + +#endif + + END_INTERFACE + } ID3D12CommandQueueVtbl; + + interface ID3D12CommandQueue + { + CONST_VTBL struct ID3D12CommandQueueVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#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) ) + + +#define ID3D12CommandQueue_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12CommandQueue_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12CommandQueue_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12CommandQueue_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12CommandQueue_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#define ID3D12CommandQueue_UpdateTileMappings(This,pResource,NumResourceRegions,pResourceRegionStartCoordinates,pResourceRegionSizes,pHeap,NumRanges,pRangeFlags,pHeapRangeStartOffsets,pRangeTileCounts,Flags) \ + ( (This)->lpVtbl -> UpdateTileMappings(This,pResource,NumResourceRegions,pResourceRegionStartCoordinates,pResourceRegionSizes,pHeap,NumRanges,pRangeFlags,pHeapRangeStartOffsets,pRangeTileCounts,Flags) ) + +#define ID3D12CommandQueue_CopyTileMappings(This,pDstResource,pDstRegionStartCoordinate,pSrcResource,pSrcRegionStartCoordinate,pRegionSize,Flags) \ + ( (This)->lpVtbl -> CopyTileMappings(This,pDstResource,pDstRegionStartCoordinate,pSrcResource,pSrcRegionStartCoordinate,pRegionSize,Flags) ) + +#define ID3D12CommandQueue_ExecuteCommandLists(This,NumCommandLists,ppCommandLists) \ + ( (This)->lpVtbl -> ExecuteCommandLists(This,NumCommandLists,ppCommandLists) ) + +#define ID3D12CommandQueue_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12CommandQueue_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12CommandQueue_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12CommandQueue_Signal(This,pFence,Value) \ + ( (This)->lpVtbl -> Signal(This,pFence,Value) ) + +#define ID3D12CommandQueue_Wait(This,pFence,Value) \ + ( (This)->lpVtbl -> Wait(This,pFence,Value) ) + +#define ID3D12CommandQueue_GetTimestampFrequency(This,pFrequency) \ + ( (This)->lpVtbl -> GetTimestampFrequency(This,pFrequency) ) + +#define ID3D12CommandQueue_GetClockCalibration(This,pGpuTimestamp,pCpuTimestamp) \ + ( (This)->lpVtbl -> GetClockCalibration(This,pGpuTimestamp,pCpuTimestamp) ) +#if !defined(_WIN32) + +#define ID3D12CommandQueue_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12CommandQueue_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12CommandQueue_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0020 */ +/* [local] */ + +#ifdef __midl +#ifndef LUID_DEFINED +#define LUID_DEFINED 1 +typedef struct __LUID + { + DWORD LowPart; + LONG HighPart; + } LUID; + +typedef struct __LUID *PLUID; + +#endif +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0020_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0020_v0_0_s_ifspec; + +#ifndef __ID3D12Device_INTERFACE_DEFINED__ +#define __ID3D12Device_INTERFACE_DEFINED__ + +/* interface ID3D12Device */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("189819f1-1db6-4b57-be54-1821339b85f7") + ID3D12Device : public ID3D12Object + { + public: + virtual UINT STDMETHODCALLTYPE GetNodeCount( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateCommandQueue( + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateCommandAllocator( + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateGraphicsPipelineState( + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateComputePipelineState( + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateCommandList( + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList) = 0; + + virtual HRESULT STDMETHODCALLTYPE CheckFeatureSupport( + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateDescriptorHeap( + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap) = 0; + + virtual UINT STDMETHODCALLTYPE GetDescriptorHandleIncrementSize( + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateRootSignature( + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature) = 0; + + virtual void STDMETHODCALLTYPE CreateConstantBufferView( + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0; + + virtual void STDMETHODCALLTYPE CreateShaderResourceView( + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0; + + virtual void STDMETHODCALLTYPE CreateUnorderedAccessView( + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0; + + virtual void STDMETHODCALLTYPE CreateRenderTargetView( + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0; + + virtual void STDMETHODCALLTYPE CreateDepthStencilView( + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0; + + virtual void STDMETHODCALLTYPE CreateSampler( + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0; + + virtual void STDMETHODCALLTYPE CopyDescriptors( + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType) = 0; + + virtual void STDMETHODCALLTYPE CopyDescriptorsSimple( + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType) = 0; + +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_RESOURCE_ALLOCATION_INFO STDMETHODCALLTYPE GetResourceAllocationInfo( + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs) = 0; +#else + virtual D3D12_RESOURCE_ALLOCATION_INFO *STDMETHODCALLTYPE GetResourceAllocationInfo( + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs) = 0; +#endif + +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_HEAP_PROPERTIES STDMETHODCALLTYPE GetCustomHeapProperties( + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType) = 0; +#else + virtual D3D12_HEAP_PROPERTIES *STDMETHODCALLTYPE GetCustomHeapProperties( + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType) = 0; +#endif + + virtual HRESULT STDMETHODCALLTYPE CreateCommittedResource( + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateHeap( + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreatePlacedResource( + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateReservedResource( + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateSharedHandle( + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle) = 0; + + virtual HRESULT STDMETHODCALLTYPE OpenSharedHandle( + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj) = 0; + + virtual HRESULT STDMETHODCALLTYPE OpenSharedHandleByName( + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle) = 0; + + virtual HRESULT STDMETHODCALLTYPE MakeResident( + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects) = 0; + + virtual HRESULT STDMETHODCALLTYPE Evict( + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateFence( + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDeviceRemovedReason( void) = 0; + + virtual void STDMETHODCALLTYPE GetCopyableFootprints( + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateQueryHeap( + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetStablePowerState( + BOOL Enable) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateCommandSignature( + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature) = 0; + + virtual void STDMETHODCALLTYPE GetResourceTiling( + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips) = 0; + +#if defined(_MSC_VER) || !defined(_WIN32) + virtual LUID STDMETHODCALLTYPE GetAdapterLuid( void) = 0; +#else + virtual LUID *STDMETHODCALLTYPE GetAdapterLuid( + LUID * RetVal) = 0; +#endif + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device * This, + LUID * RetVal); + +#endif + + END_INTERFACE + } ID3D12DeviceVtbl; + + interface ID3D12Device + { + CONST_VTBL struct ID3D12DeviceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#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) ) + + +#define ID3D12Device_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12PipelineLibrary_INTERFACE_DEFINED__ +#define __ID3D12PipelineLibrary_INTERFACE_DEFINED__ + +/* interface ID3D12PipelineLibrary */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12PipelineLibrary; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("c64226a8-9201-46af-b4cc-53fb9ff7414f") + ID3D12PipelineLibrary : public ID3D12DeviceChild + { + public: + virtual HRESULT STDMETHODCALLTYPE StorePipeline( + _In_opt_ LPCWSTR pName, + _In_ ID3D12PipelineState *pPipeline) = 0; + + virtual HRESULT STDMETHODCALLTYPE LoadGraphicsPipeline( + _In_ LPCWSTR pName, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState) = 0; + + virtual HRESULT STDMETHODCALLTYPE LoadComputePipeline( + _In_ LPCWSTR pName, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState) = 0; + + virtual SIZE_T STDMETHODCALLTYPE GetSerializedSize( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Serialize( + _Out_writes_(DataSizeInBytes) void *pData, + SIZE_T DataSizeInBytes) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12PipelineLibraryVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12PipelineLibrary * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12PipelineLibrary * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12PipelineLibrary * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12PipelineLibrary * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12PipelineLibrary * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12PipelineLibrary * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12PipelineLibrary * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12PipelineLibrary * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, StorePipeline) + HRESULT ( STDMETHODCALLTYPE *StorePipeline )( + ID3D12PipelineLibrary * This, + _In_opt_ LPCWSTR pName, + _In_ ID3D12PipelineState *pPipeline); + + DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, LoadGraphicsPipeline) + HRESULT ( STDMETHODCALLTYPE *LoadGraphicsPipeline )( + ID3D12PipelineLibrary * This, + _In_ LPCWSTR pName, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, LoadComputePipeline) + HRESULT ( STDMETHODCALLTYPE *LoadComputePipeline )( + ID3D12PipelineLibrary * This, + _In_ LPCWSTR pName, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, GetSerializedSize) + SIZE_T ( STDMETHODCALLTYPE *GetSerializedSize )( + ID3D12PipelineLibrary * This); + + DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, Serialize) + HRESULT ( STDMETHODCALLTYPE *Serialize )( + ID3D12PipelineLibrary * This, + _Out_writes_(DataSizeInBytes) void *pData, + SIZE_T DataSizeInBytes); + + END_INTERFACE + } ID3D12PipelineLibraryVtbl; + + interface ID3D12PipelineLibrary + { + CONST_VTBL struct ID3D12PipelineLibraryVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12PipelineLibrary_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12PipelineLibrary_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12PipelineLibrary_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12PipelineLibrary_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12PipelineLibrary_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12PipelineLibrary_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12PipelineLibrary_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12PipelineLibrary_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12PipelineLibrary_StorePipeline(This,pName,pPipeline) \ + ( (This)->lpVtbl -> StorePipeline(This,pName,pPipeline) ) + +#define ID3D12PipelineLibrary_LoadGraphicsPipeline(This,pName,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> LoadGraphicsPipeline(This,pName,pDesc,riid,ppPipelineState) ) + +#define ID3D12PipelineLibrary_LoadComputePipeline(This,pName,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> LoadComputePipeline(This,pName,pDesc,riid,ppPipelineState) ) + +#define ID3D12PipelineLibrary_GetSerializedSize(This) \ + ( (This)->lpVtbl -> GetSerializedSize(This) ) + +#define ID3D12PipelineLibrary_Serialize(This,pData,DataSizeInBytes) \ + ( (This)->lpVtbl -> Serialize(This,pData,DataSizeInBytes) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12PipelineLibrary_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12PipelineLibrary1_INTERFACE_DEFINED__ +#define __ID3D12PipelineLibrary1_INTERFACE_DEFINED__ + +/* interface ID3D12PipelineLibrary1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12PipelineLibrary1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("80eabf42-2568-4e5e-bd82-c37f86961dc3") + ID3D12PipelineLibrary1 : public ID3D12PipelineLibrary + { + public: + virtual HRESULT STDMETHODCALLTYPE LoadPipeline( + _In_ LPCWSTR pName, + _In_ const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12PipelineLibrary1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12PipelineLibrary1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12PipelineLibrary1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12PipelineLibrary1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12PipelineLibrary1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12PipelineLibrary1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12PipelineLibrary1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12PipelineLibrary1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12PipelineLibrary1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, StorePipeline) + HRESULT ( STDMETHODCALLTYPE *StorePipeline )( + ID3D12PipelineLibrary1 * This, + _In_opt_ LPCWSTR pName, + _In_ ID3D12PipelineState *pPipeline); + + DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, LoadGraphicsPipeline) + HRESULT ( STDMETHODCALLTYPE *LoadGraphicsPipeline )( + ID3D12PipelineLibrary1 * This, + _In_ LPCWSTR pName, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, LoadComputePipeline) + HRESULT ( STDMETHODCALLTYPE *LoadComputePipeline )( + ID3D12PipelineLibrary1 * This, + _In_ LPCWSTR pName, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, GetSerializedSize) + SIZE_T ( STDMETHODCALLTYPE *GetSerializedSize )( + ID3D12PipelineLibrary1 * This); + + DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, Serialize) + HRESULT ( STDMETHODCALLTYPE *Serialize )( + ID3D12PipelineLibrary1 * This, + _Out_writes_(DataSizeInBytes) void *pData, + SIZE_T DataSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12PipelineLibrary1, LoadPipeline) + HRESULT ( STDMETHODCALLTYPE *LoadPipeline )( + ID3D12PipelineLibrary1 * This, + _In_ LPCWSTR pName, + _In_ const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + END_INTERFACE + } ID3D12PipelineLibrary1Vtbl; + + interface ID3D12PipelineLibrary1 + { + CONST_VTBL struct ID3D12PipelineLibrary1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12PipelineLibrary1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12PipelineLibrary1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12PipelineLibrary1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12PipelineLibrary1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12PipelineLibrary1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12PipelineLibrary1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12PipelineLibrary1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12PipelineLibrary1_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12PipelineLibrary1_StorePipeline(This,pName,pPipeline) \ + ( (This)->lpVtbl -> StorePipeline(This,pName,pPipeline) ) + +#define ID3D12PipelineLibrary1_LoadGraphicsPipeline(This,pName,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> LoadGraphicsPipeline(This,pName,pDesc,riid,ppPipelineState) ) + +#define ID3D12PipelineLibrary1_LoadComputePipeline(This,pName,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> LoadComputePipeline(This,pName,pDesc,riid,ppPipelineState) ) + +#define ID3D12PipelineLibrary1_GetSerializedSize(This) \ + ( (This)->lpVtbl -> GetSerializedSize(This) ) + +#define ID3D12PipelineLibrary1_Serialize(This,pData,DataSizeInBytes) \ + ( (This)->lpVtbl -> Serialize(This,pData,DataSizeInBytes) ) + + +#define ID3D12PipelineLibrary1_LoadPipeline(This,pName,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> LoadPipeline(This,pName,pDesc,riid,ppPipelineState) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12PipelineLibrary1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0023 */ +/* [local] */ + +typedef +enum D3D12_MULTIPLE_FENCE_WAIT_FLAGS + { + D3D12_MULTIPLE_FENCE_WAIT_FLAG_NONE = 0, + D3D12_MULTIPLE_FENCE_WAIT_FLAG_ANY = 0x1, + D3D12_MULTIPLE_FENCE_WAIT_FLAG_ALL = 0 + } D3D12_MULTIPLE_FENCE_WAIT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_MULTIPLE_FENCE_WAIT_FLAGS ); +typedef +enum D3D12_RESIDENCY_PRIORITY + { + D3D12_RESIDENCY_PRIORITY_MINIMUM = 0x28000000, + D3D12_RESIDENCY_PRIORITY_LOW = 0x50000000, + D3D12_RESIDENCY_PRIORITY_NORMAL = 0x78000000, + D3D12_RESIDENCY_PRIORITY_HIGH = 0xa0010000, + D3D12_RESIDENCY_PRIORITY_MAXIMUM = 0xc8000000 + } D3D12_RESIDENCY_PRIORITY; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0023_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0023_v0_0_s_ifspec; + +#ifndef __ID3D12Device1_INTERFACE_DEFINED__ +#define __ID3D12Device1_INTERFACE_DEFINED__ + +/* interface ID3D12Device1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("77acce80-638e-4e65-8895-c1f23386863e") + ID3D12Device1 : public ID3D12Device + { + public: + virtual HRESULT STDMETHODCALLTYPE CreatePipelineLibrary( + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetEventOnMultipleFenceCompletion( + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetResidencyPriority( + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device1 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device1 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device1 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device1 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device1 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device1 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device1 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device1 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device1 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device1 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device1 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device1 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device1 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device1 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device1 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device1 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device1 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device1 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device1 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device1 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device1 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device1 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device1 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device1 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device1 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device1 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device1 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device1 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device1 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device1 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device1 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device1 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device1 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device1 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device1 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device1 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device1 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device1 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device1 * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device1 * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device1 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device1 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device1 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + + END_INTERFACE + } ID3D12Device1Vtbl; + + interface ID3D12Device1 + { + CONST_VTBL struct ID3D12Device1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Device1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Device1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Device1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Device1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device1_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device1_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device1_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device1_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device1_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device1_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device1_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device1_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device1_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device1_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device1_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device1_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device1_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device1_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device1_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device1_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device1_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device1_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device1_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device1_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device1_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device1_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device1_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device1_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device1_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device1_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device1_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device1_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device1_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device1_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device1_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device1_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device1_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device1_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device1_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device1_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device1_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device1_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device1_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device1_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + + +#define ID3D12Device1_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) + +#define ID3D12Device1_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) + +#define ID3D12Device1_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Device2_INTERFACE_DEFINED__ +#define __ID3D12Device2_INTERFACE_DEFINED__ + +/* interface ID3D12Device2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("30baa41e-b15b-475c-a0bb-1af5c5b64328") + ID3D12Device2 : public ID3D12Device1 + { + public: + virtual HRESULT STDMETHODCALLTYPE CreatePipelineState( + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device2 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device2 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device2 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device2 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device2 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device2 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device2 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device2 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device2 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device2 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device2 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device2 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device2 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device2 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device2 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device2 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device2 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device2 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device2 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device2 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device2 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device2 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device2 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device2 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device2 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device2 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device2 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device2 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device2 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device2 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device2 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device2 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device2 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device2 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device2 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device2 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device2 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device2 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device2 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device2 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device2 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device2 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device2 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device2 * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device2 * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device2 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device2 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device2 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device2 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + END_INTERFACE + } ID3D12Device2Vtbl; + + interface ID3D12Device2 + { + CONST_VTBL struct ID3D12Device2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Device2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Device2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Device2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Device2_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device2_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device2_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device2_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device2_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device2_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device2_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device2_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device2_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device2_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device2_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device2_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device2_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device2_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device2_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device2_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device2_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device2_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device2_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device2_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device2_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device2_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device2_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device2_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device2_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device2_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device2_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device2_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device2_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device2_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device2_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device2_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device2_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device2_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device2_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device2_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device2_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device2_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device2_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device2_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device2_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device2_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device2_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device2_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + + +#define ID3D12Device2_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) + +#define ID3D12Device2_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) + +#define ID3D12Device2_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) + + +#define ID3D12Device2_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device2_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0025 */ +/* [local] */ + +typedef +enum D3D12_RESIDENCY_FLAGS + { + D3D12_RESIDENCY_FLAG_NONE = 0, + D3D12_RESIDENCY_FLAG_DENY_OVERBUDGET = 0x1 + } D3D12_RESIDENCY_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESIDENCY_FLAGS ); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0025_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0025_v0_0_s_ifspec; + +#ifndef __ID3D12Device3_INTERFACE_DEFINED__ +#define __ID3D12Device3_INTERFACE_DEFINED__ + +/* interface ID3D12Device3 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device3; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("81dadc15-2bad-4392-93c5-101345c4aa98") + ID3D12Device3 : public ID3D12Device2 + { + public: + virtual HRESULT STDMETHODCALLTYPE OpenExistingHeapFromAddress( + _In_ const void *pAddress, + REFIID riid, + _COM_Outptr_ void **ppvHeap) = 0; + + virtual HRESULT STDMETHODCALLTYPE OpenExistingHeapFromFileMapping( + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap) = 0; + + virtual HRESULT STDMETHODCALLTYPE EnqueueMakeResident( + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device3Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device3 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device3 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device3 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device3 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device3 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device3 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device3 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device3 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device3 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device3 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device3 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device3 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device3 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device3 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device3 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device3 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device3 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device3 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device3 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device3 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device3 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device3 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device3 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device3 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device3 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device3 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device3 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device3 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device3 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device3 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device3 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device3 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device3 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device3 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device3 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device3 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device3 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device3 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device3 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device3 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device3 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device3 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device3 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device3 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device3 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device3 * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device3 * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device3 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device3 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device3 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device3 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( + ID3D12Device3 * This, + _In_ const void *pAddress, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( + ID3D12Device3 * This, + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) + HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( + ID3D12Device3 * This, + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal); + + END_INTERFACE + } ID3D12Device3Vtbl; + + interface ID3D12Device3 + { + CONST_VTBL struct ID3D12Device3Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Device3_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Device3_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Device3_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Device3_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device3_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device3_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device3_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device3_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device3_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device3_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device3_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device3_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device3_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device3_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device3_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device3_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device3_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device3_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device3_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device3_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device3_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device3_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device3_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device3_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device3_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device3_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device3_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device3_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device3_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device3_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device3_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device3_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device3_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device3_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device3_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device3_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device3_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device3_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device3_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device3_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device3_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device3_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device3_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device3_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device3_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device3_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device3_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + + +#define ID3D12Device3_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) + +#define ID3D12Device3_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) + +#define ID3D12Device3_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) + + +#define ID3D12Device3_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) + + +#define ID3D12Device3_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) + +#define ID3D12Device3_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) + +#define ID3D12Device3_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ + ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device3_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0026 */ +/* [local] */ + +typedef +enum D3D12_COMMAND_LIST_FLAGS + { + D3D12_COMMAND_LIST_FLAG_NONE = 0 + } D3D12_COMMAND_LIST_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_LIST_FLAGS ); +typedef +enum D3D12_COMMAND_POOL_FLAGS + { + D3D12_COMMAND_POOL_FLAG_NONE = 0 + } D3D12_COMMAND_POOL_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_POOL_FLAGS ); +typedef +enum D3D12_COMMAND_RECORDER_FLAGS + { + D3D12_COMMAND_RECORDER_FLAG_NONE = 0 + } D3D12_COMMAND_RECORDER_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_RECORDER_FLAGS ); +typedef +enum D3D12_PROTECTED_SESSION_STATUS + { + D3D12_PROTECTED_SESSION_STATUS_OK = 0, + D3D12_PROTECTED_SESSION_STATUS_INVALID = 1 + } D3D12_PROTECTED_SESSION_STATUS; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0026_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0026_v0_0_s_ifspec; + +#ifndef __ID3D12ProtectedSession_INTERFACE_DEFINED__ +#define __ID3D12ProtectedSession_INTERFACE_DEFINED__ + +/* interface ID3D12ProtectedSession */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12ProtectedSession; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("A1533D18-0AC1-4084-85B9-89A96116806B") + ID3D12ProtectedSession : public ID3D12DeviceChild + { + public: + virtual HRESULT STDMETHODCALLTYPE GetStatusFence( + REFIID riid, + _COM_Outptr_opt_ void **ppFence) = 0; + + virtual D3D12_PROTECTED_SESSION_STATUS STDMETHODCALLTYPE GetSessionStatus( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12ProtectedSessionVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12ProtectedSession * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12ProtectedSession * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12ProtectedSession * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12ProtectedSession * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12ProtectedSession * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12ProtectedSession * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12ProtectedSession * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12ProtectedSession * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12ProtectedSession, GetStatusFence) + HRESULT ( STDMETHODCALLTYPE *GetStatusFence )( + ID3D12ProtectedSession * This, + REFIID riid, + _COM_Outptr_opt_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12ProtectedSession, GetSessionStatus) + D3D12_PROTECTED_SESSION_STATUS ( STDMETHODCALLTYPE *GetSessionStatus )( + ID3D12ProtectedSession * This); + + END_INTERFACE + } ID3D12ProtectedSessionVtbl; + + interface ID3D12ProtectedSession + { + CONST_VTBL struct ID3D12ProtectedSessionVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12ProtectedSession_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12ProtectedSession_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12ProtectedSession_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12ProtectedSession_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12ProtectedSession_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12ProtectedSession_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12ProtectedSession_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12ProtectedSession_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12ProtectedSession_GetStatusFence(This,riid,ppFence) \ + ( (This)->lpVtbl -> GetStatusFence(This,riid,ppFence) ) + +#define ID3D12ProtectedSession_GetSessionStatus(This) \ + ( (This)->lpVtbl -> GetSessionStatus(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12ProtectedSession_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0027 */ +/* [local] */ + +typedef +enum D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS + { + D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_NONE = 0, + D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_SUPPORTED = 0x1 + } D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS ); +typedef struct D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_SUPPORT + { + UINT NodeIndex; + D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS Support; + } D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_SUPPORT; + +typedef +enum D3D12_PROTECTED_RESOURCE_SESSION_FLAGS + { + D3D12_PROTECTED_RESOURCE_SESSION_FLAG_NONE = 0 + } D3D12_PROTECTED_RESOURCE_SESSION_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_PROTECTED_RESOURCE_SESSION_FLAGS ); +typedef struct D3D12_PROTECTED_RESOURCE_SESSION_DESC + { + UINT NodeMask; + D3D12_PROTECTED_RESOURCE_SESSION_FLAGS Flags; + } D3D12_PROTECTED_RESOURCE_SESSION_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0027_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0027_v0_0_s_ifspec; + +#ifndef __ID3D12ProtectedResourceSession_INTERFACE_DEFINED__ +#define __ID3D12ProtectedResourceSession_INTERFACE_DEFINED__ + +/* interface ID3D12ProtectedResourceSession */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12ProtectedResourceSession; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6CD696F4-F289-40CC-8091-5A6C0A099C3D") + ID3D12ProtectedResourceSession : public ID3D12ProtectedSession + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_PROTECTED_RESOURCE_SESSION_DESC STDMETHODCALLTYPE GetDesc( void) = 0; +#else + virtual D3D12_PROTECTED_RESOURCE_SESSION_DESC *STDMETHODCALLTYPE GetDesc( + D3D12_PROTECTED_RESOURCE_SESSION_DESC * RetVal) = 0; +#endif + + }; + + +#else /* C style interface */ + + typedef struct ID3D12ProtectedResourceSessionVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12ProtectedResourceSession * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12ProtectedResourceSession * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12ProtectedResourceSession * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12ProtectedResourceSession * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12ProtectedResourceSession * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12ProtectedResourceSession * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12ProtectedResourceSession * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12ProtectedResourceSession * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12ProtectedSession, GetStatusFence) + HRESULT ( STDMETHODCALLTYPE *GetStatusFence )( + ID3D12ProtectedResourceSession * This, + REFIID riid, + _COM_Outptr_opt_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12ProtectedSession, GetSessionStatus) + D3D12_PROTECTED_SESSION_STATUS ( STDMETHODCALLTYPE *GetSessionStatus )( + ID3D12ProtectedResourceSession * This); + + DECLSPEC_XFGVIRT(ID3D12ProtectedResourceSession, GetDesc) +#if !defined(_WIN32) + D3D12_PROTECTED_RESOURCE_SESSION_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12ProtectedResourceSession * This); + +#else + D3D12_PROTECTED_RESOURCE_SESSION_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12ProtectedResourceSession * This, + D3D12_PROTECTED_RESOURCE_SESSION_DESC * RetVal); + +#endif + + END_INTERFACE + } ID3D12ProtectedResourceSessionVtbl; + + interface ID3D12ProtectedResourceSession + { + CONST_VTBL struct ID3D12ProtectedResourceSessionVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12ProtectedResourceSession_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12ProtectedResourceSession_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12ProtectedResourceSession_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12ProtectedResourceSession_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12ProtectedResourceSession_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12ProtectedResourceSession_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12ProtectedResourceSession_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12ProtectedResourceSession_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12ProtectedResourceSession_GetStatusFence(This,riid,ppFence) \ + ( (This)->lpVtbl -> GetStatusFence(This,riid,ppFence) ) + +#define ID3D12ProtectedResourceSession_GetSessionStatus(This) \ + ( (This)->lpVtbl -> GetSessionStatus(This) ) + +#if !defined(_WIN32) + +#define ID3D12ProtectedResourceSession_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12ProtectedResourceSession_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12ProtectedResourceSession_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Device4_INTERFACE_DEFINED__ +#define __ID3D12Device4_INTERFACE_DEFINED__ + +/* interface ID3D12Device4 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device4; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("e865df17-a9ee-46f9-a463-3098315aa2e5") + ID3D12Device4 : public ID3D12Device3 + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateCommandList1( + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ D3D12_COMMAND_LIST_FLAGS flags, + REFIID riid, + _COM_Outptr_ void **ppCommandList) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateProtectedResourceSession( + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateCommittedResource1( + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateHeap1( + _In_ const D3D12_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateReservedResource1( + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource) = 0; + +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_RESOURCE_ALLOCATION_INFO STDMETHODCALLTYPE GetResourceAllocationInfo1( + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1) = 0; +#else + virtual D3D12_RESOURCE_ALLOCATION_INFO *STDMETHODCALLTYPE GetResourceAllocationInfo1( + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1) = 0; +#endif + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device4Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device4 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device4 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device4 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device4 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device4 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device4 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device4 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device4 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device4 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device4 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device4 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device4 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device4 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device4 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device4 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device4 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device4 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device4 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device4 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device4 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device4 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device4 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device4 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device4 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device4 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device4 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device4 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device4 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device4 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device4 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device4 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device4 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device4 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device4 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device4 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device4 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device4 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device4 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device4 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device4 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device4 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device4 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device4 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device4 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device4 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device4 * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device4 * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device4 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device4 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device4 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device4 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( + ID3D12Device4 * This, + _In_ const void *pAddress, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( + ID3D12Device4 * This, + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) + HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( + ID3D12Device4 * This, + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( + ID3D12Device4 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ D3D12_COMMAND_LIST_FLAGS flags, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( + ID3D12Device4 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( + ID3D12Device4 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( + ID3D12Device4 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( + ID3D12Device4 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device4 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device4 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + END_INTERFACE + } ID3D12Device4Vtbl; + + interface ID3D12Device4 + { + CONST_VTBL struct ID3D12Device4Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Device4_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Device4_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Device4_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Device4_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device4_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device4_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device4_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device4_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device4_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device4_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device4_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device4_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device4_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device4_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device4_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device4_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device4_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device4_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device4_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device4_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device4_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device4_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device4_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device4_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device4_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device4_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device4_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device4_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device4_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device4_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device4_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device4_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device4_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device4_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device4_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device4_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device4_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device4_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device4_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device4_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device4_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device4_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device4_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device4_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device4_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device4_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device4_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + + +#define ID3D12Device4_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) + +#define ID3D12Device4_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) + +#define ID3D12Device4_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) + + +#define ID3D12Device4_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) + + +#define ID3D12Device4_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) + +#define ID3D12Device4_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) + +#define ID3D12Device4_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ + ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) + + +#define ID3D12Device4_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) + +#define ID3D12Device4_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) + +#define ID3D12Device4_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device4_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) + +#define ID3D12Device4_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) +#if !defined(_WIN32) + +#define ID3D12Device4_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device4_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device4_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0029 */ +/* [local] */ + +typedef +enum D3D12_LIFETIME_STATE + { + D3D12_LIFETIME_STATE_IN_USE = 0, + D3D12_LIFETIME_STATE_NOT_IN_USE = ( D3D12_LIFETIME_STATE_IN_USE + 1 ) + } D3D12_LIFETIME_STATE; + + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0029_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0029_v0_0_s_ifspec; + +#ifndef __ID3D12LifetimeOwner_INTERFACE_DEFINED__ +#define __ID3D12LifetimeOwner_INTERFACE_DEFINED__ + +/* interface ID3D12LifetimeOwner */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12LifetimeOwner; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("e667af9f-cd56-4f46-83ce-032e595d70a8") + ID3D12LifetimeOwner : public IUnknown + { + public: + virtual void STDMETHODCALLTYPE LifetimeStateUpdated( + D3D12_LIFETIME_STATE NewState) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12LifetimeOwnerVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12LifetimeOwner * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12LifetimeOwner * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12LifetimeOwner * This); + + DECLSPEC_XFGVIRT(ID3D12LifetimeOwner, LifetimeStateUpdated) + void ( STDMETHODCALLTYPE *LifetimeStateUpdated )( + ID3D12LifetimeOwner * This, + D3D12_LIFETIME_STATE NewState); + + END_INTERFACE + } ID3D12LifetimeOwnerVtbl; + + interface ID3D12LifetimeOwner + { + CONST_VTBL struct ID3D12LifetimeOwnerVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12LifetimeOwner_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12LifetimeOwner_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12LifetimeOwner_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12LifetimeOwner_LifetimeStateUpdated(This,NewState) \ + ( (This)->lpVtbl -> LifetimeStateUpdated(This,NewState) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12LifetimeOwner_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12SwapChainAssistant_INTERFACE_DEFINED__ +#define __ID3D12SwapChainAssistant_INTERFACE_DEFINED__ + +/* interface ID3D12SwapChainAssistant */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12SwapChainAssistant; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("f1df64b6-57fd-49cd-8807-c0eb88b45c8f") + ID3D12SwapChainAssistant : public IUnknown + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual LUID STDMETHODCALLTYPE GetLUID( void) = 0; +#else + virtual LUID *STDMETHODCALLTYPE GetLUID( + LUID * RetVal) = 0; +#endif + + virtual HRESULT STDMETHODCALLTYPE GetSwapChainObject( + REFIID riid, + _COM_Outptr_ void **ppv) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetCurrentResourceAndCommandQueue( + REFIID riidResource, + _COM_Outptr_ void **ppvResource, + REFIID riidQueue, + _COM_Outptr_ void **ppvQueue) = 0; + + virtual HRESULT STDMETHODCALLTYPE InsertImplicitSync( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12SwapChainAssistantVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12SwapChainAssistant * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12SwapChainAssistant * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12SwapChainAssistant * This); + + DECLSPEC_XFGVIRT(ID3D12SwapChainAssistant, GetLUID) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetLUID )( + ID3D12SwapChainAssistant * This); + +#else + LUID *( STDMETHODCALLTYPE *GetLUID )( + ID3D12SwapChainAssistant * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12SwapChainAssistant, GetSwapChainObject) + HRESULT ( STDMETHODCALLTYPE *GetSwapChainObject )( + ID3D12SwapChainAssistant * This, + REFIID riid, + _COM_Outptr_ void **ppv); + + DECLSPEC_XFGVIRT(ID3D12SwapChainAssistant, GetCurrentResourceAndCommandQueue) + HRESULT ( STDMETHODCALLTYPE *GetCurrentResourceAndCommandQueue )( + ID3D12SwapChainAssistant * This, + REFIID riidResource, + _COM_Outptr_ void **ppvResource, + REFIID riidQueue, + _COM_Outptr_ void **ppvQueue); + + DECLSPEC_XFGVIRT(ID3D12SwapChainAssistant, InsertImplicitSync) + HRESULT ( STDMETHODCALLTYPE *InsertImplicitSync )( + ID3D12SwapChainAssistant * This); + + END_INTERFACE + } ID3D12SwapChainAssistantVtbl; + + interface ID3D12SwapChainAssistant + { + CONST_VTBL struct ID3D12SwapChainAssistantVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12SwapChainAssistant_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12SwapChainAssistant_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12SwapChainAssistant_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + +#if !defined(_WIN32) + +#define ID3D12SwapChainAssistant_GetLUID(This) \ + ( (This)->lpVtbl -> GetLUID(This) ) +#else +#define ID3D12SwapChainAssistant_GetLUID(This,RetVal) \ + ( (This)->lpVtbl -> GetLUID(This,RetVal) ) +#endif + +#define ID3D12SwapChainAssistant_GetSwapChainObject(This,riid,ppv) \ + ( (This)->lpVtbl -> GetSwapChainObject(This,riid,ppv) ) + +#define ID3D12SwapChainAssistant_GetCurrentResourceAndCommandQueue(This,riidResource,ppvResource,riidQueue,ppvQueue) \ + ( (This)->lpVtbl -> GetCurrentResourceAndCommandQueue(This,riidResource,ppvResource,riidQueue,ppvQueue) ) + +#define ID3D12SwapChainAssistant_InsertImplicitSync(This) \ + ( (This)->lpVtbl -> InsertImplicitSync(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12SwapChainAssistant_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12LifetimeTracker_INTERFACE_DEFINED__ +#define __ID3D12LifetimeTracker_INTERFACE_DEFINED__ + +/* interface ID3D12LifetimeTracker */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12LifetimeTracker; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3fd03d36-4eb1-424a-a582-494ecb8ba813") + ID3D12LifetimeTracker : public ID3D12DeviceChild + { + public: + virtual HRESULT STDMETHODCALLTYPE DestroyOwnedObject( + _In_ ID3D12DeviceChild *pObject) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12LifetimeTrackerVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12LifetimeTracker * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12LifetimeTracker * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12LifetimeTracker * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12LifetimeTracker * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12LifetimeTracker * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12LifetimeTracker * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12LifetimeTracker * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12LifetimeTracker * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12LifetimeTracker, DestroyOwnedObject) + HRESULT ( STDMETHODCALLTYPE *DestroyOwnedObject )( + ID3D12LifetimeTracker * This, + _In_ ID3D12DeviceChild *pObject); + + END_INTERFACE + } ID3D12LifetimeTrackerVtbl; + + interface ID3D12LifetimeTracker + { + CONST_VTBL struct ID3D12LifetimeTrackerVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12LifetimeTracker_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12LifetimeTracker_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12LifetimeTracker_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12LifetimeTracker_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12LifetimeTracker_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12LifetimeTracker_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12LifetimeTracker_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12LifetimeTracker_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12LifetimeTracker_DestroyOwnedObject(This,pObject) \ + ( (This)->lpVtbl -> DestroyOwnedObject(This,pObject) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12LifetimeTracker_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0032 */ +/* [local] */ + +typedef +enum D3D12_META_COMMAND_PARAMETER_TYPE + { + D3D12_META_COMMAND_PARAMETER_TYPE_FLOAT = 0, + D3D12_META_COMMAND_PARAMETER_TYPE_UINT64 = 1, + D3D12_META_COMMAND_PARAMETER_TYPE_GPU_VIRTUAL_ADDRESS = 2, + D3D12_META_COMMAND_PARAMETER_TYPE_CPU_DESCRIPTOR_HANDLE_HEAP_TYPE_CBV_SRV_UAV = 3, + D3D12_META_COMMAND_PARAMETER_TYPE_GPU_DESCRIPTOR_HANDLE_HEAP_TYPE_CBV_SRV_UAV = 4 + } D3D12_META_COMMAND_PARAMETER_TYPE; + +typedef +enum D3D12_META_COMMAND_PARAMETER_FLAGS + { + D3D12_META_COMMAND_PARAMETER_FLAG_INPUT = 0x1, + D3D12_META_COMMAND_PARAMETER_FLAG_OUTPUT = 0x2 + } D3D12_META_COMMAND_PARAMETER_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_META_COMMAND_PARAMETER_FLAGS ); +typedef +enum D3D12_META_COMMAND_PARAMETER_STAGE + { + D3D12_META_COMMAND_PARAMETER_STAGE_CREATION = 0, + D3D12_META_COMMAND_PARAMETER_STAGE_INITIALIZATION = 1, + D3D12_META_COMMAND_PARAMETER_STAGE_EXECUTION = 2 + } D3D12_META_COMMAND_PARAMETER_STAGE; + +typedef struct D3D12_META_COMMAND_PARAMETER_DESC + { + LPCWSTR Name; + D3D12_META_COMMAND_PARAMETER_TYPE Type; + D3D12_META_COMMAND_PARAMETER_FLAGS Flags; + D3D12_RESOURCE_STATES RequiredResourceState; + UINT StructureOffset; + } D3D12_META_COMMAND_PARAMETER_DESC; + +typedef +enum D3D12_GRAPHICS_STATES + { + D3D12_GRAPHICS_STATE_NONE = 0, + D3D12_GRAPHICS_STATE_IA_VERTEX_BUFFERS = ( 1 << 0 ) , + D3D12_GRAPHICS_STATE_IA_INDEX_BUFFER = ( 1 << 1 ) , + D3D12_GRAPHICS_STATE_IA_PRIMITIVE_TOPOLOGY = ( 1 << 2 ) , + D3D12_GRAPHICS_STATE_DESCRIPTOR_HEAP = ( 1 << 3 ) , + D3D12_GRAPHICS_STATE_GRAPHICS_ROOT_SIGNATURE = ( 1 << 4 ) , + D3D12_GRAPHICS_STATE_COMPUTE_ROOT_SIGNATURE = ( 1 << 5 ) , + D3D12_GRAPHICS_STATE_RS_VIEWPORTS = ( 1 << 6 ) , + D3D12_GRAPHICS_STATE_RS_SCISSOR_RECTS = ( 1 << 7 ) , + D3D12_GRAPHICS_STATE_PREDICATION = ( 1 << 8 ) , + D3D12_GRAPHICS_STATE_OM_RENDER_TARGETS = ( 1 << 9 ) , + D3D12_GRAPHICS_STATE_OM_STENCIL_REF = ( 1 << 10 ) , + D3D12_GRAPHICS_STATE_OM_BLEND_FACTOR = ( 1 << 11 ) , + D3D12_GRAPHICS_STATE_PIPELINE_STATE = ( 1 << 12 ) , + D3D12_GRAPHICS_STATE_SO_TARGETS = ( 1 << 13 ) , + D3D12_GRAPHICS_STATE_OM_DEPTH_BOUNDS = ( 1 << 14 ) , + D3D12_GRAPHICS_STATE_SAMPLE_POSITIONS = ( 1 << 15 ) , + D3D12_GRAPHICS_STATE_VIEW_INSTANCE_MASK = ( 1 << 16 ) + } D3D12_GRAPHICS_STATES; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_GRAPHICS_STATES ); +typedef struct D3D12_META_COMMAND_DESC + { + GUID Id; + LPCWSTR Name; + D3D12_GRAPHICS_STATES InitializationDirtyState; + D3D12_GRAPHICS_STATES ExecutionDirtyState; + } D3D12_META_COMMAND_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0032_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0032_v0_0_s_ifspec; + +#ifndef __ID3D12StateObject_INTERFACE_DEFINED__ +#define __ID3D12StateObject_INTERFACE_DEFINED__ + +/* interface ID3D12StateObject */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12StateObject; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("47016943-fca8-4594-93ea-af258b55346d") + ID3D12StateObject : public ID3D12Pageable + { + public: + }; + + +#else /* C style interface */ + + typedef struct ID3D12StateObjectVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12StateObject * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12StateObject * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12StateObject * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12StateObject * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12StateObject * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12StateObject * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12StateObject * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12StateObject * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + END_INTERFACE + } ID3D12StateObjectVtbl; + + interface ID3D12StateObject + { + CONST_VTBL struct ID3D12StateObjectVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12StateObject_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12StateObject_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12StateObject_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12StateObject_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12StateObject_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12StateObject_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12StateObject_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12StateObject_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12StateObject_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12StateObjectProperties_INTERFACE_DEFINED__ +#define __ID3D12StateObjectProperties_INTERFACE_DEFINED__ + +/* interface ID3D12StateObjectProperties */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12StateObjectProperties; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("de5fa827-9bf9-4f26-89ff-d7f56fde3860") + ID3D12StateObjectProperties : public IUnknown + { + public: + virtual void *STDMETHODCALLTYPE GetShaderIdentifier( + _In_ LPCWSTR pExportName) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetShaderStackSize( + _In_ LPCWSTR pExportName) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetPipelineStackSize( void) = 0; + + virtual void STDMETHODCALLTYPE SetPipelineStackSize( + UINT64 PipelineStackSizeInBytes) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12StateObjectPropertiesVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12StateObjectProperties * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12StateObjectProperties * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12StateObjectProperties * This); + + DECLSPEC_XFGVIRT(ID3D12StateObjectProperties, GetShaderIdentifier) + void *( STDMETHODCALLTYPE *GetShaderIdentifier )( + ID3D12StateObjectProperties * This, + _In_ LPCWSTR pExportName); + + DECLSPEC_XFGVIRT(ID3D12StateObjectProperties, GetShaderStackSize) + UINT64 ( STDMETHODCALLTYPE *GetShaderStackSize )( + ID3D12StateObjectProperties * This, + _In_ LPCWSTR pExportName); + + DECLSPEC_XFGVIRT(ID3D12StateObjectProperties, GetPipelineStackSize) + UINT64 ( STDMETHODCALLTYPE *GetPipelineStackSize )( + ID3D12StateObjectProperties * This); + + DECLSPEC_XFGVIRT(ID3D12StateObjectProperties, SetPipelineStackSize) + void ( STDMETHODCALLTYPE *SetPipelineStackSize )( + ID3D12StateObjectProperties * This, + UINT64 PipelineStackSizeInBytes); + + END_INTERFACE + } ID3D12StateObjectPropertiesVtbl; + + interface ID3D12StateObjectProperties + { + CONST_VTBL struct ID3D12StateObjectPropertiesVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12StateObjectProperties_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12StateObjectProperties_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12StateObjectProperties_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12StateObjectProperties_GetShaderIdentifier(This,pExportName) \ + ( (This)->lpVtbl -> GetShaderIdentifier(This,pExportName) ) + +#define ID3D12StateObjectProperties_GetShaderStackSize(This,pExportName) \ + ( (This)->lpVtbl -> GetShaderStackSize(This,pExportName) ) + +#define ID3D12StateObjectProperties_GetPipelineStackSize(This) \ + ( (This)->lpVtbl -> GetPipelineStackSize(This) ) + +#define ID3D12StateObjectProperties_SetPipelineStackSize(This,PipelineStackSizeInBytes) \ + ( (This)->lpVtbl -> SetPipelineStackSize(This,PipelineStackSizeInBytes) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12StateObjectProperties_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0034 */ +/* [local] */ + +typedef +enum D3D12_STATE_SUBOBJECT_TYPE + { + D3D12_STATE_SUBOBJECT_TYPE_STATE_OBJECT_CONFIG = 0, + D3D12_STATE_SUBOBJECT_TYPE_GLOBAL_ROOT_SIGNATURE = 1, + D3D12_STATE_SUBOBJECT_TYPE_LOCAL_ROOT_SIGNATURE = 2, + D3D12_STATE_SUBOBJECT_TYPE_NODE_MASK = 3, + D3D12_STATE_SUBOBJECT_TYPE_DXIL_LIBRARY = 5, + D3D12_STATE_SUBOBJECT_TYPE_EXISTING_COLLECTION = 6, + D3D12_STATE_SUBOBJECT_TYPE_SUBOBJECT_TO_EXPORTS_ASSOCIATION = 7, + D3D12_STATE_SUBOBJECT_TYPE_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION = 8, + D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_SHADER_CONFIG = 9, + D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG = 10, + D3D12_STATE_SUBOBJECT_TYPE_HIT_GROUP = 11, + D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG1 = 12, + D3D12_STATE_SUBOBJECT_TYPE_MAX_VALID = ( D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG1 + 1 ) + } D3D12_STATE_SUBOBJECT_TYPE; + +typedef struct D3D12_STATE_SUBOBJECT + { + D3D12_STATE_SUBOBJECT_TYPE Type; + const void *pDesc; + } D3D12_STATE_SUBOBJECT; + +typedef +enum D3D12_STATE_OBJECT_FLAGS + { + D3D12_STATE_OBJECT_FLAG_NONE = 0, + D3D12_STATE_OBJECT_FLAG_ALLOW_LOCAL_DEPENDENCIES_ON_EXTERNAL_DEFINITIONS = 0x1, + D3D12_STATE_OBJECT_FLAG_ALLOW_EXTERNAL_DEPENDENCIES_ON_LOCAL_DEFINITIONS = 0x2, + D3D12_STATE_OBJECT_FLAG_ALLOW_STATE_OBJECT_ADDITIONS = 0x4 + } D3D12_STATE_OBJECT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_STATE_OBJECT_FLAGS ); +typedef struct D3D12_STATE_OBJECT_CONFIG + { + D3D12_STATE_OBJECT_FLAGS Flags; + } D3D12_STATE_OBJECT_CONFIG; + +typedef struct D3D12_GLOBAL_ROOT_SIGNATURE + { + ID3D12RootSignature *pGlobalRootSignature; + } D3D12_GLOBAL_ROOT_SIGNATURE; + +typedef struct D3D12_LOCAL_ROOT_SIGNATURE + { + ID3D12RootSignature *pLocalRootSignature; + } D3D12_LOCAL_ROOT_SIGNATURE; + +typedef struct D3D12_NODE_MASK + { + UINT NodeMask; + } D3D12_NODE_MASK; + +typedef +enum D3D12_EXPORT_FLAGS + { + D3D12_EXPORT_FLAG_NONE = 0 + } D3D12_EXPORT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_EXPORT_FLAGS ); +typedef struct D3D12_EXPORT_DESC + { + LPCWSTR Name; + _In_opt_ LPCWSTR ExportToRename; + D3D12_EXPORT_FLAGS Flags; + } D3D12_EXPORT_DESC; + +typedef struct D3D12_DXIL_LIBRARY_DESC + { + D3D12_SHADER_BYTECODE DXILLibrary; + UINT NumExports; + _In_reads_(NumExports) D3D12_EXPORT_DESC *pExports; + } D3D12_DXIL_LIBRARY_DESC; + +typedef struct D3D12_EXISTING_COLLECTION_DESC + { + ID3D12StateObject *pExistingCollection; + UINT NumExports; + _In_reads_(NumExports) D3D12_EXPORT_DESC *pExports; + } D3D12_EXISTING_COLLECTION_DESC; + +typedef struct D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION + { + const D3D12_STATE_SUBOBJECT *pSubobjectToAssociate; + UINT NumExports; + _In_reads_(NumExports) LPCWSTR *pExports; + } D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION; + +typedef struct D3D12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION + { + LPCWSTR SubobjectToAssociate; + UINT NumExports; + _In_reads_(NumExports) LPCWSTR *pExports; + } D3D12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION; + +typedef +enum D3D12_HIT_GROUP_TYPE + { + D3D12_HIT_GROUP_TYPE_TRIANGLES = 0, + D3D12_HIT_GROUP_TYPE_PROCEDURAL_PRIMITIVE = 0x1 + } D3D12_HIT_GROUP_TYPE; + +typedef struct D3D12_HIT_GROUP_DESC + { + LPCWSTR HitGroupExport; + D3D12_HIT_GROUP_TYPE Type; + _In_opt_ LPCWSTR AnyHitShaderImport; + _In_opt_ LPCWSTR ClosestHitShaderImport; + _In_opt_ LPCWSTR IntersectionShaderImport; + } D3D12_HIT_GROUP_DESC; + +typedef struct D3D12_RAYTRACING_SHADER_CONFIG + { + UINT MaxPayloadSizeInBytes; + UINT MaxAttributeSizeInBytes; + } D3D12_RAYTRACING_SHADER_CONFIG; + +typedef struct D3D12_RAYTRACING_PIPELINE_CONFIG + { + UINT MaxTraceRecursionDepth; + } D3D12_RAYTRACING_PIPELINE_CONFIG; + +typedef +enum D3D12_RAYTRACING_PIPELINE_FLAGS + { + D3D12_RAYTRACING_PIPELINE_FLAG_NONE = 0, + D3D12_RAYTRACING_PIPELINE_FLAG_SKIP_TRIANGLES = 0x100, + D3D12_RAYTRACING_PIPELINE_FLAG_SKIP_PROCEDURAL_PRIMITIVES = 0x200 + } D3D12_RAYTRACING_PIPELINE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_PIPELINE_FLAGS ); +typedef struct D3D12_RAYTRACING_PIPELINE_CONFIG1 + { + UINT MaxTraceRecursionDepth; + D3D12_RAYTRACING_PIPELINE_FLAGS Flags; + } D3D12_RAYTRACING_PIPELINE_CONFIG1; + +typedef +enum D3D12_STATE_OBJECT_TYPE + { + D3D12_STATE_OBJECT_TYPE_COLLECTION = 0, + D3D12_STATE_OBJECT_TYPE_RAYTRACING_PIPELINE = 3 + } D3D12_STATE_OBJECT_TYPE; + +typedef struct D3D12_STATE_OBJECT_DESC + { + D3D12_STATE_OBJECT_TYPE Type; + UINT NumSubobjects; + _In_reads_(NumSubobjects) const D3D12_STATE_SUBOBJECT *pSubobjects; + } D3D12_STATE_OBJECT_DESC; + +typedef +enum D3D12_RAYTRACING_GEOMETRY_FLAGS + { + D3D12_RAYTRACING_GEOMETRY_FLAG_NONE = 0, + D3D12_RAYTRACING_GEOMETRY_FLAG_OPAQUE = 0x1, + D3D12_RAYTRACING_GEOMETRY_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION = 0x2 + } D3D12_RAYTRACING_GEOMETRY_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_GEOMETRY_FLAGS ); +typedef +enum D3D12_RAYTRACING_GEOMETRY_TYPE + { + D3D12_RAYTRACING_GEOMETRY_TYPE_TRIANGLES = 0, + D3D12_RAYTRACING_GEOMETRY_TYPE_PROCEDURAL_PRIMITIVE_AABBS = ( D3D12_RAYTRACING_GEOMETRY_TYPE_TRIANGLES + 1 ) + } D3D12_RAYTRACING_GEOMETRY_TYPE; + +typedef +enum D3D12_RAYTRACING_INSTANCE_FLAGS + { + D3D12_RAYTRACING_INSTANCE_FLAG_NONE = 0, + D3D12_RAYTRACING_INSTANCE_FLAG_TRIANGLE_CULL_DISABLE = 0x1, + D3D12_RAYTRACING_INSTANCE_FLAG_TRIANGLE_FRONT_COUNTERCLOCKWISE = 0x2, + D3D12_RAYTRACING_INSTANCE_FLAG_FORCE_OPAQUE = 0x4, + D3D12_RAYTRACING_INSTANCE_FLAG_FORCE_NON_OPAQUE = 0x8 + } D3D12_RAYTRACING_INSTANCE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_INSTANCE_FLAGS ); +typedef struct D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE + { + D3D12_GPU_VIRTUAL_ADDRESS StartAddress; + UINT64 StrideInBytes; + } D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE; + +typedef struct D3D12_GPU_VIRTUAL_ADDRESS_RANGE + { + D3D12_GPU_VIRTUAL_ADDRESS StartAddress; + UINT64 SizeInBytes; + } D3D12_GPU_VIRTUAL_ADDRESS_RANGE; + +typedef struct D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE + { + D3D12_GPU_VIRTUAL_ADDRESS StartAddress; + UINT64 SizeInBytes; + UINT64 StrideInBytes; + } D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE; + +typedef struct D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC + { + D3D12_GPU_VIRTUAL_ADDRESS Transform3x4; + DXGI_FORMAT IndexFormat; + DXGI_FORMAT VertexFormat; + UINT IndexCount; + UINT VertexCount; + D3D12_GPU_VIRTUAL_ADDRESS IndexBuffer; + D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE VertexBuffer; + } D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC; + +typedef struct D3D12_RAYTRACING_AABB + { + FLOAT MinX; + FLOAT MinY; + FLOAT MinZ; + FLOAT MaxX; + FLOAT MaxY; + FLOAT MaxZ; + } D3D12_RAYTRACING_AABB; + +typedef struct D3D12_RAYTRACING_GEOMETRY_AABBS_DESC + { + UINT64 AABBCount; + D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE AABBs; + } D3D12_RAYTRACING_GEOMETRY_AABBS_DESC; + +typedef +enum D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS + { + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_NONE = 0, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_UPDATE = 0x1, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_COMPACTION = 0x2, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PREFER_FAST_TRACE = 0x4, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PREFER_FAST_BUILD = 0x8, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_MINIMIZE_MEMORY = 0x10, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PERFORM_UPDATE = 0x20 + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS ); +typedef +enum D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE + { + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_CLONE = 0, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_COMPACT = 0x1, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_VISUALIZATION_DECODE_FOR_TOOLS = 0x2, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_SERIALIZE = 0x3, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_DESERIALIZE = 0x4 + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE; + +typedef +enum D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE + { + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL = 0, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL = 0x1 + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE; + +typedef +enum D3D12_ELEMENTS_LAYOUT + { + D3D12_ELEMENTS_LAYOUT_ARRAY = 0, + D3D12_ELEMENTS_LAYOUT_ARRAY_OF_POINTERS = 0x1 + } D3D12_ELEMENTS_LAYOUT; + +typedef +enum D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TYPE + { + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_COMPACTED_SIZE = 0, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TOOLS_VISUALIZATION = 0x1, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_SERIALIZATION = 0x2, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_CURRENT_SIZE = 0x3 + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TYPE; + +typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC + { + D3D12_GPU_VIRTUAL_ADDRESS DestBuffer; + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TYPE InfoType; + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC; + +typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_COMPACTED_SIZE_DESC + { + UINT64 CompactedSizeInBytes; + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_COMPACTED_SIZE_DESC; + +typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TOOLS_VISUALIZATION_DESC + { + UINT64 DecodedSizeInBytes; + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TOOLS_VISUALIZATION_DESC; + +typedef struct D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_TOOLS_VISUALIZATION_HEADER + { + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE Type; + UINT NumDescs; + } D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_TOOLS_VISUALIZATION_HEADER; + +// Regarding D3D12_BUILD_RAY_TRACING_ACCELERATION_STRUCTURE_TOOLS_VISUALIZATION_HEADER above, +// depending on Type field, NumDescs above is followed by either: +// D3D12_RAY_TRACING_INSTANCE_DESC InstanceDescs[NumDescs] +// or D3D12_RAY_TRACING_GEOMETRY_DESC GeometryDescs[NumDescs]. +// There is 4 bytes of padding between GeometryDesc structs in the array so alignment is natural when viewed by CPU. + +typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_SERIALIZATION_DESC + { + UINT64 SerializedSizeInBytes; + UINT64 NumBottomLevelAccelerationStructurePointers; + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_SERIALIZATION_DESC; + +typedef struct D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER + { + GUID DriverOpaqueGUID; + BYTE DriverOpaqueVersioningData[ 16 ]; + } D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER; + +typedef +enum D3D12_SERIALIZED_DATA_TYPE + { + D3D12_SERIALIZED_DATA_RAYTRACING_ACCELERATION_STRUCTURE = 0 + } D3D12_SERIALIZED_DATA_TYPE; + +typedef +enum D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS + { + D3D12_DRIVER_MATCHING_IDENTIFIER_COMPATIBLE_WITH_DEVICE = 0, + D3D12_DRIVER_MATCHING_IDENTIFIER_UNSUPPORTED_TYPE = 0x1, + D3D12_DRIVER_MATCHING_IDENTIFIER_UNRECOGNIZED = 0x2, + D3D12_DRIVER_MATCHING_IDENTIFIER_INCOMPATIBLE_VERSION = 0x3, + D3D12_DRIVER_MATCHING_IDENTIFIER_INCOMPATIBLE_TYPE = 0x4 + } D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS; + +typedef struct D3D12_SERIALIZED_RAYTRACING_ACCELERATION_STRUCTURE_HEADER + { + D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER DriverMatchingIdentifier; + UINT64 SerializedSizeInBytesIncludingHeader; + UINT64 DeserializedSizeInBytes; + UINT64 NumBottomLevelAccelerationStructurePointersAfterHeader; + } D3D12_SERIALIZED_RAYTRACING_ACCELERATION_STRUCTURE_HEADER; + +typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_CURRENT_SIZE_DESC + { + UINT64 CurrentSizeInBytes; + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_CURRENT_SIZE_DESC; + +typedef struct D3D12_RAYTRACING_INSTANCE_DESC + { + FLOAT Transform[ 3 ][ 4 ]; + UINT InstanceID : 24; + UINT InstanceMask : 8; + UINT InstanceContributionToHitGroupIndex : 24; + UINT Flags : 8; + D3D12_GPU_VIRTUAL_ADDRESS AccelerationStructure; + } D3D12_RAYTRACING_INSTANCE_DESC; + +typedef struct D3D12_RAYTRACING_GEOMETRY_DESC + { + D3D12_RAYTRACING_GEOMETRY_TYPE Type; + D3D12_RAYTRACING_GEOMETRY_FLAGS Flags; + union + { + D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC Triangles; + D3D12_RAYTRACING_GEOMETRY_AABBS_DESC AABBs; + } ; + } D3D12_RAYTRACING_GEOMETRY_DESC; + +typedef struct D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS + { + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE Type; + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS Flags; + UINT NumDescs; + D3D12_ELEMENTS_LAYOUT DescsLayout; + union + { + D3D12_GPU_VIRTUAL_ADDRESS InstanceDescs; + const D3D12_RAYTRACING_GEOMETRY_DESC *pGeometryDescs; + const D3D12_RAYTRACING_GEOMETRY_DESC *const *ppGeometryDescs; + } ; + } D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS; + +typedef struct D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC + { + D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData; + D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS Inputs; + _In_opt_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData; + D3D12_GPU_VIRTUAL_ADDRESS ScratchAccelerationStructureData; + } D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC; + +typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO + { + UINT64 ResultDataMaxSizeInBytes; + UINT64 ScratchDataSizeInBytes; + UINT64 UpdateScratchDataSizeInBytes; + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO; + +typedef +enum D3D12_RAY_FLAGS + { + D3D12_RAY_FLAG_NONE = 0, + D3D12_RAY_FLAG_FORCE_OPAQUE = 0x1, + D3D12_RAY_FLAG_FORCE_NON_OPAQUE = 0x2, + D3D12_RAY_FLAG_ACCEPT_FIRST_HIT_AND_END_SEARCH = 0x4, + D3D12_RAY_FLAG_SKIP_CLOSEST_HIT_SHADER = 0x8, + D3D12_RAY_FLAG_CULL_BACK_FACING_TRIANGLES = 0x10, + D3D12_RAY_FLAG_CULL_FRONT_FACING_TRIANGLES = 0x20, + D3D12_RAY_FLAG_CULL_OPAQUE = 0x40, + D3D12_RAY_FLAG_CULL_NON_OPAQUE = 0x80, + D3D12_RAY_FLAG_SKIP_TRIANGLES = 0x100, + D3D12_RAY_FLAG_SKIP_PROCEDURAL_PRIMITIVES = 0x200 + } D3D12_RAY_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAY_FLAGS ); +typedef +enum D3D12_HIT_KIND + { + D3D12_HIT_KIND_TRIANGLE_FRONT_FACE = 0xfe, + D3D12_HIT_KIND_TRIANGLE_BACK_FACE = 0xff + } D3D12_HIT_KIND; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0034_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0034_v0_0_s_ifspec; + +#ifndef __ID3D12Device5_INTERFACE_DEFINED__ +#define __ID3D12Device5_INTERFACE_DEFINED__ + +/* interface ID3D12Device5 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device5; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("8b4f173b-2fea-4b80-8f58-4307191ab95d") + ID3D12Device5 : public ID3D12Device4 + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateLifetimeTracker( + _In_ ID3D12LifetimeOwner *pOwner, + REFIID riid, + _COM_Outptr_ void **ppvTracker) = 0; + + virtual void STDMETHODCALLTYPE RemoveDevice( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE EnumerateMetaCommands( + _Inout_ UINT *pNumMetaCommands, + _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs) = 0; + + virtual HRESULT STDMETHODCALLTYPE EnumerateMetaCommandParameters( + _In_ REFGUID CommandId, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _Out_opt_ UINT *pTotalStructureSizeInBytes, + _Inout_ UINT *pParameterCount, + _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateMetaCommand( + _In_ REFGUID CommandId, + _In_ UINT NodeMask, + _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, + _In_ SIZE_T CreationParametersDataSizeInBytes, + REFIID riid, + _COM_Outptr_ void **ppMetaCommand) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateStateObject( + const D3D12_STATE_OBJECT_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppStateObject) = 0; + + virtual void STDMETHODCALLTYPE GetRaytracingAccelerationStructurePrebuildInfo( + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, + _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo) = 0; + + virtual D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS STDMETHODCALLTYPE CheckDriverMatchingIdentifier( + _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, + _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device5Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device5 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device5 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device5 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device5 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device5 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device5 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device5 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device5 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device5 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device5 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device5 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device5 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device5 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device5 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device5 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device5 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device5 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device5 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device5 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device5 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device5 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device5 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device5 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device5 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device5 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device5 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device5 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device5 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device5 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device5 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device5 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device5 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device5 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device5 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device5 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device5 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device5 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device5 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device5 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device5 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device5 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device5 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device5 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device5 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device5 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device5 * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device5 * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device5 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device5 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device5 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device5 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( + ID3D12Device5 * This, + _In_ const void *pAddress, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( + ID3D12Device5 * This, + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) + HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( + ID3D12Device5 * This, + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( + ID3D12Device5 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ D3D12_COMMAND_LIST_FLAGS flags, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( + ID3D12Device5 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( + ID3D12Device5 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( + ID3D12Device5 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( + ID3D12Device5 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device5 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device5 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) + HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( + ID3D12Device5 * This, + _In_ ID3D12LifetimeOwner *pOwner, + REFIID riid, + _COM_Outptr_ void **ppvTracker); + + DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) + void ( STDMETHODCALLTYPE *RemoveDevice )( + ID3D12Device5 * This); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( + ID3D12Device5 * This, + _Inout_ UINT *pNumMetaCommands, + _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( + ID3D12Device5 * This, + _In_ REFGUID CommandId, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _Out_opt_ UINT *pTotalStructureSizeInBytes, + _Inout_ UINT *pParameterCount, + _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) + HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( + ID3D12Device5 * This, + _In_ REFGUID CommandId, + _In_ UINT NodeMask, + _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, + _In_ SIZE_T CreationParametersDataSizeInBytes, + REFIID riid, + _COM_Outptr_ void **ppMetaCommand); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) + HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( + ID3D12Device5 * This, + const D3D12_STATE_OBJECT_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) + void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( + ID3D12Device5 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, + _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); + + DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) + D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( + ID3D12Device5 * This, + _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, + _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); + + END_INTERFACE + } ID3D12Device5Vtbl; + + interface ID3D12Device5 + { + CONST_VTBL struct ID3D12Device5Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Device5_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Device5_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Device5_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Device5_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device5_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device5_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device5_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device5_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device5_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device5_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device5_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device5_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device5_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device5_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device5_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device5_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device5_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device5_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device5_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device5_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device5_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device5_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device5_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device5_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device5_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device5_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device5_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device5_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device5_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device5_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device5_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device5_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device5_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device5_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device5_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device5_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device5_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device5_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device5_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device5_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device5_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device5_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device5_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device5_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device5_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device5_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device5_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + + +#define ID3D12Device5_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) + +#define ID3D12Device5_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) + +#define ID3D12Device5_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) + + +#define ID3D12Device5_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) + + +#define ID3D12Device5_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) + +#define ID3D12Device5_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) + +#define ID3D12Device5_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ + ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) + + +#define ID3D12Device5_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) + +#define ID3D12Device5_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) + +#define ID3D12Device5_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device5_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) + +#define ID3D12Device5_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) +#if !defined(_WIN32) + +#define ID3D12Device5_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device5_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + + +#define ID3D12Device5_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ + ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) + +#define ID3D12Device5_RemoveDevice(This) \ + ( (This)->lpVtbl -> RemoveDevice(This) ) + +#define ID3D12Device5_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) + +#define ID3D12Device5_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) + +#define ID3D12Device5_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ + ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) + +#define ID3D12Device5_CreateStateObject(This,pDesc,riid,ppStateObject) \ + ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) + +#define ID3D12Device5_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ + ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) + +#define ID3D12Device5_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ + ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device5_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0035 */ +/* [local] */ + +typedef +enum D3D12_AUTO_BREADCRUMB_OP + { + D3D12_AUTO_BREADCRUMB_OP_SETMARKER = 0, + D3D12_AUTO_BREADCRUMB_OP_BEGINEVENT = 1, + D3D12_AUTO_BREADCRUMB_OP_ENDEVENT = 2, + D3D12_AUTO_BREADCRUMB_OP_DRAWINSTANCED = 3, + D3D12_AUTO_BREADCRUMB_OP_DRAWINDEXEDINSTANCED = 4, + D3D12_AUTO_BREADCRUMB_OP_EXECUTEINDIRECT = 5, + D3D12_AUTO_BREADCRUMB_OP_DISPATCH = 6, + D3D12_AUTO_BREADCRUMB_OP_COPYBUFFERREGION = 7, + D3D12_AUTO_BREADCRUMB_OP_COPYTEXTUREREGION = 8, + D3D12_AUTO_BREADCRUMB_OP_COPYRESOURCE = 9, + D3D12_AUTO_BREADCRUMB_OP_COPYTILES = 10, + D3D12_AUTO_BREADCRUMB_OP_RESOLVESUBRESOURCE = 11, + D3D12_AUTO_BREADCRUMB_OP_CLEARRENDERTARGETVIEW = 12, + D3D12_AUTO_BREADCRUMB_OP_CLEARUNORDEREDACCESSVIEW = 13, + D3D12_AUTO_BREADCRUMB_OP_CLEARDEPTHSTENCILVIEW = 14, + D3D12_AUTO_BREADCRUMB_OP_RESOURCEBARRIER = 15, + D3D12_AUTO_BREADCRUMB_OP_EXECUTEBUNDLE = 16, + D3D12_AUTO_BREADCRUMB_OP_PRESENT = 17, + D3D12_AUTO_BREADCRUMB_OP_RESOLVEQUERYDATA = 18, + D3D12_AUTO_BREADCRUMB_OP_BEGINSUBMISSION = 19, + D3D12_AUTO_BREADCRUMB_OP_ENDSUBMISSION = 20, + D3D12_AUTO_BREADCRUMB_OP_DECODEFRAME = 21, + D3D12_AUTO_BREADCRUMB_OP_PROCESSFRAMES = 22, + D3D12_AUTO_BREADCRUMB_OP_ATOMICCOPYBUFFERUINT = 23, + D3D12_AUTO_BREADCRUMB_OP_ATOMICCOPYBUFFERUINT64 = 24, + D3D12_AUTO_BREADCRUMB_OP_RESOLVESUBRESOURCEREGION = 25, + D3D12_AUTO_BREADCRUMB_OP_WRITEBUFFERIMMEDIATE = 26, + D3D12_AUTO_BREADCRUMB_OP_DECODEFRAME1 = 27, + D3D12_AUTO_BREADCRUMB_OP_SETPROTECTEDRESOURCESESSION = 28, + D3D12_AUTO_BREADCRUMB_OP_DECODEFRAME2 = 29, + D3D12_AUTO_BREADCRUMB_OP_PROCESSFRAMES1 = 30, + D3D12_AUTO_BREADCRUMB_OP_BUILDRAYTRACINGACCELERATIONSTRUCTURE = 31, + D3D12_AUTO_BREADCRUMB_OP_EMITRAYTRACINGACCELERATIONSTRUCTUREPOSTBUILDINFO = 32, + D3D12_AUTO_BREADCRUMB_OP_COPYRAYTRACINGACCELERATIONSTRUCTURE = 33, + D3D12_AUTO_BREADCRUMB_OP_DISPATCHRAYS = 34, + D3D12_AUTO_BREADCRUMB_OP_INITIALIZEMETACOMMAND = 35, + D3D12_AUTO_BREADCRUMB_OP_EXECUTEMETACOMMAND = 36, + D3D12_AUTO_BREADCRUMB_OP_ESTIMATEMOTION = 37, + D3D12_AUTO_BREADCRUMB_OP_RESOLVEMOTIONVECTORHEAP = 38, + D3D12_AUTO_BREADCRUMB_OP_SETPIPELINESTATE1 = 39, + D3D12_AUTO_BREADCRUMB_OP_INITIALIZEEXTENSIONCOMMAND = 40, + D3D12_AUTO_BREADCRUMB_OP_EXECUTEEXTENSIONCOMMAND = 41, + D3D12_AUTO_BREADCRUMB_OP_DISPATCHMESH = 42, + D3D12_AUTO_BREADCRUMB_OP_ENCODEFRAME = 43, + D3D12_AUTO_BREADCRUMB_OP_RESOLVEENCODEROUTPUTMETADATA = 44 + } D3D12_AUTO_BREADCRUMB_OP; + +typedef struct D3D12_AUTO_BREADCRUMB_NODE + { + const char *pCommandListDebugNameA; + const wchar_t *pCommandListDebugNameW; + const char *pCommandQueueDebugNameA; + const wchar_t *pCommandQueueDebugNameW; + ID3D12GraphicsCommandList *pCommandList; + ID3D12CommandQueue *pCommandQueue; + UINT32 BreadcrumbCount; + const UINT32 *pLastBreadcrumbValue; + const D3D12_AUTO_BREADCRUMB_OP *pCommandHistory; + const struct D3D12_AUTO_BREADCRUMB_NODE *pNext; + } D3D12_AUTO_BREADCRUMB_NODE; + +typedef struct D3D12_DRED_BREADCRUMB_CONTEXT + { + UINT BreadcrumbIndex; + const wchar_t *pContextString; + } D3D12_DRED_BREADCRUMB_CONTEXT; + +typedef struct D3D12_AUTO_BREADCRUMB_NODE1 + { + const char *pCommandListDebugNameA; + const wchar_t *pCommandListDebugNameW; + const char *pCommandQueueDebugNameA; + const wchar_t *pCommandQueueDebugNameW; + ID3D12GraphicsCommandList *pCommandList; + ID3D12CommandQueue *pCommandQueue; + UINT BreadcrumbCount; + const UINT *pLastBreadcrumbValue; + const D3D12_AUTO_BREADCRUMB_OP *pCommandHistory; + const struct D3D12_AUTO_BREADCRUMB_NODE1 *pNext; + UINT BreadcrumbContextsCount; + D3D12_DRED_BREADCRUMB_CONTEXT *pBreadcrumbContexts; + } D3D12_AUTO_BREADCRUMB_NODE1; + +typedef +enum D3D12_DRED_VERSION + { + D3D12_DRED_VERSION_1_0 = 0x1, + D3D12_DRED_VERSION_1_1 = 0x2, + D3D12_DRED_VERSION_1_2 = 0x3, + D3D12_DRED_VERSION_1_3 = 0x4 + } D3D12_DRED_VERSION; + +typedef +enum D3D12_DRED_FLAGS + { + D3D12_DRED_FLAG_NONE = 0, + D3D12_DRED_FLAG_FORCE_ENABLE = 1, + D3D12_DRED_FLAG_DISABLE_AUTOBREADCRUMBS = 2 + } D3D12_DRED_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_DRED_FLAGS ); +typedef +enum D3D12_DRED_ENABLEMENT + { + D3D12_DRED_ENABLEMENT_SYSTEM_CONTROLLED = 0, + D3D12_DRED_ENABLEMENT_FORCED_OFF = 1, + D3D12_DRED_ENABLEMENT_FORCED_ON = 2 + } D3D12_DRED_ENABLEMENT; + +typedef struct D3D12_DEVICE_REMOVED_EXTENDED_DATA + { + _In_ D3D12_DRED_FLAGS Flags; + _Out_ D3D12_AUTO_BREADCRUMB_NODE *pHeadAutoBreadcrumbNode; + } D3D12_DEVICE_REMOVED_EXTENDED_DATA; + +typedef +enum D3D12_DRED_ALLOCATION_TYPE + { + D3D12_DRED_ALLOCATION_TYPE_COMMAND_QUEUE = 19, + D3D12_DRED_ALLOCATION_TYPE_COMMAND_ALLOCATOR = 20, + D3D12_DRED_ALLOCATION_TYPE_PIPELINE_STATE = 21, + D3D12_DRED_ALLOCATION_TYPE_COMMAND_LIST = 22, + D3D12_DRED_ALLOCATION_TYPE_FENCE = 23, + D3D12_DRED_ALLOCATION_TYPE_DESCRIPTOR_HEAP = 24, + D3D12_DRED_ALLOCATION_TYPE_HEAP = 25, + D3D12_DRED_ALLOCATION_TYPE_QUERY_HEAP = 27, + D3D12_DRED_ALLOCATION_TYPE_COMMAND_SIGNATURE = 28, + D3D12_DRED_ALLOCATION_TYPE_PIPELINE_LIBRARY = 29, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_DECODER = 30, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_PROCESSOR = 32, + D3D12_DRED_ALLOCATION_TYPE_RESOURCE = 34, + D3D12_DRED_ALLOCATION_TYPE_PASS = 35, + D3D12_DRED_ALLOCATION_TYPE_CRYPTOSESSION = 36, + D3D12_DRED_ALLOCATION_TYPE_CRYPTOSESSIONPOLICY = 37, + D3D12_DRED_ALLOCATION_TYPE_PROTECTEDRESOURCESESSION = 38, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_DECODER_HEAP = 39, + D3D12_DRED_ALLOCATION_TYPE_COMMAND_POOL = 40, + D3D12_DRED_ALLOCATION_TYPE_COMMAND_RECORDER = 41, + D3D12_DRED_ALLOCATION_TYPE_STATE_OBJECT = 42, + D3D12_DRED_ALLOCATION_TYPE_METACOMMAND = 43, + D3D12_DRED_ALLOCATION_TYPE_SCHEDULINGGROUP = 44, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_MOTION_ESTIMATOR = 45, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_MOTION_VECTOR_HEAP = 46, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_EXTENSION_COMMAND = 47, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_ENCODER = 48, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_ENCODER_HEAP = 49, + D3D12_DRED_ALLOCATION_TYPE_INVALID = 0xffffffff + } D3D12_DRED_ALLOCATION_TYPE; + +typedef struct D3D12_DRED_ALLOCATION_NODE + { + const char *ObjectNameA; + const wchar_t *ObjectNameW; + D3D12_DRED_ALLOCATION_TYPE AllocationType; + const struct D3D12_DRED_ALLOCATION_NODE *pNext; + } D3D12_DRED_ALLOCATION_NODE; + +typedef struct D3D12_DRED_ALLOCATION_NODE1 + { + const char *ObjectNameA; + const wchar_t *ObjectNameW; + D3D12_DRED_ALLOCATION_TYPE AllocationType; + const struct D3D12_DRED_ALLOCATION_NODE1 *pNext; + const IUnknown *pObject; + } D3D12_DRED_ALLOCATION_NODE1; + +typedef struct D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT + { + _Out_ const D3D12_AUTO_BREADCRUMB_NODE *pHeadAutoBreadcrumbNode; + } D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT; + +typedef struct D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 + { + _Out_ const D3D12_AUTO_BREADCRUMB_NODE1 *pHeadAutoBreadcrumbNode; + } D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1; + +typedef struct D3D12_DRED_PAGE_FAULT_OUTPUT + { + D3D12_GPU_VIRTUAL_ADDRESS PageFaultVA; + _Out_ const D3D12_DRED_ALLOCATION_NODE *pHeadExistingAllocationNode; + _Out_ const D3D12_DRED_ALLOCATION_NODE *pHeadRecentFreedAllocationNode; + } D3D12_DRED_PAGE_FAULT_OUTPUT; + +typedef struct D3D12_DRED_PAGE_FAULT_OUTPUT1 + { + D3D12_GPU_VIRTUAL_ADDRESS PageFaultVA; + _Out_ const D3D12_DRED_ALLOCATION_NODE1 *pHeadExistingAllocationNode; + _Out_ const D3D12_DRED_ALLOCATION_NODE1 *pHeadRecentFreedAllocationNode; + } D3D12_DRED_PAGE_FAULT_OUTPUT1; + +typedef +enum D3D12_DRED_PAGE_FAULT_FLAGS + { + D3D12_DRED_PAGE_FAULT_FLAGS_NONE = 0 + } D3D12_DRED_PAGE_FAULT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_DRED_PAGE_FAULT_FLAGS ); +typedef +enum D3D12_DRED_DEVICE_STATE + { + D3D12_DRED_DEVICE_STATE_UNKNOWN = 0, + D3D12_DRED_DEVICE_STATE_HUNG = 3, + D3D12_DRED_DEVICE_STATE_FAULT = 6, + D3D12_DRED_DEVICE_STATE_PAGEFAULT = 7 + } D3D12_DRED_DEVICE_STATE; + +typedef struct D3D12_DRED_PAGE_FAULT_OUTPUT2 + { + D3D12_GPU_VIRTUAL_ADDRESS PageFaultVA; + _Out_ const D3D12_DRED_ALLOCATION_NODE1 *pHeadExistingAllocationNode; + _Out_ const D3D12_DRED_ALLOCATION_NODE1 *pHeadRecentFreedAllocationNode; + D3D12_DRED_PAGE_FAULT_FLAGS PageFaultFlags; + } D3D12_DRED_PAGE_FAULT_OUTPUT2; + +typedef struct D3D12_DEVICE_REMOVED_EXTENDED_DATA1 + { + HRESULT DeviceRemovedReason; + D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT AutoBreadcrumbsOutput; + D3D12_DRED_PAGE_FAULT_OUTPUT PageFaultOutput; + } D3D12_DEVICE_REMOVED_EXTENDED_DATA1; + +typedef struct D3D12_DEVICE_REMOVED_EXTENDED_DATA2 + { + HRESULT DeviceRemovedReason; + D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 AutoBreadcrumbsOutput; + D3D12_DRED_PAGE_FAULT_OUTPUT1 PageFaultOutput; + } D3D12_DEVICE_REMOVED_EXTENDED_DATA2; + +typedef struct D3D12_DEVICE_REMOVED_EXTENDED_DATA3 + { + HRESULT DeviceRemovedReason; + D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 AutoBreadcrumbsOutput; + D3D12_DRED_PAGE_FAULT_OUTPUT2 PageFaultOutput; + D3D12_DRED_DEVICE_STATE DeviceState; + } D3D12_DEVICE_REMOVED_EXTENDED_DATA3; + +typedef struct D3D12_VERSIONED_DEVICE_REMOVED_EXTENDED_DATA + { + D3D12_DRED_VERSION Version; + union + { + D3D12_DEVICE_REMOVED_EXTENDED_DATA Dred_1_0; + D3D12_DEVICE_REMOVED_EXTENDED_DATA1 Dred_1_1; + D3D12_DEVICE_REMOVED_EXTENDED_DATA2 Dred_1_2; + D3D12_DEVICE_REMOVED_EXTENDED_DATA3 Dred_1_3; + } ; + } D3D12_VERSIONED_DEVICE_REMOVED_EXTENDED_DATA; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0035_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0035_v0_0_s_ifspec; + +#ifndef __ID3D12DeviceRemovedExtendedDataSettings_INTERFACE_DEFINED__ +#define __ID3D12DeviceRemovedExtendedDataSettings_INTERFACE_DEFINED__ + +/* interface ID3D12DeviceRemovedExtendedDataSettings */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedDataSettings; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("82BC481C-6B9B-4030-AEDB-7EE3D1DF1E63") + ID3D12DeviceRemovedExtendedDataSettings : public IUnknown + { + public: + virtual void STDMETHODCALLTYPE SetAutoBreadcrumbsEnablement( + D3D12_DRED_ENABLEMENT Enablement) = 0; + + virtual void STDMETHODCALLTYPE SetPageFaultEnablement( + D3D12_DRED_ENABLEMENT Enablement) = 0; + + virtual void STDMETHODCALLTYPE SetWatsonDumpEnablement( + D3D12_DRED_ENABLEMENT Enablement) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceRemovedExtendedDataSettingsVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceRemovedExtendedDataSettings * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceRemovedExtendedDataSettings * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceRemovedExtendedDataSettings * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetAutoBreadcrumbsEnablement) + void ( STDMETHODCALLTYPE *SetAutoBreadcrumbsEnablement )( + ID3D12DeviceRemovedExtendedDataSettings * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetPageFaultEnablement) + void ( STDMETHODCALLTYPE *SetPageFaultEnablement )( + ID3D12DeviceRemovedExtendedDataSettings * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetWatsonDumpEnablement) + void ( STDMETHODCALLTYPE *SetWatsonDumpEnablement )( + ID3D12DeviceRemovedExtendedDataSettings * This, + D3D12_DRED_ENABLEMENT Enablement); + + END_INTERFACE + } ID3D12DeviceRemovedExtendedDataSettingsVtbl; + + interface ID3D12DeviceRemovedExtendedDataSettings + { + CONST_VTBL struct ID3D12DeviceRemovedExtendedDataSettingsVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DeviceRemovedExtendedDataSettings_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DeviceRemovedExtendedDataSettings_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DeviceRemovedExtendedDataSettings_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DeviceRemovedExtendedDataSettings_SetAutoBreadcrumbsEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetAutoBreadcrumbsEnablement(This,Enablement) ) + +#define ID3D12DeviceRemovedExtendedDataSettings_SetPageFaultEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetPageFaultEnablement(This,Enablement) ) + +#define ID3D12DeviceRemovedExtendedDataSettings_SetWatsonDumpEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetWatsonDumpEnablement(This,Enablement) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DeviceRemovedExtendedDataSettings_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedDataSettings1_INTERFACE_DEFINED__ +#define __ID3D12DeviceRemovedExtendedDataSettings1_INTERFACE_DEFINED__ + +/* interface ID3D12DeviceRemovedExtendedDataSettings1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedDataSettings1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("DBD5AE51-3317-4F0A-ADF9-1D7CEDCAAE0B") + ID3D12DeviceRemovedExtendedDataSettings1 : public ID3D12DeviceRemovedExtendedDataSettings + { + public: + virtual void STDMETHODCALLTYPE SetBreadcrumbContextEnablement( + D3D12_DRED_ENABLEMENT Enablement) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceRemovedExtendedDataSettings1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceRemovedExtendedDataSettings1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceRemovedExtendedDataSettings1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceRemovedExtendedDataSettings1 * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetAutoBreadcrumbsEnablement) + void ( STDMETHODCALLTYPE *SetAutoBreadcrumbsEnablement )( + ID3D12DeviceRemovedExtendedDataSettings1 * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetPageFaultEnablement) + void ( STDMETHODCALLTYPE *SetPageFaultEnablement )( + ID3D12DeviceRemovedExtendedDataSettings1 * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetWatsonDumpEnablement) + void ( STDMETHODCALLTYPE *SetWatsonDumpEnablement )( + ID3D12DeviceRemovedExtendedDataSettings1 * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings1, SetBreadcrumbContextEnablement) + void ( STDMETHODCALLTYPE *SetBreadcrumbContextEnablement )( + ID3D12DeviceRemovedExtendedDataSettings1 * This, + D3D12_DRED_ENABLEMENT Enablement); + + END_INTERFACE + } ID3D12DeviceRemovedExtendedDataSettings1Vtbl; + + interface ID3D12DeviceRemovedExtendedDataSettings1 + { + CONST_VTBL struct ID3D12DeviceRemovedExtendedDataSettings1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DeviceRemovedExtendedDataSettings1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DeviceRemovedExtendedDataSettings1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DeviceRemovedExtendedDataSettings1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DeviceRemovedExtendedDataSettings1_SetAutoBreadcrumbsEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetAutoBreadcrumbsEnablement(This,Enablement) ) + +#define ID3D12DeviceRemovedExtendedDataSettings1_SetPageFaultEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetPageFaultEnablement(This,Enablement) ) + +#define ID3D12DeviceRemovedExtendedDataSettings1_SetWatsonDumpEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetWatsonDumpEnablement(This,Enablement) ) + + +#define ID3D12DeviceRemovedExtendedDataSettings1_SetBreadcrumbContextEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetBreadcrumbContextEnablement(This,Enablement) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DeviceRemovedExtendedDataSettings1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedDataSettings2_INTERFACE_DEFINED__ +#define __ID3D12DeviceRemovedExtendedDataSettings2_INTERFACE_DEFINED__ + +/* interface ID3D12DeviceRemovedExtendedDataSettings2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedDataSettings2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("61552388-01ab-4008-a436-83db189566ea") + ID3D12DeviceRemovedExtendedDataSettings2 : public ID3D12DeviceRemovedExtendedDataSettings1 + { + public: + virtual void STDMETHODCALLTYPE UseMarkersOnlyAutoBreadcrumbs( + BOOL MarkersOnly) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceRemovedExtendedDataSettings2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceRemovedExtendedDataSettings2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceRemovedExtendedDataSettings2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceRemovedExtendedDataSettings2 * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetAutoBreadcrumbsEnablement) + void ( STDMETHODCALLTYPE *SetAutoBreadcrumbsEnablement )( + ID3D12DeviceRemovedExtendedDataSettings2 * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetPageFaultEnablement) + void ( STDMETHODCALLTYPE *SetPageFaultEnablement )( + ID3D12DeviceRemovedExtendedDataSettings2 * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetWatsonDumpEnablement) + void ( STDMETHODCALLTYPE *SetWatsonDumpEnablement )( + ID3D12DeviceRemovedExtendedDataSettings2 * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings1, SetBreadcrumbContextEnablement) + void ( STDMETHODCALLTYPE *SetBreadcrumbContextEnablement )( + ID3D12DeviceRemovedExtendedDataSettings2 * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings2, UseMarkersOnlyAutoBreadcrumbs) + void ( STDMETHODCALLTYPE *UseMarkersOnlyAutoBreadcrumbs )( + ID3D12DeviceRemovedExtendedDataSettings2 * This, + BOOL MarkersOnly); + + END_INTERFACE + } ID3D12DeviceRemovedExtendedDataSettings2Vtbl; + + interface ID3D12DeviceRemovedExtendedDataSettings2 + { + CONST_VTBL struct ID3D12DeviceRemovedExtendedDataSettings2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DeviceRemovedExtendedDataSettings2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DeviceRemovedExtendedDataSettings2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DeviceRemovedExtendedDataSettings2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DeviceRemovedExtendedDataSettings2_SetAutoBreadcrumbsEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetAutoBreadcrumbsEnablement(This,Enablement) ) + +#define ID3D12DeviceRemovedExtendedDataSettings2_SetPageFaultEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetPageFaultEnablement(This,Enablement) ) + +#define ID3D12DeviceRemovedExtendedDataSettings2_SetWatsonDumpEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetWatsonDumpEnablement(This,Enablement) ) + + +#define ID3D12DeviceRemovedExtendedDataSettings2_SetBreadcrumbContextEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetBreadcrumbContextEnablement(This,Enablement) ) + + +#define ID3D12DeviceRemovedExtendedDataSettings2_UseMarkersOnlyAutoBreadcrumbs(This,MarkersOnly) \ + ( (This)->lpVtbl -> UseMarkersOnlyAutoBreadcrumbs(This,MarkersOnly) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DeviceRemovedExtendedDataSettings2_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedData_INTERFACE_DEFINED__ +#define __ID3D12DeviceRemovedExtendedData_INTERFACE_DEFINED__ + +/* interface ID3D12DeviceRemovedExtendedData */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedData; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("98931D33-5AE8-4791-AA3C-1A73A2934E71") + ID3D12DeviceRemovedExtendedData : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetAutoBreadcrumbsOutput( + _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT *pOutput) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetPageFaultAllocationOutput( + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT *pOutput) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceRemovedExtendedDataVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceRemovedExtendedData * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceRemovedExtendedData * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceRemovedExtendedData * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetAutoBreadcrumbsOutput) + HRESULT ( STDMETHODCALLTYPE *GetAutoBreadcrumbsOutput )( + ID3D12DeviceRemovedExtendedData * This, + _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetPageFaultAllocationOutput) + HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput )( + ID3D12DeviceRemovedExtendedData * This, + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT *pOutput); + + END_INTERFACE + } ID3D12DeviceRemovedExtendedDataVtbl; + + interface ID3D12DeviceRemovedExtendedData + { + CONST_VTBL struct ID3D12DeviceRemovedExtendedDataVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DeviceRemovedExtendedData_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DeviceRemovedExtendedData_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DeviceRemovedExtendedData_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DeviceRemovedExtendedData_GetAutoBreadcrumbsOutput(This,pOutput) \ + ( (This)->lpVtbl -> GetAutoBreadcrumbsOutput(This,pOutput) ) + +#define ID3D12DeviceRemovedExtendedData_GetPageFaultAllocationOutput(This,pOutput) \ + ( (This)->lpVtbl -> GetPageFaultAllocationOutput(This,pOutput) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DeviceRemovedExtendedData_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedData1_INTERFACE_DEFINED__ +#define __ID3D12DeviceRemovedExtendedData1_INTERFACE_DEFINED__ + +/* interface ID3D12DeviceRemovedExtendedData1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedData1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9727A022-CF1D-4DDA-9EBA-EFFA653FC506") + ID3D12DeviceRemovedExtendedData1 : public ID3D12DeviceRemovedExtendedData + { + public: + virtual HRESULT STDMETHODCALLTYPE GetAutoBreadcrumbsOutput1( + _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 *pOutput) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetPageFaultAllocationOutput1( + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT1 *pOutput) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceRemovedExtendedData1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceRemovedExtendedData1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceRemovedExtendedData1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceRemovedExtendedData1 * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetAutoBreadcrumbsOutput) + HRESULT ( STDMETHODCALLTYPE *GetAutoBreadcrumbsOutput )( + ID3D12DeviceRemovedExtendedData1 * This, + _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetPageFaultAllocationOutput) + HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput )( + ID3D12DeviceRemovedExtendedData1 * This, + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData1, GetAutoBreadcrumbsOutput1) + HRESULT ( STDMETHODCALLTYPE *GetAutoBreadcrumbsOutput1 )( + ID3D12DeviceRemovedExtendedData1 * This, + _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData1, GetPageFaultAllocationOutput1) + HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput1 )( + ID3D12DeviceRemovedExtendedData1 * This, + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT1 *pOutput); + + END_INTERFACE + } ID3D12DeviceRemovedExtendedData1Vtbl; + + interface ID3D12DeviceRemovedExtendedData1 + { + CONST_VTBL struct ID3D12DeviceRemovedExtendedData1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DeviceRemovedExtendedData1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DeviceRemovedExtendedData1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DeviceRemovedExtendedData1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DeviceRemovedExtendedData1_GetAutoBreadcrumbsOutput(This,pOutput) \ + ( (This)->lpVtbl -> GetAutoBreadcrumbsOutput(This,pOutput) ) + +#define ID3D12DeviceRemovedExtendedData1_GetPageFaultAllocationOutput(This,pOutput) \ + ( (This)->lpVtbl -> GetPageFaultAllocationOutput(This,pOutput) ) + + +#define ID3D12DeviceRemovedExtendedData1_GetAutoBreadcrumbsOutput1(This,pOutput) \ + ( (This)->lpVtbl -> GetAutoBreadcrumbsOutput1(This,pOutput) ) + +#define ID3D12DeviceRemovedExtendedData1_GetPageFaultAllocationOutput1(This,pOutput) \ + ( (This)->lpVtbl -> GetPageFaultAllocationOutput1(This,pOutput) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DeviceRemovedExtendedData1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedData2_INTERFACE_DEFINED__ +#define __ID3D12DeviceRemovedExtendedData2_INTERFACE_DEFINED__ + +/* interface ID3D12DeviceRemovedExtendedData2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedData2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("67FC5816-E4CA-4915-BF18-42541272DA54") + ID3D12DeviceRemovedExtendedData2 : public ID3D12DeviceRemovedExtendedData1 + { + public: + virtual HRESULT STDMETHODCALLTYPE GetPageFaultAllocationOutput2( + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT2 *pOutput) = 0; + + virtual D3D12_DRED_DEVICE_STATE STDMETHODCALLTYPE GetDeviceState( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceRemovedExtendedData2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceRemovedExtendedData2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceRemovedExtendedData2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceRemovedExtendedData2 * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetAutoBreadcrumbsOutput) + HRESULT ( STDMETHODCALLTYPE *GetAutoBreadcrumbsOutput )( + ID3D12DeviceRemovedExtendedData2 * This, + _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetPageFaultAllocationOutput) + HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput )( + ID3D12DeviceRemovedExtendedData2 * This, + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData1, GetAutoBreadcrumbsOutput1) + HRESULT ( STDMETHODCALLTYPE *GetAutoBreadcrumbsOutput1 )( + ID3D12DeviceRemovedExtendedData2 * This, + _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData1, GetPageFaultAllocationOutput1) + HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput1 )( + ID3D12DeviceRemovedExtendedData2 * This, + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT1 *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData2, GetPageFaultAllocationOutput2) + HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput2 )( + ID3D12DeviceRemovedExtendedData2 * This, + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT2 *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData2, GetDeviceState) + D3D12_DRED_DEVICE_STATE ( STDMETHODCALLTYPE *GetDeviceState )( + ID3D12DeviceRemovedExtendedData2 * This); + + END_INTERFACE + } ID3D12DeviceRemovedExtendedData2Vtbl; + + interface ID3D12DeviceRemovedExtendedData2 + { + CONST_VTBL struct ID3D12DeviceRemovedExtendedData2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DeviceRemovedExtendedData2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DeviceRemovedExtendedData2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DeviceRemovedExtendedData2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DeviceRemovedExtendedData2_GetAutoBreadcrumbsOutput(This,pOutput) \ + ( (This)->lpVtbl -> GetAutoBreadcrumbsOutput(This,pOutput) ) + +#define ID3D12DeviceRemovedExtendedData2_GetPageFaultAllocationOutput(This,pOutput) \ + ( (This)->lpVtbl -> GetPageFaultAllocationOutput(This,pOutput) ) + + +#define ID3D12DeviceRemovedExtendedData2_GetAutoBreadcrumbsOutput1(This,pOutput) \ + ( (This)->lpVtbl -> GetAutoBreadcrumbsOutput1(This,pOutput) ) + +#define ID3D12DeviceRemovedExtendedData2_GetPageFaultAllocationOutput1(This,pOutput) \ + ( (This)->lpVtbl -> GetPageFaultAllocationOutput1(This,pOutput) ) + + +#define ID3D12DeviceRemovedExtendedData2_GetPageFaultAllocationOutput2(This,pOutput) \ + ( (This)->lpVtbl -> GetPageFaultAllocationOutput2(This,pOutput) ) + +#define ID3D12DeviceRemovedExtendedData2_GetDeviceState(This) \ + ( (This)->lpVtbl -> GetDeviceState(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DeviceRemovedExtendedData2_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0041 */ +/* [local] */ + +typedef +enum D3D12_BACKGROUND_PROCESSING_MODE + { + D3D12_BACKGROUND_PROCESSING_MODE_ALLOWED = 0, + D3D12_BACKGROUND_PROCESSING_MODE_ALLOW_INTRUSIVE_MEASUREMENTS = ( D3D12_BACKGROUND_PROCESSING_MODE_ALLOWED + 1 ) , + D3D12_BACKGROUND_PROCESSING_MODE_DISABLE_BACKGROUND_WORK = ( D3D12_BACKGROUND_PROCESSING_MODE_ALLOW_INTRUSIVE_MEASUREMENTS + 1 ) , + D3D12_BACKGROUND_PROCESSING_MODE_DISABLE_PROFILING_BY_SYSTEM = ( D3D12_BACKGROUND_PROCESSING_MODE_DISABLE_BACKGROUND_WORK + 1 ) + } D3D12_BACKGROUND_PROCESSING_MODE; + +typedef +enum D3D12_MEASUREMENTS_ACTION + { + D3D12_MEASUREMENTS_ACTION_KEEP_ALL = 0, + D3D12_MEASUREMENTS_ACTION_COMMIT_RESULTS = ( D3D12_MEASUREMENTS_ACTION_KEEP_ALL + 1 ) , + D3D12_MEASUREMENTS_ACTION_COMMIT_RESULTS_HIGH_PRIORITY = ( D3D12_MEASUREMENTS_ACTION_COMMIT_RESULTS + 1 ) , + D3D12_MEASUREMENTS_ACTION_DISCARD_PREVIOUS = ( D3D12_MEASUREMENTS_ACTION_COMMIT_RESULTS_HIGH_PRIORITY + 1 ) + } D3D12_MEASUREMENTS_ACTION; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0041_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0041_v0_0_s_ifspec; + +#ifndef __ID3D12Device6_INTERFACE_DEFINED__ +#define __ID3D12Device6_INTERFACE_DEFINED__ + +/* interface ID3D12Device6 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device6; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("c70b221b-40e4-4a17-89af-025a0727a6dc") + ID3D12Device6 : public ID3D12Device5 + { + public: + virtual HRESULT STDMETHODCALLTYPE SetBackgroundProcessingMode( + D3D12_BACKGROUND_PROCESSING_MODE Mode, + D3D12_MEASUREMENTS_ACTION MeasurementsAction, + _In_opt_ HANDLE hEventToSignalUponCompletion, + _Out_opt_ BOOL *pbFurtherMeasurementsDesired) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device6Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device6 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device6 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device6 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device6 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device6 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device6 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device6 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device6 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device6 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device6 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device6 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device6 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device6 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device6 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device6 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device6 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device6 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device6 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device6 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device6 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device6 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device6 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device6 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device6 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device6 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device6 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device6 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device6 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device6 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device6 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device6 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device6 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device6 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device6 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device6 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device6 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device6 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device6 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device6 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device6 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device6 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device6 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device6 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device6 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device6 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device6 * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device6 * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device6 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device6 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device6 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device6 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( + ID3D12Device6 * This, + _In_ const void *pAddress, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( + ID3D12Device6 * This, + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) + HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( + ID3D12Device6 * This, + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( + ID3D12Device6 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ D3D12_COMMAND_LIST_FLAGS flags, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( + ID3D12Device6 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( + ID3D12Device6 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( + ID3D12Device6 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( + ID3D12Device6 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device6 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device6 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) + HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( + ID3D12Device6 * This, + _In_ ID3D12LifetimeOwner *pOwner, + REFIID riid, + _COM_Outptr_ void **ppvTracker); + + DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) + void ( STDMETHODCALLTYPE *RemoveDevice )( + ID3D12Device6 * This); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( + ID3D12Device6 * This, + _Inout_ UINT *pNumMetaCommands, + _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( + ID3D12Device6 * This, + _In_ REFGUID CommandId, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _Out_opt_ UINT *pTotalStructureSizeInBytes, + _Inout_ UINT *pParameterCount, + _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) + HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( + ID3D12Device6 * This, + _In_ REFGUID CommandId, + _In_ UINT NodeMask, + _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, + _In_ SIZE_T CreationParametersDataSizeInBytes, + REFIID riid, + _COM_Outptr_ void **ppMetaCommand); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) + HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( + ID3D12Device6 * This, + const D3D12_STATE_OBJECT_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) + void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( + ID3D12Device6 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, + _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); + + DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) + D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( + ID3D12Device6 * This, + _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, + _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); + + DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode) + HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )( + ID3D12Device6 * This, + D3D12_BACKGROUND_PROCESSING_MODE Mode, + D3D12_MEASUREMENTS_ACTION MeasurementsAction, + _In_opt_ HANDLE hEventToSignalUponCompletion, + _Out_opt_ BOOL *pbFurtherMeasurementsDesired); + + END_INTERFACE + } ID3D12Device6Vtbl; + + interface ID3D12Device6 + { + CONST_VTBL struct ID3D12Device6Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Device6_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Device6_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Device6_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Device6_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device6_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device6_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device6_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device6_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device6_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device6_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device6_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device6_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device6_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device6_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device6_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device6_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device6_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device6_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device6_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device6_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device6_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device6_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device6_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device6_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device6_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device6_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device6_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device6_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device6_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device6_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device6_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device6_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device6_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device6_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device6_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device6_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device6_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device6_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device6_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device6_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device6_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device6_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device6_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device6_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device6_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device6_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device6_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + + +#define ID3D12Device6_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) + +#define ID3D12Device6_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) + +#define ID3D12Device6_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) + + +#define ID3D12Device6_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) + + +#define ID3D12Device6_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) + +#define ID3D12Device6_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) + +#define ID3D12Device6_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ + ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) + + +#define ID3D12Device6_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) + +#define ID3D12Device6_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) + +#define ID3D12Device6_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device6_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) + +#define ID3D12Device6_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) +#if !defined(_WIN32) + +#define ID3D12Device6_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device6_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + + +#define ID3D12Device6_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ + ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) + +#define ID3D12Device6_RemoveDevice(This) \ + ( (This)->lpVtbl -> RemoveDevice(This) ) + +#define ID3D12Device6_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) + +#define ID3D12Device6_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) + +#define ID3D12Device6_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ + ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) + +#define ID3D12Device6_CreateStateObject(This,pDesc,riid,ppStateObject) \ + ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) + +#define ID3D12Device6_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ + ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) + +#define ID3D12Device6_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ + ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) + + +#define ID3D12Device6_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ + ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device6_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0042 */ +/* [local] */ + +DEFINE_GUID(D3D12_PROTECTED_RESOURCES_SESSION_HARDWARE_PROTECTED, 0x62B0084E, 0xC70E, 0x4DAA, 0xA1, 0x09, 0x30, 0xFF, 0x8D, 0x5A, 0x04, 0x82); +typedef struct D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPE_COUNT + { + UINT NodeIndex; + UINT Count; + } D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPE_COUNT; + +typedef struct D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPES + { + UINT NodeIndex; + UINT Count; + GUID *pTypes; + } D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPES; + +typedef struct D3D12_PROTECTED_RESOURCE_SESSION_DESC1 + { + UINT NodeMask; + D3D12_PROTECTED_RESOURCE_SESSION_FLAGS Flags; + GUID ProtectionType; + } D3D12_PROTECTED_RESOURCE_SESSION_DESC1; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0042_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0042_v0_0_s_ifspec; + +#ifndef __ID3D12ProtectedResourceSession1_INTERFACE_DEFINED__ +#define __ID3D12ProtectedResourceSession1_INTERFACE_DEFINED__ + +/* interface ID3D12ProtectedResourceSession1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12ProtectedResourceSession1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("D6F12DD6-76FB-406E-8961-4296EEFC0409") + ID3D12ProtectedResourceSession1 : public ID3D12ProtectedResourceSession + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_PROTECTED_RESOURCE_SESSION_DESC1 STDMETHODCALLTYPE GetDesc1( void) = 0; +#else + virtual D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *STDMETHODCALLTYPE GetDesc1( + D3D12_PROTECTED_RESOURCE_SESSION_DESC1 * RetVal) = 0; +#endif + + }; + + +#else /* C style interface */ + + typedef struct ID3D12ProtectedResourceSession1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12ProtectedResourceSession1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12ProtectedResourceSession1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12ProtectedResourceSession1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12ProtectedResourceSession1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12ProtectedResourceSession1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12ProtectedResourceSession1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12ProtectedResourceSession1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12ProtectedResourceSession1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12ProtectedSession, GetStatusFence) + HRESULT ( STDMETHODCALLTYPE *GetStatusFence )( + ID3D12ProtectedResourceSession1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12ProtectedSession, GetSessionStatus) + D3D12_PROTECTED_SESSION_STATUS ( STDMETHODCALLTYPE *GetSessionStatus )( + ID3D12ProtectedResourceSession1 * This); + + DECLSPEC_XFGVIRT(ID3D12ProtectedResourceSession, GetDesc) +#if !defined(_WIN32) + D3D12_PROTECTED_RESOURCE_SESSION_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12ProtectedResourceSession1 * This); + +#else + D3D12_PROTECTED_RESOURCE_SESSION_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12ProtectedResourceSession1 * This, + D3D12_PROTECTED_RESOURCE_SESSION_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12ProtectedResourceSession1, GetDesc1) +#if !defined(_WIN32) + D3D12_PROTECTED_RESOURCE_SESSION_DESC1 ( STDMETHODCALLTYPE *GetDesc1 )( + ID3D12ProtectedResourceSession1 * This); + +#else + D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *( STDMETHODCALLTYPE *GetDesc1 )( + ID3D12ProtectedResourceSession1 * This, + D3D12_PROTECTED_RESOURCE_SESSION_DESC1 * RetVal); + +#endif + + END_INTERFACE + } ID3D12ProtectedResourceSession1Vtbl; + + interface ID3D12ProtectedResourceSession1 + { + CONST_VTBL struct ID3D12ProtectedResourceSession1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12ProtectedResourceSession1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12ProtectedResourceSession1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12ProtectedResourceSession1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12ProtectedResourceSession1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12ProtectedResourceSession1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12ProtectedResourceSession1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12ProtectedResourceSession1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12ProtectedResourceSession1_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12ProtectedResourceSession1_GetStatusFence(This,riid,ppFence) \ + ( (This)->lpVtbl -> GetStatusFence(This,riid,ppFence) ) + +#define ID3D12ProtectedResourceSession1_GetSessionStatus(This) \ + ( (This)->lpVtbl -> GetSessionStatus(This) ) + +#if !defined(_WIN32) + +#define ID3D12ProtectedResourceSession1_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12ProtectedResourceSession1_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#if !defined(_WIN32) + +#define ID3D12ProtectedResourceSession1_GetDesc1(This) \ + ( (This)->lpVtbl -> GetDesc1(This) ) +#else +#define ID3D12ProtectedResourceSession1_GetDesc1(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc1(This,RetVal) ) +#endif + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12ProtectedResourceSession1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Device7_INTERFACE_DEFINED__ +#define __ID3D12Device7_INTERFACE_DEFINED__ + +/* interface ID3D12Device7 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device7; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("5c014b53-68a1-4b9b-8bd1-dd6046b9358b") + ID3D12Device7 : public ID3D12Device6 + { + public: + virtual HRESULT STDMETHODCALLTYPE AddToStateObject( + const D3D12_STATE_OBJECT_DESC *pAddition, + ID3D12StateObject *pStateObjectToGrowFrom, + REFIID riid, + _COM_Outptr_ void **ppNewStateObject) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateProtectedResourceSession1( + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device7Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device7 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device7 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device7 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device7 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device7 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device7 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device7 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device7 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device7 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device7 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device7 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device7 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device7 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device7 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device7 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device7 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device7 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device7 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device7 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device7 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device7 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device7 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device7 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device7 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device7 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device7 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device7 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device7 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device7 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device7 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device7 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device7 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device7 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device7 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device7 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device7 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device7 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device7 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device7 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device7 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device7 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device7 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device7 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device7 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device7 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device7 * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device7 * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device7 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device7 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device7 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device7 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( + ID3D12Device7 * This, + _In_ const void *pAddress, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( + ID3D12Device7 * This, + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) + HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( + ID3D12Device7 * This, + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( + ID3D12Device7 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ D3D12_COMMAND_LIST_FLAGS flags, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( + ID3D12Device7 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( + ID3D12Device7 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( + ID3D12Device7 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( + ID3D12Device7 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device7 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device7 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) + HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( + ID3D12Device7 * This, + _In_ ID3D12LifetimeOwner *pOwner, + REFIID riid, + _COM_Outptr_ void **ppvTracker); + + DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) + void ( STDMETHODCALLTYPE *RemoveDevice )( + ID3D12Device7 * This); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( + ID3D12Device7 * This, + _Inout_ UINT *pNumMetaCommands, + _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( + ID3D12Device7 * This, + _In_ REFGUID CommandId, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _Out_opt_ UINT *pTotalStructureSizeInBytes, + _Inout_ UINT *pParameterCount, + _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) + HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( + ID3D12Device7 * This, + _In_ REFGUID CommandId, + _In_ UINT NodeMask, + _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, + _In_ SIZE_T CreationParametersDataSizeInBytes, + REFIID riid, + _COM_Outptr_ void **ppMetaCommand); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) + HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( + ID3D12Device7 * This, + const D3D12_STATE_OBJECT_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) + void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( + ID3D12Device7 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, + _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); + + DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) + D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( + ID3D12Device7 * This, + _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, + _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); + + DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode) + HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )( + ID3D12Device7 * This, + D3D12_BACKGROUND_PROCESSING_MODE Mode, + D3D12_MEASUREMENTS_ACTION MeasurementsAction, + _In_opt_ HANDLE hEventToSignalUponCompletion, + _Out_opt_ BOOL *pbFurtherMeasurementsDesired); + + DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject) + HRESULT ( STDMETHODCALLTYPE *AddToStateObject )( + ID3D12Device7 * This, + const D3D12_STATE_OBJECT_DESC *pAddition, + ID3D12StateObject *pStateObjectToGrowFrom, + REFIID riid, + _COM_Outptr_ void **ppNewStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )( + ID3D12Device7 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + END_INTERFACE + } ID3D12Device7Vtbl; + + interface ID3D12Device7 + { + CONST_VTBL struct ID3D12Device7Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Device7_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Device7_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Device7_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Device7_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device7_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device7_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device7_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device7_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device7_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device7_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device7_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device7_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device7_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device7_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device7_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device7_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device7_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device7_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device7_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device7_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device7_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device7_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device7_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device7_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device7_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device7_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device7_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device7_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device7_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device7_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device7_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device7_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device7_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device7_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device7_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device7_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device7_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device7_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device7_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device7_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device7_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device7_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device7_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device7_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device7_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device7_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device7_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + + +#define ID3D12Device7_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) + +#define ID3D12Device7_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) + +#define ID3D12Device7_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) + + +#define ID3D12Device7_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) + + +#define ID3D12Device7_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) + +#define ID3D12Device7_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) + +#define ID3D12Device7_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ + ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) + + +#define ID3D12Device7_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) + +#define ID3D12Device7_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) + +#define ID3D12Device7_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device7_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) + +#define ID3D12Device7_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) +#if !defined(_WIN32) + +#define ID3D12Device7_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device7_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + + +#define ID3D12Device7_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ + ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) + +#define ID3D12Device7_RemoveDevice(This) \ + ( (This)->lpVtbl -> RemoveDevice(This) ) + +#define ID3D12Device7_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) + +#define ID3D12Device7_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) + +#define ID3D12Device7_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ + ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) + +#define ID3D12Device7_CreateStateObject(This,pDesc,riid,ppStateObject) \ + ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) + +#define ID3D12Device7_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ + ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) + +#define ID3D12Device7_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ + ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) + + +#define ID3D12Device7_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ + ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) ) + + +#define ID3D12Device7_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \ + ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) ) + +#define ID3D12Device7_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device7_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Device8_INTERFACE_DEFINED__ +#define __ID3D12Device8_INTERFACE_DEFINED__ + +/* interface ID3D12Device8 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device8; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9218E6BB-F944-4F7E-A75C-B1B2C7B701F3") + ID3D12Device8 : public ID3D12Device7 + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_RESOURCE_ALLOCATION_INFO STDMETHODCALLTYPE GetResourceAllocationInfo2( + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1) = 0; +#else + virtual D3D12_RESOURCE_ALLOCATION_INFO *STDMETHODCALLTYPE GetResourceAllocationInfo2( + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1) = 0; +#endif + + virtual HRESULT STDMETHODCALLTYPE CreateCommittedResource2( + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreatePlacedResource1( + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource) = 0; + + virtual void STDMETHODCALLTYPE CreateSamplerFeedbackUnorderedAccessView( + _In_opt_ ID3D12Resource *pTargetedResource, + _In_opt_ ID3D12Resource *pFeedbackResource, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0; + + virtual void STDMETHODCALLTYPE GetCopyableFootprints1( + _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device8Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device8 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device8 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device8 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device8 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device8 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device8 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device8 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device8 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device8 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device8 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device8 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device8 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device8 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device8 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device8 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device8 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device8 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device8 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device8 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device8 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device8 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device8 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device8 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device8 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device8 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device8 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device8 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device8 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device8 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device8 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device8 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device8 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device8 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device8 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device8 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device8 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device8 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device8 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device8 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device8 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device8 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device8 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device8 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device8 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device8 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device8 * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device8 * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device8 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device8 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device8 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device8 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( + ID3D12Device8 * This, + _In_ const void *pAddress, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( + ID3D12Device8 * This, + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) + HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( + ID3D12Device8 * This, + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( + ID3D12Device8 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ D3D12_COMMAND_LIST_FLAGS flags, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( + ID3D12Device8 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( + ID3D12Device8 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( + ID3D12Device8 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( + ID3D12Device8 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device8 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device8 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) + HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( + ID3D12Device8 * This, + _In_ ID3D12LifetimeOwner *pOwner, + REFIID riid, + _COM_Outptr_ void **ppvTracker); + + DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) + void ( STDMETHODCALLTYPE *RemoveDevice )( + ID3D12Device8 * This); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( + ID3D12Device8 * This, + _Inout_ UINT *pNumMetaCommands, + _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( + ID3D12Device8 * This, + _In_ REFGUID CommandId, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _Out_opt_ UINT *pTotalStructureSizeInBytes, + _Inout_ UINT *pParameterCount, + _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) + HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( + ID3D12Device8 * This, + _In_ REFGUID CommandId, + _In_ UINT NodeMask, + _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, + _In_ SIZE_T CreationParametersDataSizeInBytes, + REFIID riid, + _COM_Outptr_ void **ppMetaCommand); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) + HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( + ID3D12Device8 * This, + const D3D12_STATE_OBJECT_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) + void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( + ID3D12Device8 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, + _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); + + DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) + D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( + ID3D12Device8 * This, + _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, + _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); + + DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode) + HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )( + ID3D12Device8 * This, + D3D12_BACKGROUND_PROCESSING_MODE Mode, + D3D12_MEASUREMENTS_ACTION MeasurementsAction, + _In_opt_ HANDLE hEventToSignalUponCompletion, + _Out_opt_ BOOL *pbFurtherMeasurementsDesired); + + DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject) + HRESULT ( STDMETHODCALLTYPE *AddToStateObject )( + ID3D12Device8 * This, + const D3D12_STATE_OBJECT_DESC *pAddition, + ID3D12StateObject *pStateObjectToGrowFrom, + REFIID riid, + _COM_Outptr_ void **ppNewStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )( + ID3D12Device8 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device8, GetResourceAllocationInfo2) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( + ID3D12Device8 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( + ID3D12Device8 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device8, CreateCommittedResource2) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource2 )( + ID3D12Device8 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device8, CreatePlacedResource1) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource1 )( + ID3D12Device8 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device8, CreateSamplerFeedbackUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateSamplerFeedbackUnorderedAccessView )( + ID3D12Device8 * This, + _In_opt_ ID3D12Resource *pTargetedResource, + _In_opt_ ID3D12Resource *pFeedbackResource, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device8, GetCopyableFootprints1) + void ( STDMETHODCALLTYPE *GetCopyableFootprints1 )( + ID3D12Device8 * This, + _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + END_INTERFACE + } ID3D12Device8Vtbl; + + interface ID3D12Device8 + { + CONST_VTBL struct ID3D12Device8Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Device8_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Device8_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Device8_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Device8_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device8_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device8_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device8_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device8_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device8_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device8_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device8_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device8_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device8_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device8_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device8_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device8_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device8_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device8_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device8_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device8_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device8_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device8_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device8_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device8_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device8_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device8_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device8_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device8_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device8_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device8_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device8_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device8_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device8_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device8_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device8_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device8_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device8_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device8_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device8_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device8_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device8_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device8_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device8_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device8_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device8_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device8_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device8_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + + +#define ID3D12Device8_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) + +#define ID3D12Device8_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) + +#define ID3D12Device8_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) + + +#define ID3D12Device8_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) + + +#define ID3D12Device8_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) + +#define ID3D12Device8_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) + +#define ID3D12Device8_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ + ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) + + +#define ID3D12Device8_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) + +#define ID3D12Device8_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) + +#define ID3D12Device8_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device8_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) + +#define ID3D12Device8_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) +#if !defined(_WIN32) + +#define ID3D12Device8_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device8_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + + +#define ID3D12Device8_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ + ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) + +#define ID3D12Device8_RemoveDevice(This) \ + ( (This)->lpVtbl -> RemoveDevice(This) ) + +#define ID3D12Device8_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) + +#define ID3D12Device8_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) + +#define ID3D12Device8_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ + ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) + +#define ID3D12Device8_CreateStateObject(This,pDesc,riid,ppStateObject) \ + ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) + +#define ID3D12Device8_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ + ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) + +#define ID3D12Device8_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ + ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) + + +#define ID3D12Device8_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ + ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) ) + + +#define ID3D12Device8_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \ + ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) ) + +#define ID3D12Device8_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) ) + +#if !defined(_WIN32) + +#define ID3D12Device8_GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device8_GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + +#define ID3D12Device8_CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device8_CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device8_CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) ) + +#define ID3D12Device8_GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device8_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Resource1_INTERFACE_DEFINED__ +#define __ID3D12Resource1_INTERFACE_DEFINED__ + +/* interface ID3D12Resource1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Resource1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9D5E227A-4430-4161-88B3-3ECA6BB16E19") + ID3D12Resource1 : public ID3D12Resource + { + public: + virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession( + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Resource1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Resource1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Resource1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Resource1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Resource1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Resource1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Resource1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Resource1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12Resource1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12Resource, Map) + HRESULT ( STDMETHODCALLTYPE *Map )( + ID3D12Resource1 * This, + UINT Subresource, + _In_opt_ const D3D12_RANGE *pReadRange, + _Outptr_opt_result_bytebuffer_(_Inexpressible_("Dependent on resource")) void **ppData); + + DECLSPEC_XFGVIRT(ID3D12Resource, Unmap) + void ( STDMETHODCALLTYPE *Unmap )( + ID3D12Resource1 * This, + UINT Subresource, + _In_opt_ const D3D12_RANGE *pWrittenRange); + + DECLSPEC_XFGVIRT(ID3D12Resource, GetDesc) +#if !defined(_WIN32) + D3D12_RESOURCE_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12Resource1 * This); + +#else + D3D12_RESOURCE_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12Resource1 * This, + D3D12_RESOURCE_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Resource, GetGPUVirtualAddress) + D3D12_GPU_VIRTUAL_ADDRESS ( STDMETHODCALLTYPE *GetGPUVirtualAddress )( + ID3D12Resource1 * This); + + DECLSPEC_XFGVIRT(ID3D12Resource, WriteToSubresource) + HRESULT ( STDMETHODCALLTYPE *WriteToSubresource )( + ID3D12Resource1 * This, + UINT DstSubresource, + _In_opt_ const D3D12_BOX *pDstBox, + _In_ const void *pSrcData, + UINT SrcRowPitch, + UINT SrcDepthPitch); + + DECLSPEC_XFGVIRT(ID3D12Resource, ReadFromSubresource) + HRESULT ( STDMETHODCALLTYPE *ReadFromSubresource )( + ID3D12Resource1 * This, + _Out_ void *pDstData, + UINT DstRowPitch, + UINT DstDepthPitch, + UINT SrcSubresource, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12Resource, GetHeapProperties) + HRESULT ( STDMETHODCALLTYPE *GetHeapProperties )( + ID3D12Resource1 * This, + _Out_opt_ D3D12_HEAP_PROPERTIES *pHeapProperties, + _Out_opt_ D3D12_HEAP_FLAGS *pHeapFlags); + + DECLSPEC_XFGVIRT(ID3D12Resource1, GetProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )( + ID3D12Resource1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession); + + END_INTERFACE + } ID3D12Resource1Vtbl; + + interface ID3D12Resource1 + { + CONST_VTBL struct ID3D12Resource1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Resource1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Resource1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Resource1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Resource1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Resource1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Resource1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Resource1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Resource1_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#define ID3D12Resource1_Map(This,Subresource,pReadRange,ppData) \ + ( (This)->lpVtbl -> Map(This,Subresource,pReadRange,ppData) ) + +#define ID3D12Resource1_Unmap(This,Subresource,pWrittenRange) \ + ( (This)->lpVtbl -> Unmap(This,Subresource,pWrittenRange) ) +#if !defined(_WIN32) + +#define ID3D12Resource1_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12Resource1_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#define ID3D12Resource1_GetGPUVirtualAddress(This) \ + ( (This)->lpVtbl -> GetGPUVirtualAddress(This) ) + +#define ID3D12Resource1_WriteToSubresource(This,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) \ + ( (This)->lpVtbl -> WriteToSubresource(This,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) ) + +#define ID3D12Resource1_ReadFromSubresource(This,pDstData,DstRowPitch,DstDepthPitch,SrcSubresource,pSrcBox) \ + ( (This)->lpVtbl -> ReadFromSubresource(This,pDstData,DstRowPitch,DstDepthPitch,SrcSubresource,pSrcBox) ) + +#define ID3D12Resource1_GetHeapProperties(This,pHeapProperties,pHeapFlags) \ + ( (This)->lpVtbl -> GetHeapProperties(This,pHeapProperties,pHeapFlags) ) + + +#define ID3D12Resource1_GetProtectedResourceSession(This,riid,ppProtectedSession) \ + ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Resource1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Resource2_INTERFACE_DEFINED__ +#define __ID3D12Resource2_INTERFACE_DEFINED__ + +/* interface ID3D12Resource2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Resource2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("BE36EC3B-EA85-4AEB-A45A-E9D76404A495") + ID3D12Resource2 : public ID3D12Resource1 + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_RESOURCE_DESC1 STDMETHODCALLTYPE GetDesc1( void) = 0; +#else + virtual D3D12_RESOURCE_DESC1 *STDMETHODCALLTYPE GetDesc1( + D3D12_RESOURCE_DESC1 * RetVal) = 0; +#endif + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Resource2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Resource2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Resource2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Resource2 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Resource2 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Resource2 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Resource2 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Resource2 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12Resource2 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12Resource, Map) + HRESULT ( STDMETHODCALLTYPE *Map )( + ID3D12Resource2 * This, + UINT Subresource, + _In_opt_ const D3D12_RANGE *pReadRange, + _Outptr_opt_result_bytebuffer_(_Inexpressible_("Dependent on resource")) void **ppData); + + DECLSPEC_XFGVIRT(ID3D12Resource, Unmap) + void ( STDMETHODCALLTYPE *Unmap )( + ID3D12Resource2 * This, + UINT Subresource, + _In_opt_ const D3D12_RANGE *pWrittenRange); + + DECLSPEC_XFGVIRT(ID3D12Resource, GetDesc) +#if !defined(_WIN32) + D3D12_RESOURCE_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12Resource2 * This); + +#else + D3D12_RESOURCE_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12Resource2 * This, + D3D12_RESOURCE_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Resource, GetGPUVirtualAddress) + D3D12_GPU_VIRTUAL_ADDRESS ( STDMETHODCALLTYPE *GetGPUVirtualAddress )( + ID3D12Resource2 * This); + + DECLSPEC_XFGVIRT(ID3D12Resource, WriteToSubresource) + HRESULT ( STDMETHODCALLTYPE *WriteToSubresource )( + ID3D12Resource2 * This, + UINT DstSubresource, + _In_opt_ const D3D12_BOX *pDstBox, + _In_ const void *pSrcData, + UINT SrcRowPitch, + UINT SrcDepthPitch); + + DECLSPEC_XFGVIRT(ID3D12Resource, ReadFromSubresource) + HRESULT ( STDMETHODCALLTYPE *ReadFromSubresource )( + ID3D12Resource2 * This, + _Out_ void *pDstData, + UINT DstRowPitch, + UINT DstDepthPitch, + UINT SrcSubresource, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12Resource, GetHeapProperties) + HRESULT ( STDMETHODCALLTYPE *GetHeapProperties )( + ID3D12Resource2 * This, + _Out_opt_ D3D12_HEAP_PROPERTIES *pHeapProperties, + _Out_opt_ D3D12_HEAP_FLAGS *pHeapFlags); + + DECLSPEC_XFGVIRT(ID3D12Resource1, GetProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )( + ID3D12Resource2 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession); + + DECLSPEC_XFGVIRT(ID3D12Resource2, GetDesc1) +#if !defined(_WIN32) + D3D12_RESOURCE_DESC1 ( STDMETHODCALLTYPE *GetDesc1 )( + ID3D12Resource2 * This); + +#else + D3D12_RESOURCE_DESC1 *( STDMETHODCALLTYPE *GetDesc1 )( + ID3D12Resource2 * This, + D3D12_RESOURCE_DESC1 * RetVal); + +#endif + + END_INTERFACE + } ID3D12Resource2Vtbl; + + interface ID3D12Resource2 + { + CONST_VTBL struct ID3D12Resource2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Resource2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Resource2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Resource2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Resource2_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Resource2_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Resource2_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Resource2_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Resource2_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#define ID3D12Resource2_Map(This,Subresource,pReadRange,ppData) \ + ( (This)->lpVtbl -> Map(This,Subresource,pReadRange,ppData) ) + +#define ID3D12Resource2_Unmap(This,Subresource,pWrittenRange) \ + ( (This)->lpVtbl -> Unmap(This,Subresource,pWrittenRange) ) +#if !defined(_WIN32) + +#define ID3D12Resource2_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12Resource2_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#define ID3D12Resource2_GetGPUVirtualAddress(This) \ + ( (This)->lpVtbl -> GetGPUVirtualAddress(This) ) + +#define ID3D12Resource2_WriteToSubresource(This,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) \ + ( (This)->lpVtbl -> WriteToSubresource(This,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) ) + +#define ID3D12Resource2_ReadFromSubresource(This,pDstData,DstRowPitch,DstDepthPitch,SrcSubresource,pSrcBox) \ + ( (This)->lpVtbl -> ReadFromSubresource(This,pDstData,DstRowPitch,DstDepthPitch,SrcSubresource,pSrcBox) ) + +#define ID3D12Resource2_GetHeapProperties(This,pHeapProperties,pHeapFlags) \ + ( (This)->lpVtbl -> GetHeapProperties(This,pHeapProperties,pHeapFlags) ) + + +#define ID3D12Resource2_GetProtectedResourceSession(This,riid,ppProtectedSession) \ + ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) ) + +#if !defined(_WIN32) + +#define ID3D12Resource2_GetDesc1(This) \ + ( (This)->lpVtbl -> GetDesc1(This) ) +#else +#define ID3D12Resource2_GetDesc1(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc1(This,RetVal) ) +#endif + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Resource2_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Heap1_INTERFACE_DEFINED__ +#define __ID3D12Heap1_INTERFACE_DEFINED__ + +/* interface ID3D12Heap1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Heap1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("572F7389-2168-49E3-9693-D6DF5871BF6D") + ID3D12Heap1 : public ID3D12Heap + { + public: + virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession( + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Heap1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Heap1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Heap1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Heap1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Heap1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Heap1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Heap1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Heap1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12Heap1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12Heap, GetDesc) +#if !defined(_WIN32) + D3D12_HEAP_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12Heap1 * This); + +#else + D3D12_HEAP_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12Heap1 * This, + D3D12_HEAP_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Heap1, GetProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )( + ID3D12Heap1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession); + + END_INTERFACE + } ID3D12Heap1Vtbl; + + interface ID3D12Heap1 + { + CONST_VTBL struct ID3D12Heap1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Heap1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Heap1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Heap1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Heap1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Heap1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Heap1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Heap1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Heap1_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#if !defined(_WIN32) + +#define ID3D12Heap1_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12Heap1_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + + +#define ID3D12Heap1_GetProtectedResourceSession(This,riid,ppProtectedSession) \ + ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Heap1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList3_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList3_INTERFACE_DEFINED__ + +/* interface ID3D12GraphicsCommandList3 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12GraphicsCommandList3; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6FDA83A7-B84C-4E38-9AC8-C7BD22016B3D") + ID3D12GraphicsCommandList3 : public ID3D12GraphicsCommandList2 + { + public: + virtual void STDMETHODCALLTYPE SetProtectedResourceSession( + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12GraphicsCommandList3Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12GraphicsCommandList3 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12GraphicsCommandList3 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12GraphicsCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12GraphicsCommandList3 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12GraphicsCommandList3 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12GraphicsCommandList3 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12GraphicsCommandList3 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12GraphicsCommandList3 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12GraphicsCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12GraphicsCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12CommandAllocator *pAllocator, + _In_opt_ ID3D12PipelineState *pInitialState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12GraphicsCommandList3 * This, + _In_opt_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT VertexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT IndexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartIndexLocation, + _In_ INT BaseVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) + void ( STDMETHODCALLTYPE *Dispatch )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) + void ( STDMETHODCALLTYPE *CopyBufferRegion )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT64 NumBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) + void ( STDMETHODCALLTYPE *CopyTextureRegion )( + ID3D12GraphicsCommandList3 * This, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, + UINT DstX, + UINT DstY, + UINT DstZ, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12Resource *pDstResource, + _In_ ID3D12Resource *pSrcResource); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) + void ( STDMETHODCALLTYPE *CopyTiles )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12Resource *pTiledResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, + _In_ ID3D12Resource *pBuffer, + UINT64 BufferStartOffsetInBytes, + D3D12_TILE_COPY_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_ DXGI_FORMAT Format); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D12GraphicsCommandList3 * This, + _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D12GraphicsCommandList3 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D12GraphicsCommandList3 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + _In_reads_( NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) + void ( STDMETHODCALLTYPE *OMSetBlendFactor )( + ID3D12GraphicsCommandList3 * This, + _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) + void ( STDMETHODCALLTYPE *OMSetStencilRef )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT StencilRef); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) + void ( STDMETHODCALLTYPE *SetPipelineState )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) + void ( STDMETHODCALLTYPE *ExecuteBundle )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12GraphicsCommandList *pCommandList); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) + void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT NumDescriptorHeaps, + _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) + void ( STDMETHODCALLTYPE *SetComputeRootSignature )( + ID3D12GraphicsCommandList3 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) + void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( + ID3D12GraphicsCommandList3 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D12GraphicsCommandList3 * This, + _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT NumRenderTargetDescriptors, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, + _In_ BOOL RTsSingleHandleToDescriptorRange, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D12GraphicsCommandList3 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, + _In_ D3D12_CLEAR_FLAGS ClearFlags, + _In_ FLOAT Depth, + _In_ UINT8 Stencil, + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D12GraphicsCommandList3 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, + _In_ const FLOAT ColorRGBA[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( + ID3D12GraphicsCommandList3 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const UINT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( + ID3D12GraphicsCommandList3 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const FLOAT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12GraphicsCommandList3 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12GraphicsCommandList3 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12GraphicsCommandList3 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12GraphicsCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) + void ( STDMETHODCALLTYPE *ExecuteIndirect )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12CommandSignature *pCommandSignature, + _In_ UINT MaxCommandCount, + _In_ ID3D12Resource *pArgumentBuffer, + _In_ UINT64 ArgumentBufferOffset, + _In_opt_ ID3D12Resource *pCountBuffer, + _In_ UINT64 CountBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds) + void ( STDMETHODCALLTYPE *OMSetDepthBounds )( + ID3D12GraphicsCommandList3 * This, + _In_ FLOAT Min, + _In_ FLOAT Max); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions) + void ( STDMETHODCALLTYPE *SetSamplePositions )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT NumSamplesPerPixel, + _In_ UINT NumPixels, + _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion) + void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ UINT DstX, + _In_ UINT DstY, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_opt_ D3D12_RECT *pSrcRect, + _In_ DXGI_FORMAT Format, + _In_ D3D12_RESOLVE_MODE ResolveMode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask) + void ( STDMETHODCALLTYPE *SetViewInstanceMask )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT Mask); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12GraphicsCommandList3 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12GraphicsCommandList3 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + END_INTERFACE + } ID3D12GraphicsCommandList3Vtbl; + + interface ID3D12GraphicsCommandList3 + { + CONST_VTBL struct ID3D12GraphicsCommandList3Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12GraphicsCommandList3_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12GraphicsCommandList3_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12GraphicsCommandList3_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12GraphicsCommandList3_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12GraphicsCommandList3_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12GraphicsCommandList3_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12GraphicsCommandList3_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12GraphicsCommandList3_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12GraphicsCommandList3_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12GraphicsCommandList3_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12GraphicsCommandList3_Reset(This,pAllocator,pInitialState) \ + ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) + +#define ID3D12GraphicsCommandList3_ClearState(This,pPipelineState) \ + ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList3_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList3_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList3_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + +#define ID3D12GraphicsCommandList3_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ + ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) + +#define ID3D12GraphicsCommandList3_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ + ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) + +#define ID3D12GraphicsCommandList3_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) + +#define ID3D12GraphicsCommandList3_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ + ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) + +#define ID3D12GraphicsCommandList3_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) + +#define ID3D12GraphicsCommandList3_IASetPrimitiveTopology(This,PrimitiveTopology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) + +#define ID3D12GraphicsCommandList3_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) + +#define ID3D12GraphicsCommandList3_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList3_OMSetBlendFactor(This,BlendFactor) \ + ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) + +#define ID3D12GraphicsCommandList3_OMSetStencilRef(This,StencilRef) \ + ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) + +#define ID3D12GraphicsCommandList3_SetPipelineState(This,pPipelineState) \ + ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList3_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12GraphicsCommandList3_ExecuteBundle(This,pCommandList) \ + ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) + +#define ID3D12GraphicsCommandList3_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ + ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) + +#define ID3D12GraphicsCommandList3_SetComputeRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList3_SetGraphicsRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList3_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList3_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList3_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList3_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList3_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList3_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList3_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList3_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList3_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList3_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList3_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList3_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList3_IASetIndexBuffer(This,pView) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) + +#define ID3D12GraphicsCommandList3_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList3_SOSetTargets(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList3_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) + +#define ID3D12GraphicsCommandList3_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList3_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList3_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList3_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList3_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12GraphicsCommandList3_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList3_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList3_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12GraphicsCommandList3_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12GraphicsCommandList3_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList3_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList3_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12GraphicsCommandList3_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ + ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) + + +#define ID3D12GraphicsCommandList3_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList3_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList3_OMSetDepthBounds(This,Min,Max) \ + ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) ) + +#define ID3D12GraphicsCommandList3_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ + ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) ) + +#define ID3D12GraphicsCommandList3_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ + ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) ) + +#define ID3D12GraphicsCommandList3_SetViewInstanceMask(This,Mask) \ + ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) ) + + +#define ID3D12GraphicsCommandList3_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + + +#define ID3D12GraphicsCommandList3_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12GraphicsCommandList3_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0049 */ +/* [local] */ + +typedef +enum D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE + { + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_DISCARD = 0, + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE = ( D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_DISCARD + 1 ) , + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_CLEAR = ( D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE + 1 ) , + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_NO_ACCESS = ( D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_CLEAR + 1 ) + } D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE; + +typedef struct D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS + { + D3D12_CLEAR_VALUE ClearValue; + } D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS; + +typedef struct D3D12_RENDER_PASS_BEGINNING_ACCESS + { + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE Type; + union + { + D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS Clear; + } ; + } D3D12_RENDER_PASS_BEGINNING_ACCESS; + +typedef +enum D3D12_RENDER_PASS_ENDING_ACCESS_TYPE + { + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_DISCARD = 0, + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE = ( D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_DISCARD + 1 ) , + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_RESOLVE = ( D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE + 1 ) , + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_NO_ACCESS = ( D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_RESOLVE + 1 ) + } D3D12_RENDER_PASS_ENDING_ACCESS_TYPE; + +typedef struct D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_SUBRESOURCE_PARAMETERS + { + UINT SrcSubresource; + UINT DstSubresource; + UINT DstX; + UINT DstY; + D3D12_RECT SrcRect; + } D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_SUBRESOURCE_PARAMETERS; + +typedef struct D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS + { + ID3D12Resource *pSrcResource; + ID3D12Resource *pDstResource; + UINT SubresourceCount; + _Field_size_full_(SubresourceCount) const D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_SUBRESOURCE_PARAMETERS *pSubresourceParameters; + DXGI_FORMAT Format; + D3D12_RESOLVE_MODE ResolveMode; + BOOL PreserveResolveSource; + } D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS; + +typedef struct D3D12_RENDER_PASS_ENDING_ACCESS + { + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE Type; + union + { + D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS Resolve; + } ; + } D3D12_RENDER_PASS_ENDING_ACCESS; + +typedef struct D3D12_RENDER_PASS_RENDER_TARGET_DESC + { + D3D12_CPU_DESCRIPTOR_HANDLE cpuDescriptor; + D3D12_RENDER_PASS_BEGINNING_ACCESS BeginningAccess; + D3D12_RENDER_PASS_ENDING_ACCESS EndingAccess; + } D3D12_RENDER_PASS_RENDER_TARGET_DESC; + +typedef struct D3D12_RENDER_PASS_DEPTH_STENCIL_DESC + { + D3D12_CPU_DESCRIPTOR_HANDLE cpuDescriptor; + D3D12_RENDER_PASS_BEGINNING_ACCESS DepthBeginningAccess; + D3D12_RENDER_PASS_BEGINNING_ACCESS StencilBeginningAccess; + D3D12_RENDER_PASS_ENDING_ACCESS DepthEndingAccess; + D3D12_RENDER_PASS_ENDING_ACCESS StencilEndingAccess; + } D3D12_RENDER_PASS_DEPTH_STENCIL_DESC; + +typedef +enum D3D12_RENDER_PASS_FLAGS + { + D3D12_RENDER_PASS_FLAG_NONE = 0, + D3D12_RENDER_PASS_FLAG_ALLOW_UAV_WRITES = 0x1, + D3D12_RENDER_PASS_FLAG_SUSPENDING_PASS = 0x2, + D3D12_RENDER_PASS_FLAG_RESUMING_PASS = 0x4 + } D3D12_RENDER_PASS_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RENDER_PASS_FLAGS ); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0049_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0049_v0_0_s_ifspec; + +#ifndef __ID3D12MetaCommand_INTERFACE_DEFINED__ +#define __ID3D12MetaCommand_INTERFACE_DEFINED__ + +/* interface ID3D12MetaCommand */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12MetaCommand; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("DBB84C27-36CE-4FC9-B801-F048C46AC570") + ID3D12MetaCommand : public ID3D12Pageable + { + public: + virtual UINT64 STDMETHODCALLTYPE GetRequiredParameterResourceSize( + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _In_ UINT ParameterIndex) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12MetaCommandVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12MetaCommand * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12MetaCommand * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12MetaCommand * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12MetaCommand * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12MetaCommand * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12MetaCommand * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12MetaCommand * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12MetaCommand * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12MetaCommand, GetRequiredParameterResourceSize) + UINT64 ( STDMETHODCALLTYPE *GetRequiredParameterResourceSize )( + ID3D12MetaCommand * This, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _In_ UINT ParameterIndex); + + END_INTERFACE + } ID3D12MetaCommandVtbl; + + interface ID3D12MetaCommand + { + CONST_VTBL struct ID3D12MetaCommandVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12MetaCommand_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12MetaCommand_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12MetaCommand_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12MetaCommand_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12MetaCommand_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12MetaCommand_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12MetaCommand_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12MetaCommand_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#define ID3D12MetaCommand_GetRequiredParameterResourceSize(This,Stage,ParameterIndex) \ + ( (This)->lpVtbl -> GetRequiredParameterResourceSize(This,Stage,ParameterIndex) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12MetaCommand_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0050 */ +/* [local] */ + +typedef struct D3D12_DISPATCH_RAYS_DESC + { + D3D12_GPU_VIRTUAL_ADDRESS_RANGE RayGenerationShaderRecord; + D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE MissShaderTable; + D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE HitGroupTable; + D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE CallableShaderTable; + UINT Width; + UINT Height; + UINT Depth; + } D3D12_DISPATCH_RAYS_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0050_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0050_v0_0_s_ifspec; + +#ifndef __ID3D12GraphicsCommandList4_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList4_INTERFACE_DEFINED__ + +/* interface ID3D12GraphicsCommandList4 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12GraphicsCommandList4; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("8754318e-d3a9-4541-98cf-645b50dc4874") + ID3D12GraphicsCommandList4 : public ID3D12GraphicsCommandList3 + { + public: + virtual void STDMETHODCALLTYPE BeginRenderPass( + _In_ UINT NumRenderTargets, + _In_reads_opt_(NumRenderTargets) const D3D12_RENDER_PASS_RENDER_TARGET_DESC *pRenderTargets, + _In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil, + D3D12_RENDER_PASS_FLAGS Flags) = 0; + + virtual void STDMETHODCALLTYPE EndRenderPass( void) = 0; + + virtual void STDMETHODCALLTYPE InitializeMetaCommand( + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData, + _In_ SIZE_T InitializationParametersDataSizeInBytes) = 0; + + virtual void STDMETHODCALLTYPE ExecuteMetaCommand( + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData, + _In_ SIZE_T ExecutionParametersDataSizeInBytes) = 0; + + virtual void STDMETHODCALLTYPE BuildRaytracingAccelerationStructure( + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc, + _In_ UINT NumPostbuildInfoDescs, + _In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs) = 0; + + virtual void STDMETHODCALLTYPE EmitRaytracingAccelerationStructurePostbuildInfo( + _In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc, + _In_ UINT NumSourceAccelerationStructures, + _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData) = 0; + + virtual void STDMETHODCALLTYPE CopyRaytracingAccelerationStructure( + _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData, + _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData, + _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode) = 0; + + virtual void STDMETHODCALLTYPE SetPipelineState1( + _In_ ID3D12StateObject *pStateObject) = 0; + + virtual void STDMETHODCALLTYPE DispatchRays( + _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12GraphicsCommandList4Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12GraphicsCommandList4 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12GraphicsCommandList4 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12GraphicsCommandList4 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12GraphicsCommandList4 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12GraphicsCommandList4 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12GraphicsCommandList4 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12GraphicsCommandList4 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12GraphicsCommandList4 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12GraphicsCommandList4 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12GraphicsCommandList4 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12CommandAllocator *pAllocator, + _In_opt_ ID3D12PipelineState *pInitialState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12GraphicsCommandList4 * This, + _In_opt_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT VertexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT IndexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartIndexLocation, + _In_ INT BaseVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) + void ( STDMETHODCALLTYPE *Dispatch )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) + void ( STDMETHODCALLTYPE *CopyBufferRegion )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT64 NumBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) + void ( STDMETHODCALLTYPE *CopyTextureRegion )( + ID3D12GraphicsCommandList4 * This, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, + UINT DstX, + UINT DstY, + UINT DstZ, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12Resource *pDstResource, + _In_ ID3D12Resource *pSrcResource); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) + void ( STDMETHODCALLTYPE *CopyTiles )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12Resource *pTiledResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, + _In_ ID3D12Resource *pBuffer, + UINT64 BufferStartOffsetInBytes, + D3D12_TILE_COPY_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_ DXGI_FORMAT Format); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D12GraphicsCommandList4 * This, + _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D12GraphicsCommandList4 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D12GraphicsCommandList4 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + _In_reads_( NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) + void ( STDMETHODCALLTYPE *OMSetBlendFactor )( + ID3D12GraphicsCommandList4 * This, + _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) + void ( STDMETHODCALLTYPE *OMSetStencilRef )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT StencilRef); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) + void ( STDMETHODCALLTYPE *SetPipelineState )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) + void ( STDMETHODCALLTYPE *ExecuteBundle )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12GraphicsCommandList *pCommandList); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) + void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT NumDescriptorHeaps, + _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) + void ( STDMETHODCALLTYPE *SetComputeRootSignature )( + ID3D12GraphicsCommandList4 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) + void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( + ID3D12GraphicsCommandList4 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D12GraphicsCommandList4 * This, + _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT NumRenderTargetDescriptors, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, + _In_ BOOL RTsSingleHandleToDescriptorRange, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D12GraphicsCommandList4 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, + _In_ D3D12_CLEAR_FLAGS ClearFlags, + _In_ FLOAT Depth, + _In_ UINT8 Stencil, + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D12GraphicsCommandList4 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, + _In_ const FLOAT ColorRGBA[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( + ID3D12GraphicsCommandList4 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const UINT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( + ID3D12GraphicsCommandList4 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const FLOAT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12GraphicsCommandList4 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12GraphicsCommandList4 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12GraphicsCommandList4 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12GraphicsCommandList4 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) + void ( STDMETHODCALLTYPE *ExecuteIndirect )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12CommandSignature *pCommandSignature, + _In_ UINT MaxCommandCount, + _In_ ID3D12Resource *pArgumentBuffer, + _In_ UINT64 ArgumentBufferOffset, + _In_opt_ ID3D12Resource *pCountBuffer, + _In_ UINT64 CountBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds) + void ( STDMETHODCALLTYPE *OMSetDepthBounds )( + ID3D12GraphicsCommandList4 * This, + _In_ FLOAT Min, + _In_ FLOAT Max); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions) + void ( STDMETHODCALLTYPE *SetSamplePositions )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT NumSamplesPerPixel, + _In_ UINT NumPixels, + _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion) + void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ UINT DstX, + _In_ UINT DstY, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_opt_ D3D12_RECT *pSrcRect, + _In_ DXGI_FORMAT Format, + _In_ D3D12_RESOLVE_MODE ResolveMode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask) + void ( STDMETHODCALLTYPE *SetViewInstanceMask )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT Mask); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12GraphicsCommandList4 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12GraphicsCommandList4 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BeginRenderPass) + void ( STDMETHODCALLTYPE *BeginRenderPass )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT NumRenderTargets, + _In_reads_opt_(NumRenderTargets) const D3D12_RENDER_PASS_RENDER_TARGET_DESC *pRenderTargets, + _In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil, + D3D12_RENDER_PASS_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EndRenderPass) + void ( STDMETHODCALLTYPE *EndRenderPass )( + ID3D12GraphicsCommandList4 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, InitializeMetaCommand) + void ( STDMETHODCALLTYPE *InitializeMetaCommand )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData, + _In_ SIZE_T InitializationParametersDataSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, ExecuteMetaCommand) + void ( STDMETHODCALLTYPE *ExecuteMetaCommand )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData, + _In_ SIZE_T ExecutionParametersDataSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BuildRaytracingAccelerationStructure) + void ( STDMETHODCALLTYPE *BuildRaytracingAccelerationStructure )( + ID3D12GraphicsCommandList4 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc, + _In_ UINT NumPostbuildInfoDescs, + _In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EmitRaytracingAccelerationStructurePostbuildInfo) + void ( STDMETHODCALLTYPE *EmitRaytracingAccelerationStructurePostbuildInfo )( + ID3D12GraphicsCommandList4 * This, + _In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc, + _In_ UINT NumSourceAccelerationStructures, + _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, CopyRaytracingAccelerationStructure) + void ( STDMETHODCALLTYPE *CopyRaytracingAccelerationStructure )( + ID3D12GraphicsCommandList4 * This, + _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData, + _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData, + _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, SetPipelineState1) + void ( STDMETHODCALLTYPE *SetPipelineState1 )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12StateObject *pStateObject); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, DispatchRays) + void ( STDMETHODCALLTYPE *DispatchRays )( + ID3D12GraphicsCommandList4 * This, + _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc); + + END_INTERFACE + } ID3D12GraphicsCommandList4Vtbl; + + interface ID3D12GraphicsCommandList4 + { + CONST_VTBL struct ID3D12GraphicsCommandList4Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12GraphicsCommandList4_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12GraphicsCommandList4_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12GraphicsCommandList4_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12GraphicsCommandList4_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12GraphicsCommandList4_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12GraphicsCommandList4_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12GraphicsCommandList4_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12GraphicsCommandList4_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12GraphicsCommandList4_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12GraphicsCommandList4_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12GraphicsCommandList4_Reset(This,pAllocator,pInitialState) \ + ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) + +#define ID3D12GraphicsCommandList4_ClearState(This,pPipelineState) \ + ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList4_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList4_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList4_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + +#define ID3D12GraphicsCommandList4_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ + ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) + +#define ID3D12GraphicsCommandList4_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ + ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) + +#define ID3D12GraphicsCommandList4_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) + +#define ID3D12GraphicsCommandList4_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ + ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) + +#define ID3D12GraphicsCommandList4_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) + +#define ID3D12GraphicsCommandList4_IASetPrimitiveTopology(This,PrimitiveTopology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) + +#define ID3D12GraphicsCommandList4_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) + +#define ID3D12GraphicsCommandList4_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList4_OMSetBlendFactor(This,BlendFactor) \ + ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) + +#define ID3D12GraphicsCommandList4_OMSetStencilRef(This,StencilRef) \ + ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) + +#define ID3D12GraphicsCommandList4_SetPipelineState(This,pPipelineState) \ + ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList4_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12GraphicsCommandList4_ExecuteBundle(This,pCommandList) \ + ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) + +#define ID3D12GraphicsCommandList4_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ + ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) + +#define ID3D12GraphicsCommandList4_SetComputeRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList4_SetGraphicsRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList4_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList4_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList4_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList4_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList4_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList4_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList4_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList4_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList4_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList4_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList4_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList4_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList4_IASetIndexBuffer(This,pView) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) + +#define ID3D12GraphicsCommandList4_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList4_SOSetTargets(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList4_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) + +#define ID3D12GraphicsCommandList4_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList4_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList4_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList4_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList4_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12GraphicsCommandList4_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList4_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList4_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12GraphicsCommandList4_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12GraphicsCommandList4_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList4_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList4_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12GraphicsCommandList4_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ + ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) + + +#define ID3D12GraphicsCommandList4_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList4_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList4_OMSetDepthBounds(This,Min,Max) \ + ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) ) + +#define ID3D12GraphicsCommandList4_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ + ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) ) + +#define ID3D12GraphicsCommandList4_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ + ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) ) + +#define ID3D12GraphicsCommandList4_SetViewInstanceMask(This,Mask) \ + ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) ) + + +#define ID3D12GraphicsCommandList4_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + + +#define ID3D12GraphicsCommandList4_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + + +#define ID3D12GraphicsCommandList4_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \ + ( (This)->lpVtbl -> BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) ) + +#define ID3D12GraphicsCommandList4_EndRenderPass(This) \ + ( (This)->lpVtbl -> EndRenderPass(This) ) + +#define ID3D12GraphicsCommandList4_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \ + ( (This)->lpVtbl -> InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) ) + +#define ID3D12GraphicsCommandList4_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) ) + +#define ID3D12GraphicsCommandList4_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \ + ( (This)->lpVtbl -> BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) ) + +#define ID3D12GraphicsCommandList4_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \ + ( (This)->lpVtbl -> EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) ) + +#define ID3D12GraphicsCommandList4_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \ + ( (This)->lpVtbl -> CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) ) + +#define ID3D12GraphicsCommandList4_SetPipelineState1(This,pStateObject) \ + ( (This)->lpVtbl -> SetPipelineState1(This,pStateObject) ) + +#define ID3D12GraphicsCommandList4_DispatchRays(This,pDesc) \ + ( (This)->lpVtbl -> DispatchRays(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12GraphicsCommandList4_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0051 */ +/* [local] */ + +typedef +enum D3D12_SHADER_CACHE_MODE + { + D3D12_SHADER_CACHE_MODE_MEMORY = 0, + D3D12_SHADER_CACHE_MODE_DISK = ( D3D12_SHADER_CACHE_MODE_MEMORY + 1 ) + } D3D12_SHADER_CACHE_MODE; + +typedef +enum D3D12_SHADER_CACHE_FLAGS + { + D3D12_SHADER_CACHE_FLAG_NONE = 0, + D3D12_SHADER_CACHE_FLAG_DRIVER_VERSIONED = 0x1, + D3D12_SHADER_CACHE_FLAG_USE_WORKING_DIR = 0x2 + } D3D12_SHADER_CACHE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_FLAGS ); +typedef struct D3D12_SHADER_CACHE_SESSION_DESC + { + GUID Identifier; + D3D12_SHADER_CACHE_MODE Mode; + D3D12_SHADER_CACHE_FLAGS Flags; + UINT MaximumInMemoryCacheSizeBytes; + UINT MaximumInMemoryCacheEntries; + UINT MaximumValueFileSizeBytes; + UINT64 Version; + } D3D12_SHADER_CACHE_SESSION_DESC; + +typedef +enum D3D12_BARRIER_LAYOUT + { + D3D12_BARRIER_LAYOUT_UNDEFINED = 0xffffffff, + D3D12_BARRIER_LAYOUT_COMMON = 0, + D3D12_BARRIER_LAYOUT_PRESENT = 0, + D3D12_BARRIER_LAYOUT_GENERIC_READ = ( D3D12_BARRIER_LAYOUT_PRESENT + 1 ) , + D3D12_BARRIER_LAYOUT_RENDER_TARGET = ( D3D12_BARRIER_LAYOUT_GENERIC_READ + 1 ) , + D3D12_BARRIER_LAYOUT_UNORDERED_ACCESS = ( D3D12_BARRIER_LAYOUT_RENDER_TARGET + 1 ) , + D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_WRITE = ( D3D12_BARRIER_LAYOUT_UNORDERED_ACCESS + 1 ) , + D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_READ = ( D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_WRITE + 1 ) , + D3D12_BARRIER_LAYOUT_SHADER_RESOURCE = ( D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_READ + 1 ) , + D3D12_BARRIER_LAYOUT_COPY_SOURCE = ( D3D12_BARRIER_LAYOUT_SHADER_RESOURCE + 1 ) , + D3D12_BARRIER_LAYOUT_COPY_DEST = ( D3D12_BARRIER_LAYOUT_COPY_SOURCE + 1 ) , + D3D12_BARRIER_LAYOUT_RESOLVE_SOURCE = ( D3D12_BARRIER_LAYOUT_COPY_DEST + 1 ) , + D3D12_BARRIER_LAYOUT_RESOLVE_DEST = ( D3D12_BARRIER_LAYOUT_RESOLVE_SOURCE + 1 ) , + D3D12_BARRIER_LAYOUT_SHADING_RATE_SOURCE = ( D3D12_BARRIER_LAYOUT_RESOLVE_DEST + 1 ) , + D3D12_BARRIER_LAYOUT_VIDEO_DECODE_READ = ( D3D12_BARRIER_LAYOUT_SHADING_RATE_SOURCE + 1 ) , + D3D12_BARRIER_LAYOUT_VIDEO_DECODE_WRITE = ( D3D12_BARRIER_LAYOUT_VIDEO_DECODE_READ + 1 ) , + D3D12_BARRIER_LAYOUT_VIDEO_PROCESS_READ = ( D3D12_BARRIER_LAYOUT_VIDEO_DECODE_WRITE + 1 ) , + D3D12_BARRIER_LAYOUT_VIDEO_PROCESS_WRITE = ( D3D12_BARRIER_LAYOUT_VIDEO_PROCESS_READ + 1 ) , + D3D12_BARRIER_LAYOUT_VIDEO_ENCODE_READ = ( D3D12_BARRIER_LAYOUT_VIDEO_PROCESS_WRITE + 1 ) , + D3D12_BARRIER_LAYOUT_VIDEO_ENCODE_WRITE = ( D3D12_BARRIER_LAYOUT_VIDEO_ENCODE_READ + 1 ) , + D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COMMON = ( D3D12_BARRIER_LAYOUT_VIDEO_ENCODE_WRITE + 1 ) , + D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_GENERIC_READ = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COMMON + 1 ) , + D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_UNORDERED_ACCESS = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_GENERIC_READ + 1 ) , + D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_SHADER_RESOURCE = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_UNORDERED_ACCESS + 1 ) , + D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_SOURCE = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_SHADER_RESOURCE + 1 ) , + D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_DEST = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_SOURCE + 1 ) , + D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COMMON = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_DEST + 1 ) , + D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_GENERIC_READ = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COMMON + 1 ) , + D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_UNORDERED_ACCESS = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_GENERIC_READ + 1 ) , + D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_SHADER_RESOURCE = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_UNORDERED_ACCESS + 1 ) , + D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_SOURCE = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_SHADER_RESOURCE + 1 ) , + D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_DEST = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_SOURCE + 1 ) , + D3D12_BARRIER_LAYOUT_VIDEO_QUEUE_COMMON = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_DEST + 1 ) + } D3D12_BARRIER_LAYOUT; + +typedef +enum D3D12_BARRIER_SYNC + { + D3D12_BARRIER_SYNC_NONE = 0, + D3D12_BARRIER_SYNC_ALL = 0x1, + D3D12_BARRIER_SYNC_DRAW = 0x2, + D3D12_BARRIER_SYNC_INPUT_ASSEMBLER = 0x4, + D3D12_BARRIER_SYNC_VERTEX_SHADING = 0x8, + D3D12_BARRIER_SYNC_PIXEL_SHADING = 0x10, + D3D12_BARRIER_SYNC_DEPTH_STENCIL = 0x20, + D3D12_BARRIER_SYNC_RENDER_TARGET = 0x40, + D3D12_BARRIER_SYNC_COMPUTE_SHADING = 0x80, + D3D12_BARRIER_SYNC_RAYTRACING = 0x100, + D3D12_BARRIER_SYNC_COPY = 0x200, + D3D12_BARRIER_SYNC_RESOLVE = 0x400, + D3D12_BARRIER_SYNC_EXECUTE_INDIRECT = 0x800, + D3D12_BARRIER_SYNC_PREDICATION = 0x800, + D3D12_BARRIER_SYNC_ALL_SHADING = 0x1000, + D3D12_BARRIER_SYNC_NON_PIXEL_SHADING = 0x2000, + D3D12_BARRIER_SYNC_EMIT_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO = 0x4000, + D3D12_BARRIER_SYNC_CLEAR_UNORDERED_ACCESS_VIEW = 0x8000, + D3D12_BARRIER_SYNC_VIDEO_DECODE = 0x100000, + D3D12_BARRIER_SYNC_VIDEO_PROCESS = 0x200000, + D3D12_BARRIER_SYNC_VIDEO_ENCODE = 0x400000, + D3D12_BARRIER_SYNC_BUILD_RAYTRACING_ACCELERATION_STRUCTURE = 0x800000, + D3D12_BARRIER_SYNC_COPY_RAYTRACING_ACCELERATION_STRUCTURE = 0x1000000, + D3D12_BARRIER_SYNC_SPLIT = 0x80000000 + } D3D12_BARRIER_SYNC; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_BARRIER_SYNC ); +typedef +enum D3D12_BARRIER_ACCESS + { + D3D12_BARRIER_ACCESS_COMMON = 0, + D3D12_BARRIER_ACCESS_VERTEX_BUFFER = 0x1, + D3D12_BARRIER_ACCESS_CONSTANT_BUFFER = 0x2, + D3D12_BARRIER_ACCESS_INDEX_BUFFER = 0x4, + D3D12_BARRIER_ACCESS_RENDER_TARGET = 0x8, + D3D12_BARRIER_ACCESS_UNORDERED_ACCESS = 0x10, + D3D12_BARRIER_ACCESS_DEPTH_STENCIL_WRITE = 0x20, + D3D12_BARRIER_ACCESS_DEPTH_STENCIL_READ = 0x40, + D3D12_BARRIER_ACCESS_SHADER_RESOURCE = 0x80, + D3D12_BARRIER_ACCESS_STREAM_OUTPUT = 0x100, + D3D12_BARRIER_ACCESS_INDIRECT_ARGUMENT = 0x200, + D3D12_BARRIER_ACCESS_PREDICATION = 0x200, + D3D12_BARRIER_ACCESS_COPY_DEST = 0x400, + D3D12_BARRIER_ACCESS_COPY_SOURCE = 0x800, + D3D12_BARRIER_ACCESS_RESOLVE_DEST = 0x1000, + D3D12_BARRIER_ACCESS_RESOLVE_SOURCE = 0x2000, + D3D12_BARRIER_ACCESS_RAYTRACING_ACCELERATION_STRUCTURE_READ = 0x4000, + D3D12_BARRIER_ACCESS_RAYTRACING_ACCELERATION_STRUCTURE_WRITE = 0x8000, + D3D12_BARRIER_ACCESS_SHADING_RATE_SOURCE = 0x10000, + D3D12_BARRIER_ACCESS_VIDEO_DECODE_READ = 0x20000, + D3D12_BARRIER_ACCESS_VIDEO_DECODE_WRITE = 0x40000, + D3D12_BARRIER_ACCESS_VIDEO_PROCESS_READ = 0x80000, + D3D12_BARRIER_ACCESS_VIDEO_PROCESS_WRITE = 0x100000, + D3D12_BARRIER_ACCESS_VIDEO_ENCODE_READ = 0x200000, + D3D12_BARRIER_ACCESS_VIDEO_ENCODE_WRITE = 0x400000, + D3D12_BARRIER_ACCESS_NO_ACCESS = 0x80000000 + } D3D12_BARRIER_ACCESS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_BARRIER_ACCESS ); +typedef +enum D3D12_BARRIER_TYPE + { + D3D12_BARRIER_TYPE_GLOBAL = 0, + D3D12_BARRIER_TYPE_TEXTURE = ( D3D12_BARRIER_TYPE_GLOBAL + 1 ) , + D3D12_BARRIER_TYPE_BUFFER = ( D3D12_BARRIER_TYPE_TEXTURE + 1 ) + } D3D12_BARRIER_TYPE; + +typedef +enum D3D12_TEXTURE_BARRIER_FLAGS + { + D3D12_TEXTURE_BARRIER_FLAG_NONE = 0, + D3D12_TEXTURE_BARRIER_FLAG_DISCARD = 0x1 + } D3D12_TEXTURE_BARRIER_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_TEXTURE_BARRIER_FLAGS ); +typedef struct D3D12_BARRIER_SUBRESOURCE_RANGE + { + UINT IndexOrFirstMipLevel; + UINT NumMipLevels; + UINT FirstArraySlice; + UINT NumArraySlices; + UINT FirstPlane; + UINT NumPlanes; + } D3D12_BARRIER_SUBRESOURCE_RANGE; + +typedef struct D3D12_GLOBAL_BARRIER + { + D3D12_BARRIER_SYNC SyncBefore; + D3D12_BARRIER_SYNC SyncAfter; + D3D12_BARRIER_ACCESS AccessBefore; + D3D12_BARRIER_ACCESS AccessAfter; + } D3D12_GLOBAL_BARRIER; + +typedef struct D3D12_TEXTURE_BARRIER + { + D3D12_BARRIER_SYNC SyncBefore; + D3D12_BARRIER_SYNC SyncAfter; + D3D12_BARRIER_ACCESS AccessBefore; + D3D12_BARRIER_ACCESS AccessAfter; + D3D12_BARRIER_LAYOUT LayoutBefore; + D3D12_BARRIER_LAYOUT LayoutAfter; + _In_ ID3D12Resource *pResource; + D3D12_BARRIER_SUBRESOURCE_RANGE Subresources; + D3D12_TEXTURE_BARRIER_FLAGS Flags; + } D3D12_TEXTURE_BARRIER; + +typedef struct D3D12_BUFFER_BARRIER + { + D3D12_BARRIER_SYNC SyncBefore; + D3D12_BARRIER_SYNC SyncAfter; + D3D12_BARRIER_ACCESS AccessBefore; + D3D12_BARRIER_ACCESS AccessAfter; + _In_ ID3D12Resource *pResource; + UINT64 Offset; + UINT64 Size; + } D3D12_BUFFER_BARRIER; + +typedef struct D3D12_BARRIER_GROUP + { + D3D12_BARRIER_TYPE Type; + UINT32 NumBarriers; + union + { + _In_reads_(NumBarriers) const D3D12_GLOBAL_BARRIER *pGlobalBarriers; + _In_reads_(NumBarriers) const D3D12_TEXTURE_BARRIER *pTextureBarriers; + _In_reads_(NumBarriers) const D3D12_BUFFER_BARRIER *pBufferBarriers; + } ; + } D3D12_BARRIER_GROUP; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0051_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0051_v0_0_s_ifspec; + +#ifndef __ID3D12ShaderCacheSession_INTERFACE_DEFINED__ +#define __ID3D12ShaderCacheSession_INTERFACE_DEFINED__ + +/* interface ID3D12ShaderCacheSession */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12ShaderCacheSession; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("28e2495d-0f64-4ae4-a6ec-129255dc49a8") + ID3D12ShaderCacheSession : public ID3D12DeviceChild + { + public: + virtual HRESULT STDMETHODCALLTYPE FindValue( + /* [annotation][in] */ + _In_reads_bytes_(KeySize) const void *pKey, + UINT KeySize, + /* [annotation][out] */ + _Out_writes_bytes_(*pValueSize) void *pValue, + _Inout_ UINT *pValueSize) = 0; + + virtual HRESULT STDMETHODCALLTYPE StoreValue( + /* [annotation][in] */ + _In_reads_bytes_(KeySize) const void *pKey, + UINT KeySize, + /* [annotation][in] */ + _In_reads_bytes_(ValueSize) const void *pValue, + UINT ValueSize) = 0; + + virtual void STDMETHODCALLTYPE SetDeleteOnDestroy( void) = 0; + +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_SHADER_CACHE_SESSION_DESC STDMETHODCALLTYPE GetDesc( void) = 0; +#else + virtual D3D12_SHADER_CACHE_SESSION_DESC *STDMETHODCALLTYPE GetDesc( + D3D12_SHADER_CACHE_SESSION_DESC * RetVal) = 0; +#endif + + }; + + +#else /* C style interface */ + + typedef struct ID3D12ShaderCacheSessionVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12ShaderCacheSession * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12ShaderCacheSession * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12ShaderCacheSession * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12ShaderCacheSession * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12ShaderCacheSession * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12ShaderCacheSession * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12ShaderCacheSession * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12ShaderCacheSession * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12ShaderCacheSession, FindValue) + HRESULT ( STDMETHODCALLTYPE *FindValue )( + ID3D12ShaderCacheSession * This, + /* [annotation][in] */ + _In_reads_bytes_(KeySize) const void *pKey, + UINT KeySize, + /* [annotation][out] */ + _Out_writes_bytes_(*pValueSize) void *pValue, + _Inout_ UINT *pValueSize); + + DECLSPEC_XFGVIRT(ID3D12ShaderCacheSession, StoreValue) + HRESULT ( STDMETHODCALLTYPE *StoreValue )( + ID3D12ShaderCacheSession * This, + /* [annotation][in] */ + _In_reads_bytes_(KeySize) const void *pKey, + UINT KeySize, + /* [annotation][in] */ + _In_reads_bytes_(ValueSize) const void *pValue, + UINT ValueSize); + + DECLSPEC_XFGVIRT(ID3D12ShaderCacheSession, SetDeleteOnDestroy) + void ( STDMETHODCALLTYPE *SetDeleteOnDestroy )( + ID3D12ShaderCacheSession * This); + + DECLSPEC_XFGVIRT(ID3D12ShaderCacheSession, GetDesc) +#if !defined(_WIN32) + D3D12_SHADER_CACHE_SESSION_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12ShaderCacheSession * This); + +#else + D3D12_SHADER_CACHE_SESSION_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12ShaderCacheSession * This, + D3D12_SHADER_CACHE_SESSION_DESC * RetVal); + +#endif + + END_INTERFACE + } ID3D12ShaderCacheSessionVtbl; + + interface ID3D12ShaderCacheSession + { + CONST_VTBL struct ID3D12ShaderCacheSessionVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12ShaderCacheSession_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12ShaderCacheSession_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12ShaderCacheSession_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12ShaderCacheSession_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12ShaderCacheSession_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12ShaderCacheSession_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12ShaderCacheSession_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12ShaderCacheSession_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12ShaderCacheSession_FindValue(This,pKey,KeySize,pValue,pValueSize) \ + ( (This)->lpVtbl -> FindValue(This,pKey,KeySize,pValue,pValueSize) ) + +#define ID3D12ShaderCacheSession_StoreValue(This,pKey,KeySize,pValue,ValueSize) \ + ( (This)->lpVtbl -> StoreValue(This,pKey,KeySize,pValue,ValueSize) ) + +#define ID3D12ShaderCacheSession_SetDeleteOnDestroy(This) \ + ( (This)->lpVtbl -> SetDeleteOnDestroy(This) ) +#if !defined(_WIN32) + +#define ID3D12ShaderCacheSession_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12ShaderCacheSession_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12ShaderCacheSession_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0052 */ +/* [local] */ + +typedef +enum D3D12_SHADER_CACHE_KIND_FLAGS + { + D3D12_SHADER_CACHE_KIND_FLAG_IMPLICIT_D3D_CACHE_FOR_DRIVER = 0x1, + D3D12_SHADER_CACHE_KIND_FLAG_IMPLICIT_D3D_CONVERSIONS = 0x2, + D3D12_SHADER_CACHE_KIND_FLAG_IMPLICIT_DRIVER_MANAGED = 0x4, + D3D12_SHADER_CACHE_KIND_FLAG_APPLICATION_MANAGED = 0x8 + } D3D12_SHADER_CACHE_KIND_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_KIND_FLAGS ); +typedef +enum D3D12_SHADER_CACHE_CONTROL_FLAGS + { + D3D12_SHADER_CACHE_CONTROL_FLAG_DISABLE = 0x1, + D3D12_SHADER_CACHE_CONTROL_FLAG_ENABLE = 0x2, + D3D12_SHADER_CACHE_CONTROL_FLAG_CLEAR = 0x4 + } D3D12_SHADER_CACHE_CONTROL_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_CONTROL_FLAGS ); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0052_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0052_v0_0_s_ifspec; + +#ifndef __ID3D12Device9_INTERFACE_DEFINED__ +#define __ID3D12Device9_INTERFACE_DEFINED__ + +/* interface ID3D12Device9 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device9; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("4c80e962-f032-4f60-bc9e-ebc2cfa1d83c") + ID3D12Device9 : public ID3D12Device8 + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateShaderCacheSession( + _In_ const D3D12_SHADER_CACHE_SESSION_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvSession) = 0; + + virtual HRESULT STDMETHODCALLTYPE ShaderCacheControl( + D3D12_SHADER_CACHE_KIND_FLAGS Kinds, + D3D12_SHADER_CACHE_CONTROL_FLAGS Control) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateCommandQueue1( + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID CreatorID, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device9Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device9 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device9 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device9 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device9 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device9 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device9 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device9 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device9 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device9 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device9 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device9 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device9 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device9 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device9 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device9 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device9 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device9 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device9 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device9 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device9 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device9 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device9 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device9 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device9 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device9 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device9 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device9 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device9 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device9 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device9 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device9 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device9 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device9 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device9 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device9 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device9 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device9 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device9 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device9 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device9 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device9 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device9 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device9 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device9 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device9 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device9 * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device9 * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device9 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device9 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device9 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device9 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( + ID3D12Device9 * This, + _In_ const void *pAddress, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( + ID3D12Device9 * This, + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) + HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( + ID3D12Device9 * This, + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( + ID3D12Device9 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ D3D12_COMMAND_LIST_FLAGS flags, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( + ID3D12Device9 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( + ID3D12Device9 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( + ID3D12Device9 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( + ID3D12Device9 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device9 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device9 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) + HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( + ID3D12Device9 * This, + _In_ ID3D12LifetimeOwner *pOwner, + REFIID riid, + _COM_Outptr_ void **ppvTracker); + + DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) + void ( STDMETHODCALLTYPE *RemoveDevice )( + ID3D12Device9 * This); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( + ID3D12Device9 * This, + _Inout_ UINT *pNumMetaCommands, + _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( + ID3D12Device9 * This, + _In_ REFGUID CommandId, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _Out_opt_ UINT *pTotalStructureSizeInBytes, + _Inout_ UINT *pParameterCount, + _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) + HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( + ID3D12Device9 * This, + _In_ REFGUID CommandId, + _In_ UINT NodeMask, + _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, + _In_ SIZE_T CreationParametersDataSizeInBytes, + REFIID riid, + _COM_Outptr_ void **ppMetaCommand); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) + HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( + ID3D12Device9 * This, + const D3D12_STATE_OBJECT_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) + void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( + ID3D12Device9 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, + _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); + + DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) + D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( + ID3D12Device9 * This, + _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, + _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); + + DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode) + HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )( + ID3D12Device9 * This, + D3D12_BACKGROUND_PROCESSING_MODE Mode, + D3D12_MEASUREMENTS_ACTION MeasurementsAction, + _In_opt_ HANDLE hEventToSignalUponCompletion, + _Out_opt_ BOOL *pbFurtherMeasurementsDesired); + + DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject) + HRESULT ( STDMETHODCALLTYPE *AddToStateObject )( + ID3D12Device9 * This, + const D3D12_STATE_OBJECT_DESC *pAddition, + ID3D12StateObject *pStateObjectToGrowFrom, + REFIID riid, + _COM_Outptr_ void **ppNewStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )( + ID3D12Device9 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device8, GetResourceAllocationInfo2) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( + ID3D12Device9 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( + ID3D12Device9 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device8, CreateCommittedResource2) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource2 )( + ID3D12Device9 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device8, CreatePlacedResource1) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource1 )( + ID3D12Device9 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device8, CreateSamplerFeedbackUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateSamplerFeedbackUnorderedAccessView )( + ID3D12Device9 * This, + _In_opt_ ID3D12Resource *pTargetedResource, + _In_opt_ ID3D12Resource *pFeedbackResource, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device8, GetCopyableFootprints1) + void ( STDMETHODCALLTYPE *GetCopyableFootprints1 )( + ID3D12Device9 * This, + _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device9, CreateShaderCacheSession) + HRESULT ( STDMETHODCALLTYPE *CreateShaderCacheSession )( + ID3D12Device9 * This, + _In_ const D3D12_SHADER_CACHE_SESSION_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvSession); + + DECLSPEC_XFGVIRT(ID3D12Device9, ShaderCacheControl) + HRESULT ( STDMETHODCALLTYPE *ShaderCacheControl )( + ID3D12Device9 * This, + D3D12_SHADER_CACHE_KIND_FLAGS Kinds, + D3D12_SHADER_CACHE_CONTROL_FLAGS Control); + + DECLSPEC_XFGVIRT(ID3D12Device9, CreateCommandQueue1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue1 )( + ID3D12Device9 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID CreatorID, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + END_INTERFACE + } ID3D12Device9Vtbl; + + interface ID3D12Device9 + { + CONST_VTBL struct ID3D12Device9Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Device9_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Device9_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Device9_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Device9_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device9_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device9_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device9_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device9_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device9_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device9_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device9_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device9_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device9_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device9_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device9_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device9_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device9_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device9_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device9_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device9_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device9_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device9_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device9_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device9_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device9_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device9_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device9_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device9_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device9_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device9_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device9_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device9_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device9_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device9_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device9_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device9_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device9_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device9_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device9_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device9_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device9_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device9_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device9_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device9_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device9_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device9_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device9_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + + +#define ID3D12Device9_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) + +#define ID3D12Device9_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) + +#define ID3D12Device9_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) + + +#define ID3D12Device9_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) + + +#define ID3D12Device9_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) + +#define ID3D12Device9_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) + +#define ID3D12Device9_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ + ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) + + +#define ID3D12Device9_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) + +#define ID3D12Device9_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) + +#define ID3D12Device9_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device9_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) + +#define ID3D12Device9_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) +#if !defined(_WIN32) + +#define ID3D12Device9_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device9_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + + +#define ID3D12Device9_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ + ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) + +#define ID3D12Device9_RemoveDevice(This) \ + ( (This)->lpVtbl -> RemoveDevice(This) ) + +#define ID3D12Device9_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) + +#define ID3D12Device9_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) + +#define ID3D12Device9_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ + ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) + +#define ID3D12Device9_CreateStateObject(This,pDesc,riid,ppStateObject) \ + ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) + +#define ID3D12Device9_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ + ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) + +#define ID3D12Device9_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ + ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) + + +#define ID3D12Device9_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ + ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) ) + + +#define ID3D12Device9_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \ + ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) ) + +#define ID3D12Device9_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) ) + +#if !defined(_WIN32) + +#define ID3D12Device9_GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device9_GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + +#define ID3D12Device9_CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device9_CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device9_CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) ) + +#define ID3D12Device9_GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + + +#define ID3D12Device9_CreateShaderCacheSession(This,pDesc,riid,ppvSession) \ + ( (This)->lpVtbl -> CreateShaderCacheSession(This,pDesc,riid,ppvSession) ) + +#define ID3D12Device9_ShaderCacheControl(This,Kinds,Control) \ + ( (This)->lpVtbl -> ShaderCacheControl(This,Kinds,Control) ) + +#define ID3D12Device9_CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device9_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Device10_INTERFACE_DEFINED__ +#define __ID3D12Device10_INTERFACE_DEFINED__ + +/* interface ID3D12Device10 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device10; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("517f8718-aa66-49f9-b02b-a7ab89c06031") + ID3D12Device10 : public ID3D12Device9 + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateCommittedResource3( + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreatePlacedResource2( + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateReservedResource2( + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device10Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device10 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device10 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device10 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device10 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device10 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device10 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device10 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device10 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device10 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device10 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device10 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device10 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device10 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device10 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device10 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device10 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device10 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device10 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device10 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device10 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device10 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device10 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device10 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device10 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device10 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device10 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device10 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device10 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device10 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device10 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device10 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device10 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device10 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device10 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device10 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device10 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device10 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device10 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device10 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device10 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device10 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device10 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device10 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device10 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device10 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device10 * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device10 * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device10 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device10 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device10 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device10 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( + ID3D12Device10 * This, + _In_ const void *pAddress, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( + ID3D12Device10 * This, + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) + HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( + ID3D12Device10 * This, + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( + ID3D12Device10 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ D3D12_COMMAND_LIST_FLAGS flags, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( + ID3D12Device10 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( + ID3D12Device10 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( + ID3D12Device10 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( + ID3D12Device10 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device10 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device10 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) + HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( + ID3D12Device10 * This, + _In_ ID3D12LifetimeOwner *pOwner, + REFIID riid, + _COM_Outptr_ void **ppvTracker); + + DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) + void ( STDMETHODCALLTYPE *RemoveDevice )( + ID3D12Device10 * This); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( + ID3D12Device10 * This, + _Inout_ UINT *pNumMetaCommands, + _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( + ID3D12Device10 * This, + _In_ REFGUID CommandId, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _Out_opt_ UINT *pTotalStructureSizeInBytes, + _Inout_ UINT *pParameterCount, + _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) + HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( + ID3D12Device10 * This, + _In_ REFGUID CommandId, + _In_ UINT NodeMask, + _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, + _In_ SIZE_T CreationParametersDataSizeInBytes, + REFIID riid, + _COM_Outptr_ void **ppMetaCommand); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) + HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( + ID3D12Device10 * This, + const D3D12_STATE_OBJECT_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) + void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( + ID3D12Device10 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, + _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); + + DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) + D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( + ID3D12Device10 * This, + _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, + _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); + + DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode) + HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )( + ID3D12Device10 * This, + D3D12_BACKGROUND_PROCESSING_MODE Mode, + D3D12_MEASUREMENTS_ACTION MeasurementsAction, + _In_opt_ HANDLE hEventToSignalUponCompletion, + _Out_opt_ BOOL *pbFurtherMeasurementsDesired); + + DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject) + HRESULT ( STDMETHODCALLTYPE *AddToStateObject )( + ID3D12Device10 * This, + const D3D12_STATE_OBJECT_DESC *pAddition, + ID3D12StateObject *pStateObjectToGrowFrom, + REFIID riid, + _COM_Outptr_ void **ppNewStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )( + ID3D12Device10 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device8, GetResourceAllocationInfo2) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( + ID3D12Device10 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( + ID3D12Device10 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device8, CreateCommittedResource2) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource2 )( + ID3D12Device10 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device8, CreatePlacedResource1) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource1 )( + ID3D12Device10 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device8, CreateSamplerFeedbackUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateSamplerFeedbackUnorderedAccessView )( + ID3D12Device10 * This, + _In_opt_ ID3D12Resource *pTargetedResource, + _In_opt_ ID3D12Resource *pFeedbackResource, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device8, GetCopyableFootprints1) + void ( STDMETHODCALLTYPE *GetCopyableFootprints1 )( + ID3D12Device10 * This, + _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device9, CreateShaderCacheSession) + HRESULT ( STDMETHODCALLTYPE *CreateShaderCacheSession )( + ID3D12Device10 * This, + _In_ const D3D12_SHADER_CACHE_SESSION_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvSession); + + DECLSPEC_XFGVIRT(ID3D12Device9, ShaderCacheControl) + HRESULT ( STDMETHODCALLTYPE *ShaderCacheControl )( + ID3D12Device10 * This, + D3D12_SHADER_CACHE_KIND_FLAGS Kinds, + D3D12_SHADER_CACHE_CONTROL_FLAGS Control); + + DECLSPEC_XFGVIRT(ID3D12Device9, CreateCommandQueue1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue1 )( + ID3D12Device10 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID CreatorID, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device10, CreateCommittedResource3) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource3 )( + ID3D12Device10 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device10, CreatePlacedResource2) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource2 )( + ID3D12Device10 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device10, CreateReservedResource2) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource2 )( + ID3D12Device10 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + END_INTERFACE + } ID3D12Device10Vtbl; + + interface ID3D12Device10 + { + CONST_VTBL struct ID3D12Device10Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Device10_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Device10_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Device10_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Device10_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device10_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device10_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device10_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device10_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device10_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device10_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device10_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device10_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device10_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device10_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device10_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device10_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device10_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device10_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device10_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device10_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device10_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device10_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device10_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device10_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device10_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device10_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device10_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device10_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device10_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device10_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device10_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device10_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device10_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device10_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device10_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device10_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device10_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device10_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device10_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device10_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device10_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device10_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device10_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device10_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device10_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device10_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device10_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + + +#define ID3D12Device10_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) + +#define ID3D12Device10_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) + +#define ID3D12Device10_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) + + +#define ID3D12Device10_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) + + +#define ID3D12Device10_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) + +#define ID3D12Device10_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) + +#define ID3D12Device10_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ + ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) + + +#define ID3D12Device10_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) + +#define ID3D12Device10_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) + +#define ID3D12Device10_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device10_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) + +#define ID3D12Device10_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) +#if !defined(_WIN32) + +#define ID3D12Device10_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device10_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + + +#define ID3D12Device10_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ + ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) + +#define ID3D12Device10_RemoveDevice(This) \ + ( (This)->lpVtbl -> RemoveDevice(This) ) + +#define ID3D12Device10_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) + +#define ID3D12Device10_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) + +#define ID3D12Device10_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ + ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) + +#define ID3D12Device10_CreateStateObject(This,pDesc,riid,ppStateObject) \ + ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) + +#define ID3D12Device10_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ + ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) + +#define ID3D12Device10_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ + ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) + + +#define ID3D12Device10_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ + ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) ) + + +#define ID3D12Device10_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \ + ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) ) + +#define ID3D12Device10_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) ) + +#if !defined(_WIN32) + +#define ID3D12Device10_GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device10_GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + +#define ID3D12Device10_CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device10_CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device10_CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) ) + +#define ID3D12Device10_GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + + +#define ID3D12Device10_CreateShaderCacheSession(This,pDesc,riid,ppvSession) \ + ( (This)->lpVtbl -> CreateShaderCacheSession(This,pDesc,riid,ppvSession) ) + +#define ID3D12Device10_ShaderCacheControl(This,Kinds,Control) \ + ( (This)->lpVtbl -> ShaderCacheControl(This,Kinds,Control) ) + +#define ID3D12Device10_CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) ) + + +#define ID3D12Device10_CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) ) + +#define ID3D12Device10_CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) ) + +#define ID3D12Device10_CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device10_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Device11_INTERFACE_DEFINED__ +#define __ID3D12Device11_INTERFACE_DEFINED__ + +/* interface ID3D12Device11 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device11; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("5405c344-d457-444e-b4dd-2366e45aee39") + ID3D12Device11 : public ID3D12Device10 + { + public: + virtual void STDMETHODCALLTYPE CreateSampler2( + _In_ const D3D12_SAMPLER_DESC2 *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device11Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device11 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device11 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device11 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device11 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device11 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device11 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device11 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device11 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device11 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device11 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device11 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device11 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device11 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device11 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device11 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device11 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device11 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device11 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device11 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device11 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device11 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device11 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device11 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device11 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device11 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device11 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device11 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device11 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device11 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device11 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device11 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device11 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device11 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device11 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device11 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device11 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device11 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device11 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device11 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device11 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device11 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device11 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device11 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device11 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device11 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device11 * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device11 * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device11 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device11 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device11 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device11 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( + ID3D12Device11 * This, + _In_ const void *pAddress, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( + ID3D12Device11 * This, + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) + HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( + ID3D12Device11 * This, + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( + ID3D12Device11 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ D3D12_COMMAND_LIST_FLAGS flags, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( + ID3D12Device11 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( + ID3D12Device11 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( + ID3D12Device11 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( + ID3D12Device11 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device11 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device11 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) + HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( + ID3D12Device11 * This, + _In_ ID3D12LifetimeOwner *pOwner, + REFIID riid, + _COM_Outptr_ void **ppvTracker); + + DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) + void ( STDMETHODCALLTYPE *RemoveDevice )( + ID3D12Device11 * This); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( + ID3D12Device11 * This, + _Inout_ UINT *pNumMetaCommands, + _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( + ID3D12Device11 * This, + _In_ REFGUID CommandId, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _Out_opt_ UINT *pTotalStructureSizeInBytes, + _Inout_ UINT *pParameterCount, + _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) + HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( + ID3D12Device11 * This, + _In_ REFGUID CommandId, + _In_ UINT NodeMask, + _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, + _In_ SIZE_T CreationParametersDataSizeInBytes, + REFIID riid, + _COM_Outptr_ void **ppMetaCommand); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) + HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( + ID3D12Device11 * This, + const D3D12_STATE_OBJECT_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) + void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( + ID3D12Device11 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, + _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); + + DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) + D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( + ID3D12Device11 * This, + _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, + _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); + + DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode) + HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )( + ID3D12Device11 * This, + D3D12_BACKGROUND_PROCESSING_MODE Mode, + D3D12_MEASUREMENTS_ACTION MeasurementsAction, + _In_opt_ HANDLE hEventToSignalUponCompletion, + _Out_opt_ BOOL *pbFurtherMeasurementsDesired); + + DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject) + HRESULT ( STDMETHODCALLTYPE *AddToStateObject )( + ID3D12Device11 * This, + const D3D12_STATE_OBJECT_DESC *pAddition, + ID3D12StateObject *pStateObjectToGrowFrom, + REFIID riid, + _COM_Outptr_ void **ppNewStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )( + ID3D12Device11 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device8, GetResourceAllocationInfo2) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( + ID3D12Device11 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( + ID3D12Device11 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device8, CreateCommittedResource2) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource2 )( + ID3D12Device11 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device8, CreatePlacedResource1) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource1 )( + ID3D12Device11 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device8, CreateSamplerFeedbackUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateSamplerFeedbackUnorderedAccessView )( + ID3D12Device11 * This, + _In_opt_ ID3D12Resource *pTargetedResource, + _In_opt_ ID3D12Resource *pFeedbackResource, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device8, GetCopyableFootprints1) + void ( STDMETHODCALLTYPE *GetCopyableFootprints1 )( + ID3D12Device11 * This, + _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device9, CreateShaderCacheSession) + HRESULT ( STDMETHODCALLTYPE *CreateShaderCacheSession )( + ID3D12Device11 * This, + _In_ const D3D12_SHADER_CACHE_SESSION_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvSession); + + DECLSPEC_XFGVIRT(ID3D12Device9, ShaderCacheControl) + HRESULT ( STDMETHODCALLTYPE *ShaderCacheControl )( + ID3D12Device11 * This, + D3D12_SHADER_CACHE_KIND_FLAGS Kinds, + D3D12_SHADER_CACHE_CONTROL_FLAGS Control); + + DECLSPEC_XFGVIRT(ID3D12Device9, CreateCommandQueue1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue1 )( + ID3D12Device11 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID CreatorID, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device10, CreateCommittedResource3) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource3 )( + ID3D12Device11 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device10, CreatePlacedResource2) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource2 )( + ID3D12Device11 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device10, CreateReservedResource2) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource2 )( + ID3D12Device11 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device11, CreateSampler2) + void ( STDMETHODCALLTYPE *CreateSampler2 )( + ID3D12Device11 * This, + _In_ const D3D12_SAMPLER_DESC2 *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + END_INTERFACE + } ID3D12Device11Vtbl; + + interface ID3D12Device11 + { + CONST_VTBL struct ID3D12Device11Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Device11_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Device11_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Device11_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Device11_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device11_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device11_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device11_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device11_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device11_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device11_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device11_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device11_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device11_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device11_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device11_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device11_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device11_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device11_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device11_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device11_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device11_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device11_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device11_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device11_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device11_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device11_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device11_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device11_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device11_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device11_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device11_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device11_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device11_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device11_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device11_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device11_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device11_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device11_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device11_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device11_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device11_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device11_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device11_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device11_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device11_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device11_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device11_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + + +#define ID3D12Device11_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) + +#define ID3D12Device11_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) + +#define ID3D12Device11_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) + + +#define ID3D12Device11_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) + + +#define ID3D12Device11_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) + +#define ID3D12Device11_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) + +#define ID3D12Device11_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ + ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) + + +#define ID3D12Device11_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) + +#define ID3D12Device11_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) + +#define ID3D12Device11_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device11_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) + +#define ID3D12Device11_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) +#if !defined(_WIN32) + +#define ID3D12Device11_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device11_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + + +#define ID3D12Device11_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ + ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) + +#define ID3D12Device11_RemoveDevice(This) \ + ( (This)->lpVtbl -> RemoveDevice(This) ) + +#define ID3D12Device11_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) + +#define ID3D12Device11_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) + +#define ID3D12Device11_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ + ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) + +#define ID3D12Device11_CreateStateObject(This,pDesc,riid,ppStateObject) \ + ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) + +#define ID3D12Device11_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ + ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) + +#define ID3D12Device11_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ + ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) + + +#define ID3D12Device11_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ + ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) ) + + +#define ID3D12Device11_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \ + ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) ) + +#define ID3D12Device11_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) ) + +#if !defined(_WIN32) + +#define ID3D12Device11_GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device11_GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + +#define ID3D12Device11_CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device11_CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device11_CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) ) + +#define ID3D12Device11_GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + + +#define ID3D12Device11_CreateShaderCacheSession(This,pDesc,riid,ppvSession) \ + ( (This)->lpVtbl -> CreateShaderCacheSession(This,pDesc,riid,ppvSession) ) + +#define ID3D12Device11_ShaderCacheControl(This,Kinds,Control) \ + ( (This)->lpVtbl -> ShaderCacheControl(This,Kinds,Control) ) + +#define ID3D12Device11_CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) ) + + +#define ID3D12Device11_CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) ) + +#define ID3D12Device11_CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) ) + +#define ID3D12Device11_CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) ) + + +#define ID3D12Device11_CreateSampler2(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler2(This,pDesc,DestDescriptor) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device11_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VirtualizationGuestDevice_INTERFACE_DEFINED__ +#define __ID3D12VirtualizationGuestDevice_INTERFACE_DEFINED__ + +/* interface ID3D12VirtualizationGuestDevice */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VirtualizationGuestDevice; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("bc66d368-7373-4943-8757-fc87dc79e476") + ID3D12VirtualizationGuestDevice : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE ShareWithHost( + _In_ ID3D12DeviceChild *pObject, + _Out_ HANDLE *pHandle) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateFenceFd( + _In_ ID3D12Fence *pFence, + UINT64 FenceValue, + _Out_ int *pFenceFd) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VirtualizationGuestDeviceVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VirtualizationGuestDevice * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VirtualizationGuestDevice * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VirtualizationGuestDevice * This); + + DECLSPEC_XFGVIRT(ID3D12VirtualizationGuestDevice, ShareWithHost) + HRESULT ( STDMETHODCALLTYPE *ShareWithHost )( + ID3D12VirtualizationGuestDevice * This, + _In_ ID3D12DeviceChild *pObject, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12VirtualizationGuestDevice, CreateFenceFd) + HRESULT ( STDMETHODCALLTYPE *CreateFenceFd )( + ID3D12VirtualizationGuestDevice * This, + _In_ ID3D12Fence *pFence, + UINT64 FenceValue, + _Out_ int *pFenceFd); + + END_INTERFACE + } ID3D12VirtualizationGuestDeviceVtbl; + + interface ID3D12VirtualizationGuestDevice + { + CONST_VTBL struct ID3D12VirtualizationGuestDeviceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VirtualizationGuestDevice_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VirtualizationGuestDevice_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VirtualizationGuestDevice_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VirtualizationGuestDevice_ShareWithHost(This,pObject,pHandle) \ + ( (This)->lpVtbl -> ShareWithHost(This,pObject,pHandle) ) + +#define ID3D12VirtualizationGuestDevice_CreateFenceFd(This,pFence,FenceValue,pFenceFd) \ + ( (This)->lpVtbl -> CreateFenceFd(This,pFence,FenceValue,pFenceFd) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VirtualizationGuestDevice_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Tools_INTERFACE_DEFINED__ +#define __ID3D12Tools_INTERFACE_DEFINED__ + +/* interface ID3D12Tools */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Tools; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("7071e1f0-e84b-4b33-974f-12fa49de65c5") + ID3D12Tools : public IUnknown + { + public: + virtual void STDMETHODCALLTYPE EnableShaderInstrumentation( + BOOL bEnable) = 0; + + virtual BOOL STDMETHODCALLTYPE ShaderInstrumentationEnabled( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12ToolsVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Tools * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Tools * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Tools * This); + + DECLSPEC_XFGVIRT(ID3D12Tools, EnableShaderInstrumentation) + void ( STDMETHODCALLTYPE *EnableShaderInstrumentation )( + ID3D12Tools * This, + BOOL bEnable); + + DECLSPEC_XFGVIRT(ID3D12Tools, ShaderInstrumentationEnabled) + BOOL ( STDMETHODCALLTYPE *ShaderInstrumentationEnabled )( + ID3D12Tools * This); + + END_INTERFACE + } ID3D12ToolsVtbl; + + interface ID3D12Tools + { + CONST_VTBL struct ID3D12ToolsVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Tools_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Tools_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Tools_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Tools_EnableShaderInstrumentation(This,bEnable) \ + ( (This)->lpVtbl -> EnableShaderInstrumentation(This,bEnable) ) + +#define ID3D12Tools_ShaderInstrumentationEnabled(This) \ + ( (This)->lpVtbl -> ShaderInstrumentationEnabled(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Tools_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0057 */ +/* [local] */ + +typedef struct D3D12_SUBRESOURCE_DATA + { + const void *pData; + LONG_PTR RowPitch; + LONG_PTR SlicePitch; + } D3D12_SUBRESOURCE_DATA; + +typedef struct D3D12_MEMCPY_DEST + { + void *pData; + SIZE_T RowPitch; + SIZE_T SlicePitch; + } D3D12_MEMCPY_DEST; + +#if !defined( D3D12_IGNORE_SDK_LAYERS ) +#include "d3d12sdklayers.h" +#endif + +/////////////////////////////////////////////////////////////////////////// +// D3D12CreateDevice +// ------------------ +// +// pAdapter +// If NULL, D3D12CreateDevice will choose the primary adapter. +// If non-NULL, D3D12CreateDevice will use the provided adapter. +// MinimumFeatureLevel +// The minimum feature level required for successful device creation. +// riid +// The interface IID of the device to be returned. Expected: ID3D12Device. +// ppDevice +// Pointer to returned interface. May be NULL. +// +// Return Values +// Any of those documented for +// CreateDXGIFactory1 +// IDXGIFactory::EnumAdapters +// D3D12CreateDevice +// +/////////////////////////////////////////////////////////////////////////// +typedef HRESULT (WINAPI* PFN_D3D12_CREATE_DEVICE)( _In_opt_ IUnknown*, + D3D_FEATURE_LEVEL, + _In_ REFIID, _COM_Outptr_opt_ void** ); + +HRESULT WINAPI D3D12CreateDevice( + _In_opt_ IUnknown* pAdapter, + D3D_FEATURE_LEVEL MinimumFeatureLevel, + _In_ REFIID riid, // Expected: ID3D12Device + _COM_Outptr_opt_ void** ppDevice ); + + +typedef HRESULT (WINAPI* PFN_D3D12_GET_DEBUG_INTERFACE)( _In_ REFIID, _COM_Outptr_opt_ void** ); + +HRESULT WINAPI D3D12GetDebugInterface( _In_ REFIID riid, _COM_Outptr_opt_ void** ppvDebug ); + +// -------------------------------------------------------------------------------------------------------------------------------- +// D3D12EnableExperimentalFeatures +// +// Pass in a list of feature GUIDs to be enabled together. +// +// If a particular feature requires some configuration information on enablement, it will have +// a configuration struct that can be passed alongside the GUID. +// +// Some features might use an interface IID as the GUID. For these, once the feature is enabled via +// D3D12EnableExperimentalFeatures, D3D12GetDebugInterface can then be called with the IID to retrieve the interface +// for manipulating the feature. This allows for control that might not cleanly be expressed by just +// the configuration struct that D3D12EnableExperimentalFeatures provides. +// +// If this method is called and a change to existing feature enablement is made, +// all current D3D12 devices are set to DEVICE_REMOVED state, since under the covers there is really only one +// singleton device for a process. Removing the devices when configuration changes prevents +// mismatched expectations of how a device is supposed to work after it has been created from the app's point of view. +// +// The call returns E_NOINTERFACE if an unrecognized feature is passed in or Windows Developer mode is not on. +// The call returns E_INVALIDARG if the configuration of a feature is incorrect, the set of features passed +// in are known to be incompatible with each other, or other errors. +// Returns S_OK otherwise. +// +// -------------------------------------------------------------------------------------------------------------------------------- +HRESULT WINAPI D3D12EnableExperimentalFeatures( + UINT NumFeatures, + _In_count_(NumFeatures) const IID* pIIDs, + _In_opt_count_(NumFeatures) void* pConfigurationStructs, + _In_opt_count_(NumFeatures) UINT* pConfigurationStructSizes); + +// -------------------------------------------------------------------------------------------------------------------------------- +// Experimental Feature: D3D12ExperimentalShaderModels +// +// Use with D3D12EnableExperimentalFeatures to enable experimental shader model support, +// meaning shader models that haven't been finalized for use in retail. +// +// Enabling D3D12ExperimentalShaderModels needs no configuration struct, pass NULL in the pConfigurationStructs array. +// +// -------------------------------------------------------------------------------------------------------------------------------- +static const UUID D3D12ExperimentalShaderModels = { /* 76f5573e-f13a-40f5-b297-81ce9e18933f */ + 0x76f5573e, + 0xf13a, + 0x40f5, + { 0xb2, 0x97, 0x81, 0xce, 0x9e, 0x18, 0x93, 0x3f } +}; +// -------------------------------------------------------------------------------------------------------------------------------- +// Experimental Feature: D3D12TiledResourceTier4 +// +// Use with D3D12EnableExperimentalFeatures to enable tiled resource tier 4 support, +// meaning texture tile data-inheritance is allowed. +// +// Enabling D3D12TiledResourceTier4 needs no configuration struct, pass NULL in the pConfigurationStructs array. +// +// -------------------------------------------------------------------------------------------------------------------------------- +static const UUID D3D12TiledResourceTier4 = { /* c9c4725f-a81a-4f56-8c5b-c51039d694fb */ + 0xc9c4725f, + 0xa81a, + 0x4f56, + { 0x8c, 0x5b, 0xc5, 0x10, 0x39, 0xd6, 0x94, 0xfb } +}; +// -------------------------------------------------------------------------------------------------------------------------------- +// D3D12GetInterface +// +// Retrieve Global D3D12 Interface. +// + +DEFINE_GUID(CLSID_D3D12Debug, 0xf2352aeb, 0xdd84, 0x49fe, 0xb9, 0x7b, 0xa9, 0xdc, 0xfd, 0xcc, 0x1b, 0x4f); +DEFINE_GUID(CLSID_D3D12Tools, 0xe38216b1, 0x3c8c, 0x4833, 0xaa, 0x09, 0x0a, 0x06, 0xb6, 0x5d, 0x96, 0xc8); +DEFINE_GUID(CLSID_D3D12DeviceRemovedExtendedData, 0x4a75bbc4, 0x9ff4, 0x4ad8, 0x9f, 0x18, 0xab, 0xae, 0x84, 0xdc, 0x5f, 0xf2); +DEFINE_GUID(CLSID_D3D12SDKConfiguration, 0x7cda6aca, 0xa03e, 0x49c8, 0x94, 0x58, 0x03, 0x34, 0xd2, 0x0e, 0x07, 0xce); +DEFINE_GUID(CLSID_D3D12DeviceFactory, 0x114863bf, 0xc386, 0x4aee, 0xb3, 0x9d, 0x8f, 0x0b, 0xbb, 0x06, 0x29, 0x55); + +typedef HRESULT (WINAPI* PFN_D3D12_GET_INTERFACE)( _In_ REFCLSID, _In_ REFIID, _COM_Outptr_opt_ void** ); + +HRESULT WINAPI D3D12GetInterface( _In_ REFCLSID rclsid, _In_ REFIID riid, _COM_Outptr_opt_ void** ppvDebug ); + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0057_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0057_v0_0_s_ifspec; + +#ifndef __ID3D12SDKConfiguration_INTERFACE_DEFINED__ +#define __ID3D12SDKConfiguration_INTERFACE_DEFINED__ + +/* interface ID3D12SDKConfiguration */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12SDKConfiguration; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("e9eb5314-33aa-42b2-a718-d77f58b1f1c7") + ID3D12SDKConfiguration : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetSDKVersion( + UINT SDKVersion, + _In_z_ LPCSTR SDKPath) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12SDKConfigurationVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12SDKConfiguration * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12SDKConfiguration * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12SDKConfiguration * This); + + DECLSPEC_XFGVIRT(ID3D12SDKConfiguration, SetSDKVersion) + HRESULT ( STDMETHODCALLTYPE *SetSDKVersion )( + ID3D12SDKConfiguration * This, + UINT SDKVersion, + _In_z_ LPCSTR SDKPath); + + END_INTERFACE + } ID3D12SDKConfigurationVtbl; + + interface ID3D12SDKConfiguration + { + CONST_VTBL struct ID3D12SDKConfigurationVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12SDKConfiguration_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12SDKConfiguration_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12SDKConfiguration_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12SDKConfiguration_SetSDKVersion(This,SDKVersion,SDKPath) \ + ( (This)->lpVtbl -> SetSDKVersion(This,SDKVersion,SDKPath) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12SDKConfiguration_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12SDKConfiguration1_INTERFACE_DEFINED__ +#define __ID3D12SDKConfiguration1_INTERFACE_DEFINED__ + +/* interface ID3D12SDKConfiguration1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12SDKConfiguration1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("8aaf9303-ad25-48b9-9a57-d9c37e009d9f") + ID3D12SDKConfiguration1 : public ID3D12SDKConfiguration + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateDeviceFactory( + UINT SDKVersion, + _In_ LPCSTR SDKPath, + REFIID riid, + _COM_Outptr_ void **ppvFactory) = 0; + + virtual void STDMETHODCALLTYPE FreeUnusedSDKs( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12SDKConfiguration1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12SDKConfiguration1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12SDKConfiguration1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12SDKConfiguration1 * This); + + DECLSPEC_XFGVIRT(ID3D12SDKConfiguration, SetSDKVersion) + HRESULT ( STDMETHODCALLTYPE *SetSDKVersion )( + ID3D12SDKConfiguration1 * This, + UINT SDKVersion, + _In_z_ LPCSTR SDKPath); + + DECLSPEC_XFGVIRT(ID3D12SDKConfiguration1, CreateDeviceFactory) + HRESULT ( STDMETHODCALLTYPE *CreateDeviceFactory )( + ID3D12SDKConfiguration1 * This, + UINT SDKVersion, + _In_ LPCSTR SDKPath, + REFIID riid, + _COM_Outptr_ void **ppvFactory); + + DECLSPEC_XFGVIRT(ID3D12SDKConfiguration1, FreeUnusedSDKs) + void ( STDMETHODCALLTYPE *FreeUnusedSDKs )( + ID3D12SDKConfiguration1 * This); + + END_INTERFACE + } ID3D12SDKConfiguration1Vtbl; + + interface ID3D12SDKConfiguration1 + { + CONST_VTBL struct ID3D12SDKConfiguration1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12SDKConfiguration1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12SDKConfiguration1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12SDKConfiguration1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12SDKConfiguration1_SetSDKVersion(This,SDKVersion,SDKPath) \ + ( (This)->lpVtbl -> SetSDKVersion(This,SDKVersion,SDKPath) ) + + +#define ID3D12SDKConfiguration1_CreateDeviceFactory(This,SDKVersion,SDKPath,riid,ppvFactory) \ + ( (This)->lpVtbl -> CreateDeviceFactory(This,SDKVersion,SDKPath,riid,ppvFactory) ) + +#define ID3D12SDKConfiguration1_FreeUnusedSDKs(This) \ + ( (This)->lpVtbl -> FreeUnusedSDKs(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12SDKConfiguration1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0059 */ +/* [local] */ + +typedef +enum D3D12_DEVICE_FACTORY_FLAGS + { + D3D12_DEVICE_FACTORY_FLAG_NONE = 0, + D3D12_DEVICE_FACTORY_FLAG_ALLOW_RETURNING_EXISTING_DEVICE = 0x1, + D3D12_DEVICE_FACTORY_FLAG_ALLOW_RETURNING_INCOMPATIBLE_EXISTING_DEVICE = 0x2, + D3D12_DEVICE_FACTORY_FLAG_DISALLOW_STORING_NEW_DEVICE_AS_SINGLETON = 0x4 + } D3D12_DEVICE_FACTORY_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_DEVICE_FACTORY_FLAGS ); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0059_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0059_v0_0_s_ifspec; + +#ifndef __ID3D12DeviceFactory_INTERFACE_DEFINED__ +#define __ID3D12DeviceFactory_INTERFACE_DEFINED__ + +/* interface ID3D12DeviceFactory */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DeviceFactory; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("61f307d3-d34e-4e7c-8374-3ba4de23cccb") + ID3D12DeviceFactory : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE InitializeFromGlobalState( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE ApplyToGlobalState( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetFlags( + D3D12_DEVICE_FACTORY_FLAGS flags) = 0; + + virtual D3D12_DEVICE_FACTORY_FLAGS STDMETHODCALLTYPE GetFlags( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetConfigurationInterface( + REFCLSID clsid, + REFIID iid, + _COM_Outptr_ void **ppv) = 0; + + virtual HRESULT STDMETHODCALLTYPE EnableExperimentalFeatures( + UINT NumFeatures, + _In_reads_(NumFeatures) const IID *pIIDs, + _In_reads_opt_(NumFeatures) void *pConfigurationStructs, + _In_reads_opt_(NumFeatures) UINT *pConfigurationStructSizes) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateDevice( + _In_opt_ IUnknown *adapter, + D3D_FEATURE_LEVEL FeatureLevel, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceFactoryVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceFactory * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceFactory * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceFactory * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceFactory, InitializeFromGlobalState) + HRESULT ( STDMETHODCALLTYPE *InitializeFromGlobalState )( + ID3D12DeviceFactory * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceFactory, ApplyToGlobalState) + HRESULT ( STDMETHODCALLTYPE *ApplyToGlobalState )( + ID3D12DeviceFactory * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceFactory, SetFlags) + HRESULT ( STDMETHODCALLTYPE *SetFlags )( + ID3D12DeviceFactory * This, + D3D12_DEVICE_FACTORY_FLAGS flags); + + DECLSPEC_XFGVIRT(ID3D12DeviceFactory, GetFlags) + D3D12_DEVICE_FACTORY_FLAGS ( STDMETHODCALLTYPE *GetFlags )( + ID3D12DeviceFactory * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceFactory, GetConfigurationInterface) + HRESULT ( STDMETHODCALLTYPE *GetConfigurationInterface )( + ID3D12DeviceFactory * This, + REFCLSID clsid, + REFIID iid, + _COM_Outptr_ void **ppv); + + DECLSPEC_XFGVIRT(ID3D12DeviceFactory, EnableExperimentalFeatures) + HRESULT ( STDMETHODCALLTYPE *EnableExperimentalFeatures )( + ID3D12DeviceFactory * This, + UINT NumFeatures, + _In_reads_(NumFeatures) const IID *pIIDs, + _In_reads_opt_(NumFeatures) void *pConfigurationStructs, + _In_reads_opt_(NumFeatures) UINT *pConfigurationStructSizes); + + DECLSPEC_XFGVIRT(ID3D12DeviceFactory, CreateDevice) + HRESULT ( STDMETHODCALLTYPE *CreateDevice )( + ID3D12DeviceFactory * This, + _In_opt_ IUnknown *adapter, + D3D_FEATURE_LEVEL FeatureLevel, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + END_INTERFACE + } ID3D12DeviceFactoryVtbl; + + interface ID3D12DeviceFactory + { + CONST_VTBL struct ID3D12DeviceFactoryVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DeviceFactory_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DeviceFactory_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DeviceFactory_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DeviceFactory_InitializeFromGlobalState(This) \ + ( (This)->lpVtbl -> InitializeFromGlobalState(This) ) + +#define ID3D12DeviceFactory_ApplyToGlobalState(This) \ + ( (This)->lpVtbl -> ApplyToGlobalState(This) ) + +#define ID3D12DeviceFactory_SetFlags(This,flags) \ + ( (This)->lpVtbl -> SetFlags(This,flags) ) + +#define ID3D12DeviceFactory_GetFlags(This) \ + ( (This)->lpVtbl -> GetFlags(This) ) + +#define ID3D12DeviceFactory_GetConfigurationInterface(This,clsid,iid,ppv) \ + ( (This)->lpVtbl -> GetConfigurationInterface(This,clsid,iid,ppv) ) + +#define ID3D12DeviceFactory_EnableExperimentalFeatures(This,NumFeatures,pIIDs,pConfigurationStructs,pConfigurationStructSizes) \ + ( (This)->lpVtbl -> EnableExperimentalFeatures(This,NumFeatures,pIIDs,pConfigurationStructs,pConfigurationStructSizes) ) + +#define ID3D12DeviceFactory_CreateDevice(This,adapter,FeatureLevel,riid,ppvDevice) \ + ( (This)->lpVtbl -> CreateDevice(This,adapter,FeatureLevel,riid,ppvDevice) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DeviceFactory_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0060 */ +/* [local] */ + +typedef +enum D3D12_DEVICE_FLAGS + { + D3D12_DEVICE_FLAG_NONE = 0, + D3D12_DEVICE_FLAG_DEBUG_LAYER_ENABLED = 0x1, + D3D12_DEVICE_FLAG_GPU_BASED_VALIDATION_ENABLED = 0x2, + D3D12_DEVICE_FLAG_SYNCHRONIZED_COMMAND_QUEUE_VALIDATION_DISABLED = 0x4, + D3D12_DEVICE_FLAG_DRED_AUTO_BREADCRUMBS_ENABLED = 0x8, + D3D12_DEVICE_FLAG_DRED_PAGE_FAULT_REPORTING_ENABLED = 0x10, + D3D12_DEVICE_FLAG_DRED_WATSON_REPORTING_ENABLED = 0x20, + D3D12_DEVICE_FLAG_DRED_BREADCRUMB_CONTEXT_ENABLED = 0x40, + D3D12_DEVICE_FLAG_DRED_USE_MARKERS_ONLY_BREADCRUMBS = 0x80, + D3D12_DEVICE_FLAG_SHADER_INSTRUMENTATION_ENABLED = 0x100, + D3D12_DEVICE_FLAG_AUTO_DEBUG_NAME_ENABLED = 0x200, + D3D12_DEVICE_FLAG_FORCE_LEGACY_STATE_VALIDATION = 0x400 + } D3D12_DEVICE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_DEVICE_FLAGS ); +typedef struct D3D12_DEVICE_CONFIGURATION_DESC + { + D3D12_DEVICE_FLAGS Flags; + UINT GpuBasedValidationFlags; + UINT SDKVersion; + UINT NumEnabledExperimentalFeatures; + } D3D12_DEVICE_CONFIGURATION_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0060_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0060_v0_0_s_ifspec; + +#ifndef __ID3D12DeviceConfiguration_INTERFACE_DEFINED__ +#define __ID3D12DeviceConfiguration_INTERFACE_DEFINED__ + +/* interface ID3D12DeviceConfiguration */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DeviceConfiguration; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("78dbf87b-f766-422b-a61c-c8c446bdb9ad") + ID3D12DeviceConfiguration : public IUnknown + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_DEVICE_CONFIGURATION_DESC STDMETHODCALLTYPE GetDesc( void) = 0; +#else + virtual D3D12_DEVICE_CONFIGURATION_DESC *STDMETHODCALLTYPE GetDesc( + D3D12_DEVICE_CONFIGURATION_DESC * RetVal) = 0; +#endif + + virtual HRESULT STDMETHODCALLTYPE GetEnabledExperimentalFeatures( + _Out_writes_(NumGuids) GUID *pGuids, + UINT NumGuids) = 0; + + virtual HRESULT STDMETHODCALLTYPE SerializeVersionedRootSignature( + _In_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *pDesc, + _COM_Outptr_ ID3DBlob **ppResult, + _Always_(_Outptr_opt_result_maybenull_) ID3DBlob **ppError) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateVersionedRootSignatureDeserializer( + _In_reads_bytes_(Size) const void *pBlob, + SIZE_T Size, + REFIID riid, + _COM_Outptr_ void **ppvDeserializer) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceConfigurationVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceConfiguration * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceConfiguration * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceConfiguration * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceConfiguration, GetDesc) +#if !defined(_WIN32) + D3D12_DEVICE_CONFIGURATION_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12DeviceConfiguration * This); + +#else + D3D12_DEVICE_CONFIGURATION_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12DeviceConfiguration * This, + D3D12_DEVICE_CONFIGURATION_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12DeviceConfiguration, GetEnabledExperimentalFeatures) + HRESULT ( STDMETHODCALLTYPE *GetEnabledExperimentalFeatures )( + ID3D12DeviceConfiguration * This, + _Out_writes_(NumGuids) GUID *pGuids, + UINT NumGuids); + + DECLSPEC_XFGVIRT(ID3D12DeviceConfiguration, SerializeVersionedRootSignature) + HRESULT ( STDMETHODCALLTYPE *SerializeVersionedRootSignature )( + ID3D12DeviceConfiguration * This, + _In_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *pDesc, + _COM_Outptr_ ID3DBlob **ppResult, + _Always_(_Outptr_opt_result_maybenull_) ID3DBlob **ppError); + + DECLSPEC_XFGVIRT(ID3D12DeviceConfiguration, CreateVersionedRootSignatureDeserializer) + HRESULT ( STDMETHODCALLTYPE *CreateVersionedRootSignatureDeserializer )( + ID3D12DeviceConfiguration * This, + _In_reads_bytes_(Size) const void *pBlob, + SIZE_T Size, + REFIID riid, + _COM_Outptr_ void **ppvDeserializer); + + END_INTERFACE + } ID3D12DeviceConfigurationVtbl; + + interface ID3D12DeviceConfiguration + { + CONST_VTBL struct ID3D12DeviceConfigurationVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DeviceConfiguration_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DeviceConfiguration_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DeviceConfiguration_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + +#if !defined(_WIN32) + +#define ID3D12DeviceConfiguration_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12DeviceConfiguration_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#define ID3D12DeviceConfiguration_GetEnabledExperimentalFeatures(This,pGuids,NumGuids) \ + ( (This)->lpVtbl -> GetEnabledExperimentalFeatures(This,pGuids,NumGuids) ) + +#define ID3D12DeviceConfiguration_SerializeVersionedRootSignature(This,pDesc,ppResult,ppError) \ + ( (This)->lpVtbl -> SerializeVersionedRootSignature(This,pDesc,ppResult,ppError) ) + +#define ID3D12DeviceConfiguration_CreateVersionedRootSignatureDeserializer(This,pBlob,Size,riid,ppvDeserializer) \ + ( (This)->lpVtbl -> CreateVersionedRootSignatureDeserializer(This,pBlob,Size,riid,ppvDeserializer) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DeviceConfiguration_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0061 */ +/* [local] */ + +typedef +enum D3D12_AXIS_SHADING_RATE + { + D3D12_AXIS_SHADING_RATE_1X = 0, + D3D12_AXIS_SHADING_RATE_2X = 0x1, + D3D12_AXIS_SHADING_RATE_4X = 0x2 + } D3D12_AXIS_SHADING_RATE; + +#define D3D12_SHADING_RATE_X_AXIS_SHIFT 2 +#define D3D12_SHADING_RATE_VALID_MASK 3 +#define D3D12_MAKE_COARSE_SHADING_RATE(x,y) ((x) << D3D12_SHADING_RATE_X_AXIS_SHIFT | (y)) +#define D3D12_GET_COARSE_SHADING_RATE_X_AXIS(x) (((x) >> D3D12_SHADING_RATE_X_AXIS_SHIFT) & D3D12_SHADING_RATE_VALID_MASK) +#define D3D12_GET_COARSE_SHADING_RATE_Y_AXIS(y) ((y) & D3D12_SHADING_RATE_VALID_MASK) +typedef +enum D3D12_SHADING_RATE + { + D3D12_SHADING_RATE_1X1 = 0, + D3D12_SHADING_RATE_1X2 = 0x1, + D3D12_SHADING_RATE_2X1 = 0x4, + D3D12_SHADING_RATE_2X2 = 0x5, + D3D12_SHADING_RATE_2X4 = 0x6, + D3D12_SHADING_RATE_4X2 = 0x9, + D3D12_SHADING_RATE_4X4 = 0xa + } D3D12_SHADING_RATE; + +typedef +enum D3D12_SHADING_RATE_COMBINER + { + D3D12_SHADING_RATE_COMBINER_PASSTHROUGH = 0, + D3D12_SHADING_RATE_COMBINER_OVERRIDE = 1, + D3D12_SHADING_RATE_COMBINER_MIN = 2, + D3D12_SHADING_RATE_COMBINER_MAX = 3, + D3D12_SHADING_RATE_COMBINER_SUM = 4 + } D3D12_SHADING_RATE_COMBINER; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0061_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0061_v0_0_s_ifspec; + +#ifndef __ID3D12GraphicsCommandList5_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList5_INTERFACE_DEFINED__ + +/* interface ID3D12GraphicsCommandList5 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12GraphicsCommandList5; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("55050859-4024-474c-87f5-6472eaee44ea") + ID3D12GraphicsCommandList5 : public ID3D12GraphicsCommandList4 + { + public: + virtual void STDMETHODCALLTYPE RSSetShadingRate( + _In_ D3D12_SHADING_RATE baseShadingRate, + _In_reads_opt_(D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT) const D3D12_SHADING_RATE_COMBINER *combiners) = 0; + + virtual void STDMETHODCALLTYPE RSSetShadingRateImage( + _In_opt_ ID3D12Resource *shadingRateImage) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12GraphicsCommandList5Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12GraphicsCommandList5 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12GraphicsCommandList5 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12GraphicsCommandList5 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12GraphicsCommandList5 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12GraphicsCommandList5 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12GraphicsCommandList5 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12GraphicsCommandList5 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12GraphicsCommandList5 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12GraphicsCommandList5 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12GraphicsCommandList5 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12CommandAllocator *pAllocator, + _In_opt_ ID3D12PipelineState *pInitialState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12GraphicsCommandList5 * This, + _In_opt_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT VertexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT IndexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartIndexLocation, + _In_ INT BaseVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) + void ( STDMETHODCALLTYPE *Dispatch )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) + void ( STDMETHODCALLTYPE *CopyBufferRegion )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT64 NumBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) + void ( STDMETHODCALLTYPE *CopyTextureRegion )( + ID3D12GraphicsCommandList5 * This, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, + UINT DstX, + UINT DstY, + UINT DstZ, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12Resource *pDstResource, + _In_ ID3D12Resource *pSrcResource); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) + void ( STDMETHODCALLTYPE *CopyTiles )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12Resource *pTiledResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, + _In_ ID3D12Resource *pBuffer, + UINT64 BufferStartOffsetInBytes, + D3D12_TILE_COPY_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_ DXGI_FORMAT Format); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D12GraphicsCommandList5 * This, + _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D12GraphicsCommandList5 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D12GraphicsCommandList5 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + _In_reads_( NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) + void ( STDMETHODCALLTYPE *OMSetBlendFactor )( + ID3D12GraphicsCommandList5 * This, + _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) + void ( STDMETHODCALLTYPE *OMSetStencilRef )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT StencilRef); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) + void ( STDMETHODCALLTYPE *SetPipelineState )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) + void ( STDMETHODCALLTYPE *ExecuteBundle )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12GraphicsCommandList *pCommandList); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) + void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT NumDescriptorHeaps, + _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) + void ( STDMETHODCALLTYPE *SetComputeRootSignature )( + ID3D12GraphicsCommandList5 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) + void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( + ID3D12GraphicsCommandList5 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D12GraphicsCommandList5 * This, + _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT NumRenderTargetDescriptors, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, + _In_ BOOL RTsSingleHandleToDescriptorRange, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D12GraphicsCommandList5 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, + _In_ D3D12_CLEAR_FLAGS ClearFlags, + _In_ FLOAT Depth, + _In_ UINT8 Stencil, + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D12GraphicsCommandList5 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, + _In_ const FLOAT ColorRGBA[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( + ID3D12GraphicsCommandList5 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const UINT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( + ID3D12GraphicsCommandList5 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const FLOAT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12GraphicsCommandList5 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12GraphicsCommandList5 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12GraphicsCommandList5 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12GraphicsCommandList5 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) + void ( STDMETHODCALLTYPE *ExecuteIndirect )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12CommandSignature *pCommandSignature, + _In_ UINT MaxCommandCount, + _In_ ID3D12Resource *pArgumentBuffer, + _In_ UINT64 ArgumentBufferOffset, + _In_opt_ ID3D12Resource *pCountBuffer, + _In_ UINT64 CountBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds) + void ( STDMETHODCALLTYPE *OMSetDepthBounds )( + ID3D12GraphicsCommandList5 * This, + _In_ FLOAT Min, + _In_ FLOAT Max); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions) + void ( STDMETHODCALLTYPE *SetSamplePositions )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT NumSamplesPerPixel, + _In_ UINT NumPixels, + _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion) + void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ UINT DstX, + _In_ UINT DstY, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_opt_ D3D12_RECT *pSrcRect, + _In_ DXGI_FORMAT Format, + _In_ D3D12_RESOLVE_MODE ResolveMode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask) + void ( STDMETHODCALLTYPE *SetViewInstanceMask )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT Mask); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12GraphicsCommandList5 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12GraphicsCommandList5 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BeginRenderPass) + void ( STDMETHODCALLTYPE *BeginRenderPass )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT NumRenderTargets, + _In_reads_opt_(NumRenderTargets) const D3D12_RENDER_PASS_RENDER_TARGET_DESC *pRenderTargets, + _In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil, + D3D12_RENDER_PASS_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EndRenderPass) + void ( STDMETHODCALLTYPE *EndRenderPass )( + ID3D12GraphicsCommandList5 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, InitializeMetaCommand) + void ( STDMETHODCALLTYPE *InitializeMetaCommand )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData, + _In_ SIZE_T InitializationParametersDataSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, ExecuteMetaCommand) + void ( STDMETHODCALLTYPE *ExecuteMetaCommand )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData, + _In_ SIZE_T ExecutionParametersDataSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BuildRaytracingAccelerationStructure) + void ( STDMETHODCALLTYPE *BuildRaytracingAccelerationStructure )( + ID3D12GraphicsCommandList5 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc, + _In_ UINT NumPostbuildInfoDescs, + _In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EmitRaytracingAccelerationStructurePostbuildInfo) + void ( STDMETHODCALLTYPE *EmitRaytracingAccelerationStructurePostbuildInfo )( + ID3D12GraphicsCommandList5 * This, + _In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc, + _In_ UINT NumSourceAccelerationStructures, + _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, CopyRaytracingAccelerationStructure) + void ( STDMETHODCALLTYPE *CopyRaytracingAccelerationStructure )( + ID3D12GraphicsCommandList5 * This, + _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData, + _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData, + _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, SetPipelineState1) + void ( STDMETHODCALLTYPE *SetPipelineState1 )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12StateObject *pStateObject); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, DispatchRays) + void ( STDMETHODCALLTYPE *DispatchRays )( + ID3D12GraphicsCommandList5 * This, + _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRate) + void ( STDMETHODCALLTYPE *RSSetShadingRate )( + ID3D12GraphicsCommandList5 * This, + _In_ D3D12_SHADING_RATE baseShadingRate, + _In_reads_opt_(D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT) const D3D12_SHADING_RATE_COMBINER *combiners); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRateImage) + void ( STDMETHODCALLTYPE *RSSetShadingRateImage )( + ID3D12GraphicsCommandList5 * This, + _In_opt_ ID3D12Resource *shadingRateImage); + + END_INTERFACE + } ID3D12GraphicsCommandList5Vtbl; + + interface ID3D12GraphicsCommandList5 + { + CONST_VTBL struct ID3D12GraphicsCommandList5Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12GraphicsCommandList5_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12GraphicsCommandList5_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12GraphicsCommandList5_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12GraphicsCommandList5_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12GraphicsCommandList5_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12GraphicsCommandList5_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12GraphicsCommandList5_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12GraphicsCommandList5_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12GraphicsCommandList5_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12GraphicsCommandList5_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12GraphicsCommandList5_Reset(This,pAllocator,pInitialState) \ + ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) + +#define ID3D12GraphicsCommandList5_ClearState(This,pPipelineState) \ + ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList5_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList5_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList5_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + +#define ID3D12GraphicsCommandList5_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ + ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) + +#define ID3D12GraphicsCommandList5_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ + ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) + +#define ID3D12GraphicsCommandList5_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) + +#define ID3D12GraphicsCommandList5_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ + ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) + +#define ID3D12GraphicsCommandList5_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) + +#define ID3D12GraphicsCommandList5_IASetPrimitiveTopology(This,PrimitiveTopology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) + +#define ID3D12GraphicsCommandList5_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) + +#define ID3D12GraphicsCommandList5_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList5_OMSetBlendFactor(This,BlendFactor) \ + ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) + +#define ID3D12GraphicsCommandList5_OMSetStencilRef(This,StencilRef) \ + ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) + +#define ID3D12GraphicsCommandList5_SetPipelineState(This,pPipelineState) \ + ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList5_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12GraphicsCommandList5_ExecuteBundle(This,pCommandList) \ + ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) + +#define ID3D12GraphicsCommandList5_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ + ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) + +#define ID3D12GraphicsCommandList5_SetComputeRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList5_SetGraphicsRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList5_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList5_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList5_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList5_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList5_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList5_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList5_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList5_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList5_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList5_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList5_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList5_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList5_IASetIndexBuffer(This,pView) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) + +#define ID3D12GraphicsCommandList5_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList5_SOSetTargets(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList5_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) + +#define ID3D12GraphicsCommandList5_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList5_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList5_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList5_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList5_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12GraphicsCommandList5_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList5_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList5_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12GraphicsCommandList5_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12GraphicsCommandList5_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList5_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList5_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12GraphicsCommandList5_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ + ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) + + +#define ID3D12GraphicsCommandList5_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList5_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList5_OMSetDepthBounds(This,Min,Max) \ + ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) ) + +#define ID3D12GraphicsCommandList5_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ + ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) ) + +#define ID3D12GraphicsCommandList5_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ + ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) ) + +#define ID3D12GraphicsCommandList5_SetViewInstanceMask(This,Mask) \ + ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) ) + + +#define ID3D12GraphicsCommandList5_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + + +#define ID3D12GraphicsCommandList5_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + + +#define ID3D12GraphicsCommandList5_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \ + ( (This)->lpVtbl -> BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) ) + +#define ID3D12GraphicsCommandList5_EndRenderPass(This) \ + ( (This)->lpVtbl -> EndRenderPass(This) ) + +#define ID3D12GraphicsCommandList5_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \ + ( (This)->lpVtbl -> InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) ) + +#define ID3D12GraphicsCommandList5_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) ) + +#define ID3D12GraphicsCommandList5_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \ + ( (This)->lpVtbl -> BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) ) + +#define ID3D12GraphicsCommandList5_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \ + ( (This)->lpVtbl -> EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) ) + +#define ID3D12GraphicsCommandList5_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \ + ( (This)->lpVtbl -> CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) ) + +#define ID3D12GraphicsCommandList5_SetPipelineState1(This,pStateObject) \ + ( (This)->lpVtbl -> SetPipelineState1(This,pStateObject) ) + +#define ID3D12GraphicsCommandList5_DispatchRays(This,pDesc) \ + ( (This)->lpVtbl -> DispatchRays(This,pDesc) ) + + +#define ID3D12GraphicsCommandList5_RSSetShadingRate(This,baseShadingRate,combiners) \ + ( (This)->lpVtbl -> RSSetShadingRate(This,baseShadingRate,combiners) ) + +#define ID3D12GraphicsCommandList5_RSSetShadingRateImage(This,shadingRateImage) \ + ( (This)->lpVtbl -> RSSetShadingRateImage(This,shadingRateImage) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12GraphicsCommandList5_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0062 */ +/* [local] */ + +typedef struct D3D12_DISPATCH_MESH_ARGUMENTS + { + UINT ThreadGroupCountX; + UINT ThreadGroupCountY; + UINT ThreadGroupCountZ; + } D3D12_DISPATCH_MESH_ARGUMENTS; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0062_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0062_v0_0_s_ifspec; + +#ifndef __ID3D12GraphicsCommandList6_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList6_INTERFACE_DEFINED__ + +/* interface ID3D12GraphicsCommandList6 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12GraphicsCommandList6; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("c3827890-e548-4cfa-96cf-5689a9370f80") + ID3D12GraphicsCommandList6 : public ID3D12GraphicsCommandList5 + { + public: + virtual void STDMETHODCALLTYPE DispatchMesh( + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12GraphicsCommandList6Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12GraphicsCommandList6 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12GraphicsCommandList6 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12GraphicsCommandList6 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12GraphicsCommandList6 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12GraphicsCommandList6 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12GraphicsCommandList6 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12GraphicsCommandList6 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12GraphicsCommandList6 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12GraphicsCommandList6 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12GraphicsCommandList6 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12CommandAllocator *pAllocator, + _In_opt_ ID3D12PipelineState *pInitialState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12GraphicsCommandList6 * This, + _In_opt_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT VertexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT IndexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartIndexLocation, + _In_ INT BaseVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) + void ( STDMETHODCALLTYPE *Dispatch )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) + void ( STDMETHODCALLTYPE *CopyBufferRegion )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT64 NumBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) + void ( STDMETHODCALLTYPE *CopyTextureRegion )( + ID3D12GraphicsCommandList6 * This, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, + UINT DstX, + UINT DstY, + UINT DstZ, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12Resource *pDstResource, + _In_ ID3D12Resource *pSrcResource); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) + void ( STDMETHODCALLTYPE *CopyTiles )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12Resource *pTiledResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, + _In_ ID3D12Resource *pBuffer, + UINT64 BufferStartOffsetInBytes, + D3D12_TILE_COPY_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_ DXGI_FORMAT Format); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D12GraphicsCommandList6 * This, + _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D12GraphicsCommandList6 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D12GraphicsCommandList6 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + _In_reads_( NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) + void ( STDMETHODCALLTYPE *OMSetBlendFactor )( + ID3D12GraphicsCommandList6 * This, + _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) + void ( STDMETHODCALLTYPE *OMSetStencilRef )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT StencilRef); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) + void ( STDMETHODCALLTYPE *SetPipelineState )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) + void ( STDMETHODCALLTYPE *ExecuteBundle )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12GraphicsCommandList *pCommandList); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) + void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT NumDescriptorHeaps, + _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) + void ( STDMETHODCALLTYPE *SetComputeRootSignature )( + ID3D12GraphicsCommandList6 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) + void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( + ID3D12GraphicsCommandList6 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D12GraphicsCommandList6 * This, + _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT NumRenderTargetDescriptors, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, + _In_ BOOL RTsSingleHandleToDescriptorRange, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D12GraphicsCommandList6 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, + _In_ D3D12_CLEAR_FLAGS ClearFlags, + _In_ FLOAT Depth, + _In_ UINT8 Stencil, + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D12GraphicsCommandList6 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, + _In_ const FLOAT ColorRGBA[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( + ID3D12GraphicsCommandList6 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const UINT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( + ID3D12GraphicsCommandList6 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const FLOAT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12GraphicsCommandList6 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12GraphicsCommandList6 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12GraphicsCommandList6 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12GraphicsCommandList6 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) + void ( STDMETHODCALLTYPE *ExecuteIndirect )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12CommandSignature *pCommandSignature, + _In_ UINT MaxCommandCount, + _In_ ID3D12Resource *pArgumentBuffer, + _In_ UINT64 ArgumentBufferOffset, + _In_opt_ ID3D12Resource *pCountBuffer, + _In_ UINT64 CountBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds) + void ( STDMETHODCALLTYPE *OMSetDepthBounds )( + ID3D12GraphicsCommandList6 * This, + _In_ FLOAT Min, + _In_ FLOAT Max); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions) + void ( STDMETHODCALLTYPE *SetSamplePositions )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT NumSamplesPerPixel, + _In_ UINT NumPixels, + _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion) + void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ UINT DstX, + _In_ UINT DstY, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_opt_ D3D12_RECT *pSrcRect, + _In_ DXGI_FORMAT Format, + _In_ D3D12_RESOLVE_MODE ResolveMode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask) + void ( STDMETHODCALLTYPE *SetViewInstanceMask )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT Mask); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12GraphicsCommandList6 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12GraphicsCommandList6 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BeginRenderPass) + void ( STDMETHODCALLTYPE *BeginRenderPass )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT NumRenderTargets, + _In_reads_opt_(NumRenderTargets) const D3D12_RENDER_PASS_RENDER_TARGET_DESC *pRenderTargets, + _In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil, + D3D12_RENDER_PASS_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EndRenderPass) + void ( STDMETHODCALLTYPE *EndRenderPass )( + ID3D12GraphicsCommandList6 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, InitializeMetaCommand) + void ( STDMETHODCALLTYPE *InitializeMetaCommand )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData, + _In_ SIZE_T InitializationParametersDataSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, ExecuteMetaCommand) + void ( STDMETHODCALLTYPE *ExecuteMetaCommand )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData, + _In_ SIZE_T ExecutionParametersDataSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BuildRaytracingAccelerationStructure) + void ( STDMETHODCALLTYPE *BuildRaytracingAccelerationStructure )( + ID3D12GraphicsCommandList6 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc, + _In_ UINT NumPostbuildInfoDescs, + _In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EmitRaytracingAccelerationStructurePostbuildInfo) + void ( STDMETHODCALLTYPE *EmitRaytracingAccelerationStructurePostbuildInfo )( + ID3D12GraphicsCommandList6 * This, + _In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc, + _In_ UINT NumSourceAccelerationStructures, + _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, CopyRaytracingAccelerationStructure) + void ( STDMETHODCALLTYPE *CopyRaytracingAccelerationStructure )( + ID3D12GraphicsCommandList6 * This, + _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData, + _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData, + _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, SetPipelineState1) + void ( STDMETHODCALLTYPE *SetPipelineState1 )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12StateObject *pStateObject); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, DispatchRays) + void ( STDMETHODCALLTYPE *DispatchRays )( + ID3D12GraphicsCommandList6 * This, + _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRate) + void ( STDMETHODCALLTYPE *RSSetShadingRate )( + ID3D12GraphicsCommandList6 * This, + _In_ D3D12_SHADING_RATE baseShadingRate, + _In_reads_opt_(D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT) const D3D12_SHADING_RATE_COMBINER *combiners); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRateImage) + void ( STDMETHODCALLTYPE *RSSetShadingRateImage )( + ID3D12GraphicsCommandList6 * This, + _In_opt_ ID3D12Resource *shadingRateImage); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList6, DispatchMesh) + void ( STDMETHODCALLTYPE *DispatchMesh )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + + END_INTERFACE + } ID3D12GraphicsCommandList6Vtbl; + + interface ID3D12GraphicsCommandList6 + { + CONST_VTBL struct ID3D12GraphicsCommandList6Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12GraphicsCommandList6_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12GraphicsCommandList6_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12GraphicsCommandList6_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12GraphicsCommandList6_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12GraphicsCommandList6_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12GraphicsCommandList6_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12GraphicsCommandList6_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12GraphicsCommandList6_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12GraphicsCommandList6_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12GraphicsCommandList6_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12GraphicsCommandList6_Reset(This,pAllocator,pInitialState) \ + ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) + +#define ID3D12GraphicsCommandList6_ClearState(This,pPipelineState) \ + ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList6_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList6_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList6_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + +#define ID3D12GraphicsCommandList6_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ + ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) + +#define ID3D12GraphicsCommandList6_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ + ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) + +#define ID3D12GraphicsCommandList6_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) + +#define ID3D12GraphicsCommandList6_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ + ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) + +#define ID3D12GraphicsCommandList6_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) + +#define ID3D12GraphicsCommandList6_IASetPrimitiveTopology(This,PrimitiveTopology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) + +#define ID3D12GraphicsCommandList6_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) + +#define ID3D12GraphicsCommandList6_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList6_OMSetBlendFactor(This,BlendFactor) \ + ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) + +#define ID3D12GraphicsCommandList6_OMSetStencilRef(This,StencilRef) \ + ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) + +#define ID3D12GraphicsCommandList6_SetPipelineState(This,pPipelineState) \ + ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList6_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12GraphicsCommandList6_ExecuteBundle(This,pCommandList) \ + ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) + +#define ID3D12GraphicsCommandList6_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ + ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) + +#define ID3D12GraphicsCommandList6_SetComputeRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList6_SetGraphicsRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList6_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList6_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList6_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList6_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList6_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList6_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList6_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList6_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList6_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList6_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList6_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList6_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList6_IASetIndexBuffer(This,pView) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) + +#define ID3D12GraphicsCommandList6_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList6_SOSetTargets(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList6_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) + +#define ID3D12GraphicsCommandList6_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList6_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList6_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList6_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList6_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12GraphicsCommandList6_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList6_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList6_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12GraphicsCommandList6_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12GraphicsCommandList6_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList6_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList6_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12GraphicsCommandList6_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ + ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) + + +#define ID3D12GraphicsCommandList6_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList6_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList6_OMSetDepthBounds(This,Min,Max) \ + ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) ) + +#define ID3D12GraphicsCommandList6_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ + ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) ) + +#define ID3D12GraphicsCommandList6_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ + ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) ) + +#define ID3D12GraphicsCommandList6_SetViewInstanceMask(This,Mask) \ + ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) ) + + +#define ID3D12GraphicsCommandList6_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + + +#define ID3D12GraphicsCommandList6_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + + +#define ID3D12GraphicsCommandList6_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \ + ( (This)->lpVtbl -> BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) ) + +#define ID3D12GraphicsCommandList6_EndRenderPass(This) \ + ( (This)->lpVtbl -> EndRenderPass(This) ) + +#define ID3D12GraphicsCommandList6_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \ + ( (This)->lpVtbl -> InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) ) + +#define ID3D12GraphicsCommandList6_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) ) + +#define ID3D12GraphicsCommandList6_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \ + ( (This)->lpVtbl -> BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) ) + +#define ID3D12GraphicsCommandList6_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \ + ( (This)->lpVtbl -> EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) ) + +#define ID3D12GraphicsCommandList6_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \ + ( (This)->lpVtbl -> CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) ) + +#define ID3D12GraphicsCommandList6_SetPipelineState1(This,pStateObject) \ + ( (This)->lpVtbl -> SetPipelineState1(This,pStateObject) ) + +#define ID3D12GraphicsCommandList6_DispatchRays(This,pDesc) \ + ( (This)->lpVtbl -> DispatchRays(This,pDesc) ) + + +#define ID3D12GraphicsCommandList6_RSSetShadingRate(This,baseShadingRate,combiners) \ + ( (This)->lpVtbl -> RSSetShadingRate(This,baseShadingRate,combiners) ) + +#define ID3D12GraphicsCommandList6_RSSetShadingRateImage(This,shadingRateImage) \ + ( (This)->lpVtbl -> RSSetShadingRateImage(This,shadingRateImage) ) + + +#define ID3D12GraphicsCommandList6_DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12GraphicsCommandList6_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList7_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList7_INTERFACE_DEFINED__ + +/* interface ID3D12GraphicsCommandList7 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12GraphicsCommandList7; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("dd171223-8b61-4769-90e3-160ccde4e2c1") + ID3D12GraphicsCommandList7 : public ID3D12GraphicsCommandList6 + { + public: + virtual void STDMETHODCALLTYPE Barrier( + UINT32 NumBarrierGroups, + _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12GraphicsCommandList7Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12GraphicsCommandList7 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12GraphicsCommandList7 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12GraphicsCommandList7 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12GraphicsCommandList7 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12GraphicsCommandList7 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12GraphicsCommandList7 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12GraphicsCommandList7 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12GraphicsCommandList7 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12GraphicsCommandList7 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12GraphicsCommandList7 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12CommandAllocator *pAllocator, + _In_opt_ ID3D12PipelineState *pInitialState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12GraphicsCommandList7 * This, + _In_opt_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT VertexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT IndexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartIndexLocation, + _In_ INT BaseVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) + void ( STDMETHODCALLTYPE *Dispatch )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) + void ( STDMETHODCALLTYPE *CopyBufferRegion )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT64 NumBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) + void ( STDMETHODCALLTYPE *CopyTextureRegion )( + ID3D12GraphicsCommandList7 * This, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, + UINT DstX, + UINT DstY, + UINT DstZ, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12Resource *pDstResource, + _In_ ID3D12Resource *pSrcResource); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) + void ( STDMETHODCALLTYPE *CopyTiles )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12Resource *pTiledResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, + _In_ ID3D12Resource *pBuffer, + UINT64 BufferStartOffsetInBytes, + D3D12_TILE_COPY_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_ DXGI_FORMAT Format); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D12GraphicsCommandList7 * This, + _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D12GraphicsCommandList7 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D12GraphicsCommandList7 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + _In_reads_( NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) + void ( STDMETHODCALLTYPE *OMSetBlendFactor )( + ID3D12GraphicsCommandList7 * This, + _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) + void ( STDMETHODCALLTYPE *OMSetStencilRef )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT StencilRef); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) + void ( STDMETHODCALLTYPE *SetPipelineState )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) + void ( STDMETHODCALLTYPE *ExecuteBundle )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12GraphicsCommandList *pCommandList); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) + void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT NumDescriptorHeaps, + _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) + void ( STDMETHODCALLTYPE *SetComputeRootSignature )( + ID3D12GraphicsCommandList7 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) + void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( + ID3D12GraphicsCommandList7 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D12GraphicsCommandList7 * This, + _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT NumRenderTargetDescriptors, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, + _In_ BOOL RTsSingleHandleToDescriptorRange, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D12GraphicsCommandList7 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, + _In_ D3D12_CLEAR_FLAGS ClearFlags, + _In_ FLOAT Depth, + _In_ UINT8 Stencil, + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D12GraphicsCommandList7 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, + _In_ const FLOAT ColorRGBA[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( + ID3D12GraphicsCommandList7 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const UINT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( + ID3D12GraphicsCommandList7 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const FLOAT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12GraphicsCommandList7 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12GraphicsCommandList7 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12GraphicsCommandList7 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12GraphicsCommandList7 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) + void ( STDMETHODCALLTYPE *ExecuteIndirect )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12CommandSignature *pCommandSignature, + _In_ UINT MaxCommandCount, + _In_ ID3D12Resource *pArgumentBuffer, + _In_ UINT64 ArgumentBufferOffset, + _In_opt_ ID3D12Resource *pCountBuffer, + _In_ UINT64 CountBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds) + void ( STDMETHODCALLTYPE *OMSetDepthBounds )( + ID3D12GraphicsCommandList7 * This, + _In_ FLOAT Min, + _In_ FLOAT Max); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions) + void ( STDMETHODCALLTYPE *SetSamplePositions )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT NumSamplesPerPixel, + _In_ UINT NumPixels, + _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion) + void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ UINT DstX, + _In_ UINT DstY, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_opt_ D3D12_RECT *pSrcRect, + _In_ DXGI_FORMAT Format, + _In_ D3D12_RESOLVE_MODE ResolveMode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask) + void ( STDMETHODCALLTYPE *SetViewInstanceMask )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT Mask); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12GraphicsCommandList7 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12GraphicsCommandList7 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BeginRenderPass) + void ( STDMETHODCALLTYPE *BeginRenderPass )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT NumRenderTargets, + _In_reads_opt_(NumRenderTargets) const D3D12_RENDER_PASS_RENDER_TARGET_DESC *pRenderTargets, + _In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil, + D3D12_RENDER_PASS_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EndRenderPass) + void ( STDMETHODCALLTYPE *EndRenderPass )( + ID3D12GraphicsCommandList7 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, InitializeMetaCommand) + void ( STDMETHODCALLTYPE *InitializeMetaCommand )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData, + _In_ SIZE_T InitializationParametersDataSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, ExecuteMetaCommand) + void ( STDMETHODCALLTYPE *ExecuteMetaCommand )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData, + _In_ SIZE_T ExecutionParametersDataSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BuildRaytracingAccelerationStructure) + void ( STDMETHODCALLTYPE *BuildRaytracingAccelerationStructure )( + ID3D12GraphicsCommandList7 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc, + _In_ UINT NumPostbuildInfoDescs, + _In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EmitRaytracingAccelerationStructurePostbuildInfo) + void ( STDMETHODCALLTYPE *EmitRaytracingAccelerationStructurePostbuildInfo )( + ID3D12GraphicsCommandList7 * This, + _In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc, + _In_ UINT NumSourceAccelerationStructures, + _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, CopyRaytracingAccelerationStructure) + void ( STDMETHODCALLTYPE *CopyRaytracingAccelerationStructure )( + ID3D12GraphicsCommandList7 * This, + _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData, + _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData, + _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, SetPipelineState1) + void ( STDMETHODCALLTYPE *SetPipelineState1 )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12StateObject *pStateObject); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, DispatchRays) + void ( STDMETHODCALLTYPE *DispatchRays )( + ID3D12GraphicsCommandList7 * This, + _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRate) + void ( STDMETHODCALLTYPE *RSSetShadingRate )( + ID3D12GraphicsCommandList7 * This, + _In_ D3D12_SHADING_RATE baseShadingRate, + _In_reads_opt_(D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT) const D3D12_SHADING_RATE_COMBINER *combiners); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRateImage) + void ( STDMETHODCALLTYPE *RSSetShadingRateImage )( + ID3D12GraphicsCommandList7 * This, + _In_opt_ ID3D12Resource *shadingRateImage); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList6, DispatchMesh) + void ( STDMETHODCALLTYPE *DispatchMesh )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList7, Barrier) + void ( STDMETHODCALLTYPE *Barrier )( + ID3D12GraphicsCommandList7 * This, + UINT32 NumBarrierGroups, + _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups); + + END_INTERFACE + } ID3D12GraphicsCommandList7Vtbl; + + interface ID3D12GraphicsCommandList7 + { + CONST_VTBL struct ID3D12GraphicsCommandList7Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12GraphicsCommandList7_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12GraphicsCommandList7_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12GraphicsCommandList7_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12GraphicsCommandList7_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12GraphicsCommandList7_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12GraphicsCommandList7_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12GraphicsCommandList7_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12GraphicsCommandList7_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12GraphicsCommandList7_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12GraphicsCommandList7_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12GraphicsCommandList7_Reset(This,pAllocator,pInitialState) \ + ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) + +#define ID3D12GraphicsCommandList7_ClearState(This,pPipelineState) \ + ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList7_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList7_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList7_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + +#define ID3D12GraphicsCommandList7_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ + ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) + +#define ID3D12GraphicsCommandList7_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ + ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) + +#define ID3D12GraphicsCommandList7_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) + +#define ID3D12GraphicsCommandList7_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ + ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) + +#define ID3D12GraphicsCommandList7_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) + +#define ID3D12GraphicsCommandList7_IASetPrimitiveTopology(This,PrimitiveTopology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) + +#define ID3D12GraphicsCommandList7_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) + +#define ID3D12GraphicsCommandList7_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList7_OMSetBlendFactor(This,BlendFactor) \ + ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) + +#define ID3D12GraphicsCommandList7_OMSetStencilRef(This,StencilRef) \ + ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) + +#define ID3D12GraphicsCommandList7_SetPipelineState(This,pPipelineState) \ + ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList7_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12GraphicsCommandList7_ExecuteBundle(This,pCommandList) \ + ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) + +#define ID3D12GraphicsCommandList7_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ + ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) + +#define ID3D12GraphicsCommandList7_SetComputeRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList7_SetGraphicsRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList7_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList7_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList7_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList7_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList7_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList7_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList7_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList7_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList7_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList7_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList7_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList7_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList7_IASetIndexBuffer(This,pView) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) + +#define ID3D12GraphicsCommandList7_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList7_SOSetTargets(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList7_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) + +#define ID3D12GraphicsCommandList7_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList7_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList7_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList7_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList7_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12GraphicsCommandList7_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList7_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList7_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12GraphicsCommandList7_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12GraphicsCommandList7_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList7_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList7_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12GraphicsCommandList7_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ + ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) + + +#define ID3D12GraphicsCommandList7_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList7_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList7_OMSetDepthBounds(This,Min,Max) \ + ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) ) + +#define ID3D12GraphicsCommandList7_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ + ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) ) + +#define ID3D12GraphicsCommandList7_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ + ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) ) + +#define ID3D12GraphicsCommandList7_SetViewInstanceMask(This,Mask) \ + ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) ) + + +#define ID3D12GraphicsCommandList7_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + + +#define ID3D12GraphicsCommandList7_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + + +#define ID3D12GraphicsCommandList7_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \ + ( (This)->lpVtbl -> BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) ) + +#define ID3D12GraphicsCommandList7_EndRenderPass(This) \ + ( (This)->lpVtbl -> EndRenderPass(This) ) + +#define ID3D12GraphicsCommandList7_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \ + ( (This)->lpVtbl -> InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) ) + +#define ID3D12GraphicsCommandList7_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) ) + +#define ID3D12GraphicsCommandList7_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \ + ( (This)->lpVtbl -> BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) ) + +#define ID3D12GraphicsCommandList7_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \ + ( (This)->lpVtbl -> EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) ) + +#define ID3D12GraphicsCommandList7_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \ + ( (This)->lpVtbl -> CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) ) + +#define ID3D12GraphicsCommandList7_SetPipelineState1(This,pStateObject) \ + ( (This)->lpVtbl -> SetPipelineState1(This,pStateObject) ) + +#define ID3D12GraphicsCommandList7_DispatchRays(This,pDesc) \ + ( (This)->lpVtbl -> DispatchRays(This,pDesc) ) + + +#define ID3D12GraphicsCommandList7_RSSetShadingRate(This,baseShadingRate,combiners) \ + ( (This)->lpVtbl -> RSSetShadingRate(This,baseShadingRate,combiners) ) + +#define ID3D12GraphicsCommandList7_RSSetShadingRateImage(This,shadingRateImage) \ + ( (This)->lpVtbl -> RSSetShadingRateImage(This,shadingRateImage) ) + + +#define ID3D12GraphicsCommandList7_DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + + +#define ID3D12GraphicsCommandList7_Barrier(This,NumBarrierGroups,pBarrierGroups) \ + ( (This)->lpVtbl -> Barrier(This,NumBarrierGroups,pBarrierGroups) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12GraphicsCommandList7_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList8_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList8_INTERFACE_DEFINED__ + +/* interface ID3D12GraphicsCommandList8 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12GraphicsCommandList8; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("ee936ef9-599d-4d28-938e-23c4ad05ce51") + ID3D12GraphicsCommandList8 : public ID3D12GraphicsCommandList7 + { + public: + virtual void STDMETHODCALLTYPE OMSetFrontAndBackStencilRef( + _In_ UINT FrontStencilRef, + _In_ UINT BackStencilRef) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12GraphicsCommandList8Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12GraphicsCommandList8 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12GraphicsCommandList8 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12GraphicsCommandList8 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12GraphicsCommandList8 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12GraphicsCommandList8 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12GraphicsCommandList8 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12GraphicsCommandList8 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12GraphicsCommandList8 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12GraphicsCommandList8 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12GraphicsCommandList8 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12CommandAllocator *pAllocator, + _In_opt_ ID3D12PipelineState *pInitialState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12GraphicsCommandList8 * This, + _In_opt_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT VertexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT IndexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartIndexLocation, + _In_ INT BaseVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) + void ( STDMETHODCALLTYPE *Dispatch )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) + void ( STDMETHODCALLTYPE *CopyBufferRegion )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT64 NumBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) + void ( STDMETHODCALLTYPE *CopyTextureRegion )( + ID3D12GraphicsCommandList8 * This, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, + UINT DstX, + UINT DstY, + UINT DstZ, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12Resource *pDstResource, + _In_ ID3D12Resource *pSrcResource); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) + void ( STDMETHODCALLTYPE *CopyTiles )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12Resource *pTiledResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, + _In_ ID3D12Resource *pBuffer, + UINT64 BufferStartOffsetInBytes, + D3D12_TILE_COPY_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_ DXGI_FORMAT Format); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D12GraphicsCommandList8 * This, + _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D12GraphicsCommandList8 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D12GraphicsCommandList8 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + _In_reads_( NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) + void ( STDMETHODCALLTYPE *OMSetBlendFactor )( + ID3D12GraphicsCommandList8 * This, + _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) + void ( STDMETHODCALLTYPE *OMSetStencilRef )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT StencilRef); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) + void ( STDMETHODCALLTYPE *SetPipelineState )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) + void ( STDMETHODCALLTYPE *ExecuteBundle )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12GraphicsCommandList *pCommandList); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) + void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT NumDescriptorHeaps, + _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) + void ( STDMETHODCALLTYPE *SetComputeRootSignature )( + ID3D12GraphicsCommandList8 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) + void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( + ID3D12GraphicsCommandList8 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D12GraphicsCommandList8 * This, + _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT NumRenderTargetDescriptors, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, + _In_ BOOL RTsSingleHandleToDescriptorRange, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D12GraphicsCommandList8 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, + _In_ D3D12_CLEAR_FLAGS ClearFlags, + _In_ FLOAT Depth, + _In_ UINT8 Stencil, + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D12GraphicsCommandList8 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, + _In_ const FLOAT ColorRGBA[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( + ID3D12GraphicsCommandList8 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const UINT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( + ID3D12GraphicsCommandList8 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const FLOAT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12GraphicsCommandList8 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12GraphicsCommandList8 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12GraphicsCommandList8 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12GraphicsCommandList8 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) + void ( STDMETHODCALLTYPE *ExecuteIndirect )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12CommandSignature *pCommandSignature, + _In_ UINT MaxCommandCount, + _In_ ID3D12Resource *pArgumentBuffer, + _In_ UINT64 ArgumentBufferOffset, + _In_opt_ ID3D12Resource *pCountBuffer, + _In_ UINT64 CountBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds) + void ( STDMETHODCALLTYPE *OMSetDepthBounds )( + ID3D12GraphicsCommandList8 * This, + _In_ FLOAT Min, + _In_ FLOAT Max); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions) + void ( STDMETHODCALLTYPE *SetSamplePositions )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT NumSamplesPerPixel, + _In_ UINT NumPixels, + _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion) + void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ UINT DstX, + _In_ UINT DstY, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_opt_ D3D12_RECT *pSrcRect, + _In_ DXGI_FORMAT Format, + _In_ D3D12_RESOLVE_MODE ResolveMode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask) + void ( STDMETHODCALLTYPE *SetViewInstanceMask )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT Mask); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12GraphicsCommandList8 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12GraphicsCommandList8 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BeginRenderPass) + void ( STDMETHODCALLTYPE *BeginRenderPass )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT NumRenderTargets, + _In_reads_opt_(NumRenderTargets) const D3D12_RENDER_PASS_RENDER_TARGET_DESC *pRenderTargets, + _In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil, + D3D12_RENDER_PASS_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EndRenderPass) + void ( STDMETHODCALLTYPE *EndRenderPass )( + ID3D12GraphicsCommandList8 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, InitializeMetaCommand) + void ( STDMETHODCALLTYPE *InitializeMetaCommand )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData, + _In_ SIZE_T InitializationParametersDataSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, ExecuteMetaCommand) + void ( STDMETHODCALLTYPE *ExecuteMetaCommand )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData, + _In_ SIZE_T ExecutionParametersDataSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BuildRaytracingAccelerationStructure) + void ( STDMETHODCALLTYPE *BuildRaytracingAccelerationStructure )( + ID3D12GraphicsCommandList8 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc, + _In_ UINT NumPostbuildInfoDescs, + _In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EmitRaytracingAccelerationStructurePostbuildInfo) + void ( STDMETHODCALLTYPE *EmitRaytracingAccelerationStructurePostbuildInfo )( + ID3D12GraphicsCommandList8 * This, + _In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc, + _In_ UINT NumSourceAccelerationStructures, + _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, CopyRaytracingAccelerationStructure) + void ( STDMETHODCALLTYPE *CopyRaytracingAccelerationStructure )( + ID3D12GraphicsCommandList8 * This, + _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData, + _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData, + _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, SetPipelineState1) + void ( STDMETHODCALLTYPE *SetPipelineState1 )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12StateObject *pStateObject); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, DispatchRays) + void ( STDMETHODCALLTYPE *DispatchRays )( + ID3D12GraphicsCommandList8 * This, + _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRate) + void ( STDMETHODCALLTYPE *RSSetShadingRate )( + ID3D12GraphicsCommandList8 * This, + _In_ D3D12_SHADING_RATE baseShadingRate, + _In_reads_opt_(D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT) const D3D12_SHADING_RATE_COMBINER *combiners); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRateImage) + void ( STDMETHODCALLTYPE *RSSetShadingRateImage )( + ID3D12GraphicsCommandList8 * This, + _In_opt_ ID3D12Resource *shadingRateImage); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList6, DispatchMesh) + void ( STDMETHODCALLTYPE *DispatchMesh )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList7, Barrier) + void ( STDMETHODCALLTYPE *Barrier )( + ID3D12GraphicsCommandList8 * This, + UINT32 NumBarrierGroups, + _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList8, OMSetFrontAndBackStencilRef) + void ( STDMETHODCALLTYPE *OMSetFrontAndBackStencilRef )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT FrontStencilRef, + _In_ UINT BackStencilRef); + + END_INTERFACE + } ID3D12GraphicsCommandList8Vtbl; + + interface ID3D12GraphicsCommandList8 + { + CONST_VTBL struct ID3D12GraphicsCommandList8Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12GraphicsCommandList8_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12GraphicsCommandList8_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12GraphicsCommandList8_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12GraphicsCommandList8_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12GraphicsCommandList8_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12GraphicsCommandList8_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12GraphicsCommandList8_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12GraphicsCommandList8_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12GraphicsCommandList8_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12GraphicsCommandList8_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12GraphicsCommandList8_Reset(This,pAllocator,pInitialState) \ + ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) + +#define ID3D12GraphicsCommandList8_ClearState(This,pPipelineState) \ + ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList8_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList8_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList8_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + +#define ID3D12GraphicsCommandList8_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ + ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) + +#define ID3D12GraphicsCommandList8_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ + ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) + +#define ID3D12GraphicsCommandList8_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) + +#define ID3D12GraphicsCommandList8_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ + ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) + +#define ID3D12GraphicsCommandList8_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) + +#define ID3D12GraphicsCommandList8_IASetPrimitiveTopology(This,PrimitiveTopology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) + +#define ID3D12GraphicsCommandList8_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) + +#define ID3D12GraphicsCommandList8_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList8_OMSetBlendFactor(This,BlendFactor) \ + ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) + +#define ID3D12GraphicsCommandList8_OMSetStencilRef(This,StencilRef) \ + ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) + +#define ID3D12GraphicsCommandList8_SetPipelineState(This,pPipelineState) \ + ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList8_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12GraphicsCommandList8_ExecuteBundle(This,pCommandList) \ + ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) + +#define ID3D12GraphicsCommandList8_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ + ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) + +#define ID3D12GraphicsCommandList8_SetComputeRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList8_SetGraphicsRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList8_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList8_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList8_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList8_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList8_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList8_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList8_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList8_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList8_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList8_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList8_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList8_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList8_IASetIndexBuffer(This,pView) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) + +#define ID3D12GraphicsCommandList8_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList8_SOSetTargets(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList8_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) + +#define ID3D12GraphicsCommandList8_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList8_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList8_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList8_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList8_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12GraphicsCommandList8_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList8_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList8_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12GraphicsCommandList8_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12GraphicsCommandList8_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList8_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList8_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12GraphicsCommandList8_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ + ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) + + +#define ID3D12GraphicsCommandList8_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList8_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList8_OMSetDepthBounds(This,Min,Max) \ + ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) ) + +#define ID3D12GraphicsCommandList8_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ + ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) ) + +#define ID3D12GraphicsCommandList8_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ + ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) ) + +#define ID3D12GraphicsCommandList8_SetViewInstanceMask(This,Mask) \ + ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) ) + + +#define ID3D12GraphicsCommandList8_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + + +#define ID3D12GraphicsCommandList8_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + + +#define ID3D12GraphicsCommandList8_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \ + ( (This)->lpVtbl -> BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) ) + +#define ID3D12GraphicsCommandList8_EndRenderPass(This) \ + ( (This)->lpVtbl -> EndRenderPass(This) ) + +#define ID3D12GraphicsCommandList8_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \ + ( (This)->lpVtbl -> InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) ) + +#define ID3D12GraphicsCommandList8_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) ) + +#define ID3D12GraphicsCommandList8_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \ + ( (This)->lpVtbl -> BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) ) + +#define ID3D12GraphicsCommandList8_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \ + ( (This)->lpVtbl -> EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) ) + +#define ID3D12GraphicsCommandList8_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \ + ( (This)->lpVtbl -> CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) ) + +#define ID3D12GraphicsCommandList8_SetPipelineState1(This,pStateObject) \ + ( (This)->lpVtbl -> SetPipelineState1(This,pStateObject) ) + +#define ID3D12GraphicsCommandList8_DispatchRays(This,pDesc) \ + ( (This)->lpVtbl -> DispatchRays(This,pDesc) ) + + +#define ID3D12GraphicsCommandList8_RSSetShadingRate(This,baseShadingRate,combiners) \ + ( (This)->lpVtbl -> RSSetShadingRate(This,baseShadingRate,combiners) ) + +#define ID3D12GraphicsCommandList8_RSSetShadingRateImage(This,shadingRateImage) \ + ( (This)->lpVtbl -> RSSetShadingRateImage(This,shadingRateImage) ) + + +#define ID3D12GraphicsCommandList8_DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + + +#define ID3D12GraphicsCommandList8_Barrier(This,NumBarrierGroups,pBarrierGroups) \ + ( (This)->lpVtbl -> Barrier(This,NumBarrierGroups,pBarrierGroups) ) + + +#define ID3D12GraphicsCommandList8_OMSetFrontAndBackStencilRef(This,FrontStencilRef,BackStencilRef) \ + ( (This)->lpVtbl -> OMSetFrontAndBackStencilRef(This,FrontStencilRef,BackStencilRef) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12GraphicsCommandList8_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0065 */ +/* [local] */ + +#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */ +#pragma endregion +DEFINE_GUID(IID_ID3D12Object,0xc4fec28f,0x7966,0x4e95,0x9f,0x94,0xf4,0x31,0xcb,0x56,0xc3,0xb8); +DEFINE_GUID(IID_ID3D12DeviceChild,0x905db94b,0xa00c,0x4140,0x9d,0xf5,0x2b,0x64,0xca,0x9e,0xa3,0x57); +DEFINE_GUID(IID_ID3D12RootSignature,0xc54a6b66,0x72df,0x4ee8,0x8b,0xe5,0xa9,0x46,0xa1,0x42,0x92,0x14); +DEFINE_GUID(IID_ID3D12RootSignatureDeserializer,0x34AB647B,0x3CC8,0x46AC,0x84,0x1B,0xC0,0x96,0x56,0x45,0xC0,0x46); +DEFINE_GUID(IID_ID3D12VersionedRootSignatureDeserializer,0x7F91CE67,0x090C,0x4BB7,0xB7,0x8E,0xED,0x8F,0xF2,0xE3,0x1D,0xA0); +DEFINE_GUID(IID_ID3D12Pageable,0x63ee58fb,0x1268,0x4835,0x86,0xda,0xf0,0x08,0xce,0x62,0xf0,0xd6); +DEFINE_GUID(IID_ID3D12Heap,0x6b3b2502,0x6e51,0x45b3,0x90,0xee,0x98,0x84,0x26,0x5e,0x8d,0xf3); +DEFINE_GUID(IID_ID3D12Resource,0x696442be,0xa72e,0x4059,0xbc,0x79,0x5b,0x5c,0x98,0x04,0x0f,0xad); +DEFINE_GUID(IID_ID3D12CommandAllocator,0x6102dee4,0xaf59,0x4b09,0xb9,0x99,0xb4,0x4d,0x73,0xf0,0x9b,0x24); +DEFINE_GUID(IID_ID3D12Fence,0x0a753dcf,0xc4d8,0x4b91,0xad,0xf6,0xbe,0x5a,0x60,0xd9,0x5a,0x76); +DEFINE_GUID(IID_ID3D12Fence1,0x433685fe,0xe22b,0x4ca0,0xa8,0xdb,0xb5,0xb4,0xf4,0xdd,0x0e,0x4a); +DEFINE_GUID(IID_ID3D12PipelineState,0x765a30f3,0xf624,0x4c6f,0xa8,0x28,0xac,0xe9,0x48,0x62,0x24,0x45); +DEFINE_GUID(IID_ID3D12DescriptorHeap,0x8efb471d,0x616c,0x4f49,0x90,0xf7,0x12,0x7b,0xb7,0x63,0xfa,0x51); +DEFINE_GUID(IID_ID3D12QueryHeap,0x0d9658ae,0xed45,0x469e,0xa6,0x1d,0x97,0x0e,0xc5,0x83,0xca,0xb4); +DEFINE_GUID(IID_ID3D12CommandSignature,0xc36a797c,0xec80,0x4f0a,0x89,0x85,0xa7,0xb2,0x47,0x50,0x82,0xd1); +DEFINE_GUID(IID_ID3D12CommandList,0x7116d91c,0xe7e4,0x47ce,0xb8,0xc6,0xec,0x81,0x68,0xf4,0x37,0xe5); +DEFINE_GUID(IID_ID3D12GraphicsCommandList,0x5b160d0f,0xac1b,0x4185,0x8b,0xa8,0xb3,0xae,0x42,0xa5,0xa4,0x55); +DEFINE_GUID(IID_ID3D12GraphicsCommandList1,0x553103fb,0x1fe7,0x4557,0xbb,0x38,0x94,0x6d,0x7d,0x0e,0x7c,0xa7); +DEFINE_GUID(IID_ID3D12GraphicsCommandList2,0x38C3E585,0xFF17,0x412C,0x91,0x50,0x4F,0xC6,0xF9,0xD7,0x2A,0x28); +DEFINE_GUID(IID_ID3D12CommandQueue,0x0ec870a6,0x5d7e,0x4c22,0x8c,0xfc,0x5b,0xaa,0xe0,0x76,0x16,0xed); +DEFINE_GUID(IID_ID3D12Device,0x189819f1,0x1db6,0x4b57,0xbe,0x54,0x18,0x21,0x33,0x9b,0x85,0xf7); +DEFINE_GUID(IID_ID3D12PipelineLibrary,0xc64226a8,0x9201,0x46af,0xb4,0xcc,0x53,0xfb,0x9f,0xf7,0x41,0x4f); +DEFINE_GUID(IID_ID3D12PipelineLibrary1,0x80eabf42,0x2568,0x4e5e,0xbd,0x82,0xc3,0x7f,0x86,0x96,0x1d,0xc3); +DEFINE_GUID(IID_ID3D12Device1,0x77acce80,0x638e,0x4e65,0x88,0x95,0xc1,0xf2,0x33,0x86,0x86,0x3e); +DEFINE_GUID(IID_ID3D12Device2,0x30baa41e,0xb15b,0x475c,0xa0,0xbb,0x1a,0xf5,0xc5,0xb6,0x43,0x28); +DEFINE_GUID(IID_ID3D12Device3,0x81dadc15,0x2bad,0x4392,0x93,0xc5,0x10,0x13,0x45,0xc4,0xaa,0x98); +DEFINE_GUID(IID_ID3D12ProtectedSession,0xA1533D18,0x0AC1,0x4084,0x85,0xB9,0x89,0xA9,0x61,0x16,0x80,0x6B); +DEFINE_GUID(IID_ID3D12ProtectedResourceSession,0x6CD696F4,0xF289,0x40CC,0x80,0x91,0x5A,0x6C,0x0A,0x09,0x9C,0x3D); +DEFINE_GUID(IID_ID3D12Device4,0xe865df17,0xa9ee,0x46f9,0xa4,0x63,0x30,0x98,0x31,0x5a,0xa2,0xe5); +DEFINE_GUID(IID_ID3D12LifetimeOwner,0xe667af9f,0xcd56,0x4f46,0x83,0xce,0x03,0x2e,0x59,0x5d,0x70,0xa8); +DEFINE_GUID(IID_ID3D12SwapChainAssistant,0xf1df64b6,0x57fd,0x49cd,0x88,0x07,0xc0,0xeb,0x88,0xb4,0x5c,0x8f); +DEFINE_GUID(IID_ID3D12LifetimeTracker,0x3fd03d36,0x4eb1,0x424a,0xa5,0x82,0x49,0x4e,0xcb,0x8b,0xa8,0x13); +DEFINE_GUID(IID_ID3D12StateObject,0x47016943,0xfca8,0x4594,0x93,0xea,0xaf,0x25,0x8b,0x55,0x34,0x6d); +DEFINE_GUID(IID_ID3D12StateObjectProperties,0xde5fa827,0x9bf9,0x4f26,0x89,0xff,0xd7,0xf5,0x6f,0xde,0x38,0x60); +DEFINE_GUID(IID_ID3D12Device5,0x8b4f173b,0x2fea,0x4b80,0x8f,0x58,0x43,0x07,0x19,0x1a,0xb9,0x5d); +DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedDataSettings,0x82BC481C,0x6B9B,0x4030,0xAE,0xDB,0x7E,0xE3,0xD1,0xDF,0x1E,0x63); +DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedDataSettings1,0xDBD5AE51,0x3317,0x4F0A,0xAD,0xF9,0x1D,0x7C,0xED,0xCA,0xAE,0x0B); +DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedDataSettings2,0x61552388,0x01ab,0x4008,0xa4,0x36,0x83,0xdb,0x18,0x95,0x66,0xea); +DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedData,0x98931D33,0x5AE8,0x4791,0xAA,0x3C,0x1A,0x73,0xA2,0x93,0x4E,0x71); +DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedData1,0x9727A022,0xCF1D,0x4DDA,0x9E,0xBA,0xEF,0xFA,0x65,0x3F,0xC5,0x06); +DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedData2,0x67FC5816,0xE4CA,0x4915,0xBF,0x18,0x42,0x54,0x12,0x72,0xDA,0x54); +DEFINE_GUID(IID_ID3D12Device6,0xc70b221b,0x40e4,0x4a17,0x89,0xaf,0x02,0x5a,0x07,0x27,0xa6,0xdc); +DEFINE_GUID(IID_ID3D12ProtectedResourceSession1,0xD6F12DD6,0x76FB,0x406E,0x89,0x61,0x42,0x96,0xEE,0xFC,0x04,0x09); +DEFINE_GUID(IID_ID3D12Device7,0x5c014b53,0x68a1,0x4b9b,0x8b,0xd1,0xdd,0x60,0x46,0xb9,0x35,0x8b); +DEFINE_GUID(IID_ID3D12Device8,0x9218E6BB,0xF944,0x4F7E,0xA7,0x5C,0xB1,0xB2,0xC7,0xB7,0x01,0xF3); +DEFINE_GUID(IID_ID3D12Resource1,0x9D5E227A,0x4430,0x4161,0x88,0xB3,0x3E,0xCA,0x6B,0xB1,0x6E,0x19); +DEFINE_GUID(IID_ID3D12Resource2,0xBE36EC3B,0xEA85,0x4AEB,0xA4,0x5A,0xE9,0xD7,0x64,0x04,0xA4,0x95); +DEFINE_GUID(IID_ID3D12Heap1,0x572F7389,0x2168,0x49E3,0x96,0x93,0xD6,0xDF,0x58,0x71,0xBF,0x6D); +DEFINE_GUID(IID_ID3D12GraphicsCommandList3,0x6FDA83A7,0xB84C,0x4E38,0x9A,0xC8,0xC7,0xBD,0x22,0x01,0x6B,0x3D); +DEFINE_GUID(IID_ID3D12MetaCommand,0xDBB84C27,0x36CE,0x4FC9,0xB8,0x01,0xF0,0x48,0xC4,0x6A,0xC5,0x70); +DEFINE_GUID(IID_ID3D12GraphicsCommandList4,0x8754318e,0xd3a9,0x4541,0x98,0xcf,0x64,0x5b,0x50,0xdc,0x48,0x74); +DEFINE_GUID(IID_ID3D12ShaderCacheSession,0x28e2495d,0x0f64,0x4ae4,0xa6,0xec,0x12,0x92,0x55,0xdc,0x49,0xa8); +DEFINE_GUID(IID_ID3D12Device9,0x4c80e962,0xf032,0x4f60,0xbc,0x9e,0xeb,0xc2,0xcf,0xa1,0xd8,0x3c); +DEFINE_GUID(IID_ID3D12Device10,0x517f8718,0xaa66,0x49f9,0xb0,0x2b,0xa7,0xab,0x89,0xc0,0x60,0x31); +DEFINE_GUID(IID_ID3D12Device11,0x5405c344,0xd457,0x444e,0xb4,0xdd,0x23,0x66,0xe4,0x5a,0xee,0x39); +DEFINE_GUID(IID_ID3D12VirtualizationGuestDevice,0xbc66d368,0x7373,0x4943,0x87,0x57,0xfc,0x87,0xdc,0x79,0xe4,0x76); +DEFINE_GUID(IID_ID3D12Tools,0x7071e1f0,0xe84b,0x4b33,0x97,0x4f,0x12,0xfa,0x49,0xde,0x65,0xc5); +DEFINE_GUID(IID_ID3D12SDKConfiguration,0xe9eb5314,0x33aa,0x42b2,0xa7,0x18,0xd7,0x7f,0x58,0xb1,0xf1,0xc7); +DEFINE_GUID(IID_ID3D12SDKConfiguration1,0x8aaf9303,0xad25,0x48b9,0x9a,0x57,0xd9,0xc3,0x7e,0x00,0x9d,0x9f); +DEFINE_GUID(IID_ID3D12DeviceFactory,0x61f307d3,0xd34e,0x4e7c,0x83,0x74,0x3b,0xa4,0xde,0x23,0xcc,0xcb); +DEFINE_GUID(IID_ID3D12DeviceConfiguration,0x78dbf87b,0xf766,0x422b,0xa6,0x1c,0xc8,0xc4,0x46,0xbd,0xb9,0xad); +DEFINE_GUID(IID_ID3D12GraphicsCommandList5,0x55050859,0x4024,0x474c,0x87,0xf5,0x64,0x72,0xea,0xee,0x44,0xea); +DEFINE_GUID(IID_ID3D12GraphicsCommandList6,0xc3827890,0xe548,0x4cfa,0x96,0xcf,0x56,0x89,0xa9,0x37,0x0f,0x80); +DEFINE_GUID(IID_ID3D12GraphicsCommandList7,0xdd171223,0x8b61,0x4769,0x90,0xe3,0x16,0x0c,0xcd,0xe4,0xe2,0xc1); +DEFINE_GUID(IID_ID3D12GraphicsCommandList8,0xee936ef9,0x599d,0x4d28,0x93,0x8e,0x23,0xc4,0xad,0x05,0xce,0x51); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0065_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0065_v0_0_s_ifspec; + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12.idl b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12.idl new file mode 100644 index 0000000..c831573 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12.idl @@ -0,0 +1,5928 @@ +/*------------------------------------------------------------------------------------- + * + * Copyright (c) Microsoft Corporation + * Licensed under the MIT license + * + *-------------------------------------------------------------------------------------*/ +import "oaidl.idl"; +import "ocidl.idl"; + +import "dxgicommon.idl"; +import "dxgiformat.idl"; + +import "d3dcommon.idl"; + +cpp_quote("#include ") + +#pragma region App Family +cpp_quote("#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES)") + +// NOTE: The following constants are generated from the D3D12 hardware spec. Do not edit these values directly. +cpp_quote( "#ifndef _D3D12_CONSTANTS" ) +cpp_quote( "#define _D3D12_CONSTANTS" ) +const UINT D3D12_16BIT_INDEX_STRIP_CUT_VALUE = 0xffff; +const UINT D3D12_32BIT_INDEX_STRIP_CUT_VALUE = 0xffffffff; +const UINT D3D12_8BIT_INDEX_STRIP_CUT_VALUE = 0xff; +const UINT D3D12_APPEND_ALIGNED_ELEMENT = 0xffffffff; +const UINT D3D12_ARRAY_AXIS_ADDRESS_RANGE_BIT_COUNT = 9; +const UINT D3D12_CLIP_OR_CULL_DISTANCE_COUNT = 8; +const UINT D3D12_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT = 2; +const UINT D3D12_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT = 14; +const UINT D3D12_COMMONSHADER_CONSTANT_BUFFER_COMPONENTS = 4; +const UINT D3D12_COMMONSHADER_CONSTANT_BUFFER_COMPONENT_BIT_COUNT = 32; +const UINT D3D12_COMMONSHADER_CONSTANT_BUFFER_HW_SLOT_COUNT = 15; +const UINT D3D12_COMMONSHADER_CONSTANT_BUFFER_PARTIAL_UPDATE_EXTENTS_BYTE_ALIGNMENT = 16; +const UINT D3D12_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COMPONENTS = 4; +const UINT D3D12_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COUNT = 15; +const UINT D3D12_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READS_PER_INST = 1; +const UINT D3D12_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READ_PORTS = 1; +const UINT D3D12_COMMONSHADER_FLOWCONTROL_NESTING_LIMIT = 64; +const UINT D3D12_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COMPONENTS = 4; +const UINT D3D12_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COUNT = 1; +const UINT D3D12_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READS_PER_INST = 1; +const UINT D3D12_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READ_PORTS = 1; +const UINT D3D12_COMMONSHADER_IMMEDIATE_VALUE_COMPONENT_BIT_COUNT = 32; +const UINT D3D12_COMMONSHADER_INPUT_RESOURCE_REGISTER_COMPONENTS = 1; +const UINT D3D12_COMMONSHADER_INPUT_RESOURCE_REGISTER_COUNT = 128; +const UINT D3D12_COMMONSHADER_INPUT_RESOURCE_REGISTER_READS_PER_INST = 1; +const UINT D3D12_COMMONSHADER_INPUT_RESOURCE_REGISTER_READ_PORTS = 1; +const UINT D3D12_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT = 128; +const UINT D3D12_COMMONSHADER_SAMPLER_REGISTER_COMPONENTS = 1; +const UINT D3D12_COMMONSHADER_SAMPLER_REGISTER_COUNT = 16; +const UINT D3D12_COMMONSHADER_SAMPLER_REGISTER_READS_PER_INST = 1; +const UINT D3D12_COMMONSHADER_SAMPLER_REGISTER_READ_PORTS = 1; +const UINT D3D12_COMMONSHADER_SAMPLER_SLOT_COUNT = 16; +const UINT D3D12_COMMONSHADER_SUBROUTINE_NESTING_LIMIT = 32; +const UINT D3D12_COMMONSHADER_TEMP_REGISTER_COMPONENTS = 4; +const UINT D3D12_COMMONSHADER_TEMP_REGISTER_COMPONENT_BIT_COUNT = 32; +const UINT D3D12_COMMONSHADER_TEMP_REGISTER_COUNT = 4096; +const UINT D3D12_COMMONSHADER_TEMP_REGISTER_READS_PER_INST = 3; +const UINT D3D12_COMMONSHADER_TEMP_REGISTER_READ_PORTS = 3; +const UINT D3D12_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MAX = 10; +const INT D3D12_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MIN = -10; +const INT D3D12_COMMONSHADER_TEXEL_OFFSET_MAX_NEGATIVE = -8; +const UINT D3D12_COMMONSHADER_TEXEL_OFFSET_MAX_POSITIVE = 7; +const UINT D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT = 256; +const UINT D3D12_CS_4_X_BUCKET00_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 256; +const UINT D3D12_CS_4_X_BUCKET00_MAX_NUM_THREADS_PER_GROUP = 64; +const UINT D3D12_CS_4_X_BUCKET01_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 240; +const UINT D3D12_CS_4_X_BUCKET01_MAX_NUM_THREADS_PER_GROUP = 68; +const UINT D3D12_CS_4_X_BUCKET02_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 224; +const UINT D3D12_CS_4_X_BUCKET02_MAX_NUM_THREADS_PER_GROUP = 72; +const UINT D3D12_CS_4_X_BUCKET03_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 208; +const UINT D3D12_CS_4_X_BUCKET03_MAX_NUM_THREADS_PER_GROUP = 76; +const UINT D3D12_CS_4_X_BUCKET04_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 192; +const UINT D3D12_CS_4_X_BUCKET04_MAX_NUM_THREADS_PER_GROUP = 84; +const UINT D3D12_CS_4_X_BUCKET05_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 176; +const UINT D3D12_CS_4_X_BUCKET05_MAX_NUM_THREADS_PER_GROUP = 92; +const UINT D3D12_CS_4_X_BUCKET06_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 160; +const UINT D3D12_CS_4_X_BUCKET06_MAX_NUM_THREADS_PER_GROUP = 100; +const UINT D3D12_CS_4_X_BUCKET07_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 144; +const UINT D3D12_CS_4_X_BUCKET07_MAX_NUM_THREADS_PER_GROUP = 112; +const UINT D3D12_CS_4_X_BUCKET08_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 128; +const UINT D3D12_CS_4_X_BUCKET08_MAX_NUM_THREADS_PER_GROUP = 128; +const UINT D3D12_CS_4_X_BUCKET09_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 112; +const UINT D3D12_CS_4_X_BUCKET09_MAX_NUM_THREADS_PER_GROUP = 144; +const UINT D3D12_CS_4_X_BUCKET10_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 96; +const UINT D3D12_CS_4_X_BUCKET10_MAX_NUM_THREADS_PER_GROUP = 168; +const UINT D3D12_CS_4_X_BUCKET11_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 80; +const UINT D3D12_CS_4_X_BUCKET11_MAX_NUM_THREADS_PER_GROUP = 204; +const UINT D3D12_CS_4_X_BUCKET12_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 64; +const UINT D3D12_CS_4_X_BUCKET12_MAX_NUM_THREADS_PER_GROUP = 256; +const UINT D3D12_CS_4_X_BUCKET13_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 48; +const UINT D3D12_CS_4_X_BUCKET13_MAX_NUM_THREADS_PER_GROUP = 340; +const UINT D3D12_CS_4_X_BUCKET14_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 32; +const UINT D3D12_CS_4_X_BUCKET14_MAX_NUM_THREADS_PER_GROUP = 512; +const UINT D3D12_CS_4_X_BUCKET15_MAX_BYTES_TGSM_WRITABLE_PER_THREAD = 16; +const UINT D3D12_CS_4_X_BUCKET15_MAX_NUM_THREADS_PER_GROUP = 768; +const UINT D3D12_CS_4_X_DISPATCH_MAX_THREAD_GROUPS_IN_Z_DIMENSION = 1; +const UINT D3D12_CS_4_X_RAW_UAV_BYTE_ALIGNMENT = 256; +const UINT D3D12_CS_4_X_THREAD_GROUP_MAX_THREADS_PER_GROUP = 768; +const UINT D3D12_CS_4_X_THREAD_GROUP_MAX_X = 768; +const UINT D3D12_CS_4_X_THREAD_GROUP_MAX_Y = 768; +const UINT D3D12_CS_4_X_UAV_REGISTER_COUNT = 1; +const UINT D3D12_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION = 65535; +const UINT D3D12_CS_TGSM_REGISTER_COUNT = 8192; +const UINT D3D12_CS_TGSM_REGISTER_READS_PER_INST = 1; +const UINT D3D12_CS_TGSM_RESOURCE_REGISTER_COMPONENTS = 1; +const UINT D3D12_CS_TGSM_RESOURCE_REGISTER_READ_PORTS = 1; +const UINT D3D12_CS_THREADGROUPID_REGISTER_COMPONENTS = 3; +const UINT D3D12_CS_THREADGROUPID_REGISTER_COUNT = 1; +const UINT D3D12_CS_THREADIDINGROUPFLATTENED_REGISTER_COMPONENTS = 1; +const UINT D3D12_CS_THREADIDINGROUPFLATTENED_REGISTER_COUNT = 1; +const UINT D3D12_CS_THREADIDINGROUP_REGISTER_COMPONENTS = 3; +const UINT D3D12_CS_THREADIDINGROUP_REGISTER_COUNT = 1; +const UINT D3D12_CS_THREADID_REGISTER_COMPONENTS = 3; +const UINT D3D12_CS_THREADID_REGISTER_COUNT = 1; +const UINT D3D12_CS_THREAD_GROUP_MAX_THREADS_PER_GROUP = 1024; +const UINT D3D12_CS_THREAD_GROUP_MAX_X = 1024; +const UINT D3D12_CS_THREAD_GROUP_MAX_Y = 1024; +const UINT D3D12_CS_THREAD_GROUP_MAX_Z = 64; +const UINT D3D12_CS_THREAD_GROUP_MIN_X = 1; +const UINT D3D12_CS_THREAD_GROUP_MIN_Y = 1; +const UINT D3D12_CS_THREAD_GROUP_MIN_Z = 1; +const UINT D3D12_CS_THREAD_LOCAL_TEMP_REGISTER_POOL = 16384; +cpp_quote( "#define D3D12_DEFAULT_BLEND_FACTOR_ALPHA ( 1.0f )" ) +cpp_quote( "#define D3D12_DEFAULT_BLEND_FACTOR_BLUE ( 1.0f )" ) +cpp_quote( "#define D3D12_DEFAULT_BLEND_FACTOR_GREEN ( 1.0f )" ) +cpp_quote( "#define D3D12_DEFAULT_BLEND_FACTOR_RED ( 1.0f )" ) +cpp_quote( "#define D3D12_DEFAULT_BORDER_COLOR_COMPONENT ( 0.0f )" ) +const UINT D3D12_DEFAULT_DEPTH_BIAS = 0; +cpp_quote( "#define D3D12_DEFAULT_DEPTH_BIAS_CLAMP ( 0.0f )" ) +const UINT D3D12_DEFAULT_MAX_ANISOTROPY = 16; +cpp_quote( "#define D3D12_DEFAULT_MIP_LOD_BIAS ( 0.0f )" ) +const UINT D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT = 4194304; +const UINT D3D12_DEFAULT_RENDER_TARGET_ARRAY_INDEX = 0; +const UINT D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT = 65536; +const UINT D3D12_DEFAULT_SAMPLE_MASK = 0xffffffff; +const UINT D3D12_DEFAULT_SCISSOR_ENDX = 0; +const UINT D3D12_DEFAULT_SCISSOR_ENDY = 0; +const UINT D3D12_DEFAULT_SCISSOR_STARTX = 0; +const UINT D3D12_DEFAULT_SCISSOR_STARTY = 0; +cpp_quote( "#define D3D12_DEFAULT_SLOPE_SCALED_DEPTH_BIAS ( 0.0f )" ) +const UINT D3D12_DEFAULT_STENCIL_READ_MASK = 0xff; +const UINT D3D12_DEFAULT_STENCIL_REFERENCE = 0; +const UINT D3D12_DEFAULT_STENCIL_WRITE_MASK = 0xff; +const UINT D3D12_DEFAULT_VIEWPORT_AND_SCISSORRECT_INDEX = 0; +const UINT D3D12_DEFAULT_VIEWPORT_HEIGHT = 0; +cpp_quote( "#define D3D12_DEFAULT_VIEWPORT_MAX_DEPTH ( 0.0f )" ) +cpp_quote( "#define D3D12_DEFAULT_VIEWPORT_MIN_DEPTH ( 0.0f )" ) +const UINT D3D12_DEFAULT_VIEWPORT_TOPLEFTX = 0; +const UINT D3D12_DEFAULT_VIEWPORT_TOPLEFTY = 0; +const UINT D3D12_DEFAULT_VIEWPORT_WIDTH = 0; +const UINT D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND = 0xffffffff; +const UINT D3D12_DRIVER_RESERVED_REGISTER_SPACE_VALUES_END = 0xfffffff7; +const UINT D3D12_DRIVER_RESERVED_REGISTER_SPACE_VALUES_START = 0xfffffff0; +const UINT D3D12_DS_INPUT_CONTROL_POINTS_MAX_TOTAL_SCALARS = 3968; +const UINT D3D12_DS_INPUT_CONTROL_POINT_REGISTER_COMPONENTS = 4; +const UINT D3D12_DS_INPUT_CONTROL_POINT_REGISTER_COMPONENT_BIT_COUNT = 32; +const UINT D3D12_DS_INPUT_CONTROL_POINT_REGISTER_COUNT = 32; +const UINT D3D12_DS_INPUT_CONTROL_POINT_REGISTER_READS_PER_INST = 2; +const UINT D3D12_DS_INPUT_CONTROL_POINT_REGISTER_READ_PORTS = 1; +const UINT D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_COMPONENTS = 3; +const UINT D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_COMPONENT_BIT_COUNT = 32; +const UINT D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_COUNT = 1; +const UINT D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_READS_PER_INST = 2; +const UINT D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_READ_PORTS = 1; +const UINT D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_COMPONENTS = 4; +const UINT D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_COMPONENT_BIT_COUNT = 32; +const UINT D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_COUNT = 32; +const UINT D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_READS_PER_INST = 2; +const UINT D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_READ_PORTS = 1; +const UINT D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENTS = 1; +const UINT D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENT_BIT_COUNT = 32; +const UINT D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_COUNT = 1; +const UINT D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_READS_PER_INST = 2; +const UINT D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_READ_PORTS = 1; +const UINT D3D12_DS_OUTPUT_REGISTER_COMPONENTS = 4; +const UINT D3D12_DS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT = 32; +const UINT D3D12_DS_OUTPUT_REGISTER_COUNT = 32; +cpp_quote( "#define D3D12_FLOAT16_FUSED_TOLERANCE_IN_ULP ( 0.6 )" ) +cpp_quote( "#define D3D12_FLOAT32_MAX ( 3.402823466e+38f )" ) +cpp_quote( "#define D3D12_FLOAT32_TO_INTEGER_TOLERANCE_IN_ULP ( 0.6f )" ) +cpp_quote( "#define D3D12_FLOAT_TO_SRGB_EXPONENT_DENOMINATOR ( 2.4f )" ) +cpp_quote( "#define D3D12_FLOAT_TO_SRGB_EXPONENT_NUMERATOR ( 1.0f )" ) +cpp_quote( "#define D3D12_FLOAT_TO_SRGB_OFFSET ( 0.055f )" ) +cpp_quote( "#define D3D12_FLOAT_TO_SRGB_SCALE_1 ( 12.92f )" ) +cpp_quote( "#define D3D12_FLOAT_TO_SRGB_SCALE_2 ( 1.055f )" ) +cpp_quote( "#define D3D12_FLOAT_TO_SRGB_THRESHOLD ( 0.0031308f )" ) +cpp_quote( "#define D3D12_FTOI_INSTRUCTION_MAX_INPUT ( 2147483647.999f )" ) +cpp_quote( "#define D3D12_FTOI_INSTRUCTION_MIN_INPUT ( -2147483648.999f )" ) +cpp_quote( "#define D3D12_FTOU_INSTRUCTION_MAX_INPUT ( 4294967295.999f )" ) +cpp_quote( "#define D3D12_FTOU_INSTRUCTION_MIN_INPUT ( 0.0f )" ) +const UINT D3D12_GS_INPUT_INSTANCE_ID_READS_PER_INST = 2; +const UINT D3D12_GS_INPUT_INSTANCE_ID_READ_PORTS = 1; +const UINT D3D12_GS_INPUT_INSTANCE_ID_REGISTER_COMPONENTS = 1; +const UINT D3D12_GS_INPUT_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT = 32; +const UINT D3D12_GS_INPUT_INSTANCE_ID_REGISTER_COUNT = 1; +const UINT D3D12_GS_INPUT_PRIM_CONST_REGISTER_COMPONENTS = 1; +const UINT D3D12_GS_INPUT_PRIM_CONST_REGISTER_COMPONENT_BIT_COUNT = 32; +const UINT D3D12_GS_INPUT_PRIM_CONST_REGISTER_COUNT = 1; +const UINT D3D12_GS_INPUT_PRIM_CONST_REGISTER_READS_PER_INST = 2; +const UINT D3D12_GS_INPUT_PRIM_CONST_REGISTER_READ_PORTS = 1; +const UINT D3D12_GS_INPUT_REGISTER_COMPONENTS = 4; +const UINT D3D12_GS_INPUT_REGISTER_COMPONENT_BIT_COUNT = 32; +const UINT D3D12_GS_INPUT_REGISTER_COUNT = 32; +const UINT D3D12_GS_INPUT_REGISTER_READS_PER_INST = 2; +const UINT D3D12_GS_INPUT_REGISTER_READ_PORTS = 1; +const UINT D3D12_GS_INPUT_REGISTER_VERTICES = 32; +const UINT D3D12_GS_MAX_INSTANCE_COUNT = 32; +const UINT D3D12_GS_MAX_OUTPUT_VERTEX_COUNT_ACROSS_INSTANCES = 1024; +const UINT D3D12_GS_OUTPUT_ELEMENTS = 32; +const UINT D3D12_GS_OUTPUT_REGISTER_COMPONENTS = 4; +const UINT D3D12_GS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT = 32; +const UINT D3D12_GS_OUTPUT_REGISTER_COUNT = 32; +const UINT D3D12_HS_CONTROL_POINT_PHASE_INPUT_REGISTER_COUNT = 32; +const UINT D3D12_HS_CONTROL_POINT_PHASE_OUTPUT_REGISTER_COUNT = 32; +const UINT D3D12_HS_CONTROL_POINT_REGISTER_COMPONENTS = 4; +const UINT D3D12_HS_CONTROL_POINT_REGISTER_COMPONENT_BIT_COUNT = 32; +const UINT D3D12_HS_CONTROL_POINT_REGISTER_READS_PER_INST = 2; +const UINT D3D12_HS_CONTROL_POINT_REGISTER_READ_PORTS = 1; +const UINT D3D12_HS_FORK_PHASE_INSTANCE_COUNT_UPPER_BOUND = 0xFFFFFFFF; +const UINT D3D12_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COMPONENTS = 1; +const UINT D3D12_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT = 32; +const UINT D3D12_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COUNT = 1; +const UINT D3D12_HS_INPUT_FORK_INSTANCE_ID_REGISTER_READS_PER_INST = 2; +const UINT D3D12_HS_INPUT_FORK_INSTANCE_ID_REGISTER_READ_PORTS = 1; +const UINT D3D12_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COMPONENTS = 1; +const UINT D3D12_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT = 32; +const UINT D3D12_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COUNT = 1; +const UINT D3D12_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_READS_PER_INST = 2; +const UINT D3D12_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_READ_PORTS = 1; +const UINT D3D12_HS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENTS = 1; +const UINT D3D12_HS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENT_BIT_COUNT = 32; +const UINT D3D12_HS_INPUT_PRIMITIVE_ID_REGISTER_COUNT = 1; +const UINT D3D12_HS_INPUT_PRIMITIVE_ID_REGISTER_READS_PER_INST = 2; +const UINT D3D12_HS_INPUT_PRIMITIVE_ID_REGISTER_READ_PORTS = 1; +const UINT D3D12_HS_JOIN_PHASE_INSTANCE_COUNT_UPPER_BOUND = 0xFFFFFFFF; +cpp_quote( "#define D3D12_HS_MAXTESSFACTOR_LOWER_BOUND ( 1.0f )" ) +cpp_quote( "#define D3D12_HS_MAXTESSFACTOR_UPPER_BOUND ( 64.0f )" ) +const UINT D3D12_HS_OUTPUT_CONTROL_POINTS_MAX_TOTAL_SCALARS = 3968; +const UINT D3D12_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COMPONENTS = 1; +const UINT D3D12_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COMPONENT_BIT_COUNT = 32; +const UINT D3D12_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COUNT = 1; +const UINT D3D12_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_READS_PER_INST = 2; +const UINT D3D12_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_READ_PORTS = 1; +const UINT D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COMPONENTS = 4; +const UINT D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COMPONENT_BIT_COUNT = 32; +const UINT D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COUNT = 32; +const UINT D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_READS_PER_INST = 2; +const UINT D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_READ_PORTS = 1; +const UINT D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_SCALAR_COMPONENTS = 128; +const UINT D3D12_IA_DEFAULT_INDEX_BUFFER_OFFSET_IN_BYTES = 0; +const UINT D3D12_IA_DEFAULT_PRIMITIVE_TOPOLOGY = 0; +const UINT D3D12_IA_DEFAULT_VERTEX_BUFFER_OFFSET_IN_BYTES = 0; +const UINT D3D12_IA_INDEX_INPUT_RESOURCE_SLOT_COUNT = 1; +const UINT D3D12_IA_INSTANCE_ID_BIT_COUNT = 32; +const UINT D3D12_IA_INTEGER_ARITHMETIC_BIT_COUNT = 32; +const UINT D3D12_IA_PATCH_MAX_CONTROL_POINT_COUNT = 32; +const UINT D3D12_IA_PRIMITIVE_ID_BIT_COUNT = 32; +const UINT D3D12_IA_VERTEX_ID_BIT_COUNT = 32; +const UINT D3D12_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT = 32; +const UINT D3D12_IA_VERTEX_INPUT_STRUCTURE_ELEMENTS_COMPONENTS = 128; +const UINT D3D12_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT = 32; +const UINT D3D12_INTEGER_DIVIDE_BY_ZERO_QUOTIENT = 0xffffffff; +const UINT D3D12_INTEGER_DIVIDE_BY_ZERO_REMAINDER = 0xffffffff; +const UINT D3D12_KEEP_RENDER_TARGETS_AND_DEPTH_STENCIL = 0xffffffff; +const UINT D3D12_KEEP_UNORDERED_ACCESS_VIEWS = 0xffffffff; +cpp_quote( "#define D3D12_LINEAR_GAMMA ( 1.0f )" ) +const UINT D3D12_MAJOR_VERSION = 12; +cpp_quote( "#define D3D12_MAX_BORDER_COLOR_COMPONENT ( 1.0f )" ) +cpp_quote( "#define D3D12_MAX_DEPTH ( 1.0f )" ) +const UINT D3D12_MAX_LIVE_STATIC_SAMPLERS = 2032; +const UINT D3D12_MAX_MAXANISOTROPY = 16; +const UINT D3D12_MAX_MULTISAMPLE_SAMPLE_COUNT = 32; +cpp_quote( "#define D3D12_MAX_POSITION_VALUE ( 3.402823466e+34f )" ) +const UINT D3D12_MAX_ROOT_COST = 64; +const UINT D3D12_MAX_SHADER_VISIBLE_DESCRIPTOR_HEAP_SIZE_TIER_1 = 1000000; +const UINT D3D12_MAX_SHADER_VISIBLE_DESCRIPTOR_HEAP_SIZE_TIER_2 = 1000000; +const UINT D3D12_MAX_SHADER_VISIBLE_SAMPLER_HEAP_SIZE = 2048; +const UINT D3D12_MAX_TEXTURE_DIMENSION_2_TO_EXP = 17; +const UINT D3D12_MAX_VIEW_INSTANCE_COUNT = 4; +const UINT D3D12_MINOR_VERSION = 0; +cpp_quote( "#define D3D12_MIN_BORDER_COLOR_COMPONENT ( 0.0f )" ) +cpp_quote( "#define D3D12_MIN_DEPTH ( 0.0f )" ) +const UINT D3D12_MIN_MAXANISOTROPY = 0; +cpp_quote( "#define D3D12_MIP_LOD_BIAS_MAX ( 15.99f )" ) +cpp_quote( "#define D3D12_MIP_LOD_BIAS_MIN ( -16.0f )" ) +const UINT D3D12_MIP_LOD_FRACTIONAL_BIT_COUNT = 8; +const UINT D3D12_MIP_LOD_RANGE_BIT_COUNT = 8; +cpp_quote( "#define D3D12_MULTISAMPLE_ANTIALIAS_LINE_WIDTH ( 1.4f )" ) +const UINT D3D12_NONSAMPLE_FETCH_OUT_OF_RANGE_ACCESS_RESULT = 0; +const UINT D3D12_OS_RESERVED_REGISTER_SPACE_VALUES_END = 0xffffffff; +const UINT D3D12_OS_RESERVED_REGISTER_SPACE_VALUES_START = 0xfffffff8; +const UINT D3D12_PACKED_TILE = 0xffffffff; +const UINT D3D12_PIXEL_ADDRESS_RANGE_BIT_COUNT = 15; +const UINT D3D12_PREVIEW_SDK_VERSION = 706; +const UINT D3D12_PRE_SCISSOR_PIXEL_ADDRESS_RANGE_BIT_COUNT = 16; +const UINT D3D12_PS_CS_UAV_REGISTER_COMPONENTS = 1; +const UINT D3D12_PS_CS_UAV_REGISTER_COUNT = 8; +const UINT D3D12_PS_CS_UAV_REGISTER_READS_PER_INST = 1; +const UINT D3D12_PS_CS_UAV_REGISTER_READ_PORTS = 1; +const UINT D3D12_PS_FRONTFACING_DEFAULT_VALUE = 0xFFFFFFFF; +const UINT D3D12_PS_FRONTFACING_FALSE_VALUE = 0x00000000; +const UINT D3D12_PS_FRONTFACING_TRUE_VALUE = 0xFFFFFFFF; +const UINT D3D12_PS_INPUT_REGISTER_COMPONENTS = 4; +const UINT D3D12_PS_INPUT_REGISTER_COMPONENT_BIT_COUNT = 32; +const UINT D3D12_PS_INPUT_REGISTER_COUNT = 32; +const UINT D3D12_PS_INPUT_REGISTER_READS_PER_INST = 2; +const UINT D3D12_PS_INPUT_REGISTER_READ_PORTS = 1; +cpp_quote( "#define D3D12_PS_LEGACY_PIXEL_CENTER_FRACTIONAL_COMPONENT ( 0.0f )" ) +const UINT D3D12_PS_OUTPUT_DEPTH_REGISTER_COMPONENTS = 1; +const UINT D3D12_PS_OUTPUT_DEPTH_REGISTER_COMPONENT_BIT_COUNT = 32; +const UINT D3D12_PS_OUTPUT_DEPTH_REGISTER_COUNT = 1; +const UINT D3D12_PS_OUTPUT_MASK_REGISTER_COMPONENTS = 1; +const UINT D3D12_PS_OUTPUT_MASK_REGISTER_COMPONENT_BIT_COUNT = 32; +const UINT D3D12_PS_OUTPUT_MASK_REGISTER_COUNT = 1; +const UINT D3D12_PS_OUTPUT_REGISTER_COMPONENTS = 4; +const UINT D3D12_PS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT = 32; +const UINT D3D12_PS_OUTPUT_REGISTER_COUNT = 8; +cpp_quote( "#define D3D12_PS_PIXEL_CENTER_FRACTIONAL_COMPONENT ( 0.5f )" ) +const UINT D3D12_RAW_UAV_SRV_BYTE_ALIGNMENT = 16; +const UINT D3D12_RAYTRACING_AABB_BYTE_ALIGNMENT = 8; +const UINT D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BYTE_ALIGNMENT = 256; +const UINT D3D12_RAYTRACING_INSTANCE_DESCS_BYTE_ALIGNMENT = 16; +const UINT D3D12_RAYTRACING_MAX_ATTRIBUTE_SIZE_IN_BYTES = 32; +const UINT D3D12_RAYTRACING_MAX_DECLARABLE_TRACE_RECURSION_DEPTH = 31; +const UINT D3D12_RAYTRACING_MAX_GEOMETRIES_PER_BOTTOM_LEVEL_ACCELERATION_STRUCTURE = 16777216; +const UINT D3D12_RAYTRACING_MAX_INSTANCES_PER_TOP_LEVEL_ACCELERATION_STRUCTURE = 16777216; +const UINT D3D12_RAYTRACING_MAX_PRIMITIVES_PER_BOTTOM_LEVEL_ACCELERATION_STRUCTURE = 536870912; +const UINT D3D12_RAYTRACING_MAX_RAY_GENERATION_SHADER_THREADS = 1073741824; +const UINT D3D12_RAYTRACING_MAX_SHADER_RECORD_STRIDE = 4096; +const UINT D3D12_RAYTRACING_SHADER_RECORD_BYTE_ALIGNMENT = 32; +const UINT D3D12_RAYTRACING_SHADER_TABLE_BYTE_ALIGNMENT = 64; +const UINT D3D12_RAYTRACING_TRANSFORM3X4_BYTE_ALIGNMENT = 16; +const UINT D3D12_REQ_BLEND_OBJECT_COUNT_PER_DEVICE = 4096; +const UINT D3D12_REQ_BUFFER_RESOURCE_TEXEL_COUNT_2_TO_EXP = 27; +const UINT D3D12_REQ_CONSTANT_BUFFER_ELEMENT_COUNT = 4096; +const UINT D3D12_REQ_DEPTH_STENCIL_OBJECT_COUNT_PER_DEVICE = 4096; +const UINT D3D12_REQ_DRAWINDEXED_INDEX_COUNT_2_TO_EXP = 32; +const UINT D3D12_REQ_DRAW_VERTEX_COUNT_2_TO_EXP = 32; +const UINT D3D12_REQ_FILTERING_HW_ADDRESSABLE_RESOURCE_DIMENSION = 16384; +const UINT D3D12_REQ_GS_INVOCATION_32BIT_OUTPUT_COMPONENT_LIMIT = 1024; +const UINT D3D12_REQ_IMMEDIATE_CONSTANT_BUFFER_ELEMENT_COUNT = 4096; +const UINT D3D12_REQ_MAXANISOTROPY = 16; +const UINT D3D12_REQ_MIP_LEVELS = 15; +const UINT D3D12_REQ_MULTI_ELEMENT_STRUCTURE_SIZE_IN_BYTES = 2048; +const UINT D3D12_REQ_RASTERIZER_OBJECT_COUNT_PER_DEVICE = 4096; +const UINT D3D12_REQ_RENDER_TO_BUFFER_WINDOW_WIDTH = 16384; +const UINT D3D12_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_A_TERM = 128; +cpp_quote( "#define D3D12_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_B_TERM ( 0.25f )" ) +const UINT D3D12_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_C_TERM = 2048; +const UINT D3D12_REQ_RESOURCE_VIEW_COUNT_PER_DEVICE_2_TO_EXP = 20; +const UINT D3D12_REQ_SAMPLER_OBJECT_COUNT_PER_DEVICE = 4096; +const UINT D3D12_REQ_SUBRESOURCES = 30720; +const UINT D3D12_REQ_TEXTURE1D_ARRAY_AXIS_DIMENSION = 2048; +const UINT D3D12_REQ_TEXTURE1D_U_DIMENSION = 16384; +const UINT D3D12_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION = 2048; +const UINT D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION = 16384; +const UINT D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION = 2048; +const UINT D3D12_REQ_TEXTURECUBE_DIMENSION = 16384; +const UINT D3D12_RESINFO_INSTRUCTION_MISSING_COMPONENT_RETVAL = 0; +const UINT D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES = 0xffffffff; +const UINT D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT = 2; +const UINT D3D12_SDK_VERSION = 606; +const UINT D3D12_SHADER_IDENTIFIER_SIZE_IN_BYTES = 32; +const UINT D3D12_SHADER_MAJOR_VERSION = 5; +const UINT D3D12_SHADER_MAX_INSTANCES = 65535; +const UINT D3D12_SHADER_MAX_INTERFACES = 253; +const UINT D3D12_SHADER_MAX_INTERFACE_CALL_SITES = 4096; +const UINT D3D12_SHADER_MAX_TYPES = 65535; +const UINT D3D12_SHADER_MINOR_VERSION = 1; +const UINT D3D12_SHIFT_INSTRUCTION_PAD_VALUE = 0; +const UINT D3D12_SHIFT_INSTRUCTION_SHIFT_VALUE_BIT_COUNT = 5; +const UINT D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT = 8; +const UINT D3D12_SMALL_MSAA_RESOURCE_PLACEMENT_ALIGNMENT = 65536; +const UINT D3D12_SMALL_RESOURCE_PLACEMENT_ALIGNMENT = 4096; +const UINT D3D12_SO_BUFFER_MAX_STRIDE_IN_BYTES = 2048; +const UINT D3D12_SO_BUFFER_MAX_WRITE_WINDOW_IN_BYTES = 512; +const UINT D3D12_SO_BUFFER_SLOT_COUNT = 4; +const UINT D3D12_SO_DDI_REGISTER_INDEX_DENOTING_GAP = 0xffffffff; +const UINT D3D12_SO_NO_RASTERIZED_STREAM = 0xffffffff; +const UINT D3D12_SO_OUTPUT_COMPONENT_COUNT = 128; +const UINT D3D12_SO_STREAM_COUNT = 4; +const UINT D3D12_SPEC_DATE_DAY = 14; +const UINT D3D12_SPEC_DATE_MONTH = 11; +const UINT D3D12_SPEC_DATE_YEAR = 2014; +cpp_quote( "#define D3D12_SPEC_VERSION ( 1.16 )" ) +cpp_quote( "#define D3D12_SRGB_GAMMA ( 2.2f )" ) +cpp_quote( "#define D3D12_SRGB_TO_FLOAT_DENOMINATOR_1 ( 12.92f )" ) +cpp_quote( "#define D3D12_SRGB_TO_FLOAT_DENOMINATOR_2 ( 1.055f )" ) +cpp_quote( "#define D3D12_SRGB_TO_FLOAT_EXPONENT ( 2.4f )" ) +cpp_quote( "#define D3D12_SRGB_TO_FLOAT_OFFSET ( 0.055f )" ) +cpp_quote( "#define D3D12_SRGB_TO_FLOAT_THRESHOLD ( 0.04045f )" ) +cpp_quote( "#define D3D12_SRGB_TO_FLOAT_TOLERANCE_IN_ULP ( 0.5f )" ) +const UINT D3D12_STANDARD_COMPONENT_BIT_COUNT = 32; +const UINT D3D12_STANDARD_COMPONENT_BIT_COUNT_DOUBLED = 64; +const UINT D3D12_STANDARD_MAXIMUM_ELEMENT_ALIGNMENT_BYTE_MULTIPLE = 4; +const UINT D3D12_STANDARD_PIXEL_COMPONENT_COUNT = 128; +const UINT D3D12_STANDARD_PIXEL_ELEMENT_COUNT = 32; +const UINT D3D12_STANDARD_VECTOR_SIZE = 4; +const UINT D3D12_STANDARD_VERTEX_ELEMENT_COUNT = 32; +const UINT D3D12_STANDARD_VERTEX_TOTAL_COMPONENT_COUNT = 64; +const UINT D3D12_SUBPIXEL_FRACTIONAL_BIT_COUNT = 8; +const UINT D3D12_SUBTEXEL_FRACTIONAL_BIT_COUNT = 8; +const UINT D3D12_SYSTEM_RESERVED_REGISTER_SPACE_VALUES_END = 0xffffffff; +const UINT D3D12_SYSTEM_RESERVED_REGISTER_SPACE_VALUES_START = 0xfffffff0; +const UINT D3D12_TESSELLATOR_MAX_EVEN_TESSELLATION_FACTOR = 64; +const UINT D3D12_TESSELLATOR_MAX_ISOLINE_DENSITY_TESSELLATION_FACTOR = 64; +const UINT D3D12_TESSELLATOR_MAX_ODD_TESSELLATION_FACTOR = 63; +const UINT D3D12_TESSELLATOR_MAX_TESSELLATION_FACTOR = 64; +const UINT D3D12_TESSELLATOR_MIN_EVEN_TESSELLATION_FACTOR = 2; +const UINT D3D12_TESSELLATOR_MIN_ISOLINE_DENSITY_TESSELLATION_FACTOR = 1; +const UINT D3D12_TESSELLATOR_MIN_ODD_TESSELLATION_FACTOR = 1; +const UINT D3D12_TEXEL_ADDRESS_RANGE_BIT_COUNT = 16; +const UINT D3D12_TEXTURE_DATA_PITCH_ALIGNMENT = 256; +const UINT D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT = 512; +const UINT D3D12_TILED_RESOURCE_TILE_SIZE_IN_BYTES = 65536; +const UINT D3D12_TRACKED_WORKLOAD_MAX_INSTANCES = 32; +const UINT D3D12_UAV_COUNTER_PLACEMENT_ALIGNMENT = 4096; +const UINT D3D12_UAV_SLOT_COUNT = 64; +const UINT D3D12_UNBOUND_MEMORY_ACCESS_RESULT = 0; +const UINT D3D12_VIDEO_DECODE_MAX_ARGUMENTS = 10; +const UINT D3D12_VIDEO_DECODE_MAX_HISTOGRAM_COMPONENTS = 4; +const UINT D3D12_VIDEO_DECODE_MIN_BITSTREAM_OFFSET_ALIGNMENT = 256; +const UINT D3D12_VIDEO_DECODE_MIN_HISTOGRAM_OFFSET_ALIGNMENT = 256; +const UINT D3D12_VIDEO_DECODE_STATUS_MACROBLOCKS_AFFECTED_UNKNOWN = 0xffffffff; +const UINT D3D12_VIDEO_PROCESS_MAX_FILTERS = 32; +const UINT D3D12_VIDEO_PROCESS_STEREO_VIEWS = 2; +const UINT D3D12_VIEWPORT_AND_SCISSORRECT_MAX_INDEX = 15; +const UINT D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE = 16; +const UINT D3D12_VIEWPORT_BOUNDS_MAX = 32767; +const INT D3D12_VIEWPORT_BOUNDS_MIN = -32768; +const UINT D3D12_VS_INPUT_REGISTER_COMPONENTS = 4; +const UINT D3D12_VS_INPUT_REGISTER_COMPONENT_BIT_COUNT = 32; +const UINT D3D12_VS_INPUT_REGISTER_COUNT = 32; +const UINT D3D12_VS_INPUT_REGISTER_READS_PER_INST = 2; +const UINT D3D12_VS_INPUT_REGISTER_READ_PORTS = 1; +const UINT D3D12_VS_OUTPUT_REGISTER_COMPONENTS = 4; +const UINT D3D12_VS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT = 32; +const UINT D3D12_VS_OUTPUT_REGISTER_COUNT = 32; +const UINT D3D12_WHQL_CONTEXT_COUNT_FOR_RESOURCE_LIMIT = 10; +const UINT D3D12_WHQL_DRAWINDEXED_INDEX_COUNT_2_TO_EXP = 25; +const UINT D3D12_WHQL_DRAW_VERTEX_COUNT_2_TO_EXP = 25; +cpp_quote( "#endif" ) + + +// Forward declarations +interface ID3D12CommandQueue; + + +typedef UINT64 D3D12_GPU_VIRTUAL_ADDRESS; + +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_VIDEO_DECODE = 4, + D3D12_COMMAND_LIST_TYPE_VIDEO_PROCESS = 5, + D3D12_COMMAND_LIST_TYPE_VIDEO_ENCODE = 6, + + D3D12_COMMAND_LIST_TYPE_NONE = -1, + +} D3D12_COMMAND_LIST_TYPE; + +typedef enum D3D12_COMMAND_QUEUE_FLAGS +{ + D3D12_COMMAND_QUEUE_FLAG_NONE = 0x0, + D3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT = 0x1, +} D3D12_COMMAND_QUEUE_FLAGS; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_QUEUE_FLAGS );" ) + +typedef enum D3D12_COMMAND_QUEUE_PRIORITY +{ + D3D12_COMMAND_QUEUE_PRIORITY_NORMAL = 0, + D3D12_COMMAND_QUEUE_PRIORITY_HIGH = 100, + D3D12_COMMAND_QUEUE_PRIORITY_GLOBAL_REALTIME = 10000 +} D3D12_COMMAND_QUEUE_PRIORITY; + +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 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 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 +{ + LPCSTR SemanticName; + UINT SemanticIndex; + DXGI_FORMAT Format; + UINT InputSlot; + UINT AlignedByteOffset; + D3D12_INPUT_CLASSIFICATION InputSlotClass; + UINT InstanceDataStepRate; +} D3D12_INPUT_ELEMENT_DESC; + +// Keep FILL_MODE values in sync with earlier DX versions (HW consumes values directly). +typedef enum D3D12_FILL_MODE +{ + // 1 was POINT in D3D, unused in D3D12 + D3D12_FILL_MODE_WIREFRAME = 2, + D3D12_FILL_MODE_SOLID = 3 +} D3D12_FILL_MODE; + +typedef D3D_PRIMITIVE_TOPOLOGY D3D12_PRIMITIVE_TOPOLOGY; + +typedef D3D_PRIMITIVE D3D12_PRIMITIVE; + +// Keep CULL_MODE values in sync with earlier DX versions (HW consumes values directly). +typedef enum D3D12_CULL_MODE +{ + D3D12_CULL_MODE_NONE = 1, + D3D12_CULL_MODE_FRONT = 2, + D3D12_CULL_MODE_BACK = 3 +} D3D12_CULL_MODE; + +typedef struct D3D12_SO_DECLARATION_ENTRY +{ + UINT Stream; + LPCSTR SemanticName; + UINT SemanticIndex; + BYTE StartComponent; + BYTE ComponentCount; + BYTE OutputSlot; +} D3D12_SO_DECLARATION_ENTRY; + +typedef struct D3D12_VIEWPORT +{ + FLOAT TopLeftX; + FLOAT TopLeftY; + FLOAT Width; + FLOAT Height; + FLOAT MinDepth; + FLOAT MaxDepth; +} D3D12_VIEWPORT; + + +typedef RECT D3D12_RECT; + + +typedef struct D3D12_BOX +{ + UINT left; + UINT top; + UINT front; + UINT right; + UINT bottom; + UINT back; +} D3D12_BOX; + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// Depth-Stencil State +// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// Keep COMPARISON_FUNC values in sync with earlier DX versions (HW consumes values directly). +typedef enum D3D12_COMPARISON_FUNC +{ + D3D12_COMPARISON_FUNC_NONE = 0, + 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 enum D3D12_DEPTH_WRITE_MASK +{ + D3D12_DEPTH_WRITE_MASK_ZERO = 0, + D3D12_DEPTH_WRITE_MASK_ALL = 1 +} D3D12_DEPTH_WRITE_MASK; + +// Keep STENCILOP values in sync with earlier DX versions (HW consumes values directly). +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 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 struct D3D12_DEPTH_STENCIL_DESC1 +{ + 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; + BOOL DepthBoundsTestEnable; +} D3D12_DEPTH_STENCIL_DESC1; + +// Front/back face independent stencil masks +typedef struct D3D12_DEPTH_STENCILOP_DESC1 +{ + D3D12_STENCIL_OP StencilFailOp; + D3D12_STENCIL_OP StencilDepthFailOp; + D3D12_STENCIL_OP StencilPassOp; + D3D12_COMPARISON_FUNC StencilFunc; + UINT8 StencilReadMask; + UINT8 StencilWriteMask; +} D3D12_DEPTH_STENCILOP_DESC1; + +typedef struct D3D12_DEPTH_STENCIL_DESC2 +{ + BOOL DepthEnable; + D3D12_DEPTH_WRITE_MASK DepthWriteMask; + D3D12_COMPARISON_FUNC DepthFunc; + BOOL StencilEnable; + D3D12_DEPTH_STENCILOP_DESC1 FrontFace; + D3D12_DEPTH_STENCILOP_DESC1 BackFace; + BOOL DepthBoundsTestEnable; +} D3D12_DEPTH_STENCIL_DESC2; + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// Blend State +// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// Keep BLEND values in sync with earlier DX versions (HW consumes values directly). +typedef enum D3D12_BLEND +{ + D3D12_BLEND_ZERO = 1, + D3D12_BLEND_ONE = 2, + D3D12_BLEND_SRC_COLOR = 3, // PS output oN.rgb (N is current RT being blended) + D3D12_BLEND_INV_SRC_COLOR = 4, // 1.0f - PS output oN.rgb + D3D12_BLEND_SRC_ALPHA = 5, // PS output oN.a + D3D12_BLEND_INV_SRC_ALPHA = 6, // 1.0f - PS output oN.a + D3D12_BLEND_DEST_ALPHA = 7, // RT(N).a (N is current RT being blended) + D3D12_BLEND_INV_DEST_ALPHA = 8, // 1.0f - RT(N).a + D3D12_BLEND_DEST_COLOR = 9, // RT(N).rgb + D3D12_BLEND_INV_DEST_COLOR = 10,// 1.0f - RT(N).rgb + D3D12_BLEND_SRC_ALPHA_SAT = 11,// (f,f,f,1), f = min(1 - RT(N).a, oN.a) + // 12 reserved (was BOTHSRCALPHA) + // 13 reserved (was BOTHSRCALPHA) + D3D12_BLEND_BLEND_FACTOR = 14, + D3D12_BLEND_INV_BLEND_FACTOR = 15, + D3D12_BLEND_SRC1_COLOR = 16, // PS output o1.rgb + D3D12_BLEND_INV_SRC1_COLOR = 17, // 1.0f - PS output o1.rgb + D3D12_BLEND_SRC1_ALPHA = 18, // PS output o1.a + D3D12_BLEND_INV_SRC1_ALPHA = 19, // 1.0f - PS output o1.a + D3D12_BLEND_ALPHA_FACTOR = 20, + D3D12_BLEND_INV_ALPHA_FACTOR = 21 +} D3D12_BLEND; + +// Keep BLENDOP values in sync with earlier DX versions (HW consumes values directly). +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, // min semantics are like min shader instruction + D3D12_BLEND_OP_MAX = 5, // max semantics are like max shader instruction +} D3D12_BLEND_OP; + +typedef enum D3D12_COLOR_WRITE_ENABLE +{ + D3D12_COLOR_WRITE_ENABLE_RED = 1, + D3D12_COLOR_WRITE_ENABLE_GREEN = 2, + D3D12_COLOR_WRITE_ENABLE_BLUE = 4, + D3D12_COLOR_WRITE_ENABLE_ALPHA = 8, + 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 enum D3D12_LOGIC_OP +{ + // Operation: + // (s == PS output, d = RTV contents) + D3D12_LOGIC_OP_CLEAR = 0, // 0 + D3D12_LOGIC_OP_SET, // 1 + D3D12_LOGIC_OP_COPY, // s + D3D12_LOGIC_OP_COPY_INVERTED, // ~s + D3D12_LOGIC_OP_NOOP, // d + D3D12_LOGIC_OP_INVERT, // ~d + D3D12_LOGIC_OP_AND, // s & d + D3D12_LOGIC_OP_NAND, // ~(s & d) + D3D12_LOGIC_OP_OR, // s | d + D3D12_LOGIC_OP_NOR, // ~(s | d) + D3D12_LOGIC_OP_XOR, // s ^ d + D3D12_LOGIC_OP_EQUIV, // ~(s ^ d) + D3D12_LOGIC_OP_AND_REVERSE, // s & ~d + D3D12_LOGIC_OP_AND_INVERTED, // ~s & d + D3D12_LOGIC_OP_OR_REVERSE, // s | ~d + D3D12_LOGIC_OP_OR_INVERTED, // ~s | d +} D3D12_LOGIC_OP; + +typedef struct D3D12_RENDER_TARGET_BLEND_DESC +{ + BOOL BlendEnable; + BOOL LogicOpEnable; // LogicOpEnable and BlendEnable can't both be true + D3D12_BLEND SrcBlend; + D3D12_BLEND DestBlend; + D3D12_BLEND_OP BlendOp; + D3D12_BLEND SrcBlendAlpha; + D3D12_BLEND DestBlendAlpha; + D3D12_BLEND_OP BlendOpAlpha; + D3D12_LOGIC_OP LogicOp; // applies to RGBA + UINT8 RenderTargetWriteMask; // D3D12_COLOR_WRITE_ENABLE +} D3D12_RENDER_TARGET_BLEND_DESC; + +typedef struct D3D12_BLEND_DESC +{ + BOOL AlphaToCoverageEnable; // relevant to multisample antialiasing only + BOOL IndependentBlendEnable; // if FALSE, then replicate the first entry in RenderTarget array to other entries + D3D12_RENDER_TARGET_BLEND_DESC RenderTarget[D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT]; +} D3D12_BLEND_DESC; + +cpp_quote( "/* Note, the array size for RenderTarget[] above is D3D12_SIMULTANEOUS_RENDERTARGET_COUNT. ") +cpp_quote( " IDL processing/generation of this header replaces the define; this comment is merely explaining what happened. */" ) + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// Rasterizer State +// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +typedef enum D3D12_CONSERVATIVE_RASTERIZATION_MODE +{ + D3D12_CONSERVATIVE_RASTERIZATION_MODE_OFF = 0, // Default + 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; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// Pipeline State v1 +// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +[ uuid( c54a6b66-72df-4ee8-8be5-a946a1429214 ), object, local, pointer_default( unique ) ] +interface ID3D12RootSignature + : ID3D12DeviceChild +{ +} + +typedef struct D3D12_SHADER_BYTECODE +{ + [annotation("_Field_size_bytes_full_(BytecodeLength)")] const void* pShaderBytecode; + SIZE_T BytecodeLength; +} D3D12_SHADER_BYTECODE; + +typedef struct D3D12_STREAM_OUTPUT_DESC +{ + [annotation("_Field_size_full_(NumEntries)")] const D3D12_SO_DECLARATION_ENTRY* pSODeclaration; + UINT NumEntries; + [annotation("_Field_size_full_(NumStrides)")] const UINT* pBufferStrides; + UINT NumStrides; + UINT RasterizedStream; +} D3D12_STREAM_OUTPUT_DESC; + +typedef struct D3D12_INPUT_LAYOUT_DESC +{ + [annotation("_Field_size_full_(NumElements)")] 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 struct D3D12_CACHED_PIPELINE_STATE +{ + [annotation("_Field_size_bytes_full_(CachedBlobSizeInBytes)")] 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_TOOL_DEBUG = 0x1, + +} D3D12_PIPELINE_STATE_FLAGS; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( 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[ D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT ]; + 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; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// Pipeline State v2 +// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +struct D3D12_RT_FORMAT_ARRAY +{ + DXGI_FORMAT RTFormats[D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT]; + UINT NumRenderTargets; +}; + +typedef struct D3D12_PIPELINE_STATE_STREAM_DESC +{ + [annotation("_In_")] SIZE_T SizeInBytes; + [annotation("_In_reads_(_Inexpressible_(\"Dependent on size of subobjects\"))")] void* pPipelineStateSubobjectStream; +} D3D12_PIPELINE_STATE_STREAM_DESC; + +typedef enum D3D12_PIPELINE_STATE_SUBOBJECT_TYPE +{ + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_ROOT_SIGNATURE, // ID3D12RootSignature* + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VS, // D3D12_SHADER_BYTECODE + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PS, // D3D12_SHADER_BYTECODE + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DS, // D3D12_SHADER_BYTECODE + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_HS, // D3D12_SHADER_BYTECODE + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_GS, // D3D12_SHADER_BYTECODE + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CS, // D3D12_SHADER_BYTECODE + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_STREAM_OUTPUT, // D3D12_STREAM_OUTPUT_DESC + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_BLEND, // D3D12_BLEND_DESC + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_MASK, // UINT + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER, // D3D12_RASTERIZER_DESC + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL, // D3D12_DEPTH_STENCIL_DESC + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_INPUT_LAYOUT, // D3D12_INPUT_LAYOUT_DESC + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_IB_STRIP_CUT_VALUE, // D3D12_INDEX_BUFFER_STRIP_CUT_VALUE + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PRIMITIVE_TOPOLOGY, // D3D12_PRIMITIVE_TOPOLOGY_TYPE + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RENDER_TARGET_FORMATS, // D3D12_RT_FORMAT_ARRAY + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL_FORMAT, // DXGI_FORMAT + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_DESC, // DXGI_SAMPLE_DESC + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_NODE_MASK, // UINT + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CACHED_PSO, // D3D12_CACHED_PIPELINE_STATE + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_FLAGS, // D3D12_PIPELINE_STATE_FLAGS + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1, // D3D12_DEPTH_STENCIL_DESC1 + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VIEW_INSTANCING, // D3D12_VIEW_INSTANCING_DESC + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_AS = 24, // D3D12_SHADER_BYTECODE + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MS = 25, // D3D12_SHADER_BYTECODE + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2 = 26, // D3D12_DEPTH_STENCIL_DESC2 + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MAX_VALID, +} D3D12_PIPELINE_STATE_SUBOBJECT_TYPE; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// D3D12 Caps +// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +typedef enum D3D12_FEATURE +{ + D3D12_FEATURE_D3D12_OPTIONS = 0, + D3D12_FEATURE_ARCHITECTURE = 1, // Deprecated by D3D12_FEATURE_ARCHITECTURE1 + D3D12_FEATURE_FEATURE_LEVELS = 2, + D3D12_FEATURE_FORMAT_SUPPORT = 3, + D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS = 4, + D3D12_FEATURE_FORMAT_INFO = 5, + D3D12_FEATURE_GPU_VIRTUAL_ADDRESS_SUPPORT = 6, + D3D12_FEATURE_SHADER_MODEL = 7, + D3D12_FEATURE_D3D12_OPTIONS1 = 8, + D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_SUPPORT = 10, + D3D12_FEATURE_ROOT_SIGNATURE = 12, + D3D12_FEATURE_ARCHITECTURE1 = 16, + D3D12_FEATURE_D3D12_OPTIONS2 = 18, + D3D12_FEATURE_SHADER_CACHE = 19, + D3D12_FEATURE_COMMAND_QUEUE_PRIORITY = 20, + D3D12_FEATURE_D3D12_OPTIONS3 = 21, + D3D12_FEATURE_EXISTING_HEAPS = 22, + D3D12_FEATURE_D3D12_OPTIONS4 = 23, + D3D12_FEATURE_SERIALIZATION = 24, + D3D12_FEATURE_CROSS_NODE = 25, + D3D12_FEATURE_D3D12_OPTIONS5 = 27, + D3D12_FEATURE_DISPLAYABLE = 28, + D3D12_FEATURE_D3D12_OPTIONS6 = 30, + D3D12_FEATURE_QUERY_META_COMMAND = 31, + D3D12_FEATURE_D3D12_OPTIONS7 = 32, + D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_TYPE_COUNT = 33, + D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_TYPES = 34, + D3D12_FEATURE_D3D12_OPTIONS8 = 36, + D3D12_FEATURE_D3D12_OPTIONS9 = 37, + D3D12_FEATURE_D3D12_OPTIONS10 = 39, + D3D12_FEATURE_D3D12_OPTIONS11 = 40, + D3D12_FEATURE_D3D12_OPTIONS12 = 41, + D3D12_FEATURE_D3D12_OPTIONS13 = 42, + D3D12_FEATURE_D3D12_OPTIONS14 = 43, + D3D12_FEATURE_D3D12_OPTIONS15 = 44, +} D3D12_FEATURE; + +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; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( 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_4 = 4, +} 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_FORMAT_SUPPORT1 +{ + D3D12_FORMAT_SUPPORT1_NONE = 0, + D3D12_FORMAT_SUPPORT1_BUFFER = 0x00000001, + D3D12_FORMAT_SUPPORT1_IA_VERTEX_BUFFER = 0x00000002, + D3D12_FORMAT_SUPPORT1_IA_INDEX_BUFFER = 0x00000004, + D3D12_FORMAT_SUPPORT1_SO_BUFFER = 0x00000008, + D3D12_FORMAT_SUPPORT1_TEXTURE1D = 0x00000010, + D3D12_FORMAT_SUPPORT1_TEXTURE2D = 0x00000020, + D3D12_FORMAT_SUPPORT1_TEXTURE3D = 0x00000040, + D3D12_FORMAT_SUPPORT1_TEXTURECUBE = 0x00000080, + D3D12_FORMAT_SUPPORT1_SHADER_LOAD = 0x00000100, + D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE = 0x00000200, + D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE_COMPARISON = 0x00000400, + D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE_MONO_TEXT = 0x00000800, + D3D12_FORMAT_SUPPORT1_MIP = 0x00001000, + D3D12_FORMAT_SUPPORT1_RENDER_TARGET = 0x00004000, + D3D12_FORMAT_SUPPORT1_BLENDABLE = 0x00008000, + D3D12_FORMAT_SUPPORT1_DEPTH_STENCIL = 0x00010000, + D3D12_FORMAT_SUPPORT1_MULTISAMPLE_RESOLVE = 0x00040000, + D3D12_FORMAT_SUPPORT1_DISPLAY = 0x00080000, + D3D12_FORMAT_SUPPORT1_CAST_WITHIN_BIT_LAYOUT = 0x00100000, + D3D12_FORMAT_SUPPORT1_MULTISAMPLE_RENDERTARGET = 0x00200000, + D3D12_FORMAT_SUPPORT1_MULTISAMPLE_LOAD = 0x00400000, + D3D12_FORMAT_SUPPORT1_SHADER_GATHER = 0x00800000, + D3D12_FORMAT_SUPPORT1_BACK_BUFFER_CAST = 0x01000000, + D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW = 0x02000000, + D3D12_FORMAT_SUPPORT1_SHADER_GATHER_COMPARISON = 0x04000000, + D3D12_FORMAT_SUPPORT1_DECODER_OUTPUT = 0x08000000, + D3D12_FORMAT_SUPPORT1_VIDEO_PROCESSOR_OUTPUT = 0x10000000, + D3D12_FORMAT_SUPPORT1_VIDEO_PROCESSOR_INPUT = 0x20000000, + D3D12_FORMAT_SUPPORT1_VIDEO_ENCODER = 0x40000000, +} D3D12_FORMAT_SUPPORT1; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_FORMAT_SUPPORT1 );" ) + +typedef enum D3D12_FORMAT_SUPPORT2 +{ + D3D12_FORMAT_SUPPORT2_NONE = 0, + D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_ADD = 0x00000001, + D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_BITWISE_OPS = 0x00000002, + D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_COMPARE_STORE_OR_COMPARE_EXCHANGE = 0x00000004, + D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_EXCHANGE = 0x00000008, + D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_SIGNED_MIN_OR_MAX = 0x00000010, + D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_UNSIGNED_MIN_OR_MAX = 0x00000020, + D3D12_FORMAT_SUPPORT2_UAV_TYPED_LOAD = 0x00000040, + D3D12_FORMAT_SUPPORT2_UAV_TYPED_STORE = 0x00000080, + D3D12_FORMAT_SUPPORT2_OUTPUT_MERGER_LOGIC_OP = 0x00000100, + D3D12_FORMAT_SUPPORT2_TILED = 0x00000200, + D3D12_FORMAT_SUPPORT2_MULTIPLANE_OVERLAY = 0x00004000, + D3D12_FORMAT_SUPPORT2_SAMPLER_FEEDBACK = 0x00008000, +} D3D12_FORMAT_SUPPORT2; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_FORMAT_SUPPORT2 );" ) + +typedef enum D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS +{ + D3D12_MULTISAMPLE_QUALITY_LEVELS_FLAG_NONE = 0, + D3D12_MULTISAMPLE_QUALITY_LEVELS_FLAG_TILED_RESOURCE = 0x00000001, +} D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS );" ) + +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_3 = 4, +} 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_PROGRAMMABLE_SAMPLE_POSITIONS_TIER +{ + D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_NOT_SUPPORTED = 0, + D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_1 = 1, + D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_2 = 2, +} D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER; + +typedef enum D3D12_VIEW_INSTANCING_TIER +{ + D3D12_VIEW_INSTANCING_TIER_NOT_SUPPORTED = 0, + D3D12_VIEW_INSTANCING_TIER_1 = 1, + D3D12_VIEW_INSTANCING_TIER_2 = 2, + D3D12_VIEW_INSTANCING_TIER_3 = 3, +} D3D12_VIEW_INSTANCING_TIER; + +// D3D12_FEATURE_D3D12_OPTIONS +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS +{ + [annotation("_Out_")] BOOL DoublePrecisionFloatShaderOps; + [annotation("_Out_")] BOOL OutputMergerLogicOp; + [annotation("_Out_")] D3D12_SHADER_MIN_PRECISION_SUPPORT MinPrecisionSupport; + [annotation("_Out_")] D3D12_TILED_RESOURCES_TIER TiledResourcesTier; + [annotation("_Out_")] D3D12_RESOURCE_BINDING_TIER ResourceBindingTier; + [annotation("_Out_")] BOOL PSSpecifiedStencilRefSupported; + [annotation("_Out_")] BOOL TypedUAVLoadAdditionalFormats; + [annotation("_Out_")] BOOL ROVsSupported; + [annotation("_Out_")] D3D12_CONSERVATIVE_RASTERIZATION_TIER ConservativeRasterizationTier; + [annotation("_Out_")] UINT MaxGPUVirtualAddressBitsPerResource; + [annotation("_Out_")] BOOL StandardSwizzle64KBSupported; + [annotation("_Out_")] D3D12_CROSS_NODE_SHARING_TIER CrossNodeSharingTier; + [annotation("_Out_")] BOOL CrossAdapterRowMajorTextureSupported; + [annotation("_Out_")] BOOL VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation; + [annotation("_Out_")] D3D12_RESOURCE_HEAP_TIER ResourceHeapTier; +} D3D12_FEATURE_DATA_D3D12_OPTIONS; + +// D3D12_FEATURE_D3D12_OPTIONS1 +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS1 +{ + [annotation("_Out_")] BOOL WaveOps; + [annotation("_Out_")] UINT WaveLaneCountMin; + [annotation("_Out_")] UINT WaveLaneCountMax; + [annotation("_Out_")] UINT TotalLaneCount; + [annotation("_Out_")] BOOL ExpandedComputeResourceStates; + [annotation("_Out_")] BOOL Int64ShaderOps; +} D3D12_FEATURE_DATA_D3D12_OPTIONS1; + +// D3D12_FEATURE_D3D12_OPTIONS2 +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS2 +{ + [annotation("_Out_")] BOOL DepthBoundsTestSupported; + [annotation("_Out_")] D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER ProgrammableSamplePositionsTier; +} D3D12_FEATURE_DATA_D3D12_OPTIONS2; + +// D3D12_FEATURE_ROOT_SIGNATURE +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_FEATURE_DATA_ROOT_SIGNATURE +{ + [annotation("_Inout_")] D3D_ROOT_SIGNATURE_VERSION HighestVersion; +} D3D12_FEATURE_DATA_ROOT_SIGNATURE; + +// D3D12_FEATURE_ARCHITECTURE +typedef struct D3D12_FEATURE_DATA_ARCHITECTURE // Deprecated by D3D12_FEATURE_DATA_ARCHITECTURE1 +{ + [annotation("_In_")] UINT NodeIndex; + [annotation("_Out_")] BOOL TileBasedRenderer; + [annotation("_Out_")] BOOL UMA; // Needed for applications to understand WRITE_COMBINE + [annotation("_Out_")] BOOL CacheCoherentUMA; // Only TRUE when UMA is also TRUE +} D3D12_FEATURE_DATA_ARCHITECTURE; + +// D3D12_FEATURE_ARCHITECTURE1 +typedef struct D3D12_FEATURE_DATA_ARCHITECTURE1 +{ + [annotation("_In_")] UINT NodeIndex; + [annotation("_Out_")] BOOL TileBasedRenderer; + [annotation("_Out_")] BOOL UMA; // Needed for applications to understand WRITE_COMBINE + [annotation("_Out_")] BOOL CacheCoherentUMA; // Only TRUE when UMA is also TRUE + [annotation("_Out_")] BOOL IsolatedMMU; // GPU accesses don't honor the same MMU functionality as the CPU +} D3D12_FEATURE_DATA_ARCHITECTURE1; + +// D3D12_FEATURE_FEATURE_LEVELS +typedef struct D3D12_FEATURE_DATA_FEATURE_LEVELS +{ + [annotation("_In_")] UINT NumFeatureLevels; + [annotation("_In_reads_(NumFeatureLevels)")] const D3D_FEATURE_LEVEL* pFeatureLevelsRequested; + [annotation("_Out_")] D3D_FEATURE_LEVEL MaxSupportedFeatureLevel; +} D3D12_FEATURE_DATA_FEATURE_LEVELS; + +// D3D_SHADER_MODEL +typedef enum D3D_SHADER_MODEL +{ + D3D_SHADER_MODEL_5_1 = 0x51, + D3D_SHADER_MODEL_6_0 = 0x60, + D3D_SHADER_MODEL_6_1 = 0x61, + D3D_SHADER_MODEL_6_2 = 0x62, + D3D_SHADER_MODEL_6_3 = 0x63, + D3D_SHADER_MODEL_6_4 = 0x64, + D3D_SHADER_MODEL_6_5 = 0x65, + D3D_SHADER_MODEL_6_6 = 0x66, + D3D_SHADER_MODEL_6_7 = 0x67, + D3D_SHADER_MODEL_6_8 = 0x68, + D3D_HIGHEST_SHADER_MODEL = D3D_SHADER_MODEL_6_8 +} D3D_SHADER_MODEL; + +typedef struct D3D12_FEATURE_DATA_SHADER_MODEL +{ + [annotation("_Inout_")] D3D_SHADER_MODEL HighestShaderModel; +} D3D12_FEATURE_DATA_SHADER_MODEL; + +// D3D12_FEATURE_FORMAT_SUPPORT +typedef struct D3D12_FEATURE_DATA_FORMAT_SUPPORT +{ + [annotation("_In_")] DXGI_FORMAT Format; + [annotation("_Out_")] D3D12_FORMAT_SUPPORT1 Support1; + [annotation("_Out_")] D3D12_FORMAT_SUPPORT2 Support2; +} D3D12_FEATURE_DATA_FORMAT_SUPPORT; + +// D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS +typedef struct D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS +{ + [annotation("_In_")] DXGI_FORMAT Format; + [annotation("_In_")] UINT SampleCount; + [annotation("_In_")] D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS Flags; + [annotation("_Out_")] UINT NumQualityLevels; +} D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS; + +// D3D12_FEATURE_FORMAT_INFO +typedef struct D3D12_FEATURE_DATA_FORMAT_INFO +{ + DXGI_FORMAT Format; + UINT8 PlaneCount; +} D3D12_FEATURE_DATA_FORMAT_INFO; + +// D3D12_FEATURE_GPU_VIRTUAL_ADDRESS_SUPPORT +typedef struct D3D12_FEATURE_DATA_GPU_VIRTUAL_ADDRESS_SUPPORT +{ + UINT MaxGPUVirtualAddressBitsPerResource; + UINT MaxGPUVirtualAddressBitsPerProcess; +} D3D12_FEATURE_DATA_GPU_VIRTUAL_ADDRESS_SUPPORT; + + +typedef enum D3D12_SHADER_CACHE_SUPPORT_FLAGS +{ + D3D12_SHADER_CACHE_SUPPORT_NONE = 0x0, + D3D12_SHADER_CACHE_SUPPORT_SINGLE_PSO = 0x1, // Always supported + D3D12_SHADER_CACHE_SUPPORT_LIBRARY = 0x2, + D3D12_SHADER_CACHE_SUPPORT_AUTOMATIC_INPROC_CACHE = 0x4, + D3D12_SHADER_CACHE_SUPPORT_AUTOMATIC_DISK_CACHE = 0x8, + D3D12_SHADER_CACHE_SUPPORT_DRIVER_MANAGED_CACHE = 0x10, + D3D12_SHADER_CACHE_SUPPORT_SHADER_CONTROL_CLEAR = 0x20, + D3D12_SHADER_CACHE_SUPPORT_SHADER_SESSION_DELETE = 0x40 +} D3D12_SHADER_CACHE_SUPPORT_FLAGS; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_SUPPORT_FLAGS );" ) + +// D3D12_FEATURE_SHADER_CACHE +typedef struct D3D12_FEATURE_DATA_SHADER_CACHE +{ + [annotation("_Out_")] D3D12_SHADER_CACHE_SUPPORT_FLAGS SupportFlags; +} D3D12_FEATURE_DATA_SHADER_CACHE; + +// D3D12_FEATURE_COMMAND_QUEUE_PRIORITY +typedef struct D3D12_FEATURE_DATA_COMMAND_QUEUE_PRIORITY +{ + [annotation("_In_")] D3D12_COMMAND_LIST_TYPE CommandListType; + [annotation("_In_")] UINT Priority; + [annotation("_Out_")] BOOL PriorityForTypeIsSupported; +} D3D12_FEATURE_DATA_COMMAND_QUEUE_PRIORITY; + +typedef enum D3D12_COMMAND_LIST_SUPPORT_FLAGS +{ + D3D12_COMMAND_LIST_SUPPORT_FLAG_NONE = 0x00000000, + D3D12_COMMAND_LIST_SUPPORT_FLAG_DIRECT = 1 << D3D12_COMMAND_LIST_TYPE_DIRECT, + D3D12_COMMAND_LIST_SUPPORT_FLAG_BUNDLE = 1 << D3D12_COMMAND_LIST_TYPE_BUNDLE, + D3D12_COMMAND_LIST_SUPPORT_FLAG_COMPUTE = 1 << D3D12_COMMAND_LIST_TYPE_COMPUTE, + D3D12_COMMAND_LIST_SUPPORT_FLAG_COPY = 1 << D3D12_COMMAND_LIST_TYPE_COPY, + D3D12_COMMAND_LIST_SUPPORT_FLAG_VIDEO_DECODE = 1 << D3D12_COMMAND_LIST_TYPE_VIDEO_DECODE, + D3D12_COMMAND_LIST_SUPPORT_FLAG_VIDEO_PROCESS = 1 << D3D12_COMMAND_LIST_TYPE_VIDEO_PROCESS, + D3D12_COMMAND_LIST_SUPPORT_FLAG_VIDEO_ENCODE = 1 << D3D12_COMMAND_LIST_TYPE_VIDEO_ENCODE, + +} D3D12_COMMAND_LIST_SUPPORT_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_LIST_SUPPORT_FLAGS );") + +// D3D12_FEATURE_D3D12_OPTIONS3 +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS3 +{ + [annotation("_Out_")] BOOL CopyQueueTimestampQueriesSupported; + [annotation("_Out_")] BOOL CastingFullyTypedFormatSupported; + [annotation("_Out_")] D3D12_COMMAND_LIST_SUPPORT_FLAGS WriteBufferImmediateSupportFlags; + [annotation("_Out_")] D3D12_VIEW_INSTANCING_TIER ViewInstancingTier; + [annotation("_Out_")] BOOL BarycentricsSupported; +} D3D12_FEATURE_DATA_D3D12_OPTIONS3; + +// D3D12_FEATURE_EXISTING_HEAPS +typedef struct D3D12_FEATURE_DATA_EXISTING_HEAPS +{ + [annotation("_Out_")] BOOL Supported; +} D3D12_FEATURE_DATA_EXISTING_HEAPS; + +typedef enum D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER +{ + D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_0, + D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_1, + D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_2, +} D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER; + +typedef struct D3D12_FEATURE_DATA_DISPLAYABLE +{ + [annotation("_Out_")] BOOL DisplayableTexture; + [annotation("_Out_")] D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER SharedResourceCompatibilityTier; +} D3D12_FEATURE_DATA_DISPLAYABLE; + +// D3D12_FEATURE_D3D12_OPTIONS4 +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS4 +{ + [annotation("_Out_")] BOOL MSAA64KBAlignedTextureSupported; + [annotation("_Out_")] D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER SharedResourceCompatibilityTier; + [annotation("_Out_")] BOOL Native16BitShaderOpsSupported; +} D3D12_FEATURE_DATA_D3D12_OPTIONS4; + +typedef enum D3D12_HEAP_SERIALIZATION_TIER +{ + D3D12_HEAP_SERIALIZATION_TIER_0 = 0, + D3D12_HEAP_SERIALIZATION_TIER_10 = 10, +} D3D12_HEAP_SERIALIZATION_TIER; + +// D3D12_FEATURE_SERIALIZATION +typedef struct D3D12_FEATURE_DATA_SERIALIZATION +{ + [annotation("_In_")] UINT NodeIndex; + [annotation("_Out_")] D3D12_HEAP_SERIALIZATION_TIER HeapSerializationTier; +} D3D12_FEATURE_DATA_SERIALIZATION; + +// D3D12_FEATURE_CROSS_NODE +typedef struct D3D12_FEATURE_DATA_CROSS_NODE +{ + D3D12_CROSS_NODE_SHARING_TIER SharingTier; + BOOL AtomicShaderInstructions; +} D3D12_FEATURE_DATA_CROSS_NODE; + + +typedef enum D3D12_RENDER_PASS_TIER +{ + D3D12_RENDER_PASS_TIER_0 = 0, + D3D12_RENDER_PASS_TIER_1 = 1, + D3D12_RENDER_PASS_TIER_2 = 2, + + +} D3D12_RENDER_PASS_TIER; + +typedef enum D3D12_RAYTRACING_TIER +{ + D3D12_RAYTRACING_TIER_NOT_SUPPORTED = 0, + D3D12_RAYTRACING_TIER_1_0 = 10, + D3D12_RAYTRACING_TIER_1_1 = 11, +} D3D12_RAYTRACING_TIER; + +// D3D12_FEATURE_D3D12_OPTIONS5 +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS5 +{ + [annotation("_Out_")] BOOL SRVOnlyTiledResourceTier3; + [annotation("_Out_")] D3D12_RENDER_PASS_TIER RenderPassesTier; + [annotation("_Out_")] D3D12_RAYTRACING_TIER RaytracingTier; +} D3D12_FEATURE_DATA_D3D12_OPTIONS5; + +typedef enum D3D12_VARIABLE_SHADING_RATE_TIER +{ + D3D12_VARIABLE_SHADING_RATE_TIER_NOT_SUPPORTED = 0, + D3D12_VARIABLE_SHADING_RATE_TIER_1 = 1, + D3D12_VARIABLE_SHADING_RATE_TIER_2 = 2, +} D3D12_VARIABLE_SHADING_RATE_TIER; + +// D3D12_FEATURE_D3D12_OPTIONS6 +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS6 +{ + [annotation("_Out_")] BOOL AdditionalShadingRatesSupported; + [annotation("_Out_")] BOOL PerPrimitiveShadingRateSupportedWithViewportIndexing; + [annotation("_Out_")] D3D12_VARIABLE_SHADING_RATE_TIER VariableShadingRateTier; + [annotation("_Out_")] UINT ShadingRateImageTileSize; + [annotation("_Out_")] BOOL BackgroundProcessingSupported; +} D3D12_FEATURE_DATA_D3D12_OPTIONS6; + +typedef enum D3D12_MESH_SHADER_TIER +{ + D3D12_MESH_SHADER_TIER_NOT_SUPPORTED = 0, + D3D12_MESH_SHADER_TIER_1 = 10, +} D3D12_MESH_SHADER_TIER; + +typedef enum D3D12_SAMPLER_FEEDBACK_TIER +{ + D3D12_SAMPLER_FEEDBACK_TIER_NOT_SUPPORTED = 0, + D3D12_SAMPLER_FEEDBACK_TIER_0_9 = 90, + D3D12_SAMPLER_FEEDBACK_TIER_1_0 = 100 +} D3D12_SAMPLER_FEEDBACK_TIER; + +// D3D12_FEATURE_D3D12_OPTIONS7 +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS7 +{ + [annotation("_Out_")] D3D12_MESH_SHADER_TIER MeshShaderTier; + [annotation("_Out_")] D3D12_SAMPLER_FEEDBACK_TIER SamplerFeedbackTier; + +} D3D12_FEATURE_DATA_D3D12_OPTIONS7; + +typedef struct D3D12_FEATURE_DATA_QUERY_META_COMMAND +{ + [annotation("_In_")] GUID CommandId; + [annotation("_In_")] UINT NodeMask; + [annotation("_Field_size_bytes_full_opt_( QueryInputDataSizeInBytes )")] const void* pQueryInputData; + [annotation("_In_")] SIZE_T QueryInputDataSizeInBytes; + [annotation("_Field_size_bytes_full_( QueryOutputDataSizeInBytes )")] void* pQueryOutputData; + [annotation("_In_")] SIZE_T QueryOutputDataSizeInBytes; +} D3D12_FEATURE_DATA_QUERY_META_COMMAND; + +// D3D12_FEATURE_D3D12_OPTIONS8 +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS8 +{ + [annotation("_Out_")] BOOL UnalignedBlockTexturesSupported; +} D3D12_FEATURE_DATA_D3D12_OPTIONS8; + +typedef enum D3D12_WAVE_MMA_TIER { + D3D12_WAVE_MMA_TIER_NOT_SUPPORTED = 0, + D3D12_WAVE_MMA_TIER_1_0 = 10, +} D3D12_WAVE_MMA_TIER; + +// D3D12_FEATURE_D3D12_OPTIONS9 +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS9 +{ + [annotation("_Out_")] BOOL MeshShaderPipelineStatsSupported; + [annotation("_Out_")] BOOL MeshShaderSupportsFullRangeRenderTargetArrayIndex; + [annotation("_Out_")] BOOL AtomicInt64OnTypedResourceSupported; + [annotation("_Out_")] BOOL AtomicInt64OnGroupSharedSupported; + [annotation("_Out_")] BOOL DerivativesInMeshAndAmplificationShadersSupported; + [annotation("_Out_")] D3D12_WAVE_MMA_TIER WaveMMATier; +} D3D12_FEATURE_DATA_D3D12_OPTIONS9; + +// D3D12_FEATURE_D3D12_OPTIONS10 +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS10 +{ + [annotation("_Out_")] BOOL VariableRateShadingSumCombinerSupported; + [annotation("_Out_")] BOOL MeshShaderPerPrimitiveShadingRateSupported; +} D3D12_FEATURE_DATA_D3D12_OPTIONS10; + +// D3D12_FEATURE_D3D12_OPTIONS11 +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS11 +{ + [annotation("_Out_")] BOOL AtomicInt64OnDescriptorHeapResourceSupported; +} D3D12_FEATURE_DATA_D3D12_OPTIONS11; + +typedef enum D3D12_TRI_STATE { + D3D12_TRI_STATE_UNKNOWN = -1, + D3D12_TRI_STATE_FALSE = 0, + D3D12_TRI_STATE_TRUE = 1, +} D3D12_TRI_STATE; + +// D3D12_FEATURE_D3D12_OPTIONS12 +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS12 +{ + [annotation("_Out_")] D3D12_TRI_STATE MSPrimitivesPipelineStatisticIncludesCulledPrimitives; + [annotation("_Out_")] BOOL EnhancedBarriersSupported; + [annotation("_Out_")] BOOL RelaxedFormatCastingSupported; +} D3D12_FEATURE_DATA_D3D12_OPTIONS12; + +// D3D12_FEATURE_D3D12_OPTIONS13 +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS13 +{ + [annotation("_Out_")] BOOL UnrestrictedBufferTextureCopyPitchSupported; + [annotation("_Out_")] BOOL UnrestrictedVertexElementAlignmentSupported; + [annotation("_Out_")] BOOL InvertedViewportHeightFlipsYSupported; + [annotation("_Out_")] BOOL InvertedViewportDepthFlipsZSupported; + [annotation("_Out_")] BOOL TextureCopyBetweenDimensionsSupported; + [annotation("_Out_")] BOOL AlphaBlendFactorSupported; +} D3D12_FEATURE_DATA_D3D12_OPTIONS13; + +// D3D12_FEATURE_D3D12_OPTIONS14 +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS14 +{ + [annotation("_Out_")] BOOL AdvancedTextureOpsSupported; + [annotation("_Out_")] BOOL WriteableMSAATexturesSupported; + [annotation("_Out_")] BOOL IndependentFrontAndBackStencilRefMaskSupported; +} D3D12_FEATURE_DATA_D3D12_OPTIONS14; + +// D3D12_FEATURE_D3D12_OPTIONS15 +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS15 +{ + [annotation("_Out_")] BOOL TriangleFanSupported; + [annotation("_Out_")] BOOL DynamicIndexBufferStripCutSupported; +} D3D12_FEATURE_DATA_D3D12_OPTIONS15; + + + +typedef struct D3D12_RESOURCE_ALLOCATION_INFO +{ + UINT64 SizeInBytes; + UINT64 Alignment; +} D3D12_RESOURCE_ALLOCATION_INFO; + +typedef struct D3D12_RESOURCE_ALLOCATION_INFO1 +{ + UINT64 Offset; + UINT64 Alignment; + UINT64 SizeInBytes; +} D3D12_RESOURCE_ALLOCATION_INFO1; + +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_NOT_AVAILABLE = 1, + 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, // Maximum bandwidth for CPU + D3D12_MEMORY_POOL_L1 = 2, // More bandwidth for GPU, less for CPU +} 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_HARDWARE_PROTECTED = 0x100, + D3D12_HEAP_FLAG_ALLOW_WRITE_WATCH = 0x200, + D3D12_HEAP_FLAG_ALLOW_SHADER_ATOMICS = 0x400, + D3D12_HEAP_FLAG_CREATE_NOT_RESIDENT = 0x800, + D3D12_HEAP_FLAG_CREATE_NOT_ZEROED = 0x1000, + + // These are convenience aliases to manage resource heap tier restrictions. They cannot be bitwise OR'ed together cleanly. + D3D12_HEAP_FLAG_ALLOW_ALL_BUFFERS_AND_TEXTURES = 0x0, + 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; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_HEAP_FLAGS );" ) + +typedef struct D3D12_HEAP_DESC +{ + UINT64 SizeInBytes; + D3D12_HEAP_PROPERTIES Properties; + UINT64 Alignment; + D3D12_HEAP_FLAGS Flags; +} D3D12_HEAP_DESC; + +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, // Must be used with buffers. Can be used with cross-adapter shared textures. + 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_FLAG_VIDEO_DECODE_REFERENCE_ONLY = 0x40, + D3D12_RESOURCE_FLAG_VIDEO_ENCODE_REFERENCE_ONLY = 0x80, + D3D12_RESOURCE_FLAG_RAYTRACING_ACCELERATION_STRUCTURE = 0x100, + +} D3D12_RESOURCE_FLAGS; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_FLAGS );" ) + +typedef struct D3D12_MIP_REGION +{ + UINT Width; + UINT Height; + UINT Depth; +} D3D12_MIP_REGION; + +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 struct D3D12_RESOURCE_DESC1 +{ + 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_MIP_REGION SamplerFeedbackMipRegion; +} D3D12_RESOURCE_DESC1; + + +typedef struct D3D12_DEPTH_STENCIL_VALUE +{ + FLOAT Depth; + UINT8 Stencil; +} D3D12_DEPTH_STENCIL_VALUE; + +typedef struct D3D12_CLEAR_VALUE +{ + DXGI_FORMAT Format; + union + { + FLOAT Color[4]; + D3D12_DEPTH_STENCIL_VALUE DepthStencil; + }; +} D3D12_CLEAR_VALUE; + +typedef struct D3D12_RANGE +{ + SIZE_T Begin; + SIZE_T End; // One past end, so (End - Begin) = Size +} D3D12_RANGE; + +typedef struct D3D12_RANGE_UINT64 +{ + UINT64 Begin; + UINT64 End; // One past end, so (End - Begin) = Size +} D3D12_RANGE_UINT64; + +typedef struct D3D12_SUBRESOURCE_RANGE_UINT64 +{ + UINT Subresource; + D3D12_RANGE_UINT64 Range; +} D3D12_SUBRESOURCE_RANGE_UINT64; + +typedef struct D3D12_SUBRESOURCE_INFO +{ + UINT64 Offset; + UINT RowPitch; + UINT DepthPitch; +} D3D12_SUBRESOURCE_INFO; + +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 enum D3D12_TILE_RANGE_FLAGS +{ + D3D12_TILE_RANGE_FLAG_NONE = 0, + D3D12_TILE_RANGE_FLAG_NULL = 1, + D3D12_TILE_RANGE_FLAG_SKIP = 2, + D3D12_TILE_RANGE_FLAG_REUSE_SINGLE_TILE = 4, + +} D3D12_TILE_RANGE_FLAGS; + +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_PACKED_MIP_INFO +{ + UINT8 NumStandardMips; + UINT8 NumPackedMips; + UINT NumTilesForPackedMips; + UINT StartTileIndexInOverallResource; +} D3D12_PACKED_MIP_INFO; + +typedef enum D3D12_TILE_MAPPING_FLAGS +{ + D3D12_TILE_MAPPING_FLAG_NONE = 0x0, + D3D12_TILE_MAPPING_FLAG_NO_HAZARD = 0x1, +} D3D12_TILE_MAPPING_FLAGS; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_TILE_MAPPING_FLAGS );" ) + +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; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_TILE_COPY_FLAGS );") + +// Resource Barrier +typedef enum D3D12_RESOURCE_STATES +{ + D3D12_RESOURCE_STATE_COMMON = 0, + + D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER = 0x00001, + D3D12_RESOURCE_STATE_INDEX_BUFFER = 0x00002, + D3D12_RESOURCE_STATE_RENDER_TARGET = 0x00004, + D3D12_RESOURCE_STATE_UNORDERED_ACCESS = 0x00008, + D3D12_RESOURCE_STATE_DEPTH_WRITE = 0x00010, + D3D12_RESOURCE_STATE_DEPTH_READ = 0x00020, + D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE = 0x00040, + D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE = 0x00080, + D3D12_RESOURCE_STATE_STREAM_OUT = 0x00100, + D3D12_RESOURCE_STATE_INDIRECT_ARGUMENT = 0x00200, + D3D12_RESOURCE_STATE_COPY_DEST = 0x00400, + D3D12_RESOURCE_STATE_COPY_SOURCE = 0x00800, + D3D12_RESOURCE_STATE_RESOLVE_DEST = 0x01000, + D3D12_RESOURCE_STATE_RESOLVE_SOURCE = 0x02000, + D3D12_RESOURCE_STATE_RAYTRACING_ACCELERATION_STRUCTURE = 0x400000, + D3D12_RESOURCE_STATE_SHADING_RATE_SOURCE = 0x1000000, + + D3D12_RESOURCE_STATE_GENERIC_READ = + /*D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER*/ 0x0001 | + /*D3D12_RESOURCE_STATE_INDEX_BUFFER*/ 0x0002 | + /*D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE*/ 0x0040 | + /*D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE*/ 0x0080 | + /*D3D12_RESOURCE_STATE_INDIRECT_ARGUMENT*/ 0x0200 | + /*D3D12_RESOURCE_STATE_COPY_SOURCE*/ 0x0800, + + D3D12_RESOURCE_STATE_ALL_SHADER_RESOURCE = + /*D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE*/ 0x40 | + /*D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE*/ 0x80, + + D3D12_RESOURCE_STATE_PRESENT = 0, + D3D12_RESOURCE_STATE_PREDICATION = /*D3D12_RESOURCE_STATE_INDIRECT_ARGUMENT*/ 0x0200, + + D3D12_RESOURCE_STATE_VIDEO_DECODE_READ = 0x00010000, + D3D12_RESOURCE_STATE_VIDEO_DECODE_WRITE = 0x00020000, + D3D12_RESOURCE_STATE_VIDEO_PROCESS_READ = 0x00040000, + D3D12_RESOURCE_STATE_VIDEO_PROCESS_WRITE = 0x00080000, + D3D12_RESOURCE_STATE_VIDEO_ENCODE_READ = 0x00200000, + D3D12_RESOURCE_STATE_VIDEO_ENCODE_WRITE = 0x00800000, + +} D3D12_RESOURCE_STATES; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_STATES );" ) + +typedef enum D3D12_RESOURCE_BARRIER_TYPE +{ + D3D12_RESOURCE_BARRIER_TYPE_TRANSITION, + D3D12_RESOURCE_BARRIER_TYPE_ALIASING, + D3D12_RESOURCE_BARRIER_TYPE_UAV, +} D3D12_RESOURCE_BARRIER_TYPE; + +interface ID3D12Resource; + +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 +{ + ID3D12Resource* pResourceBefore; + ID3D12Resource* pResourceAfter; +} D3D12_RESOURCE_ALIASING_BARRIER; + +typedef struct D3D12_RESOURCE_UAV_BARRIER +{ + ID3D12Resource* pResource; +} D3D12_RESOURCE_UAV_BARRIER; + +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; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_BARRIER_FLAGS );" ) + +typedef struct D3D12_RESOURCE_BARRIER +{ + D3D12_RESOURCE_BARRIER_TYPE Type; + D3D12_RESOURCE_BARRIER_FLAGS Flags; + + union + { + D3D12_RESOURCE_TRANSITION_BARRIER Transition; + D3D12_RESOURCE_ALIASING_BARRIER Aliasing; + D3D12_RESOURCE_UAV_BARRIER UAV; + }; +} D3D12_RESOURCE_BARRIER; + +typedef struct D3D12_SUBRESOURCE_FOOTPRINT +{ + DXGI_FORMAT Format; + UINT Width; + UINT Height; + UINT Depth; + UINT RowPitch; // Must be a multiple of D3D12_TEXTURE_DATA_PITCH_ALIGNMENT +} D3D12_SUBRESOURCE_FOOTPRINT; + +typedef struct D3D12_PLACED_SUBRESOURCE_FOOTPRINT +{ + UINT64 Offset; // Must be a multiple of D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT + D3D12_SUBRESOURCE_FOOTPRINT Footprint; +} D3D12_PLACED_SUBRESOURCE_FOOTPRINT; + +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_TEXTURE_COPY_LOCATION +{ + ID3D12Resource* pResource; + D3D12_TEXTURE_COPY_TYPE Type; + union + { + D3D12_PLACED_SUBRESOURCE_FOOTPRINT PlacedFootprint; + UINT SubresourceIndex; + }; +} D3D12_TEXTURE_COPY_LOCATION; + +typedef enum D3D12_RESOLVE_MODE +{ + D3D12_RESOLVE_MODE_DECOMPRESS = 0, + D3D12_RESOLVE_MODE_MIN = 1, + D3D12_RESOLVE_MODE_MAX = 2, + D3D12_RESOLVE_MODE_AVERAGE = 3, + D3D12_RESOLVE_MODE_ENCODE_SAMPLER_FEEDBACK = 4, + D3D12_RESOLVE_MODE_DECODE_SAMPLER_FEEDBACK = 5 +} D3D12_RESOLVE_MODE; + +typedef struct D3D12_SAMPLE_POSITION +{ + INT8 X; + INT8 Y; +} D3D12_SAMPLE_POSITION; + +typedef struct D3D12_VIEW_INSTANCE_LOCATION +{ + UINT ViewportArrayIndex; + UINT RenderTargetArrayIndex; +} D3D12_VIEW_INSTANCE_LOCATION; + +typedef enum D3D12_VIEW_INSTANCING_FLAGS +{ + D3D12_VIEW_INSTANCING_FLAG_NONE = 0x0, + D3D12_VIEW_INSTANCING_FLAG_ENABLE_VIEW_INSTANCE_MASKING = 0x1, +} D3D12_VIEW_INSTANCING_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_VIEW_INSTANCING_FLAGS );") + +typedef struct D3D12_VIEW_INSTANCING_DESC +{ + UINT ViewInstanceCount; + [annotation("_Field_size_full_(ViewInstanceCount)")] const D3D12_VIEW_INSTANCE_LOCATION* pViewInstanceLocations; + D3D12_VIEW_INSTANCING_FLAGS Flags; +} D3D12_VIEW_INSTANCING_DESC; + +// D3D12 view descriptions +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; + +cpp_quote( "#define D3D12_SHADER_COMPONENT_MAPPING_MASK 0x7 ") +cpp_quote( "#define D3D12_SHADER_COMPONENT_MAPPING_SHIFT 3 ") +cpp_quote( "#define D3D12_SHADER_COMPONENT_MAPPING_ALWAYS_SET_BIT_AVOIDING_ZEROMEM_MISTAKES (1<<(D3D12_SHADER_COMPONENT_MAPPING_SHIFT*4)) ") +cpp_quote( "#define D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(Src0,Src1,Src2,Src3) ((((Src0)&D3D12_SHADER_COMPONENT_MAPPING_MASK)| \\") +cpp_quote( " (((Src1)&D3D12_SHADER_COMPONENT_MAPPING_MASK)<> (D3D12_SHADER_COMPONENT_MAPPING_SHIFT*ComponentToExtract) & D3D12_SHADER_COMPONENT_MAPPING_MASK))") +cpp_quote( "#define D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(0,1,2,3) ") +typedef enum D3D12_BUFFER_SRV_FLAGS +{ + D3D12_BUFFER_SRV_FLAG_NONE = 0, + D3D12_BUFFER_SRV_FLAG_RAW = 0x00000001, // allow device multi-component reads with DWORD addressing +} D3D12_BUFFER_SRV_FLAGS; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_BUFFER_SRV_FLAGS );" ) + +typedef struct D3D12_BUFFER_SRV +{ + UINT64 FirstElement; + UINT NumElements; + UINT StructureByteStride; // if nonzero, format must be DXGI_FORMAT_UNKNOWN + 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_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_TEX2DMS_SRV +{ + // don't need to define anything specific for this view dimension + UINT UnusedField_NothingToDefine; +} D3D12_TEX2DMS_SRV; + +typedef struct D3D12_TEX2DMS_ARRAY_SRV +{ + UINT FirstArraySlice; + UINT ArraySize; +} D3D12_TEX2DMS_ARRAY_SRV; + +typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_SRV +{ + D3D12_GPU_VIRTUAL_ADDRESS Location; +} D3D12_RAYTRACING_ACCELERATION_STRUCTURE_SRV; + +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_RAYTRACING_ACCELERATION_STRUCTURE = 11, +} D3D12_SRV_DIMENSION; + +typedef struct D3D12_SHADER_RESOURCE_VIEW_DESC +{ + DXGI_FORMAT Format; + D3D12_SRV_DIMENSION ViewDimension; + UINT Shader4ComponentMapping; + + 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; + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_SRV RaytracingAccelerationStructure; + }; +} D3D12_SHADER_RESOURCE_VIEW_DESC; + +typedef struct D3D12_CONSTANT_BUFFER_VIEW_DESC +{ + D3D12_GPU_VIRTUAL_ADDRESS BufferLocation; + UINT SizeInBytes; +} D3D12_CONSTANT_BUFFER_VIEW_DESC; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// Sampler +// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +typedef enum D3D12_FILTER +{ + // Bits used in defining enumeration of valid filters: + // bits [1:0] - mip: 0 == point, 1 == linear, 2,3 unused + // bits [3:2] - mag: 0 == point, 1 == linear, 2,3 unused + // bits [5:4] - min: 0 == point, 1 == linear, 2,3 unused + // bit [6] - aniso + // bits [8:7] - reduction type: + // 0 == standard filtering + // 1 == comparison + // 2 == min + // 3 == max + // bit [31] - mono 1-bit (narrow-purpose filter) [no longer supported in D3D12] + + D3D12_FILTER_MIN_MAG_MIP_POINT = 0x00000000, + D3D12_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x00000001, + D3D12_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x00000004, + D3D12_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x00000005, + D3D12_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x00000010, + D3D12_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x00000011, + D3D12_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x00000014, + D3D12_FILTER_MIN_MAG_MIP_LINEAR = 0x00000015, + D3D12_FILTER_ANISOTROPIC = 0x00000055, + D3D12_FILTER_COMPARISON_MIN_MAG_MIP_POINT = 0x00000080, + D3D12_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = 0x00000081, + D3D12_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x00000084, + D3D12_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR = 0x00000085, + D3D12_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT = 0x00000090, + D3D12_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x00000091, + D3D12_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = 0x00000094, + D3D12_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR = 0x00000095, + D3D12_FILTER_COMPARISON_ANISOTROPIC = 0x000000d5, + D3D12_FILTER_MINIMUM_MIN_MAG_MIP_POINT = 0x00000100, + D3D12_FILTER_MINIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x00000101, + D3D12_FILTER_MINIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x00000104, + D3D12_FILTER_MINIMUM_MIN_POINT_MAG_MIP_LINEAR = 0x00000105, + D3D12_FILTER_MINIMUM_MIN_LINEAR_MAG_MIP_POINT = 0x00000110, + D3D12_FILTER_MINIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x00000111, + D3D12_FILTER_MINIMUM_MIN_MAG_LINEAR_MIP_POINT = 0x00000114, + D3D12_FILTER_MINIMUM_MIN_MAG_MIP_LINEAR = 0x00000115, + D3D12_FILTER_MINIMUM_ANISOTROPIC = 0x00000155, + D3D12_FILTER_MAXIMUM_MIN_MAG_MIP_POINT = 0x00000180, + D3D12_FILTER_MAXIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x00000181, + D3D12_FILTER_MAXIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x00000184, + D3D12_FILTER_MAXIMUM_MIN_POINT_MAG_MIP_LINEAR = 0x00000185, + D3D12_FILTER_MAXIMUM_MIN_LINEAR_MAG_MIP_POINT = 0x00000190, + D3D12_FILTER_MAXIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x00000191, + D3D12_FILTER_MAXIMUM_MIN_MAG_LINEAR_MIP_POINT = 0x00000194, + D3D12_FILTER_MAXIMUM_MIN_MAG_MIP_LINEAR = 0x00000195, + D3D12_FILTER_MAXIMUM_ANISOTROPIC = 0x000001d5 +} D3D12_FILTER; + +typedef enum D3D12_FILTER_TYPE +{ + D3D12_FILTER_TYPE_POINT = 0, + D3D12_FILTER_TYPE_LINEAR = 1, +} D3D12_FILTER_TYPE; + +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; + +const UINT D3D12_FILTER_REDUCTION_TYPE_MASK = 0x00000003; +const UINT D3D12_FILTER_REDUCTION_TYPE_SHIFT = 7; + +const UINT D3D12_FILTER_TYPE_MASK = 0x00000003; +const UINT D3D12_MIN_FILTER_SHIFT = 4; +const UINT D3D12_MAG_FILTER_SHIFT = 2; +const UINT D3D12_MIP_FILTER_SHIFT = 0; + +const UINT D3D12_ANISOTROPIC_FILTERING_BIT = 0x00000040; + +// encode enum entry for most filters except anisotropic filtering +cpp_quote( "#define D3D12_ENCODE_BASIC_FILTER( min, mag, mip, reduction ) \\" ) +cpp_quote( " ( ( D3D12_FILTER ) ( \\" ) +cpp_quote( " ( ( ( min ) & D3D12_FILTER_TYPE_MASK ) << D3D12_MIN_FILTER_SHIFT ) | \\" ) +cpp_quote( " ( ( ( mag ) & D3D12_FILTER_TYPE_MASK ) << D3D12_MAG_FILTER_SHIFT ) | \\" ) +cpp_quote( " ( ( ( mip ) & D3D12_FILTER_TYPE_MASK ) << D3D12_MIP_FILTER_SHIFT ) | \\" ) +cpp_quote( " ( ( ( reduction ) & D3D12_FILTER_REDUCTION_TYPE_MASK ) << D3D12_FILTER_REDUCTION_TYPE_SHIFT ) ) ) " ) + +// encode enum entry for anisotropic filtering (with or without comparison filtering) +cpp_quote( "#define D3D12_ENCODE_ANISOTROPIC_FILTER( reduction ) \\" ) +cpp_quote( " ( ( D3D12_FILTER ) ( \\" ) +cpp_quote( " D3D12_ANISOTROPIC_FILTERING_BIT | \\" ) +cpp_quote( " D3D12_ENCODE_BASIC_FILTER( D3D12_FILTER_TYPE_LINEAR, \\" ) +cpp_quote( " D3D12_FILTER_TYPE_LINEAR, \\" ) +cpp_quote( " D3D12_FILTER_TYPE_LINEAR, \\" ) +cpp_quote( " reduction ) ) ) " ) + +cpp_quote( "#define D3D12_DECODE_MIN_FILTER( D3D12Filter ) \\" ) +cpp_quote( " ( ( D3D12_FILTER_TYPE ) \\" ) +cpp_quote( " ( ( ( D3D12Filter ) >> D3D12_MIN_FILTER_SHIFT ) & D3D12_FILTER_TYPE_MASK ) ) " ) + +cpp_quote( "#define D3D12_DECODE_MAG_FILTER( D3D12Filter ) \\" ) +cpp_quote( " ( ( D3D12_FILTER_TYPE ) \\" ) +cpp_quote( " ( ( ( D3D12Filter ) >> D3D12_MAG_FILTER_SHIFT ) & D3D12_FILTER_TYPE_MASK ) ) " ) + +cpp_quote( "#define D3D12_DECODE_MIP_FILTER( D3D12Filter ) \\" ) +cpp_quote( " ( ( D3D12_FILTER_TYPE ) \\" ) +cpp_quote( " ( ( ( D3D12Filter ) >> D3D12_MIP_FILTER_SHIFT ) & D3D12_FILTER_TYPE_MASK ) ) " ) + +cpp_quote( "#define D3D12_DECODE_FILTER_REDUCTION( D3D12Filter ) \\" ) +cpp_quote( " ( ( D3D12_FILTER_REDUCTION_TYPE ) \\" ) +cpp_quote( " ( ( ( D3D12Filter ) >> D3D12_FILTER_REDUCTION_TYPE_SHIFT ) & D3D12_FILTER_REDUCTION_TYPE_MASK ) ) " ) + +cpp_quote( "#define D3D12_DECODE_IS_COMPARISON_FILTER( D3D12Filter ) \\" ) +cpp_quote( " ( D3D12_DECODE_FILTER_REDUCTION( D3D12Filter ) == D3D12_FILTER_REDUCTION_TYPE_COMPARISON ) " ) + +cpp_quote( "#define D3D12_DECODE_IS_ANISOTROPIC_FILTER( D3D12Filter ) \\" ) +cpp_quote( " ( ( ( D3D12Filter ) & D3D12_ANISOTROPIC_FILTERING_BIT ) && \\" ) +cpp_quote( " ( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MIN_FILTER( D3D12Filter ) ) && \\" ) +cpp_quote( " ( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MAG_FILTER( D3D12Filter ) ) && \\" ) +cpp_quote( " ( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MIP_FILTER( D3D12Filter ) ) ) " ) + +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 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]; // RGBA + FLOAT MinLOD; + FLOAT MaxLOD; +} D3D12_SAMPLER_DESC; + + +typedef enum D3D12_SAMPLER_FLAGS +{ + D3D12_SAMPLER_FLAG_NONE = 0x0, + D3D12_SAMPLER_FLAG_UINT_BORDER_COLOR = 0x01 +} D3D12_SAMPLER_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_SAMPLER_FLAGS );") + +typedef struct D3D12_SAMPLER_DESC2 +{ + 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; + union + { + FLOAT FloatBorderColor[4]; // RGBA + UINT UintBorderColor[4]; + }; + FLOAT MinLOD; + FLOAT MaxLOD; + D3D12_SAMPLER_FLAGS Flags; +} D3D12_SAMPLER_DESC2; + + + +typedef enum D3D12_BUFFER_UAV_FLAGS +{ + D3D12_BUFFER_UAV_FLAG_NONE = 0, + D3D12_BUFFER_UAV_FLAG_RAW = 0x00000001, +} D3D12_BUFFER_UAV_FLAGS; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_BUFFER_UAV_FLAGS );" ) + +typedef struct D3D12_BUFFER_UAV +{ + UINT64 FirstElement; + UINT NumElements; + UINT StructureByteStride; // if nonzero, format must be DXGI_FORMAT_UNKNOWN + 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_TEX2DMS_UAV +{ + // don't need to define anything specific for this view dimension + UINT UnusedField_NothingToDefine; +} D3D12_TEX2DMS_UAV; + +typedef struct D3D12_TEX2DMS_ARRAY_UAV +{ + UINT FirstArraySlice; + UINT ArraySize; +} D3D12_TEX2DMS_ARRAY_UAV; + +typedef struct D3D12_TEX3D_UAV +{ + UINT MipSlice; + UINT FirstWSlice; + UINT WSize; +} D3D12_TEX3D_UAV; + +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_TEXTURE2DMS = 6, + D3D12_UAV_DIMENSION_TEXTURE2DMSARRAY = 7, + D3D12_UAV_DIMENSION_TEXTURE3D = 8, +} D3D12_UAV_DIMENSION; + +typedef struct D3D12_UNORDERED_ACCESS_VIEW_DESC +{ + DXGI_FORMAT Format; + D3D12_UAV_DIMENSION ViewDimension; + + union + { + D3D12_BUFFER_UAV Buffer; + D3D12_TEX1D_UAV Texture1D; + D3D12_TEX1D_ARRAY_UAV Texture1DArray; + D3D12_TEX2D_UAV Texture2D; + D3D12_TEX2D_ARRAY_UAV Texture2DArray; + D3D12_TEX2DMS_UAV Texture2DMS; + D3D12_TEX2DMS_ARRAY_UAV Texture2DMSArray; + D3D12_TEX3D_UAV Texture3D; + }; +} D3D12_UNORDERED_ACCESS_VIEW_DESC; + +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_TEX2DMS_RTV +{ + UINT UnusedField_NothingToDefine; +} D3D12_TEX2DMS_RTV; + +typedef struct D3D12_TEX2D_ARRAY_RTV +{ + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + UINT PlaneSlice; +} D3D12_TEX2D_ARRAY_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 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_RENDER_TARGET_VIEW_DESC +{ + DXGI_FORMAT Format; + D3D12_RTV_DIMENSION ViewDimension; + + 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; + }; +} D3D12_RENDER_TARGET_VIEW_DESC; + +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 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; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_DSV_FLAGS );" ) + +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 struct D3D12_DEPTH_STENCIL_VIEW_DESC +{ + DXGI_FORMAT Format; + D3D12_DSV_DIMENSION ViewDimension; + D3D12_DSV_FLAGS Flags; + + 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; + }; +} D3D12_DEPTH_STENCIL_VIEW_DESC; + +typedef enum D3D12_CLEAR_FLAGS +{ + // Intentionally no flag for NONE + D3D12_CLEAR_FLAG_DEPTH = 0x01, + D3D12_CLEAR_FLAG_STENCIL = 0x02, +} D3D12_CLEAR_FLAGS; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_CLEAR_FLAGS );" ) + +typedef enum D3D12_FENCE_FLAGS +{ + D3D12_FENCE_FLAG_NONE = 0x0, + D3D12_FENCE_FLAG_SHARED = 0x1, + D3D12_FENCE_FLAG_SHARED_CROSS_ADAPTER = 0x2, + D3D12_FENCE_FLAG_NON_MONITORED = 0x4, +} D3D12_FENCE_FLAGS; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_FENCE_FLAGS );" ) + +typedef enum D3D12_DESCRIPTOR_HEAP_TYPE +{ + D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, + D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER, + D3D12_DESCRIPTOR_HEAP_TYPE_RTV, + D3D12_DESCRIPTOR_HEAP_TYPE_DSV, + D3D12_DESCRIPTOR_HEAP_TYPE_NUM_TYPES +} 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; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( 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 enum D3D12_DESCRIPTOR_RANGE_TYPE +{ + D3D12_DESCRIPTOR_RANGE_TYPE_SRV, + D3D12_DESCRIPTOR_RANGE_TYPE_UAV, + D3D12_DESCRIPTOR_RANGE_TYPE_CBV, + D3D12_DESCRIPTOR_RANGE_TYPE_SAMPLER +} 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 struct D3D12_ROOT_DESCRIPTOR_TABLE +{ + UINT NumDescriptorRanges; + [annotation("_Field_size_full_(NumDescriptorRanges)")] const D3D12_DESCRIPTOR_RANGE* pDescriptorRanges; +} D3D12_ROOT_DESCRIPTOR_TABLE; + + +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_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_AMPLIFICATION = 6, + D3D12_SHADER_VISIBILITY_MESH = 7, +} D3D12_SHADER_VISIBILITY; + +typedef enum D3D12_ROOT_PARAMETER_TYPE +{ + D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, + D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS, + D3D12_ROOT_PARAMETER_TYPE_CBV, + D3D12_ROOT_PARAMETER_TYPE_SRV, + D3D12_ROOT_PARAMETER_TYPE_UAV +} D3D12_ROOT_PARAMETER_TYPE; + +typedef struct D3D12_ROOT_PARAMETER +{ + D3D12_ROOT_PARAMETER_TYPE ParameterType; + union + { + D3D12_ROOT_DESCRIPTOR_TABLE DescriptorTable; + D3D12_ROOT_CONSTANTS Constants; + D3D12_ROOT_DESCRIPTOR Descriptor; + }; + D3D12_SHADER_VISIBILITY ShaderVisibility; +} D3D12_ROOT_PARAMETER; + +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_FLAG_LOCAL_ROOT_SIGNATURE = 0x80, + D3D12_ROOT_SIGNATURE_FLAG_DENY_AMPLIFICATION_SHADER_ROOT_ACCESS = 0x100, + D3D12_ROOT_SIGNATURE_FLAG_DENY_MESH_SHADER_ROOT_ACCESS = 0x200, + D3D12_ROOT_SIGNATURE_FLAG_CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED = 0x400, + D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXED = 0x800, +} D3D12_ROOT_SIGNATURE_FLAGS; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_ROOT_SIGNATURE_FLAGS );" ) + + +typedef enum D3D12_STATIC_BORDER_COLOR +{ + D3D12_STATIC_BORDER_COLOR_TRANSPARENT_BLACK, // 0.0f,0.0f,0.0f,0.0f + D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK, // 0.0f,0.0f,0.0f,1.0f + D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE, // 1.0f,1.0f,1.0f,1.0f + D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK_UINT, // 0,0,0,1 + D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE_UINT // 1,1,1,1 +} D3D12_STATIC_BORDER_COLOR; + +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 struct D3D12_ROOT_SIGNATURE_DESC +{ + UINT NumParameters; + [annotation("_Field_size_full_(NumParameters)")] const D3D12_ROOT_PARAMETER* pParameters; + UINT NumStaticSamplers; + [annotation("_Field_size_full_(NumStaticSamplers)")] const D3D12_STATIC_SAMPLER_DESC* pStaticSamplers; + D3D12_ROOT_SIGNATURE_FLAGS Flags; +} D3D12_ROOT_SIGNATURE_DESC; + +typedef enum D3D12_DESCRIPTOR_RANGE_FLAGS +{ + D3D12_DESCRIPTOR_RANGE_FLAG_NONE = 0x0, + D3D12_DESCRIPTOR_RANGE_FLAG_DESCRIPTORS_VOLATILE = 0x1, + D3D12_DESCRIPTOR_RANGE_FLAG_DATA_VOLATILE = 0x2, + D3D12_DESCRIPTOR_RANGE_FLAG_DATA_STATIC_WHILE_SET_AT_EXECUTE = 0x4, + D3D12_DESCRIPTOR_RANGE_FLAG_DATA_STATIC = 0x8, + D3D12_DESCRIPTOR_RANGE_FLAG_DESCRIPTORS_STATIC_KEEPING_BUFFER_BOUNDS_CHECKS = 0x10000, +} D3D12_DESCRIPTOR_RANGE_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_DESCRIPTOR_RANGE_FLAGS );") + +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_TABLE1 +{ + UINT NumDescriptorRanges; + [annotation("_Field_size_full_(NumDescriptorRanges)")] const D3D12_DESCRIPTOR_RANGE1* pDescriptorRanges; +} D3D12_ROOT_DESCRIPTOR_TABLE1; + +typedef enum D3D12_ROOT_DESCRIPTOR_FLAGS +{ + D3D12_ROOT_DESCRIPTOR_FLAG_NONE = 0x0, + D3D12_ROOT_DESCRIPTOR_FLAG_DATA_VOLATILE = 0x2, + D3D12_ROOT_DESCRIPTOR_FLAG_DATA_STATIC_WHILE_SET_AT_EXECUTE = 0x4, + D3D12_ROOT_DESCRIPTOR_FLAG_DATA_STATIC = 0x8, +} D3D12_ROOT_DESCRIPTOR_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_ROOT_DESCRIPTOR_FLAGS );") + +typedef struct D3D12_ROOT_DESCRIPTOR1 +{ + UINT ShaderRegister; + UINT RegisterSpace; + D3D12_ROOT_DESCRIPTOR_FLAGS Flags; +} D3D12_ROOT_DESCRIPTOR1; + +typedef struct D3D12_ROOT_PARAMETER1 +{ + D3D12_ROOT_PARAMETER_TYPE ParameterType; + union + { + D3D12_ROOT_DESCRIPTOR_TABLE1 DescriptorTable; + D3D12_ROOT_CONSTANTS Constants; + D3D12_ROOT_DESCRIPTOR1 Descriptor; + }; + D3D12_SHADER_VISIBILITY ShaderVisibility; +} D3D12_ROOT_PARAMETER1; + +typedef struct D3D12_ROOT_SIGNATURE_DESC1 +{ + UINT NumParameters; + [annotation("_Field_size_full_(NumParameters)")] const D3D12_ROOT_PARAMETER1* pParameters; + UINT NumStaticSamplers; + [annotation("_Field_size_full_(NumStaticSamplers)")] const D3D12_STATIC_SAMPLER_DESC* pStaticSamplers; + D3D12_ROOT_SIGNATURE_FLAGS Flags; +} D3D12_ROOT_SIGNATURE_DESC1; + + +typedef struct D3D12_VERSIONED_ROOT_SIGNATURE_DESC +{ + D3D_ROOT_SIGNATURE_VERSION Version; + union + { + D3D12_ROOT_SIGNATURE_DESC Desc_1_0; + D3D12_ROOT_SIGNATURE_DESC1 Desc_1_1; + }; +} D3D12_VERSIONED_ROOT_SIGNATURE_DESC; + +[ uuid( 34AB647B-3CC8-46AC-841B-C0965645C046 ), object, local, pointer_default( unique ) ] +interface ID3D12RootSignatureDeserializer + : IUnknown +{ + const D3D12_ROOT_SIGNATURE_DESC * GetRootSignatureDesc(); +}; + +[ uuid( 7F91CE67-090C-4BB7-B78E-ED8FF2E31DA0 ), object, local, pointer_default( unique ) ] +interface ID3D12VersionedRootSignatureDeserializer + : IUnknown +{ + HRESULT GetRootSignatureDescAtVersion(D3D_ROOT_SIGNATURE_VERSION convertToVersion, [annotation("_Out_")] const D3D12_VERSIONED_ROOT_SIGNATURE_DESC** ppDesc); + const D3D12_VERSIONED_ROOT_SIGNATURE_DESC* GetUnconvertedRootSignatureDesc(); +}; + +cpp_quote( "typedef HRESULT (WINAPI* PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)(") +cpp_quote( " _In_ const D3D12_ROOT_SIGNATURE_DESC* pRootSignature," ) +cpp_quote( " _In_ D3D_ROOT_SIGNATURE_VERSION Version," ) +cpp_quote( " _Out_ ID3DBlob** ppBlob," ) +cpp_quote( " _Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorBlob);" ) +cpp_quote( "" ) +cpp_quote( "HRESULT WINAPI D3D12SerializeRootSignature(") +cpp_quote( " _In_ const D3D12_ROOT_SIGNATURE_DESC* pRootSignature," ) +cpp_quote( " _In_ D3D_ROOT_SIGNATURE_VERSION Version," ) +cpp_quote( " _Out_ ID3DBlob** ppBlob," ) +cpp_quote( " _Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorBlob);" ) +cpp_quote( "" ) +cpp_quote( "typedef HRESULT (WINAPI* PFN_D3D12_CREATE_ROOT_SIGNATURE_DESERIALIZER)(") +cpp_quote( " _In_reads_bytes_(SrcDataSizeInBytes) LPCVOID pSrcData," ) +cpp_quote( " _In_ SIZE_T SrcDataSizeInBytes," ) +cpp_quote( " _In_ REFIID pRootSignatureDeserializerInterface," ) +cpp_quote( " _Out_ void** ppRootSignatureDeserializer);" ) +cpp_quote( "" ) +cpp_quote( "HRESULT WINAPI D3D12CreateRootSignatureDeserializer(") +cpp_quote( " _In_reads_bytes_(SrcDataSizeInBytes) LPCVOID pSrcData," ) +cpp_quote( " _In_ SIZE_T SrcDataSizeInBytes," ) +cpp_quote( " _In_ REFIID pRootSignatureDeserializerInterface," ) +cpp_quote( " _Out_ void** ppRootSignatureDeserializer);" ) +cpp_quote( "" ) +cpp_quote( "typedef HRESULT (WINAPI* PFN_D3D12_SERIALIZE_VERSIONED_ROOT_SIGNATURE)(" ) +cpp_quote( " _In_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC* pRootSignature," ) +cpp_quote( " _Out_ ID3DBlob** ppBlob," ) +cpp_quote( " _Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorBlob);" ) +cpp_quote( "" ) +cpp_quote( "HRESULT WINAPI D3D12SerializeVersionedRootSignature(" ) +cpp_quote( " _In_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC* pRootSignature," ) +cpp_quote( " _Out_ ID3DBlob** ppBlob," ) +cpp_quote( " _Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorBlob);" ) +cpp_quote( "" ) +cpp_quote( "typedef HRESULT (WINAPI* PFN_D3D12_CREATE_VERSIONED_ROOT_SIGNATURE_DESERIALIZER)(" ) +cpp_quote( " _In_reads_bytes_(SrcDataSizeInBytes) LPCVOID pSrcData," ) +cpp_quote( " _In_ SIZE_T SrcDataSizeInBytes," ) +cpp_quote( " _In_ REFIID pRootSignatureDeserializerInterface," ) +cpp_quote( " _Out_ void** ppRootSignatureDeserializer);" ) +cpp_quote( "" ) +cpp_quote( "HRESULT WINAPI D3D12CreateVersionedRootSignatureDeserializer(") +cpp_quote( " _In_reads_bytes_(SrcDataSizeInBytes) LPCVOID pSrcData," ) +cpp_quote( " _In_ SIZE_T SrcDataSizeInBytes," ) +cpp_quote( " _In_ REFIID pRootSignatureDeserializerInterface," ) +cpp_quote( " _Out_ void** ppRootSignatureDeserializer);" ) +cpp_quote( "" ) + + + +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; + +cpp_quote( "// If rects are supplied in D3D12_DISCARD_REGION, below, the resource " ) +cpp_quote( "// must have 2D subresources with all specified subresources the same dimension." ) +typedef struct D3D12_DISCARD_REGION +{ + UINT NumRects; + [annotation("_In_reads_(NumRects)")] const D3D12_RECT* pRects; + UINT FirstSubresource; + UINT NumSubresources; +} D3D12_DISCARD_REGION; + +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_VIDEO_DECODE_STATISTICS = 4, + D3D12_QUERY_HEAP_TYPE_COPY_QUEUE_TIMESTAMP = 5, + D3D12_QUERY_HEAP_TYPE_PIPELINE_STATISTICS1 = 7, + +} 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_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_VIDEO_DECODE_STATISTICS = 8, + D3D12_QUERY_TYPE_PIPELINE_STATISTICS1 = 10, + +} D3D12_QUERY_TYPE; + +typedef enum D3D12_PREDICATION_OP +{ + D3D12_PREDICATION_OP_EQUAL_ZERO = 0, + D3D12_PREDICATION_OP_NOT_EQUAL_ZERO = 1, +} D3D12_PREDICATION_OP; + +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 struct D3D12_QUERY_DATA_PIPELINE_STATISTICS1 +{ + UINT64 IAVertices; + UINT64 IAPrimitives; + UINT64 VSInvocations; + UINT64 GSInvocations; + UINT64 GSPrimitives; + UINT64 CInvocations; + UINT64 CPrimitives; + UINT64 PSInvocations; + UINT64 HSInvocations; + UINT64 DSInvocations; + UINT64 CSInvocations; + UINT64 ASInvocations; + UINT64 MSInvocations; + UINT64 MSPrimitives; +} D3D12_QUERY_DATA_PIPELINE_STATISTICS1; + +typedef struct D3D12_QUERY_DATA_SO_STATISTICS +{ + UINT64 NumPrimitivesWritten; + UINT64 PrimitivesStorageNeeded; +} D3D12_QUERY_DATA_SO_STATISTICS; + +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 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_VERTEX_BUFFER_VIEW +{ + D3D12_GPU_VIRTUAL_ADDRESS BufferLocation; + UINT SizeInBytes; + UINT StrideInBytes; +} D3D12_VERTEX_BUFFER_VIEW; + +typedef struct D3D12_INDEX_BUFFER_VIEW +{ + D3D12_GPU_VIRTUAL_ADDRESS BufferLocation; + UINT SizeInBytes; + DXGI_FORMAT Format; +} D3D12_INDEX_BUFFER_VIEW; + +typedef enum D3D12_INDIRECT_ARGUMENT_TYPE +{ + D3D12_INDIRECT_ARGUMENT_TYPE_DRAW, + D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED, + D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH, + D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW, + D3D12_INDIRECT_ARGUMENT_TYPE_INDEX_BUFFER_VIEW, + D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT, + D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT_BUFFER_VIEW, + D3D12_INDIRECT_ARGUMENT_TYPE_SHADER_RESOURCE_VIEW, + D3D12_INDIRECT_ARGUMENT_TYPE_UNORDERED_ACCESS_VIEW, + D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_RAYS, + D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESH, +} D3D12_INDIRECT_ARGUMENT_TYPE; + +typedef struct D3D12_INDIRECT_ARGUMENT_DESC +{ + D3D12_INDIRECT_ARGUMENT_TYPE Type; + + 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; + }; +} D3D12_INDIRECT_ARGUMENT_DESC; + +typedef struct D3D12_COMMAND_SIGNATURE_DESC +{ + // The number of bytes between each drawing structure + UINT ByteStride; + UINT NumArgumentDescs; + [annotation("_Field_size_full_(NumArgumentDescs)")] const D3D12_INDIRECT_ARGUMENT_DESC* pArgumentDescs; + UINT NodeMask; +} D3D12_COMMAND_SIGNATURE_DESC; + +interface ID3D12Device; + +[ uuid( c4fec28f-7966-4e95-9f94-f431cb56c3b8 ), object, local, pointer_default( unique ) ] +interface ID3D12Object + : IUnknown +{ + HRESULT GetPrivateData( + [annotation("_In_")] REFGUID guid, + [annotation("_Inout_")] UINT* pDataSize, + [annotation("_Out_writes_bytes_opt_( *pDataSize )")] void* pData ); + HRESULT SetPrivateData( + [annotation("_In_")] REFGUID guid, + [annotation("_In_")] UINT DataSize, + [annotation("_In_reads_bytes_opt_( DataSize )")] const void* pData ); + HRESULT SetPrivateDataInterface( + [annotation("_In_")] REFGUID guid, + [annotation("_In_opt_")] const IUnknown* pData ); + HRESULT SetName( + [annotation("_In_z_")] LPCWSTR Name ); +} + +[ uuid( 905db94b-a00c-4140-9df5-2b64ca9ea357 ), object, local, pointer_default( unique ) ] +interface ID3D12DeviceChild + : ID3D12Object +{ + HRESULT GetDevice( + [in] REFIID riid, + [out, iid_is(riid), annotation("_COM_Outptr_opt_")] void** ppvDevice + ); +} + +[ uuid( 63ee58fb-1268-4835-86da-f008ce62f0d6 ), object, local, pointer_default( unique ) ] +interface ID3D12Pageable + : ID3D12DeviceChild +{ +} + +[ uuid( 6b3b2502-6e51-45b3-90ee-9884265e8df3 ), object, local, pointer_default( unique ) ] +interface ID3D12Heap + : ID3D12Pageable +{ + D3D12_HEAP_DESC GetDesc(); +} + +[ uuid( 696442be-a72e-4059-bc79-5b5c98040fad ), object, local, pointer_default( unique ) ] +interface ID3D12Resource + : ID3D12Pageable +{ + HRESULT Map( + UINT Subresource, + [annotation("_In_opt_")] const D3D12_RANGE* pReadRange, + [annotation("_Outptr_opt_result_bytebuffer_(_Inexpressible_(\"Dependent on resource\"))")] void** ppData); + + void Unmap(UINT Subresource, [annotation("_In_opt_")] const D3D12_RANGE* pWrittenRange ); + + D3D12_RESOURCE_DESC GetDesc(); + + D3D12_GPU_VIRTUAL_ADDRESS GetGPUVirtualAddress(); + + HRESULT WriteToSubresource( + UINT DstSubresource, + [annotation("_In_opt_")] const D3D12_BOX* pDstBox, + [annotation("_In_")] const void* pSrcData, + UINT SrcRowPitch, + UINT SrcDepthPitch ); + + HRESULT ReadFromSubresource( + [annotation("_Out_")] void* pDstData, + UINT DstRowPitch, + UINT DstDepthPitch, + UINT SrcSubresource, + [annotation("_In_opt_")] const D3D12_BOX* pSrcBox ); + + HRESULT GetHeapProperties( + [annotation("_Out_opt_")] D3D12_HEAP_PROPERTIES* pHeapProperties, + [annotation("_Out_opt_")] D3D12_HEAP_FLAGS* pHeapFlags + ); +} + +[ uuid( 6102dee4-af59-4b09-b999-b44d73f09b24 ), object, local, pointer_default( unique ) ] +interface ID3D12CommandAllocator + : ID3D12Pageable +{ + HRESULT Reset(); +} + +[ uuid( 0a753dcf-c4d8-4b91-adf6-be5a60d95a76 ), object, local, pointer_default( unique ) ] +interface ID3D12Fence + : ID3D12Pageable +{ + UINT64 GetCompletedValue(); + HRESULT SetEventOnCompletion(UINT64 Value, HANDLE hEvent); + HRESULT Signal(UINT64 Value); +}; + +[ uuid( 433685fe-e22b-4ca0-a8db-b5b4f4dd0e4a ), object, local, pointer_default( unique ) ] +interface ID3D12Fence1 + : ID3D12Fence +{ + D3D12_FENCE_FLAGS GetCreationFlags(); +}; + +[ uuid( 765a30f3-f624-4c6f-a828-ace948622445 ), object, local, pointer_default( unique ) ] +interface ID3D12PipelineState + : ID3D12Pageable +{ + HRESULT GetCachedBlob([annotation("_COM_Outptr_")] ID3DBlob** ppBlob); +} + +[ uuid( 8efb471d-616c-4f49-90f7-127bb763fa51 ), object, local, pointer_default( unique ) ] +interface ID3D12DescriptorHeap + : ID3D12Pageable +{ + D3D12_DESCRIPTOR_HEAP_DESC GetDesc(); + + D3D12_CPU_DESCRIPTOR_HANDLE GetCPUDescriptorHandleForHeapStart(); + D3D12_GPU_DESCRIPTOR_HANDLE GetGPUDescriptorHandleForHeapStart(); +} + +[ uuid( 0d9658ae-ed45-469e-a61d-970ec583cab4 ), object, local, pointer_default( unique ) ] +interface ID3D12QueryHeap + : ID3D12Pageable +{ +}; + +[ uuid( c36a797c-ec80-4f0a-8985-a7b2475082d1 ), object, local, pointer_default( unique ) ] +interface ID3D12CommandSignature + : ID3D12Pageable +{ +}; + +[ uuid( 7116d91c-e7e4-47ce-b8c6-ec8168f437e5 ), object, local, pointer_default( unique ) ] +interface ID3D12CommandList + : ID3D12DeviceChild +{ + D3D12_COMMAND_LIST_TYPE GetType(); +} + +// Superseded by ID3D12GraphicsCommandList1 +[ uuid( 5b160d0f-ac1b-4185-8ba8-b3ae42a5a455 ), object, local, pointer_default( unique ) ] +interface ID3D12GraphicsCommandList + : ID3D12CommandList +{ + HRESULT Close(); + + HRESULT Reset( + [annotation("_In_")] ID3D12CommandAllocator* pAllocator, + [annotation("_In_opt_")] ID3D12PipelineState* pInitialState + ); + + void ClearState( + [annotation("_In_opt_")] ID3D12PipelineState* pPipelineState + ); + + void DrawInstanced( + [annotation("_In_")] UINT VertexCountPerInstance, + [annotation("_In_")] UINT InstanceCount, + [annotation("_In_")] UINT StartVertexLocation, + [annotation("_In_")] UINT StartInstanceLocation + ); + + void DrawIndexedInstanced( + [annotation("_In_")] UINT IndexCountPerInstance, + [annotation("_In_")] UINT InstanceCount, + [annotation("_In_")] UINT StartIndexLocation, + [annotation("_In_")] INT BaseVertexLocation, + [annotation("_In_")] UINT StartInstanceLocation + ); + + void Dispatch( + [annotation("_In_")] UINT ThreadGroupCountX, + [annotation("_In_")] UINT ThreadGroupCountY, + [annotation("_In_")] UINT ThreadGroupCountZ + ); + + void CopyBufferRegion( + [annotation("_In_")] ID3D12Resource* pDstBuffer, + UINT64 DstOffset, + [annotation("_In_")] ID3D12Resource* pSrcBuffer, + UINT64 SrcOffset, + UINT64 NumBytes + ); + + void CopyTextureRegion( + [annotation("_In_")] const D3D12_TEXTURE_COPY_LOCATION* pDst, + UINT DstX, UINT DstY, UINT DstZ, + [annotation("_In_")] const D3D12_TEXTURE_COPY_LOCATION* pSrc, + [annotation("_In_opt_")] const D3D12_BOX* pSrcBox + ); + + void CopyResource( + [annotation("_In_")] ID3D12Resource* pDstResource, + [annotation("_In_")] ID3D12Resource* pSrcResource + ); + + void CopyTiles( + [annotation("_In_")] ID3D12Resource* pTiledResource, + [annotation("_In_")] const D3D12_TILED_RESOURCE_COORDINATE* pTileRegionStartCoordinate, + [annotation("_In_")] const D3D12_TILE_REGION_SIZE* pTileRegionSize, + [annotation("_In_")] ID3D12Resource* pBuffer, + UINT64 BufferStartOffsetInBytes, + D3D12_TILE_COPY_FLAGS Flags + ); + + void ResolveSubresource( + [annotation("_In_")] ID3D12Resource* pDstResource, + [annotation("_In_")] UINT DstSubresource, + [annotation("_In_")] ID3D12Resource* pSrcResource, + [annotation("_In_")] UINT SrcSubresource, + [annotation("_In_")] DXGI_FORMAT Format + ); + + void IASetPrimitiveTopology( + [annotation("_In_")] D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology + ); + + void RSSetViewports( + [annotation("_In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE)")] UINT NumViewports, + [annotation("_In_reads_( NumViewports)")] const D3D12_VIEWPORT* pViewports + ); + + void RSSetScissorRects( + [annotation("_In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE)")] UINT NumRects, + [annotation("_In_reads_( NumRects)")] const D3D12_RECT* pRects + ); + + void OMSetBlendFactor( + [annotation("_In_reads_opt_(4)")] const FLOAT BlendFactor[ 4 ] + ); + + void OMSetStencilRef( + [annotation("_In_")] UINT StencilRef + ); + + void SetPipelineState( + [annotation("_In_")] ID3D12PipelineState* pPipelineState + ); + + void ResourceBarrier( + [annotation("_In_")] UINT NumBarriers, + [annotation("_In_reads_(NumBarriers)")] const D3D12_RESOURCE_BARRIER* pBarriers + ); + + void ExecuteBundle( + [annotation("_In_")] ID3D12GraphicsCommandList* pCommandList + ); + + void SetDescriptorHeaps( + [annotation("_In_")] UINT NumDescriptorHeaps, + [annotation("_In_reads_(NumDescriptorHeaps)")] ID3D12DescriptorHeap* const* ppDescriptorHeaps + ); + + void SetComputeRootSignature( + [annotation("_In_opt_")] ID3D12RootSignature* pRootSignature + ); + + void SetGraphicsRootSignature( + [annotation("_In_opt_")] ID3D12RootSignature* pRootSignature + ); + + void SetComputeRootDescriptorTable( + [annotation("_In_")] UINT RootParameterIndex, + [annotation("_In_")] D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor + ); + + void SetGraphicsRootDescriptorTable( + [annotation("_In_")] UINT RootParameterIndex, + [annotation("_In_")] D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor + ); + + // Single constant + void SetComputeRoot32BitConstant( + [annotation("_In_")] UINT RootParameterIndex, + [annotation("_In_")] UINT SrcData, + [annotation("_In_")] UINT DestOffsetIn32BitValues + ); + + void SetGraphicsRoot32BitConstant( + [annotation("_In_")] UINT RootParameterIndex, + [annotation("_In_")] UINT SrcData, + [annotation("_In_")] UINT DestOffsetIn32BitValues + ); + + // Group of constants + void SetComputeRoot32BitConstants( + [annotation("_In_")] UINT RootParameterIndex, + [annotation("_In_")] UINT Num32BitValuesToSet, + [annotation("_In_reads_(Num32BitValuesToSet*sizeof(UINT))")] const void* pSrcData, + [annotation("_In_")] UINT DestOffsetIn32BitValues + ); + + void SetGraphicsRoot32BitConstants( + [annotation("_In_")] UINT RootParameterIndex, + [annotation("_In_")] UINT Num32BitValuesToSet, + [annotation("_In_reads_(Num32BitValuesToSet*sizeof(UINT))")] const void* pSrcData, + [annotation("_In_")] UINT DestOffsetIn32BitValues + ); + + // CBV + void SetComputeRootConstantBufferView( + [annotation("_In_")] UINT RootParameterIndex, + [annotation("_In_")] D3D12_GPU_VIRTUAL_ADDRESS BufferLocation + ); + + void SetGraphicsRootConstantBufferView( + [annotation("_In_")] UINT RootParameterIndex, + [annotation("_In_")] D3D12_GPU_VIRTUAL_ADDRESS BufferLocation + ); + + // SRV + void SetComputeRootShaderResourceView( + [annotation("_In_")] UINT RootParameterIndex, + [annotation("_In_")] D3D12_GPU_VIRTUAL_ADDRESS BufferLocation + ); + + void SetGraphicsRootShaderResourceView( + [annotation("_In_")] UINT RootParameterIndex, + [annotation("_In_")] D3D12_GPU_VIRTUAL_ADDRESS BufferLocation + ); + + // UAV + void SetComputeRootUnorderedAccessView( + [annotation("_In_")] UINT RootParameterIndex, + [annotation("_In_")] D3D12_GPU_VIRTUAL_ADDRESS BufferLocation + ); + + void SetGraphicsRootUnorderedAccessView( + [annotation("_In_")] UINT RootParameterIndex, + [annotation("_In_")] D3D12_GPU_VIRTUAL_ADDRESS BufferLocation + ); + + void IASetIndexBuffer( + [annotation("_In_opt_")] const D3D12_INDEX_BUFFER_VIEW* pView + ); + + void IASetVertexBuffers( + [annotation("_In_")] UINT StartSlot, + [annotation("_In_")] UINT NumViews, + [annotation("_In_reads_opt_(NumViews)")] const D3D12_VERTEX_BUFFER_VIEW* pViews + ); + + void SOSetTargets( + [annotation("_In_")] UINT StartSlot, + [annotation("_In_")] UINT NumViews, + [annotation("_In_reads_opt_(NumViews)")] const D3D12_STREAM_OUTPUT_BUFFER_VIEW* pViews + ); + + void OMSetRenderTargets( + [annotation("_In_")] UINT NumRenderTargetDescriptors, + [annotation("_In_opt_")] const D3D12_CPU_DESCRIPTOR_HANDLE* pRenderTargetDescriptors, + [annotation("_In_")] BOOL RTsSingleHandleToDescriptorRange, + [annotation("_In_opt_")] const D3D12_CPU_DESCRIPTOR_HANDLE* pDepthStencilDescriptor + ); + + void ClearDepthStencilView( + [annotation("_In_")] D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, + [annotation("_In_")] D3D12_CLEAR_FLAGS ClearFlags, + [annotation("_In_")] FLOAT Depth, + [annotation("_In_")] UINT8 Stencil, + [annotation("_In_")] UINT NumRects, + [annotation("_In_reads_(NumRects)")] const D3D12_RECT* pRects + ); + + void ClearRenderTargetView( + [annotation("_In_")] D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, + [annotation("_In_")] const FLOAT ColorRGBA[4], + [annotation("_In_")] UINT NumRects, + [annotation("_In_reads_(NumRects)")] const D3D12_RECT* pRects + ); + + void ClearUnorderedAccessViewUint( + [annotation("_In_")] D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + [annotation("_In_")] D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + [annotation("_In_")] ID3D12Resource* pResource, + [annotation("_In_")] const UINT Values[4], + [annotation("_In_")] UINT NumRects, + [annotation("_In_reads_(NumRects)")] const D3D12_RECT* pRects + ); + + void ClearUnorderedAccessViewFloat( + [annotation("_In_")] D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + [annotation("_In_")] D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + [annotation("_In_")] ID3D12Resource* pResource, + [annotation("_In_")] const FLOAT Values[4], + [annotation("_In_")] UINT NumRects, + [annotation("_In_reads_(NumRects)")] const D3D12_RECT* pRects + ); + + void DiscardResource( + [annotation("_In_")] ID3D12Resource* pResource, + [annotation("_In_opt_")] const D3D12_DISCARD_REGION* pRegion + ); + + void BeginQuery( + [annotation("_In_")] ID3D12QueryHeap* pQueryHeap, + [annotation("_In_")] D3D12_QUERY_TYPE Type, + [annotation("_In_")] UINT Index + ); + + void EndQuery( + [annotation("_In_")] ID3D12QueryHeap* pQueryHeap, + [annotation("_In_")] D3D12_QUERY_TYPE Type, + [annotation("_In_")] UINT Index + ); + + void ResolveQueryData( + [annotation("_In_")] ID3D12QueryHeap* pQueryHeap, + [annotation("_In_")] D3D12_QUERY_TYPE Type, + [annotation("_In_")] UINT StartIndex, + [annotation("_In_")] UINT NumQueries, + [annotation("_In_")] ID3D12Resource* pDestinationBuffer, + [annotation("_In_")] UINT64 AlignedDestinationBufferOffset + ); + + void SetPredication( + [annotation("_In_opt_")] ID3D12Resource* pBuffer, + [annotation("_In_")] UINT64 AlignedBufferOffset, + [annotation("_In_")] D3D12_PREDICATION_OP Operation + ); + + void SetMarker(UINT Metadata, [annotation("_In_reads_bytes_opt_(Size)")] const void* pData, UINT Size); + void BeginEvent(UINT Metadata, [annotation("_In_reads_bytes_opt_(Size)")] const void* pData, UINT Size); + void EndEvent(); + + void ExecuteIndirect( + [annotation("_In_")] ID3D12CommandSignature* pCommandSignature, + [annotation("_In_")] UINT MaxCommandCount, + [annotation("_In_")] ID3D12Resource* pArgumentBuffer, + [annotation("_In_")] UINT64 ArgumentBufferOffset, + [annotation("_In_opt_")] ID3D12Resource* pCountBuffer, + [annotation("_In_")] UINT64 CountBufferOffset + ); +} + +[ uuid( 553103fb-1fe7-4557-bb38-946d7d0e7ca7 ), object, local, pointer_default( unique ) ] +interface ID3D12GraphicsCommandList1 + : ID3D12GraphicsCommandList +{ + void AtomicCopyBufferUINT( + [annotation("_In_")] ID3D12Resource* pDstBuffer, + UINT64 DstOffset, + [annotation("_In_")] ID3D12Resource* pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, // 0 Dependencies means only the dst buffer offset is synchronized + [annotation("_In_reads_(Dependencies)")] ID3D12Resource*const* ppDependentResources, + [annotation("_In_reads_(Dependencies)")] const D3D12_SUBRESOURCE_RANGE_UINT64* pDependentSubresourceRanges + ); + + // UINT64 is only valid on UMA architectures + void AtomicCopyBufferUINT64( + [annotation("_In_")] ID3D12Resource* pDstBuffer, + UINT64 DstOffset, + [annotation("_In_")] ID3D12Resource* pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, // 0 Dependencies means only the dst buffer offset is synchronized + [annotation("_In_reads_(Dependencies)")] ID3D12Resource*const* ppDependentResources, + [annotation("_In_reads_(Dependencies)")] const D3D12_SUBRESOURCE_RANGE_UINT64* pDependentSubresourceRanges + ); + + void OMSetDepthBounds( + [annotation("_In_")] FLOAT Min, + [annotation("_In_")] FLOAT Max + ); + + void SetSamplePositions( + [annotation("_In_")] UINT NumSamplesPerPixel, + [annotation("_In_")] UINT NumPixels, + [annotation("_In_reads_(NumSamplesPerPixel*NumPixels)")] D3D12_SAMPLE_POSITION* pSamplePositions + ); + + void ResolveSubresourceRegion( + [annotation("_In_")] ID3D12Resource* pDstResource, + [annotation("_In_")] UINT DstSubresource, + [annotation("_In_")] UINT DstX, + [annotation("_In_")] UINT DstY, + [annotation("_In_")] ID3D12Resource* pSrcResource, + [annotation("_In_")] UINT SrcSubresource, + [annotation("_In_opt_")] D3D12_RECT* pSrcRect, + [annotation("_In_")] DXGI_FORMAT Format, + [annotation("_In_")] D3D12_RESOLVE_MODE ResolveMode + ); + + void SetViewInstanceMask( + [annotation("_In_")] UINT Mask + ); + +} + +typedef struct D3D12_WRITEBUFFERIMMEDIATE_PARAMETER +{ + D3D12_GPU_VIRTUAL_ADDRESS Dest; + UINT32 Value; +} D3D12_WRITEBUFFERIMMEDIATE_PARAMETER; + +typedef enum D3D12_WRITEBUFFERIMMEDIATE_MODE +{ + D3D12_WRITEBUFFERIMMEDIATE_MODE_DEFAULT = 0x0, + D3D12_WRITEBUFFERIMMEDIATE_MODE_MARKER_IN = 0x1, + D3D12_WRITEBUFFERIMMEDIATE_MODE_MARKER_OUT = 0x2, + +} D3D12_WRITEBUFFERIMMEDIATE_MODE; + +[uuid(38C3E585-FF17-412C-9150-4FC6F9D72A28), object, local, pointer_default(unique)] +interface ID3D12GraphicsCommandList2 : ID3D12GraphicsCommandList1 +{ + void WriteBufferImmediate( + UINT Count, + [annotation("_In_reads_(Count)")] const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + [annotation("_In_reads_opt_(Count)")] const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes + ); +} + +[ uuid( 0ec870a6-5d7e-4c22-8cfc-5baae07616ed ), object, local, pointer_default( unique ) ] +interface ID3D12CommandQueue + : ID3D12Pageable +{ + void UpdateTileMappings( + [annotation("_In_")] ID3D12Resource* pResource, + UINT NumResourceRegions, + [annotation("_In_reads_opt_(NumResourceRegions)")] const D3D12_TILED_RESOURCE_COORDINATE* pResourceRegionStartCoordinates, + [annotation("_In_reads_opt_(NumResourceRegions)")] const D3D12_TILE_REGION_SIZE* pResourceRegionSizes, + [annotation("_In_opt_")] ID3D12Heap* pHeap, + UINT NumRanges, + [annotation("_In_reads_opt_(NumRanges)")] const D3D12_TILE_RANGE_FLAGS* pRangeFlags, + [annotation("_In_reads_opt_(NumRanges)")] const UINT* pHeapRangeStartOffsets, + [annotation("_In_reads_opt_(NumRanges)")] const UINT* pRangeTileCounts, + D3D12_TILE_MAPPING_FLAGS Flags ); + + void CopyTileMappings( + [annotation("_In_")] ID3D12Resource* pDstResource, + [annotation("_In_")] const D3D12_TILED_RESOURCE_COORDINATE* pDstRegionStartCoordinate, + [annotation("_In_")] ID3D12Resource* pSrcResource, + [annotation("_In_")] const D3D12_TILED_RESOURCE_COORDINATE* pSrcRegionStartCoordinate, + [annotation("_In_")] const D3D12_TILE_REGION_SIZE* pRegionSize, + D3D12_TILE_MAPPING_FLAGS Flags ); + + void ExecuteCommandLists( + [annotation("_In_")] UINT NumCommandLists, + [annotation("_In_reads_(NumCommandLists)")] ID3D12CommandList * const * ppCommandLists + ); + + void SetMarker(UINT Metadata, [annotation("_In_reads_bytes_opt_(Size)")] const void* pData, UINT Size); + void BeginEvent(UINT Metadata, [annotation("_In_reads_bytes_opt_(Size)")] const void* pData, UINT Size); + void EndEvent(); + + HRESULT Signal(ID3D12Fence* pFence, UINT64 Value); + HRESULT Wait(ID3D12Fence* pFence, UINT64 Value); + + HRESULT GetTimestampFrequency( + [annotation("_Out_")] UINT64* pFrequency + ); + + HRESULT GetClockCalibration( + [annotation("_Out_")] UINT64* pGpuTimestamp, + [annotation("_Out_")] UINT64* pCpuTimestamp + ); + + D3D12_COMMAND_QUEUE_DESC GetDesc(); +} + +//-------------------------------------------------------------------------------------------------------- +// The system LUID struct isn't defined in wtypes, so we repeat it here just +// for the MIDL compiler. +cpp_quote("#ifdef __midl") +cpp_quote("#ifndef LUID_DEFINED") +cpp_quote("#define LUID_DEFINED 1") +typedef struct __LUID { + DWORD LowPart; + LONG HighPart; +} LUID, *PLUID; +cpp_quote("#endif") +cpp_quote("#endif") + +[ uuid( 189819f1-1db6-4b57-be54-1821339b85f7 ), object, local, pointer_default( unique ) ] +interface ID3D12Device + : ID3D12Object +{ + UINT GetNodeCount(); + + HRESULT CreateCommandQueue( + [annotation("_In_")] const D3D12_COMMAND_QUEUE_DESC* pDesc, + [in] REFIID riid, // Expected: ID3D12CommandQueue + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppCommandQueue + ); + + HRESULT CreateCommandAllocator( + [annotation("_In_")] D3D12_COMMAND_LIST_TYPE type, + [in] REFIID riid, // Expected: ID3D12CommandAllocator + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppCommandAllocator + ); + + HRESULT CreateGraphicsPipelineState( + [annotation("_In_")] const D3D12_GRAPHICS_PIPELINE_STATE_DESC* pDesc, + [in] REFIID riid, // Expected: ID3D12PipelineState + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppPipelineState + ); + + HRESULT CreateComputePipelineState( + [annotation("_In_")] const D3D12_COMPUTE_PIPELINE_STATE_DESC* pDesc, + [in] REFIID riid, // Expected: ID3D12PipelineState + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppPipelineState + ); + + HRESULT CreateCommandList( + [annotation("_In_")] UINT nodeMask, + [annotation("_In_")] D3D12_COMMAND_LIST_TYPE type, + [annotation("_In_")] ID3D12CommandAllocator* pCommandAllocator, + [annotation("_In_opt_")] ID3D12PipelineState* pInitialState, + [in] REFIID riid, // Expected: ID3D12CommandList + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppCommandList + ); + + HRESULT CheckFeatureSupport( + D3D12_FEATURE Feature, + [annotation("_Inout_updates_bytes_(FeatureSupportDataSize)")] void* pFeatureSupportData, + UINT FeatureSupportDataSize + ); + + HRESULT CreateDescriptorHeap( + [annotation("_In_")] const D3D12_DESCRIPTOR_HEAP_DESC* pDescriptorHeapDesc, + [in] REFIID riid, // Expected ID3D12DescriptorHeap + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppvHeap); + + UINT GetDescriptorHandleIncrementSize( + [annotation("_In_")] D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + HRESULT CreateRootSignature( + [annotation("_In_")] UINT nodeMask, + [annotation("_In_reads_(blobLengthInBytes)")] const void* pBlobWithRootSignature, + [annotation("_In_")] SIZE_T blobLengthInBytes, + [in] REFIID riid, // Expected ID3D12RootSignature + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppvRootSignature); + + void CreateConstantBufferView( + [annotation("_In_opt_")] const D3D12_CONSTANT_BUFFER_VIEW_DESC* pDesc, + [annotation("_In_")] D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + void CreateShaderResourceView( + [annotation("_In_opt_")] ID3D12Resource* pResource, + [annotation("_In_opt_")] const D3D12_SHADER_RESOURCE_VIEW_DESC* pDesc, + [annotation("_In_")] D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + void CreateUnorderedAccessView( + [annotation("_In_opt_")] ID3D12Resource* pResource, + [annotation("_In_opt_")] ID3D12Resource* pCounterResource, + [annotation("_In_opt_")] const D3D12_UNORDERED_ACCESS_VIEW_DESC* pDesc, + [annotation("_In_")] D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + void CreateRenderTargetView( + [annotation("_In_opt_")] ID3D12Resource* pResource, + [annotation("_In_opt_")] const D3D12_RENDER_TARGET_VIEW_DESC* pDesc, + [annotation("_In_")] D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + void CreateDepthStencilView( + [annotation("_In_opt_")] ID3D12Resource* pResource, + [annotation("_In_opt_")] const D3D12_DEPTH_STENCIL_VIEW_DESC* pDesc, + [annotation("_In_")] D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + void CreateSampler( + [annotation("_In_")] const D3D12_SAMPLER_DESC* pDesc, + [annotation("_In_")] D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + void CopyDescriptors( + [annotation("_In_")] UINT NumDestDescriptorRanges, + [annotation("_In_reads_(NumDestDescriptorRanges)")] const D3D12_CPU_DESCRIPTOR_HANDLE* pDestDescriptorRangeStarts, + [annotation("_In_reads_opt_(NumDestDescriptorRanges)")] const UINT* pDestDescriptorRangeSizes, // NULL means all ranges 1 + [annotation("_In_")] UINT NumSrcDescriptorRanges, + [annotation("_In_reads_(NumSrcDescriptorRanges)")] const D3D12_CPU_DESCRIPTOR_HANDLE* pSrcDescriptorRangeStarts, + [annotation("_In_reads_opt_(NumSrcDescriptorRanges)")] const UINT* pSrcDescriptorRangeSizes, // NULL means all ranges 1 + [annotation("_In_")] D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + void CopyDescriptorsSimple( + [annotation("_In_")] UINT NumDescriptors, + [annotation("_In_")] D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + [annotation("_In_")] D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + [annotation("_In_")] D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + D3D12_RESOURCE_ALLOCATION_INFO GetResourceAllocationInfo( + [annotation("_In_")] UINT visibleMask, + [annotation("_In_")] UINT numResourceDescs, + [annotation("_In_reads_(numResourceDescs)")] const D3D12_RESOURCE_DESC* pResourceDescs ); + + D3D12_HEAP_PROPERTIES GetCustomHeapProperties( + [annotation("_In_")] UINT nodeMask, + D3D12_HEAP_TYPE heapType + ); + + HRESULT CreateCommittedResource( + [annotation("_In_")] const D3D12_HEAP_PROPERTIES* pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + [annotation("_In_")] const D3D12_RESOURCE_DESC* pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + [annotation("_In_opt_")] const D3D12_CLEAR_VALUE* pOptimizedClearValue, + [in] REFIID riidResource, // Expected: ID3D12Resource* + [out, iid_is(riidResource), annotation("_COM_Outptr_opt_")] void** ppvResource ); + + HRESULT CreateHeap( + [annotation("_In_")] const D3D12_HEAP_DESC* pDesc, + [in] REFIID riid, // Expected: ID3D12Heap* + [out, iid_is(riid), annotation("_COM_Outptr_opt_")] void** ppvHeap ); + + HRESULT CreatePlacedResource( + [annotation("_In_")] ID3D12Heap* pHeap, + UINT64 HeapOffset, + [annotation("_In_")] const D3D12_RESOURCE_DESC* pDesc, + D3D12_RESOURCE_STATES InitialState, + [annotation("_In_opt_")] const D3D12_CLEAR_VALUE* pOptimizedClearValue, + [in] REFIID riid, // Expected: ID3D12Resource* + [out, iid_is(riid), annotation("_COM_Outptr_opt_")] void** ppvResource ); + + HRESULT CreateReservedResource( + [annotation("_In_")] const D3D12_RESOURCE_DESC* pDesc, + D3D12_RESOURCE_STATES InitialState, + [annotation("_In_opt_")] const D3D12_CLEAR_VALUE* pOptimizedClearValue, + [in] REFIID riid, // Expected: ID3D12Resource* + [out, iid_is(riid), annotation("_COM_Outptr_opt_")] void** ppvResource ); + + HRESULT CreateSharedHandle( + [annotation("_In_")] ID3D12DeviceChild* pObject, + [annotation("_In_opt_")] const SECURITY_ATTRIBUTES* pAttributes, + DWORD Access, + [annotation("_In_opt_")] LPCWSTR Name, + [annotation("_Out_")] HANDLE* pHandle ); + + HRESULT OpenSharedHandle( + [annotation("_In_")] HANDLE NTHandle, + [in] REFIID riid, // Expected: ID3D12Resource*, ID3D12Heap*, or ID3D12Fence + [out, iid_is(riid), annotation("_COM_Outptr_opt_")] void** ppvObj ); + + HRESULT OpenSharedHandleByName( + [annotation("_In_")] LPCWSTR Name, + DWORD Access, + [out, annotation("_Out_")] HANDLE* pNTHandle ); + + HRESULT MakeResident( + UINT NumObjects, + [annotation("_In_reads_(NumObjects)")] ID3D12Pageable*const* ppObjects ); + + HRESULT Evict( + UINT NumObjects, + [annotation("_In_reads_(NumObjects)")] ID3D12Pageable*const* ppObjects ); + + HRESULT CreateFence( + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + [in] REFIID riid, // Expected: ID3D12Fence + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppFence); + + HRESULT GetDeviceRemovedReason(); + + void GetCopyableFootprints( + [annotation("_In_")] const D3D12_RESOURCE_DESC* pResourceDesc, + [annotation("_In_range_(0,D3D12_REQ_SUBRESOURCES)")] UINT FirstSubresource, + [annotation("_In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource)")] UINT NumSubresources, + UINT64 BaseOffset, + [annotation("_Out_writes_opt_(NumSubresources)")] D3D12_PLACED_SUBRESOURCE_FOOTPRINT* pLayouts, + [annotation("_Out_writes_opt_(NumSubresources)")] UINT* pNumRows, + [annotation("_Out_writes_opt_(NumSubresources)")] UINT64* pRowSizeInBytes, + [annotation("_Out_opt_")] UINT64* pTotalBytes ); + + HRESULT CreateQueryHeap( + [annotation("_In_")] const D3D12_QUERY_HEAP_DESC* pDesc, + [in] REFIID riid, // Expected: ID3D12QueryHeap + [out, iid_is(riid), annotation("_COM_Outptr_opt_")] void** ppvHeap + ); + + HRESULT SetStablePowerState(BOOL Enable); + + HRESULT CreateCommandSignature( + [annotation("_In_")] const D3D12_COMMAND_SIGNATURE_DESC* pDesc, + [annotation("_In_opt_")] ID3D12RootSignature* pRootSignature, + [in] REFIID riid, // Expected: ID3D12CommandSignature + [out, iid_is(riid), annotation("_COM_Outptr_opt_")] void** ppvCommandSignature + ); + + void GetResourceTiling( + [annotation("_In_")] ID3D12Resource* pTiledResource, + [annotation("_Out_opt_")] UINT* pNumTilesForEntireResource, + [annotation("_Out_opt_")] D3D12_PACKED_MIP_INFO* pPackedMipDesc, + [annotation("_Out_opt_")] D3D12_TILE_SHAPE* pStandardTileShapeForNonPackedMips, + [annotation("_Inout_opt_")] UINT* pNumSubresourceTilings, + [annotation("_In_")] UINT FirstSubresourceTilingToGet, + [annotation("_Out_writes_(*pNumSubresourceTilings)")] D3D12_SUBRESOURCE_TILING* pSubresourceTilingsForNonPackedMips + ); + + LUID GetAdapterLuid(); +} + +// D3D12 Revision 1 +[ uuid( c64226a8-9201-46af-b4cc-53fb9ff7414f ), object, local, pointer_default( unique ) ] +interface ID3D12PipelineLibrary + : ID3D12DeviceChild +{ + HRESULT StorePipeline( + [annotation("_In_opt_")] LPCWSTR pName, + [annotation("_In_")] ID3D12PipelineState *pPipeline + ); + + HRESULT LoadGraphicsPipeline( + [annotation("_In_")] LPCWSTR pName, + [annotation("_In_")] const D3D12_GRAPHICS_PIPELINE_STATE_DESC* pDesc, + [in] REFIID riid, // Expected: ID3D12PipelineState + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppPipelineState + ); + + HRESULT LoadComputePipeline( + [annotation("_In_")] LPCWSTR pName, + [annotation("_In_")] const D3D12_COMPUTE_PIPELINE_STATE_DESC* pDesc, + [in] REFIID riid, // Expected: ID3D12PipelineState + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppPipelineState + ); + + SIZE_T GetSerializedSize(); + + HRESULT Serialize( + [annotation("_Out_writes_(DataSizeInBytes)")] void* pData, + SIZE_T DataSizeInBytes + ); +} + +// Pipeline State v2 +[ uuid( 80eabf42-2568-4e5e-bd82-c37f86961dc3 ), object, local, pointer_default( unique ) ] +interface ID3D12PipelineLibrary1 + : ID3D12PipelineLibrary +{ + HRESULT LoadPipeline( + [annotation("_In_")] LPCWSTR pName, + [annotation("_In_")] const D3D12_PIPELINE_STATE_STREAM_DESC* pDesc, + [in] REFIID riid, // Expected: ID3D12PipelineState + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppPipelineState + ); +} + +typedef enum D3D12_MULTIPLE_FENCE_WAIT_FLAGS +{ + D3D12_MULTIPLE_FENCE_WAIT_FLAG_NONE = 0x0, + D3D12_MULTIPLE_FENCE_WAIT_FLAG_ANY = 0x1, + + D3D12_MULTIPLE_FENCE_WAIT_FLAG_ALL = 0x0, // Alias, default behavior is ALL +} D3D12_MULTIPLE_FENCE_WAIT_FLAGS; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_MULTIPLE_FENCE_WAIT_FLAGS );" ) + +// Applications may use the whole value range of UINT for a priority. +// These names are merely semantic suggestions. +typedef enum D3D12_RESIDENCY_PRIORITY +{ + D3D12_RESIDENCY_PRIORITY_MINIMUM = 0x28000000, + D3D12_RESIDENCY_PRIORITY_LOW = 0x50000000, + D3D12_RESIDENCY_PRIORITY_NORMAL = 0x78000000, + D3D12_RESIDENCY_PRIORITY_HIGH = 0xa0010000, + D3D12_RESIDENCY_PRIORITY_MAXIMUM = 0xc8000000, +} D3D12_RESIDENCY_PRIORITY; + +[uuid(77acce80-638e-4e65-8895-c1f23386863e), object, local, pointer_default(unique)] +interface ID3D12Device1 + : ID3D12Device +{ + HRESULT CreatePipelineLibrary( + [annotation("_In_reads_(BlobLength)")] const void *pLibraryBlob, + SIZE_T BlobLength, + [in] REFIID riid, // Expected: ID3D12PipelineLibrary + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppPipelineLibrary + ); + + HRESULT SetEventOnMultipleFenceCompletion( + [annotation("_In_reads_(NumFences)")] ID3D12Fence* const* ppFences, + [annotation("_In_reads_(NumFences)")] const UINT64* pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent + ); + + HRESULT SetResidencyPriority( + UINT NumObjects, + [annotation("_In_reads_(NumObjects)")] ID3D12Pageable*const* ppObjects, + [annotation("_In_reads_(NumObjects)")] const D3D12_RESIDENCY_PRIORITY* pPriorities ); +} + +[uuid(30baa41e-b15b-475c-a0bb-1af5c5b64328), object, local, pointer_default(unique)] +interface ID3D12Device2 + : ID3D12Device1 +{ + HRESULT CreatePipelineState( + [in] const D3D12_PIPELINE_STATE_STREAM_DESC* pDesc, + [in] REFIID riid, // Can be any pipeline state interface, provided the pipeline subobjects match + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppPipelineState + ); +} + +typedef enum D3D12_RESIDENCY_FLAGS +{ + D3D12_RESIDENCY_FLAG_NONE = 0x0, + D3D12_RESIDENCY_FLAG_DENY_OVERBUDGET = 0x1, +} D3D12_RESIDENCY_FLAGS; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESIDENCY_FLAGS );" ) + +[uuid(81dadc15-2bad-4392-93c5-101345c4aa98), object, local, pointer_default(unique)] +interface ID3D12Device3 + : ID3D12Device2 +{ + HRESULT OpenExistingHeapFromAddress( + [annotation("_In_")] const void* pAddress, + [in] REFIID riid, // Expected: ID3D12Heap + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppvHeap + ); + HRESULT OpenExistingHeapFromFileMapping( + [annotation("_In_")] HANDLE hFileMapping, + [in] REFIID riid, // Expected: ID3D12Heap + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppvHeap + ); + HRESULT EnqueueMakeResident( + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + [annotation("_In_reads_(NumObjects)")] ID3D12Pageable*const* ppObjects, + [annotation("_In_")] ID3D12Fence* pFenceToSignal, + UINT64 FenceValueToSignal + ); +} + +typedef enum D3D12_COMMAND_LIST_FLAGS +{ + D3D12_COMMAND_LIST_FLAG_NONE = 0x0, +} D3D12_COMMAND_LIST_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_LIST_FLAGS );") + + +typedef enum D3D12_COMMAND_POOL_FLAGS +{ + D3D12_COMMAND_POOL_FLAG_NONE = 0x0, + +} D3D12_COMMAND_POOL_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_POOL_FLAGS );") + +typedef enum D3D12_COMMAND_RECORDER_FLAGS +{ + D3D12_COMMAND_RECORDER_FLAG_NONE = 0x0, + +} D3D12_COMMAND_RECORDER_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_RECORDER_FLAGS );") + +typedef enum D3D12_PROTECTED_SESSION_STATUS +{ + D3D12_PROTECTED_SESSION_STATUS_OK = 0, + D3D12_PROTECTED_SESSION_STATUS_INVALID = 1, +} D3D12_PROTECTED_SESSION_STATUS; + +[uuid(A1533D18-0AC1-4084-85B9-89A96116806B), object, local, pointer_default(unique)] +interface ID3D12ProtectedSession + : ID3D12DeviceChild +{ + HRESULT GetStatusFence( + [in] REFIID riid, + [out, iid_is(riid), annotation("_COM_Outptr_opt_")] void** ppFence); + + D3D12_PROTECTED_SESSION_STATUS GetSessionStatus(); +} + +typedef enum D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS +{ + D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_NONE = 0x0, + D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_SUPPORTED = 0x1, + +} D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS );") + +typedef struct D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_SUPPORT +{ + UINT NodeIndex; // input + D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS Support; // output +} D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_SUPPORT; + +typedef enum D3D12_PROTECTED_RESOURCE_SESSION_FLAGS +{ + D3D12_PROTECTED_RESOURCE_SESSION_FLAG_NONE = 0x0, + +} D3D12_PROTECTED_RESOURCE_SESSION_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_PROTECTED_RESOURCE_SESSION_FLAGS );") + +typedef struct D3D12_PROTECTED_RESOURCE_SESSION_DESC +{ + UINT NodeMask; + D3D12_PROTECTED_RESOURCE_SESSION_FLAGS Flags; +} D3D12_PROTECTED_RESOURCE_SESSION_DESC; + +[uuid(6CD696F4-F289-40CC-8091-5A6C0A099C3D), object, local, pointer_default(unique)] +interface ID3D12ProtectedResourceSession + : ID3D12ProtectedSession +{ + D3D12_PROTECTED_RESOURCE_SESSION_DESC GetDesc(); +} + +[uuid(e865df17-a9ee-46f9-a463-3098315aa2e5), object, local, pointer_default(unique)] +interface ID3D12Device4 + : ID3D12Device3 +{ + HRESULT CreateCommandList1( + [annotation("_In_")] UINT nodeMask, + [annotation("_In_")] D3D12_COMMAND_LIST_TYPE type, + [annotation("_In_")] D3D12_COMMAND_LIST_FLAGS flags, + [in] REFIID riid, // Expected: ID3D12CommandList + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppCommandList + ); + + HRESULT CreateProtectedResourceSession( + [annotation("_In_")] const D3D12_PROTECTED_RESOURCE_SESSION_DESC* pDesc, + [annotation("_In_")] REFIID riid, // Expected: ID3D12ProtectedResourceSession, + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppSession + ); + + HRESULT CreateCommittedResource1( + [annotation("_In_")] const D3D12_HEAP_PROPERTIES* pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + [annotation("_In_")] const D3D12_RESOURCE_DESC* pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + [annotation("_In_opt_")] const D3D12_CLEAR_VALUE* pOptimizedClearValue, + [annotation("_In_opt_")] ID3D12ProtectedResourceSession *pProtectedSession, + [in] REFIID riidResource, // Expected: ID3D12Resource1* + [out, iid_is(riidResource), annotation("_COM_Outptr_opt_")] void** ppvResource + ); + + HRESULT CreateHeap1( + [annotation("_In_")] const D3D12_HEAP_DESC* pDesc, + [annotation("_In_opt_")] ID3D12ProtectedResourceSession *pProtectedSession, + [in] REFIID riid, // Expected: ID3D12Heap1* + [out, iid_is(riid), annotation("_COM_Outptr_opt_")] void** ppvHeap + ); + + HRESULT CreateReservedResource1( + [annotation("_In_")] const D3D12_RESOURCE_DESC* pDesc, + D3D12_RESOURCE_STATES InitialState, + [annotation("_In_opt_")] const D3D12_CLEAR_VALUE* pOptimizedClearValue, + [annotation("_In_opt_")] ID3D12ProtectedResourceSession *pProtectedSession, + [in] REFIID riid, // Expected: ID3D12Resource1* + [out, iid_is(riid), annotation("_COM_Outptr_opt_")] void** ppvResource + ); + + D3D12_RESOURCE_ALLOCATION_INFO GetResourceAllocationInfo1( + UINT visibleMask, + UINT numResourceDescs, + [annotation("_In_reads_(numResourceDescs)")] const D3D12_RESOURCE_DESC* pResourceDescs, + [annotation("_Out_writes_opt_(numResourceDescs)")] D3D12_RESOURCE_ALLOCATION_INFO1* pResourceAllocationInfo1 + ); +} + +typedef enum D3D12_LIFETIME_STATE +{ + D3D12_LIFETIME_STATE_IN_USE, + D3D12_LIFETIME_STATE_NOT_IN_USE, +} D3D12_LIFETIME_STATE; + +interface ID3D12LifetimeTracker; + +[uuid(e667af9f-cd56-4f46-83ce-032e595d70a8), object, local, pointer_default(unique)] +interface ID3D12LifetimeOwner : IUnknown +{ + void LifetimeStateUpdated(D3D12_LIFETIME_STATE NewState); +} + +[uuid(f1df64b6-57fd-49cd-8807-c0eb88b45c8f), object, local, pointer_default(unique)] +interface ID3D12SwapChainAssistant + : IUnknown +{ + LUID GetLUID(); + HRESULT GetSwapChainObject(REFIID riid, [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppv); + HRESULT GetCurrentResourceAndCommandQueue(REFIID riidResource, [out, iid_is(riidResource), annotation("_COM_Outptr_")] void** ppvResource, + REFIID riidQueue, [out, iid_is(riidQueue), annotation("_COM_Outptr_")] void** ppvQueue); + HRESULT InsertImplicitSync(); +} + +[uuid(3fd03d36-4eb1-424a-a582-494ecb8ba813), object, local, pointer_default(unique)] +interface ID3D12LifetimeTracker + : ID3D12DeviceChild +{ + HRESULT DestroyOwnedObject([annotation("_In_")] ID3D12DeviceChild* pObject); +} + +typedef enum D3D12_META_COMMAND_PARAMETER_TYPE +{ + D3D12_META_COMMAND_PARAMETER_TYPE_FLOAT = 0, + D3D12_META_COMMAND_PARAMETER_TYPE_UINT64 = 1, + D3D12_META_COMMAND_PARAMETER_TYPE_GPU_VIRTUAL_ADDRESS = 2, + D3D12_META_COMMAND_PARAMETER_TYPE_CPU_DESCRIPTOR_HANDLE_HEAP_TYPE_CBV_SRV_UAV = 3, + D3D12_META_COMMAND_PARAMETER_TYPE_GPU_DESCRIPTOR_HANDLE_HEAP_TYPE_CBV_SRV_UAV = 4, +} D3D12_META_COMMAND_PARAMETER_TYPE; + +typedef enum D3D12_META_COMMAND_PARAMETER_FLAGS +{ + D3D12_META_COMMAND_PARAMETER_FLAG_INPUT = 0x00000001, + D3D12_META_COMMAND_PARAMETER_FLAG_OUTPUT = 0x00000002 +} D3D12_META_COMMAND_PARAMETER_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_META_COMMAND_PARAMETER_FLAGS );") + +typedef enum D3D12_META_COMMAND_PARAMETER_STAGE +{ + D3D12_META_COMMAND_PARAMETER_STAGE_CREATION = 0, + D3D12_META_COMMAND_PARAMETER_STAGE_INITIALIZATION = 1, + D3D12_META_COMMAND_PARAMETER_STAGE_EXECUTION = 2, +} D3D12_META_COMMAND_PARAMETER_STAGE; + +typedef struct D3D12_META_COMMAND_PARAMETER_DESC +{ + LPCWSTR Name; + D3D12_META_COMMAND_PARAMETER_TYPE Type; + D3D12_META_COMMAND_PARAMETER_FLAGS Flags; + D3D12_RESOURCE_STATES RequiredResourceState; + UINT StructureOffset; +} D3D12_META_COMMAND_PARAMETER_DESC; + +typedef enum D3D12_GRAPHICS_STATES +{ + D3D12_GRAPHICS_STATE_NONE = 0, + D3D12_GRAPHICS_STATE_IA_VERTEX_BUFFERS = (1 << 0), + D3D12_GRAPHICS_STATE_IA_INDEX_BUFFER = (1 << 1), + D3D12_GRAPHICS_STATE_IA_PRIMITIVE_TOPOLOGY = (1 << 2), + D3D12_GRAPHICS_STATE_DESCRIPTOR_HEAP = (1 << 3), + D3D12_GRAPHICS_STATE_GRAPHICS_ROOT_SIGNATURE = (1 << 4), + D3D12_GRAPHICS_STATE_COMPUTE_ROOT_SIGNATURE = (1 << 5), + D3D12_GRAPHICS_STATE_RS_VIEWPORTS = (1 << 6), + D3D12_GRAPHICS_STATE_RS_SCISSOR_RECTS = (1 << 7), + D3D12_GRAPHICS_STATE_PREDICATION = (1 << 8), + D3D12_GRAPHICS_STATE_OM_RENDER_TARGETS = (1 << 9), + D3D12_GRAPHICS_STATE_OM_STENCIL_REF = (1 << 10), + D3D12_GRAPHICS_STATE_OM_BLEND_FACTOR = (1 << 11), + D3D12_GRAPHICS_STATE_PIPELINE_STATE = (1 << 12), + D3D12_GRAPHICS_STATE_SO_TARGETS = (1 << 13), + D3D12_GRAPHICS_STATE_OM_DEPTH_BOUNDS = (1 << 14), + D3D12_GRAPHICS_STATE_SAMPLE_POSITIONS = (1 << 15), + D3D12_GRAPHICS_STATE_VIEW_INSTANCE_MASK = (1 << 16), + +} D3D12_GRAPHICS_STATES; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_GRAPHICS_STATES );") + +typedef struct D3D12_META_COMMAND_DESC +{ + GUID Id; + LPCWSTR Name; + D3D12_GRAPHICS_STATES InitializationDirtyState; + D3D12_GRAPHICS_STATES ExecutionDirtyState; +} D3D12_META_COMMAND_DESC; + +[uuid(47016943-fca8-4594-93ea-af258b55346d), object, local, pointer_default(unique)] +interface ID3D12StateObject + : ID3D12Pageable +{ +} + +[uuid(de5fa827-9bf9-4f26-89ff-d7f56fde3860), object, local, pointer_default(unique)] +interface ID3D12StateObjectProperties + : IUnknown +{ + void* GetShaderIdentifier([annotation("_In_")] LPCWSTR pExportName); + UINT64 GetShaderStackSize([annotation("_In_")] LPCWSTR pExportName); + UINT64 GetPipelineStackSize(); + void SetPipelineStackSize(UINT64 PipelineStackSizeInBytes); +} + +typedef enum D3D12_STATE_SUBOBJECT_TYPE +{ + D3D12_STATE_SUBOBJECT_TYPE_STATE_OBJECT_CONFIG = 0, // D3D12_STATE_OBJECT_CONFIG + D3D12_STATE_SUBOBJECT_TYPE_GLOBAL_ROOT_SIGNATURE = 1, // D3D12_GLOBAL_ROOT_SIGNATURE + D3D12_STATE_SUBOBJECT_TYPE_LOCAL_ROOT_SIGNATURE = 2, // D3D12_LOCAL_ROOT_SIGNATURE + D3D12_STATE_SUBOBJECT_TYPE_NODE_MASK = 3, // D3D12_NODE_MASK + // 4 unused + D3D12_STATE_SUBOBJECT_TYPE_DXIL_LIBRARY = 5, // D3D12_DXIL_LIBRARY_DESC + D3D12_STATE_SUBOBJECT_TYPE_EXISTING_COLLECTION = 6, // D3D12_EXISTING_COLLECTION_DESC + D3D12_STATE_SUBOBJECT_TYPE_SUBOBJECT_TO_EXPORTS_ASSOCIATION = 7, // D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION + D3D12_STATE_SUBOBJECT_TYPE_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION = 8, // D3D12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION + D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_SHADER_CONFIG = 9, // D3D12_RAYTRACING_SHADER_CONFIG + D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG = 10, // D3D12_RAYTRACING_PIPELINE_CONFIG + D3D12_STATE_SUBOBJECT_TYPE_HIT_GROUP = 11, // D3D12_HIT_GROUP_DESC + D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG1 = 12, // D3D12_RAYTRACING_PIPELINE_CONFIG1 + D3D12_STATE_SUBOBJECT_TYPE_MAX_VALID, +} D3D12_STATE_SUBOBJECT_TYPE; + +typedef struct D3D12_STATE_SUBOBJECT +{ + D3D12_STATE_SUBOBJECT_TYPE Type; + const void* pDesc; +} D3D12_STATE_SUBOBJECT; + +typedef enum D3D12_STATE_OBJECT_FLAGS +{ + D3D12_STATE_OBJECT_FLAG_NONE = 0x0, + D3D12_STATE_OBJECT_FLAG_ALLOW_LOCAL_DEPENDENCIES_ON_EXTERNAL_DEFINITIONS = 0x1, + D3D12_STATE_OBJECT_FLAG_ALLOW_EXTERNAL_DEPENDENCIES_ON_LOCAL_DEFINITIONS = 0x2, + D3D12_STATE_OBJECT_FLAG_ALLOW_STATE_OBJECT_ADDITIONS = 0x4, +} D3D12_STATE_OBJECT_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_STATE_OBJECT_FLAGS );") + +typedef struct D3D12_STATE_OBJECT_CONFIG +{ + D3D12_STATE_OBJECT_FLAGS Flags; +} D3D12_STATE_OBJECT_CONFIG; + +typedef struct D3D12_GLOBAL_ROOT_SIGNATURE +{ + ID3D12RootSignature* pGlobalRootSignature; +} D3D12_GLOBAL_ROOT_SIGNATURE; + +typedef struct D3D12_LOCAL_ROOT_SIGNATURE +{ + ID3D12RootSignature* pLocalRootSignature; +} D3D12_LOCAL_ROOT_SIGNATURE; + +typedef struct D3D12_NODE_MASK +{ + UINT NodeMask; +} D3D12_NODE_MASK; + +typedef enum D3D12_EXPORT_FLAGS +{ + D3D12_EXPORT_FLAG_NONE = 0x0, +} D3D12_EXPORT_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_EXPORT_FLAGS );") + +typedef struct D3D12_EXPORT_DESC +{ + LPCWSTR Name; + [annotation("_In_opt_")] LPCWSTR ExportToRename; + D3D12_EXPORT_FLAGS Flags; +} D3D12_EXPORT_DESC; + +typedef struct D3D12_DXIL_LIBRARY_DESC +{ + D3D12_SHADER_BYTECODE DXILLibrary; + UINT NumExports; // Optional, if 0 all exports in the library/collection will be surfaced + [annotation("_In_reads_(NumExports)")] D3D12_EXPORT_DESC* pExports; +} D3D12_DXIL_LIBRARY_DESC; + +typedef struct D3D12_EXISTING_COLLECTION_DESC +{ + ID3D12StateObject* pExistingCollection; + UINT NumExports; // Optional, if 0 all exports in the library/collection will be surfaced + [annotation("_In_reads_(NumExports)")] D3D12_EXPORT_DESC* pExports; +} D3D12_EXISTING_COLLECTION_DESC; + +typedef struct D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION +{ + const D3D12_STATE_SUBOBJECT* pSubobjectToAssociate; + UINT NumExports; + [annotation("_In_reads_(NumExports)")] LPCWSTR* pExports; +} D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION; + +typedef struct D3D12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION +{ + LPCWSTR SubobjectToAssociate; + UINT NumExports; + [annotation("_In_reads_(NumExports)")] LPCWSTR* pExports; +} D3D12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION; + +typedef enum D3D12_HIT_GROUP_TYPE +{ + D3D12_HIT_GROUP_TYPE_TRIANGLES = 0x0, + D3D12_HIT_GROUP_TYPE_PROCEDURAL_PRIMITIVE = 0x1, +} D3D12_HIT_GROUP_TYPE; + +typedef struct D3D12_HIT_GROUP_DESC +{ + LPCWSTR HitGroupExport; + D3D12_HIT_GROUP_TYPE Type; + [annotation("_In_opt_")] LPCWSTR AnyHitShaderImport; + [annotation("_In_opt_")] LPCWSTR ClosestHitShaderImport; + [annotation("_In_opt_")] LPCWSTR IntersectionShaderImport; +} D3D12_HIT_GROUP_DESC; + +typedef struct D3D12_RAYTRACING_SHADER_CONFIG +{ + UINT MaxPayloadSizeInBytes; + UINT MaxAttributeSizeInBytes; +} D3D12_RAYTRACING_SHADER_CONFIG; + +typedef struct D3D12_RAYTRACING_PIPELINE_CONFIG +{ + UINT MaxTraceRecursionDepth; +} D3D12_RAYTRACING_PIPELINE_CONFIG; + +typedef enum D3D12_RAYTRACING_PIPELINE_FLAGS +{ + D3D12_RAYTRACING_PIPELINE_FLAG_NONE = 0x0, + D3D12_RAYTRACING_PIPELINE_FLAG_SKIP_TRIANGLES = 0x100, + D3D12_RAYTRACING_PIPELINE_FLAG_SKIP_PROCEDURAL_PRIMITIVES = 0x200, +} D3D12_RAYTRACING_PIPELINE_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_PIPELINE_FLAGS );") + +typedef struct D3D12_RAYTRACING_PIPELINE_CONFIG1 +{ + UINT MaxTraceRecursionDepth; + D3D12_RAYTRACING_PIPELINE_FLAGS Flags; +} D3D12_RAYTRACING_PIPELINE_CONFIG1; + +typedef enum D3D12_STATE_OBJECT_TYPE +{ + D3D12_STATE_OBJECT_TYPE_COLLECTION = 0, + // D3D12_STATE_OBJECT_TYPE_COMPUTE_PIPELINE = 1, + // D3D12_STATE_OBJECT_TYPE_GRAPHICS_PIPELINE = 2, + D3D12_STATE_OBJECT_TYPE_RAYTRACING_PIPELINE = 3, +} D3D12_STATE_OBJECT_TYPE; + +typedef struct D3D12_STATE_OBJECT_DESC +{ + D3D12_STATE_OBJECT_TYPE Type; + UINT NumSubobjects; + [annotation("_In_reads_(NumSubobjects)")] const D3D12_STATE_SUBOBJECT* pSubobjects; +} D3D12_STATE_OBJECT_DESC; + +typedef enum D3D12_RAYTRACING_GEOMETRY_FLAGS +{ + D3D12_RAYTRACING_GEOMETRY_FLAG_NONE = 0x0, + D3D12_RAYTRACING_GEOMETRY_FLAG_OPAQUE = 0x1, + D3D12_RAYTRACING_GEOMETRY_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION = 0x2, +} D3D12_RAYTRACING_GEOMETRY_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_GEOMETRY_FLAGS );") + +typedef enum D3D12_RAYTRACING_GEOMETRY_TYPE +{ + D3D12_RAYTRACING_GEOMETRY_TYPE_TRIANGLES, + D3D12_RAYTRACING_GEOMETRY_TYPE_PROCEDURAL_PRIMITIVE_AABBS, +} D3D12_RAYTRACING_GEOMETRY_TYPE; + +typedef enum D3D12_RAYTRACING_INSTANCE_FLAGS +{ + D3D12_RAYTRACING_INSTANCE_FLAG_NONE = 0x0, + D3D12_RAYTRACING_INSTANCE_FLAG_TRIANGLE_CULL_DISABLE = 0x1, + D3D12_RAYTRACING_INSTANCE_FLAG_TRIANGLE_FRONT_COUNTERCLOCKWISE = 0x2, + D3D12_RAYTRACING_INSTANCE_FLAG_FORCE_OPAQUE = 0x4, + D3D12_RAYTRACING_INSTANCE_FLAG_FORCE_NON_OPAQUE = 0x8 +} D3D12_RAYTRACING_INSTANCE_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_INSTANCE_FLAGS );") + +typedef struct D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE +{ + D3D12_GPU_VIRTUAL_ADDRESS StartAddress; + UINT64 StrideInBytes; +} D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE; + +typedef struct D3D12_GPU_VIRTUAL_ADDRESS_RANGE +{ + D3D12_GPU_VIRTUAL_ADDRESS StartAddress; + UINT64 SizeInBytes; +} D3D12_GPU_VIRTUAL_ADDRESS_RANGE; + +typedef struct D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE +{ + D3D12_GPU_VIRTUAL_ADDRESS StartAddress; + UINT64 SizeInBytes; + UINT64 StrideInBytes; +} D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE; + +typedef struct D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC +{ + D3D12_GPU_VIRTUAL_ADDRESS Transform3x4; + DXGI_FORMAT IndexFormat; + DXGI_FORMAT VertexFormat; + UINT IndexCount; + UINT VertexCount; + D3D12_GPU_VIRTUAL_ADDRESS IndexBuffer; + D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE VertexBuffer; +} D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC; + +typedef struct D3D12_RAYTRACING_AABB +{ + FLOAT MinX; + FLOAT MinY; + FLOAT MinZ; + FLOAT MaxX; + FLOAT MaxY; + FLOAT MaxZ; +} D3D12_RAYTRACING_AABB; + +typedef struct D3D12_RAYTRACING_GEOMETRY_AABBS_DESC +{ + UINT64 AABBCount; + D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE AABBs; +} D3D12_RAYTRACING_GEOMETRY_AABBS_DESC; + +typedef enum D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS +{ + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_NONE = 0x00, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_UPDATE = 0x01, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_COMPACTION = 0x02, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PREFER_FAST_TRACE = 0x04, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PREFER_FAST_BUILD = 0x08, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_MINIMIZE_MEMORY = 0x10, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PERFORM_UPDATE = 0x20, +} D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS );") + +typedef enum D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE +{ + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_CLONE = 0x0, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_COMPACT = 0x1, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_VISUALIZATION_DECODE_FOR_TOOLS = 0x2, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_SERIALIZE = 0x3, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_DESERIALIZE = 0x4, +} D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE; + +typedef enum D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE +{ + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL = 0x0, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL = 0x1 +} D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE; + +typedef enum D3D12_ELEMENTS_LAYOUT +{ + D3D12_ELEMENTS_LAYOUT_ARRAY = 0x0, + D3D12_ELEMENTS_LAYOUT_ARRAY_OF_POINTERS = 0x1 +} D3D12_ELEMENTS_LAYOUT; + +typedef enum D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TYPE +{ + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_COMPACTED_SIZE = 0x0, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TOOLS_VISUALIZATION = 0x1, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_SERIALIZATION = 0x2, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_CURRENT_SIZE = 0x3, +} D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TYPE; + +typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC +{ + D3D12_GPU_VIRTUAL_ADDRESS DestBuffer; + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TYPE InfoType; +} D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC; + +typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_COMPACTED_SIZE_DESC +{ + UINT64 CompactedSizeInBytes; +} D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_COMPACTED_SIZE_DESC; + +typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TOOLS_VISUALIZATION_DESC +{ + UINT64 DecodedSizeInBytes; +} D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TOOLS_VISUALIZATION_DESC; + +typedef struct D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_TOOLS_VISUALIZATION_HEADER +{ + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE Type; + UINT NumDescs; +} D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_TOOLS_VISUALIZATION_HEADER; +cpp_quote("// Regarding D3D12_BUILD_RAY_TRACING_ACCELERATION_STRUCTURE_TOOLS_VISUALIZATION_HEADER above,") +cpp_quote("// depending on Type field, NumDescs above is followed by either:") +cpp_quote("// D3D12_RAY_TRACING_INSTANCE_DESC InstanceDescs[NumDescs]") +cpp_quote("// or D3D12_RAY_TRACING_GEOMETRY_DESC GeometryDescs[NumDescs].") +cpp_quote("// There is 4 bytes of padding between GeometryDesc structs in the array so alignment is natural when viewed by CPU.") +cpp_quote("") + +typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_SERIALIZATION_DESC +{ + UINT64 SerializedSizeInBytes; + UINT64 NumBottomLevelAccelerationStructurePointers; +} D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_SERIALIZATION_DESC; + +typedef struct D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER +{ + GUID DriverOpaqueGUID; + BYTE DriverOpaqueVersioningData[16]; +} D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER; + +typedef enum D3D12_SERIALIZED_DATA_TYPE +{ + D3D12_SERIALIZED_DATA_RAYTRACING_ACCELERATION_STRUCTURE = 0x0, +} D3D12_SERIALIZED_DATA_TYPE; + +typedef enum D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS +{ + D3D12_DRIVER_MATCHING_IDENTIFIER_COMPATIBLE_WITH_DEVICE = 0x0, + D3D12_DRIVER_MATCHING_IDENTIFIER_UNSUPPORTED_TYPE = 0x1, + D3D12_DRIVER_MATCHING_IDENTIFIER_UNRECOGNIZED = 0x2, + D3D12_DRIVER_MATCHING_IDENTIFIER_INCOMPATIBLE_VERSION = 0x3, + D3D12_DRIVER_MATCHING_IDENTIFIER_INCOMPATIBLE_TYPE = 0x4, +} D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS; + +typedef struct D3D12_SERIALIZED_RAYTRACING_ACCELERATION_STRUCTURE_HEADER +{ + D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER DriverMatchingIdentifier; + UINT64 SerializedSizeInBytesIncludingHeader; + UINT64 DeserializedSizeInBytes; + UINT64 NumBottomLevelAccelerationStructurePointersAfterHeader; +} D3D12_SERIALIZED_RAYTRACING_ACCELERATION_STRUCTURE_HEADER; + +typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_CURRENT_SIZE_DESC +{ + UINT64 CurrentSizeInBytes; +} D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_CURRENT_SIZE_DESC; + +typedef struct D3D12_RAYTRACING_INSTANCE_DESC +{ + FLOAT Transform[3][4]; + UINT InstanceID : 24; + UINT InstanceMask : 8; + UINT InstanceContributionToHitGroupIndex : 24; + UINT Flags : 8; + D3D12_GPU_VIRTUAL_ADDRESS AccelerationStructure; +} D3D12_RAYTRACING_INSTANCE_DESC; + +typedef struct D3D12_RAYTRACING_GEOMETRY_DESC +{ + D3D12_RAYTRACING_GEOMETRY_TYPE Type; + D3D12_RAYTRACING_GEOMETRY_FLAGS Flags; + union + { + D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC Triangles; + D3D12_RAYTRACING_GEOMETRY_AABBS_DESC AABBs; + }; +} D3D12_RAYTRACING_GEOMETRY_DESC; + +typedef struct D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS +{ + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE Type; + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS Flags; + UINT NumDescs; + D3D12_ELEMENTS_LAYOUT DescsLayout; + union + { + D3D12_GPU_VIRTUAL_ADDRESS InstanceDescs; + const D3D12_RAYTRACING_GEOMETRY_DESC* pGeometryDescs; + const D3D12_RAYTRACING_GEOMETRY_DESC*const* ppGeometryDescs; + }; +} D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS; + +typedef struct D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC +{ + D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData; + D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS Inputs; + [annotation("_In_opt_")] D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData; + D3D12_GPU_VIRTUAL_ADDRESS ScratchAccelerationStructureData; +} D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC; + +typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO +{ + UINT64 ResultDataMaxSizeInBytes; + UINT64 ScratchDataSizeInBytes; + UINT64 UpdateScratchDataSizeInBytes; +} D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO; + +typedef enum D3D12_RAY_FLAGS +{ + D3D12_RAY_FLAG_NONE = 0x00, + D3D12_RAY_FLAG_FORCE_OPAQUE = 0x01, + D3D12_RAY_FLAG_FORCE_NON_OPAQUE = 0x02, + D3D12_RAY_FLAG_ACCEPT_FIRST_HIT_AND_END_SEARCH = 0x04, + D3D12_RAY_FLAG_SKIP_CLOSEST_HIT_SHADER = 0x08, + D3D12_RAY_FLAG_CULL_BACK_FACING_TRIANGLES = 0x10, + D3D12_RAY_FLAG_CULL_FRONT_FACING_TRIANGLES = 0x20, + D3D12_RAY_FLAG_CULL_OPAQUE = 0x40, + D3D12_RAY_FLAG_CULL_NON_OPAQUE = 0x80, + D3D12_RAY_FLAG_SKIP_TRIANGLES = 0x100, + D3D12_RAY_FLAG_SKIP_PROCEDURAL_PRIMITIVES = 0x200, +} D3D12_RAY_FLAGS; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAY_FLAGS );" ) + +typedef enum D3D12_HIT_KIND +{ + D3D12_HIT_KIND_TRIANGLE_FRONT_FACE = 0xfe, + D3D12_HIT_KIND_TRIANGLE_BACK_FACE = 0xff, +} D3D12_HIT_KIND; + +[uuid(8b4f173b-2fea-4b80-8f58-4307191ab95d), object, local, pointer_default(unique)] +interface ID3D12Device5 + : ID3D12Device4 +{ + HRESULT CreateLifetimeTracker( + [annotation("_In_")] ID3D12LifetimeOwner* pOwner, + [in] REFIID riid, // Expected: ID3D12LifetimeTracker* + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppvTracker + ); + + void RemoveDevice(); + + HRESULT EnumerateMetaCommands( + [annotation("_Inout_")] UINT* pNumMetaCommands, + [annotation("_Out_writes_opt_(*pNumMetaCommands)")] D3D12_META_COMMAND_DESC* pDescs + ); + + HRESULT EnumerateMetaCommandParameters( + [annotation("_In_")] REFGUID CommandId, + [annotation("_In_")] D3D12_META_COMMAND_PARAMETER_STAGE Stage, + [annotation("_Out_opt_")] UINT* pTotalStructureSizeInBytes, + [annotation("_Inout_")] UINT* pParameterCount, + [annotation("_Out_writes_opt_(*pParameterCount)")] D3D12_META_COMMAND_PARAMETER_DESC* pParameterDescs + ); + + HRESULT CreateMetaCommand( + [annotation("_In_")] REFGUID CommandId, + [annotation("_In_")] UINT NodeMask, + [annotation("_In_reads_bytes_opt_(CreationParametersDataSizeInBytes)")] const void * pCreationParametersData, + [annotation("_In_")] SIZE_T CreationParametersDataSizeInBytes, + [in] REFIID riid, + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppMetaCommand + ); + + HRESULT CreateStateObject( + [in] const D3D12_STATE_OBJECT_DESC* pDesc, + [in] REFIID riid, // ID3D12StateObject + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppStateObject + ); + + void GetRaytracingAccelerationStructurePrebuildInfo( + [annotation("_In_")] const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS* pDesc, + [annotation("_Out_")] D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo + ); + + D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS CheckDriverMatchingIdentifier( + [annotation("_In_")] D3D12_SERIALIZED_DATA_TYPE SerializedDataType, + [annotation("_In_")] const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER* pIdentifierToCheck); +} + + +typedef enum D3D12_AUTO_BREADCRUMB_OP +{ + D3D12_AUTO_BREADCRUMB_OP_SETMARKER = 0, + D3D12_AUTO_BREADCRUMB_OP_BEGINEVENT = 1, + D3D12_AUTO_BREADCRUMB_OP_ENDEVENT = 2, + D3D12_AUTO_BREADCRUMB_OP_DRAWINSTANCED = 3, + D3D12_AUTO_BREADCRUMB_OP_DRAWINDEXEDINSTANCED = 4, + D3D12_AUTO_BREADCRUMB_OP_EXECUTEINDIRECT = 5, + D3D12_AUTO_BREADCRUMB_OP_DISPATCH = 6, + D3D12_AUTO_BREADCRUMB_OP_COPYBUFFERREGION = 7, + D3D12_AUTO_BREADCRUMB_OP_COPYTEXTUREREGION = 8, + D3D12_AUTO_BREADCRUMB_OP_COPYRESOURCE = 9, + D3D12_AUTO_BREADCRUMB_OP_COPYTILES = 10, + D3D12_AUTO_BREADCRUMB_OP_RESOLVESUBRESOURCE = 11, + D3D12_AUTO_BREADCRUMB_OP_CLEARRENDERTARGETVIEW = 12, + D3D12_AUTO_BREADCRUMB_OP_CLEARUNORDEREDACCESSVIEW = 13, + D3D12_AUTO_BREADCRUMB_OP_CLEARDEPTHSTENCILVIEW = 14, + D3D12_AUTO_BREADCRUMB_OP_RESOURCEBARRIER = 15, + D3D12_AUTO_BREADCRUMB_OP_EXECUTEBUNDLE = 16, + D3D12_AUTO_BREADCRUMB_OP_PRESENT = 17, + D3D12_AUTO_BREADCRUMB_OP_RESOLVEQUERYDATA = 18, + D3D12_AUTO_BREADCRUMB_OP_BEGINSUBMISSION = 19, + D3D12_AUTO_BREADCRUMB_OP_ENDSUBMISSION = 20, + D3D12_AUTO_BREADCRUMB_OP_DECODEFRAME = 21, + D3D12_AUTO_BREADCRUMB_OP_PROCESSFRAMES = 22, + D3D12_AUTO_BREADCRUMB_OP_ATOMICCOPYBUFFERUINT = 23, + D3D12_AUTO_BREADCRUMB_OP_ATOMICCOPYBUFFERUINT64 = 24, + D3D12_AUTO_BREADCRUMB_OP_RESOLVESUBRESOURCEREGION = 25, + D3D12_AUTO_BREADCRUMB_OP_WRITEBUFFERIMMEDIATE = 26, + D3D12_AUTO_BREADCRUMB_OP_DECODEFRAME1 = 27, + D3D12_AUTO_BREADCRUMB_OP_SETPROTECTEDRESOURCESESSION = 28, + D3D12_AUTO_BREADCRUMB_OP_DECODEFRAME2 = 29, + D3D12_AUTO_BREADCRUMB_OP_PROCESSFRAMES1 = 30, + D3D12_AUTO_BREADCRUMB_OP_BUILDRAYTRACINGACCELERATIONSTRUCTURE = 31, + D3D12_AUTO_BREADCRUMB_OP_EMITRAYTRACINGACCELERATIONSTRUCTUREPOSTBUILDINFO = 32, + D3D12_AUTO_BREADCRUMB_OP_COPYRAYTRACINGACCELERATIONSTRUCTURE = 33, + D3D12_AUTO_BREADCRUMB_OP_DISPATCHRAYS = 34, + D3D12_AUTO_BREADCRUMB_OP_INITIALIZEMETACOMMAND = 35, + D3D12_AUTO_BREADCRUMB_OP_EXECUTEMETACOMMAND = 36, + D3D12_AUTO_BREADCRUMB_OP_ESTIMATEMOTION = 37, + D3D12_AUTO_BREADCRUMB_OP_RESOLVEMOTIONVECTORHEAP = 38, + D3D12_AUTO_BREADCRUMB_OP_SETPIPELINESTATE1 = 39, + D3D12_AUTO_BREADCRUMB_OP_INITIALIZEEXTENSIONCOMMAND = 40, + D3D12_AUTO_BREADCRUMB_OP_EXECUTEEXTENSIONCOMMAND = 41, + D3D12_AUTO_BREADCRUMB_OP_DISPATCHMESH = 42, + D3D12_AUTO_BREADCRUMB_OP_ENCODEFRAME = 43, + D3D12_AUTO_BREADCRUMB_OP_RESOLVEENCODEROUTPUTMETADATA = 44, +} D3D12_AUTO_BREADCRUMB_OP; + +typedef struct D3D12_AUTO_BREADCRUMB_NODE +{ + const char *pCommandListDebugNameA; + const wchar_t *pCommandListDebugNameW; + const char *pCommandQueueDebugNameA; + const wchar_t *pCommandQueueDebugNameW; + ID3D12GraphicsCommandList *pCommandList; + ID3D12CommandQueue *pCommandQueue; + UINT32 BreadcrumbCount; + const UINT32 *pLastBreadcrumbValue; + const D3D12_AUTO_BREADCRUMB_OP *pCommandHistory; + const struct D3D12_AUTO_BREADCRUMB_NODE *pNext; // pointer to next node +} D3D12_AUTO_BREADCRUMB_NODE; + +typedef struct D3D12_DRED_BREADCRUMB_CONTEXT +{ + UINT BreadcrumbIndex; + const wchar_t *pContextString; +} D3D12_DRED_BREADCRUMB_CONTEXT; + +// !!! Must be castable to D3D12_AUTO_BREADCRUMB_NODE +typedef struct D3D12_AUTO_BREADCRUMB_NODE1 +{ + const char *pCommandListDebugNameA; + const wchar_t *pCommandListDebugNameW; + const char *pCommandQueueDebugNameA; + const wchar_t *pCommandQueueDebugNameW; + ID3D12GraphicsCommandList *pCommandList; + ID3D12CommandQueue *pCommandQueue; + UINT BreadcrumbCount; + const UINT *pLastBreadcrumbValue; + const D3D12_AUTO_BREADCRUMB_OP *pCommandHistory; + const struct D3D12_AUTO_BREADCRUMB_NODE1 *pNext; // pointer to next node + UINT BreadcrumbContextsCount; + D3D12_DRED_BREADCRUMB_CONTEXT *pBreadcrumbContexts; +} D3D12_AUTO_BREADCRUMB_NODE1; + +// D3D12_DRED_VERSION +typedef enum D3D12_DRED_VERSION +{ + D3D12_DRED_VERSION_1_0 = 0x1, + D3D12_DRED_VERSION_1_1 = 0x2, + D3D12_DRED_VERSION_1_2 = 0x3, + D3D12_DRED_VERSION_1_3 = 0x4, +} D3D12_DRED_VERSION; + +typedef enum D3D12_DRED_FLAGS +{ + D3D12_DRED_FLAG_NONE = 0, + D3D12_DRED_FLAG_FORCE_ENABLE = 1, + D3D12_DRED_FLAG_DISABLE_AUTOBREADCRUMBS = 2, +} D3D12_DRED_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_DRED_FLAGS );") + +typedef enum D3D12_DRED_ENABLEMENT +{ + D3D12_DRED_ENABLEMENT_SYSTEM_CONTROLLED = 0, + D3D12_DRED_ENABLEMENT_FORCED_OFF = 1, + D3D12_DRED_ENABLEMENT_FORCED_ON = 2, +} D3D12_DRED_ENABLEMENT; + +typedef struct D3D12_DEVICE_REMOVED_EXTENDED_DATA +{ + [annotation("_In_")] D3D12_DRED_FLAGS Flags; // Dred flags + [annotation("_Out_")] D3D12_AUTO_BREADCRUMB_NODE *pHeadAutoBreadcrumbNode; // Pointer to head of a linked list of auto-breadcrumb data +} D3D12_DEVICE_REMOVED_EXTENDED_DATA; + +typedef enum D3D12_DRED_ALLOCATION_TYPE +{ + // Enum starts at 19 and skips 26 to maintain compatibility with older D3D12 drivers + D3D12_DRED_ALLOCATION_TYPE_COMMAND_QUEUE = 19, + D3D12_DRED_ALLOCATION_TYPE_COMMAND_ALLOCATOR = 20, + D3D12_DRED_ALLOCATION_TYPE_PIPELINE_STATE = 21, + D3D12_DRED_ALLOCATION_TYPE_COMMAND_LIST = 22, + D3D12_DRED_ALLOCATION_TYPE_FENCE = 23, + D3D12_DRED_ALLOCATION_TYPE_DESCRIPTOR_HEAP = 24, + D3D12_DRED_ALLOCATION_TYPE_HEAP = 25, + D3D12_DRED_ALLOCATION_TYPE_QUERY_HEAP = 27, + D3D12_DRED_ALLOCATION_TYPE_COMMAND_SIGNATURE = 28, + D3D12_DRED_ALLOCATION_TYPE_PIPELINE_LIBRARY = 29, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_DECODER = 30, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_PROCESSOR = 32, + D3D12_DRED_ALLOCATION_TYPE_RESOURCE = 34, + D3D12_DRED_ALLOCATION_TYPE_PASS = 35, + D3D12_DRED_ALLOCATION_TYPE_CRYPTOSESSION = 36, + D3D12_DRED_ALLOCATION_TYPE_CRYPTOSESSIONPOLICY = 37, + D3D12_DRED_ALLOCATION_TYPE_PROTECTEDRESOURCESESSION = 38, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_DECODER_HEAP = 39, + D3D12_DRED_ALLOCATION_TYPE_COMMAND_POOL = 40, + D3D12_DRED_ALLOCATION_TYPE_COMMAND_RECORDER = 41, + D3D12_DRED_ALLOCATION_TYPE_STATE_OBJECT = 42, + D3D12_DRED_ALLOCATION_TYPE_METACOMMAND = 43, + D3D12_DRED_ALLOCATION_TYPE_SCHEDULINGGROUP = 44, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_MOTION_ESTIMATOR = 45, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_MOTION_VECTOR_HEAP = 46, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_EXTENSION_COMMAND = 47, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_ENCODER = 48, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_ENCODER_HEAP = 49, + + + D3D12_DRED_ALLOCATION_TYPE_INVALID = 0xFFFFFFFF +} D3D12_DRED_ALLOCATION_TYPE; + +typedef struct D3D12_DRED_ALLOCATION_NODE +{ + const char *ObjectNameA; + const wchar_t *ObjectNameW; + D3D12_DRED_ALLOCATION_TYPE AllocationType; + const struct D3D12_DRED_ALLOCATION_NODE *pNext; +} D3D12_DRED_ALLOCATION_NODE; + +typedef struct D3D12_DRED_ALLOCATION_NODE1 +{ + const char *ObjectNameA; + const wchar_t *ObjectNameW; + D3D12_DRED_ALLOCATION_TYPE AllocationType; + const struct D3D12_DRED_ALLOCATION_NODE1 *pNext; + const IUnknown *pObject; +} D3D12_DRED_ALLOCATION_NODE1; + +typedef struct D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT +{ + [annotation("_Out_")] const D3D12_AUTO_BREADCRUMB_NODE *pHeadAutoBreadcrumbNode; // Pointer to head of a null-terminated linked list of auto-breadcrumb data +} D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT; + +typedef struct D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 +{ + [annotation("_Out_")] const D3D12_AUTO_BREADCRUMB_NODE1 *pHeadAutoBreadcrumbNode; // Pointer to head of a null-terminated linked list of auto-breadcrumb data +} D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1; + +typedef struct D3D12_DRED_PAGE_FAULT_OUTPUT +{ + D3D12_GPU_VIRTUAL_ADDRESS PageFaultVA; //If the device removal was due to GPU Fault, this contains the VA of the faulting op + [annotation("_Out_")] const D3D12_DRED_ALLOCATION_NODE *pHeadExistingAllocationNode; + [annotation("_Out_")] const D3D12_DRED_ALLOCATION_NODE *pHeadRecentFreedAllocationNode; +} D3D12_DRED_PAGE_FAULT_OUTPUT; + +typedef struct D3D12_DRED_PAGE_FAULT_OUTPUT1 +{ + D3D12_GPU_VIRTUAL_ADDRESS PageFaultVA; //If the device removal was due to GPU Fault, this contains the VA of the faulting op + [annotation("_Out_")] const D3D12_DRED_ALLOCATION_NODE1 *pHeadExistingAllocationNode; + [annotation("_Out_")] const D3D12_DRED_ALLOCATION_NODE1 *pHeadRecentFreedAllocationNode; +} D3D12_DRED_PAGE_FAULT_OUTPUT1; + +typedef enum D3D12_DRED_PAGE_FAULT_FLAGS +{ + D3D12_DRED_PAGE_FAULT_FLAGS_NONE = 0, +} D3D12_DRED_PAGE_FAULT_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_DRED_PAGE_FAULT_FLAGS );") + +typedef enum D3D12_DRED_DEVICE_STATE +{ + D3D12_DRED_DEVICE_STATE_UNKNOWN = 0, // Only known if DRED event occurred + D3D12_DRED_DEVICE_STATE_HUNG = 3, + D3D12_DRED_DEVICE_STATE_FAULT = 6, + D3D12_DRED_DEVICE_STATE_PAGEFAULT = 7, +} D3D12_DRED_DEVICE_STATE; + +typedef struct D3D12_DRED_PAGE_FAULT_OUTPUT2 +{ + D3D12_GPU_VIRTUAL_ADDRESS PageFaultVA; //If the device removal was due to GPU Fault, this contains the VA of the faulting op + [annotation("_Out_")] const D3D12_DRED_ALLOCATION_NODE1 *pHeadExistingAllocationNode; + [annotation("_Out_")] const D3D12_DRED_ALLOCATION_NODE1 *pHeadRecentFreedAllocationNode; + D3D12_DRED_PAGE_FAULT_FLAGS PageFaultFlags; + +} D3D12_DRED_PAGE_FAULT_OUTPUT2; + +typedef struct D3D12_DEVICE_REMOVED_EXTENDED_DATA1 +{ + HRESULT DeviceRemovedReason; + D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT AutoBreadcrumbsOutput; + D3D12_DRED_PAGE_FAULT_OUTPUT PageFaultOutput; +} D3D12_DEVICE_REMOVED_EXTENDED_DATA1; + +typedef struct D3D12_DEVICE_REMOVED_EXTENDED_DATA2 +{ + HRESULT DeviceRemovedReason; + D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 AutoBreadcrumbsOutput; + D3D12_DRED_PAGE_FAULT_OUTPUT1 PageFaultOutput; +} D3D12_DEVICE_REMOVED_EXTENDED_DATA2; + +typedef struct D3D12_DEVICE_REMOVED_EXTENDED_DATA3 +{ + HRESULT DeviceRemovedReason; + D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 AutoBreadcrumbsOutput; + D3D12_DRED_PAGE_FAULT_OUTPUT2 PageFaultOutput; + D3D12_DRED_DEVICE_STATE DeviceState; +} D3D12_DEVICE_REMOVED_EXTENDED_DATA3; + +typedef struct D3D12_VERSIONED_DEVICE_REMOVED_EXTENDED_DATA +{ + D3D12_DRED_VERSION Version; // Version of the DRED data + union + { + D3D12_DEVICE_REMOVED_EXTENDED_DATA Dred_1_0; + D3D12_DEVICE_REMOVED_EXTENDED_DATA1 Dred_1_1; + D3D12_DEVICE_REMOVED_EXTENDED_DATA2 Dred_1_2; + D3D12_DEVICE_REMOVED_EXTENDED_DATA3 Dred_1_3; + }; +} D3D12_VERSIONED_DEVICE_REMOVED_EXTENDED_DATA; + +[uuid(82BC481C-6B9B-4030-AEDB-7EE3D1DF1E63), object, local, pointer_default(unique)] +interface ID3D12DeviceRemovedExtendedDataSettings + : IUnknown +{ + void SetAutoBreadcrumbsEnablement(D3D12_DRED_ENABLEMENT Enablement); + void SetPageFaultEnablement(D3D12_DRED_ENABLEMENT Enablement); + void SetWatsonDumpEnablement(D3D12_DRED_ENABLEMENT Enablement); +}; + +[uuid(DBD5AE51-3317-4F0A-ADF9-1D7CEDCAAE0B), object, local, pointer_default(unique)] +interface ID3D12DeviceRemovedExtendedDataSettings1 + : ID3D12DeviceRemovedExtendedDataSettings +{ + void SetBreadcrumbContextEnablement(D3D12_DRED_ENABLEMENT Enablement); +}; + +[uuid(61552388-01ab-4008-a436-83db189566ea), object, local, pointer_default(unique)] +interface ID3D12DeviceRemovedExtendedDataSettings2 + : ID3D12DeviceRemovedExtendedDataSettings1 +{ + void UseMarkersOnlyAutoBreadcrumbs(BOOL MarkersOnly); +}; + + +[uuid(98931D33-5AE8-4791-AA3C-1A73A2934E71), object, local, pointer_default(unique)] +interface ID3D12DeviceRemovedExtendedData + : IUnknown +{ + HRESULT GetAutoBreadcrumbsOutput([annotation("_Out_")] D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT *pOutput); + HRESULT GetPageFaultAllocationOutput([annotation("_Out_")] D3D12_DRED_PAGE_FAULT_OUTPUT *pOutput); +}; + +[uuid(9727A022-CF1D-4DDA-9EBA-EFFA653FC506), object, local, pointer_default(unique)] +interface ID3D12DeviceRemovedExtendedData1 + : ID3D12DeviceRemovedExtendedData +{ + HRESULT GetAutoBreadcrumbsOutput1([annotation("_Out_")] D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 *pOutput); + HRESULT GetPageFaultAllocationOutput1([annotation("_Out_")] D3D12_DRED_PAGE_FAULT_OUTPUT1 *pOutput); +}; + +[uuid(67FC5816-E4CA-4915-BF18-42541272DA54), object, local, pointer_default(unique)] +interface ID3D12DeviceRemovedExtendedData2 + : ID3D12DeviceRemovedExtendedData1 +{ + HRESULT GetPageFaultAllocationOutput2([annotation("_Out_")] D3D12_DRED_PAGE_FAULT_OUTPUT2 *pOutput); + D3D12_DRED_DEVICE_STATE GetDeviceState(); +}; + +typedef enum D3D12_BACKGROUND_PROCESSING_MODE +{ + D3D12_BACKGROUND_PROCESSING_MODE_ALLOWED, + D3D12_BACKGROUND_PROCESSING_MODE_ALLOW_INTRUSIVE_MEASUREMENTS, + D3D12_BACKGROUND_PROCESSING_MODE_DISABLE_BACKGROUND_WORK, + D3D12_BACKGROUND_PROCESSING_MODE_DISABLE_PROFILING_BY_SYSTEM, +} D3D12_BACKGROUND_PROCESSING_MODE; + +typedef enum D3D12_MEASUREMENTS_ACTION +{ + D3D12_MEASUREMENTS_ACTION_KEEP_ALL, + D3D12_MEASUREMENTS_ACTION_COMMIT_RESULTS, + D3D12_MEASUREMENTS_ACTION_COMMIT_RESULTS_HIGH_PRIORITY, + D3D12_MEASUREMENTS_ACTION_DISCARD_PREVIOUS, +} D3D12_MEASUREMENTS_ACTION; + +[uuid(c70b221b-40e4-4a17-89af-025a0727a6dc), object, local, pointer_default(unique)] +interface ID3D12Device6 : ID3D12Device5 +{ + HRESULT SetBackgroundProcessingMode( + D3D12_BACKGROUND_PROCESSING_MODE Mode, + D3D12_MEASUREMENTS_ACTION MeasurementsAction, + [annotation("_In_opt_")] HANDLE hEventToSignalUponCompletion, + [annotation("_Out_opt_")] BOOL* pbFurtherMeasurementsDesired); +}; + +cpp_quote("DEFINE_GUID(D3D12_PROTECTED_RESOURCES_SESSION_HARDWARE_PROTECTED, 0x62B0084E, 0xC70E, 0x4DAA, 0xA1, 0x09, 0x30, 0xFF, 0x8D, 0x5A, 0x04, 0x82); ") + +// D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_TYPE_COUNT +typedef struct D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPE_COUNT +{ + UINT NodeIndex; // input + UINT Count; // output +} D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPE_COUNT; + +// D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_TYPES +typedef struct D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPES +{ + UINT NodeIndex; // input + UINT Count; // input + GUID* pTypes; // output +} D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPES; + +typedef struct D3D12_PROTECTED_RESOURCE_SESSION_DESC1 +{ + UINT NodeMask; + D3D12_PROTECTED_RESOURCE_SESSION_FLAGS Flags; + GUID ProtectionType; +} D3D12_PROTECTED_RESOURCE_SESSION_DESC1; + +[uuid(D6F12DD6-76FB-406E-8961-4296EEFC0409), object, local, pointer_default(unique)] +interface ID3D12ProtectedResourceSession1 + : ID3D12ProtectedResourceSession +{ + D3D12_PROTECTED_RESOURCE_SESSION_DESC1 GetDesc1(); +}; + +[uuid(5c014b53-68a1-4b9b-8bd1-dd6046b9358b), object, local, pointer_default(unique)] +interface ID3D12Device7 : ID3D12Device6 +{ + HRESULT AddToStateObject( + [in] const D3D12_STATE_OBJECT_DESC* pAddition, + [in] ID3D12StateObject* pStateObjectToGrowFrom, + [in] REFIID riid, // ID3D12StateObject + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppNewStateObject + ); + + HRESULT CreateProtectedResourceSession1( + [annotation("_In_")] const D3D12_PROTECTED_RESOURCE_SESSION_DESC1* pDesc, + [annotation("_In_")] REFIID riid, // Expected: ID3D12ProtectedResourceSession1, + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppSession + ); +}; + +[uuid(9218E6BB-F944-4F7E-A75C-B1B2C7B701F3), object, local, pointer_default(unique)] +interface ID3D12Device8 : ID3D12Device7 +{ + D3D12_RESOURCE_ALLOCATION_INFO GetResourceAllocationInfo2( + UINT visibleMask, + UINT numResourceDescs, + [annotation("_In_reads_(numResourceDescs)")] const D3D12_RESOURCE_DESC1* pResourceDescs, + [annotation("_Out_writes_opt_(numResourceDescs)")] D3D12_RESOURCE_ALLOCATION_INFO1* pResourceAllocationInfo1); + + HRESULT CreateCommittedResource2( + [annotation("_In_")] const D3D12_HEAP_PROPERTIES* pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + [annotation("_In_")] const D3D12_RESOURCE_DESC1* pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + [annotation("_In_opt_")] const D3D12_CLEAR_VALUE* pOptimizedClearValue, + [annotation("_In_opt_")] ID3D12ProtectedResourceSession* pProtectedSession, + [in] REFIID riidResource, // Expected: ID3D12Resource1* + [out, iid_is(riidResource), annotation("_COM_Outptr_opt_")] void** ppvResource); + + HRESULT CreatePlacedResource1( + [annotation("_In_")] ID3D12Heap* pHeap, + UINT64 HeapOffset, + [annotation("_In_")] const D3D12_RESOURCE_DESC1* pDesc, + D3D12_RESOURCE_STATES InitialState, + [annotation("_In_opt_")] const D3D12_CLEAR_VALUE* pOptimizedClearValue, + [in] REFIID riid, // Expected: ID3D12Resource* + [out, iid_is(riid), annotation("_COM_Outptr_opt_")] void** ppvResource); + + void CreateSamplerFeedbackUnorderedAccessView( + [annotation("_In_opt_")] ID3D12Resource* pTargetedResource, + [annotation("_In_opt_")] ID3D12Resource* pFeedbackResource, + [annotation("_In_")] D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + void GetCopyableFootprints1( + [annotation("_In_")] const D3D12_RESOURCE_DESC1* pResourceDesc, + [annotation("_In_range_(0,D3D12_REQ_SUBRESOURCES)")] UINT FirstSubresource, + [annotation("_In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource)")] UINT NumSubresources, + UINT64 BaseOffset, + [annotation("_Out_writes_opt_(NumSubresources)")] D3D12_PLACED_SUBRESOURCE_FOOTPRINT* pLayouts, + [annotation("_Out_writes_opt_(NumSubresources)")] UINT* pNumRows, + [annotation("_Out_writes_opt_(NumSubresources)")] UINT64* pRowSizeInBytes, + [annotation("_Out_opt_")] UINT64* pTotalBytes); +}; + + +[uuid(9D5E227A-4430-4161-88B3-3ECA6BB16E19), object, local, pointer_default(unique)] +interface ID3D12Resource1 + : ID3D12Resource +{ + HRESULT GetProtectedResourceSession( + [in] REFIID riid, // Expected: ID3D12ProtectedResourceSession + [out, iid_is(riid), annotation("_COM_Outptr_opt_")] void** ppProtectedSession); +} + +[uuid(BE36EC3B-EA85-4AEB-A45A-E9D76404A495), object, local, pointer_default(unique)] +interface ID3D12Resource2 + : ID3D12Resource1 +{ + D3D12_RESOURCE_DESC1 GetDesc1(); +} + + +[uuid(572F7389-2168-49E3-9693-D6DF5871BF6D), object, local, pointer_default(unique)] +interface ID3D12Heap1 + : ID3D12Heap +{ + HRESULT GetProtectedResourceSession( + [in] REFIID riid, // Expected: ID3D12ProtectedResourceSession + [out, iid_is(riid), annotation("_COM_Outptr_opt_")] void** ppProtectedSession); +} + + +[uuid(6FDA83A7-B84C-4E38-9AC8-C7BD22016B3D), object, local, pointer_default(unique)] +interface ID3D12GraphicsCommandList3 : ID3D12GraphicsCommandList2 +{ + void SetProtectedResourceSession( + [annotation("_In_opt_")]ID3D12ProtectedResourceSession *pProtectedResourceSession + ); +} + +// Beginning Access +typedef enum D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE +{ + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_DISCARD, + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE, + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_CLEAR, + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_NO_ACCESS +} D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE; + +typedef struct D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS +{ + D3D12_CLEAR_VALUE ClearValue; +} D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS; + +typedef struct D3D12_RENDER_PASS_BEGINNING_ACCESS +{ + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE Type; + + union + { + D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS Clear; + }; +} D3D12_RENDER_PASS_BEGINNING_ACCESS; + +// Ending Access +typedef enum D3D12_RENDER_PASS_ENDING_ACCESS_TYPE +{ + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_DISCARD, + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE, + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_RESOLVE, + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_NO_ACCESS +} D3D12_RENDER_PASS_ENDING_ACCESS_TYPE; + +typedef struct D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_SUBRESOURCE_PARAMETERS +{ + UINT SrcSubresource; + UINT DstSubresource; + + UINT DstX; + UINT DstY; + D3D12_RECT SrcRect; // (0, 0, 0, 0) == resolve entire resource. + +} D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_SUBRESOURCE_PARAMETERS; + +typedef struct D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS +{ + ID3D12Resource* pSrcResource; + ID3D12Resource* pDstResource; + + // Can be a subset of RT's array slices, but can't target subresources that were't part of RTV/DSV. + UINT SubresourceCount; + [annotation("_Field_size_full_(SubresourceCount)")] const D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_SUBRESOURCE_PARAMETERS *pSubresourceParameters; + + DXGI_FORMAT Format; + D3D12_RESOLVE_MODE ResolveMode; + + BOOL PreserveResolveSource; + +} D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS; + +typedef struct D3D12_RENDER_PASS_ENDING_ACCESS +{ + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE Type; + + union + { + D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS Resolve; + }; +} D3D12_RENDER_PASS_ENDING_ACCESS; + +// Render Target Desc +typedef struct D3D12_RENDER_PASS_RENDER_TARGET_DESC +{ + D3D12_CPU_DESCRIPTOR_HANDLE cpuDescriptor; + + D3D12_RENDER_PASS_BEGINNING_ACCESS BeginningAccess; + D3D12_RENDER_PASS_ENDING_ACCESS EndingAccess; + +} D3D12_RENDER_PASS_RENDER_TARGET_DESC; + +// Depth-Stencil Desc +typedef struct D3D12_RENDER_PASS_DEPTH_STENCIL_DESC +{ + D3D12_CPU_DESCRIPTOR_HANDLE cpuDescriptor; + + D3D12_RENDER_PASS_BEGINNING_ACCESS DepthBeginningAccess; + D3D12_RENDER_PASS_BEGINNING_ACCESS StencilBeginningAccess; + + D3D12_RENDER_PASS_ENDING_ACCESS DepthEndingAccess; + D3D12_RENDER_PASS_ENDING_ACCESS StencilEndingAccess; + +} D3D12_RENDER_PASS_DEPTH_STENCIL_DESC; + +// UAV Access Mode +typedef enum D3D12_RENDER_PASS_FLAGS +{ + D3D12_RENDER_PASS_FLAG_NONE = 0x0, + D3D12_RENDER_PASS_FLAG_ALLOW_UAV_WRITES = 0x1, + D3D12_RENDER_PASS_FLAG_SUSPENDING_PASS = 0x2, + D3D12_RENDER_PASS_FLAG_RESUMING_PASS = 0x4 +} D3D12_RENDER_PASS_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_RENDER_PASS_FLAGS );") + +[uuid(DBB84C27-36CE-4FC9-B801-F048C46AC570), object, local, pointer_default(unique)] +interface ID3D12MetaCommand : ID3D12Pageable +{ + UINT64 GetRequiredParameterResourceSize([annotation("_In_")] D3D12_META_COMMAND_PARAMETER_STAGE Stage, [annotation("_In_")] UINT ParameterIndex); +} + +typedef struct D3D12_DISPATCH_RAYS_DESC +{ + D3D12_GPU_VIRTUAL_ADDRESS_RANGE RayGenerationShaderRecord; + D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE MissShaderTable; + D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE HitGroupTable; + D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE CallableShaderTable; + UINT Width; + UINT Height; + UINT Depth; +} D3D12_DISPATCH_RAYS_DESC; + +[uuid(8754318e-d3a9-4541-98cf-645b50dc4874), object, local, pointer_default(unique)] +interface ID3D12GraphicsCommandList4 : ID3D12GraphicsCommandList3 +{ + void BeginRenderPass( + [annotation("_In_")] UINT NumRenderTargets, + [annotation("_In_reads_opt_(NumRenderTargets)")] const D3D12_RENDER_PASS_RENDER_TARGET_DESC* pRenderTargets, + [annotation("_In_opt_")] const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC* pDepthStencil, + D3D12_RENDER_PASS_FLAGS Flags + ); + + void EndRenderPass(); + + void InitializeMetaCommand( + [annotation("_In_")] ID3D12MetaCommand * pMetaCommand, + [annotation("_In_reads_bytes_opt_(InitializationParametersDataSizeInBytes)")] const void * pInitializationParametersData, + [annotation("_In_")] SIZE_T InitializationParametersDataSizeInBytes + ); + + void ExecuteMetaCommand( + [annotation("_In_")] ID3D12MetaCommand * pMetaCommand, + [annotation("_In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes)")] const void * pExecutionParametersData, + [annotation("_In_")] SIZE_T ExecutionParametersDataSizeInBytes + ); + + void BuildRaytracingAccelerationStructure( + [annotation("_In_")] const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC* pDesc, + [annotation("_In_")] UINT NumPostbuildInfoDescs, + [annotation("_In_reads_opt_(NumPostbuildInfoDescs)")] const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC* pPostbuildInfoDescs + ); + + void EmitRaytracingAccelerationStructurePostbuildInfo( + [annotation("_In_")] const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC* pDesc, + [annotation("_In_")] UINT NumSourceAccelerationStructures, + [annotation("_In_reads_( NumSourceAccelerationStructures )")] const D3D12_GPU_VIRTUAL_ADDRESS* pSourceAccelerationStructureData); + + void CopyRaytracingAccelerationStructure( + [annotation("_In_")] D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData, + [annotation("_In_")] D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData, + [annotation("_In_")] D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode); + + void SetPipelineState1( + [annotation("_In_")] ID3D12StateObject* pStateObject); + + void DispatchRays( + [annotation("_In_")] const D3D12_DISPATCH_RAYS_DESC* pDesc); +} + +typedef enum D3D12_SHADER_CACHE_MODE +{ + D3D12_SHADER_CACHE_MODE_MEMORY, + D3D12_SHADER_CACHE_MODE_DISK, +} D3D12_SHADER_CACHE_MODE; + +typedef enum D3D12_SHADER_CACHE_FLAGS +{ + D3D12_SHADER_CACHE_FLAG_NONE = 0x0, + D3D12_SHADER_CACHE_FLAG_DRIVER_VERSIONED = 0x1, + D3D12_SHADER_CACHE_FLAG_USE_WORKING_DIR = 0x2, +} D3D12_SHADER_CACHE_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_FLAGS );") + +typedef struct D3D12_SHADER_CACHE_SESSION_DESC +{ + GUID Identifier; + D3D12_SHADER_CACHE_MODE Mode; + D3D12_SHADER_CACHE_FLAGS Flags; + + UINT MaximumInMemoryCacheSizeBytes; + UINT MaximumInMemoryCacheEntries; + + UINT MaximumValueFileSizeBytes; + + UINT64 Version; +} D3D12_SHADER_CACHE_SESSION_DESC; + +typedef enum D3D12_BARRIER_LAYOUT +{ + D3D12_BARRIER_LAYOUT_UNDEFINED = 0xffffffff, + D3D12_BARRIER_LAYOUT_COMMON = 0, + D3D12_BARRIER_LAYOUT_PRESENT = 0, + D3D12_BARRIER_LAYOUT_GENERIC_READ, + D3D12_BARRIER_LAYOUT_RENDER_TARGET, + D3D12_BARRIER_LAYOUT_UNORDERED_ACCESS, + D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_WRITE, + D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_READ, + D3D12_BARRIER_LAYOUT_SHADER_RESOURCE, + D3D12_BARRIER_LAYOUT_COPY_SOURCE, + D3D12_BARRIER_LAYOUT_COPY_DEST, + D3D12_BARRIER_LAYOUT_RESOLVE_SOURCE, + D3D12_BARRIER_LAYOUT_RESOLVE_DEST, + D3D12_BARRIER_LAYOUT_SHADING_RATE_SOURCE, + D3D12_BARRIER_LAYOUT_VIDEO_DECODE_READ, + D3D12_BARRIER_LAYOUT_VIDEO_DECODE_WRITE, + D3D12_BARRIER_LAYOUT_VIDEO_PROCESS_READ, + D3D12_BARRIER_LAYOUT_VIDEO_PROCESS_WRITE, + D3D12_BARRIER_LAYOUT_VIDEO_ENCODE_READ, + D3D12_BARRIER_LAYOUT_VIDEO_ENCODE_WRITE, + D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COMMON, + D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_GENERIC_READ, + D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_UNORDERED_ACCESS, + D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_SHADER_RESOURCE, + D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_SOURCE, + D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_DEST, + D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COMMON, + D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_GENERIC_READ, + D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_UNORDERED_ACCESS, + D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_SHADER_RESOURCE, + D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_SOURCE, + D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_DEST, + D3D12_BARRIER_LAYOUT_VIDEO_QUEUE_COMMON, + +} D3D12_BARRIER_LAYOUT; + +typedef enum D3D12_BARRIER_SYNC +{ + D3D12_BARRIER_SYNC_NONE = 0x0, + D3D12_BARRIER_SYNC_ALL = 0x1, + D3D12_BARRIER_SYNC_DRAW = 0x2, + D3D12_BARRIER_SYNC_INPUT_ASSEMBLER = 0x4, + D3D12_BARRIER_SYNC_VERTEX_SHADING = 0x8, + D3D12_BARRIER_SYNC_PIXEL_SHADING = 0x10, + D3D12_BARRIER_SYNC_DEPTH_STENCIL = 0x20, + D3D12_BARRIER_SYNC_RENDER_TARGET = 0x40, + D3D12_BARRIER_SYNC_COMPUTE_SHADING = 0x80, + D3D12_BARRIER_SYNC_RAYTRACING = 0x100, + D3D12_BARRIER_SYNC_COPY = 0x200, + D3D12_BARRIER_SYNC_RESOLVE = 0x400, + D3D12_BARRIER_SYNC_EXECUTE_INDIRECT = 0x800, + D3D12_BARRIER_SYNC_PREDICATION = 0x800, // Aliased with SYNC_EXECUTE_INDIRECT + D3D12_BARRIER_SYNC_ALL_SHADING = 0x1000, + D3D12_BARRIER_SYNC_NON_PIXEL_SHADING = 0x2000, + D3D12_BARRIER_SYNC_EMIT_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO = 0x4000, + D3D12_BARRIER_SYNC_CLEAR_UNORDERED_ACCESS_VIEW = 0x8000, + D3D12_BARRIER_SYNC_VIDEO_DECODE = 0x100000, + D3D12_BARRIER_SYNC_VIDEO_PROCESS = 0x200000, + D3D12_BARRIER_SYNC_VIDEO_ENCODE = 0x400000, + D3D12_BARRIER_SYNC_BUILD_RAYTRACING_ACCELERATION_STRUCTURE = 0x800000, + D3D12_BARRIER_SYNC_COPY_RAYTRACING_ACCELERATION_STRUCTURE = 0x1000000, + D3D12_BARRIER_SYNC_SPLIT = 0x80000000, +} D3D12_BARRIER_SYNC; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_BARRIER_SYNC );" ) + +typedef enum D3D12_BARRIER_ACCESS +{ + D3D12_BARRIER_ACCESS_COMMON = 0, + D3D12_BARRIER_ACCESS_VERTEX_BUFFER = 0x1, + D3D12_BARRIER_ACCESS_CONSTANT_BUFFER = 0x2, + D3D12_BARRIER_ACCESS_INDEX_BUFFER = 0x4, + D3D12_BARRIER_ACCESS_RENDER_TARGET = 0x8, + D3D12_BARRIER_ACCESS_UNORDERED_ACCESS = 0x10, + D3D12_BARRIER_ACCESS_DEPTH_STENCIL_WRITE = 0x20, + D3D12_BARRIER_ACCESS_DEPTH_STENCIL_READ = 0x40, + D3D12_BARRIER_ACCESS_SHADER_RESOURCE = 0x80, + D3D12_BARRIER_ACCESS_STREAM_OUTPUT = 0x100, + D3D12_BARRIER_ACCESS_INDIRECT_ARGUMENT = 0x200, + D3D12_BARRIER_ACCESS_PREDICATION = 0x200, // Aliased with ACCESS_INDIRECT_ARGUMENT + D3D12_BARRIER_ACCESS_COPY_DEST = 0x400, + D3D12_BARRIER_ACCESS_COPY_SOURCE = 0x800, + D3D12_BARRIER_ACCESS_RESOLVE_DEST = 0x1000, + D3D12_BARRIER_ACCESS_RESOLVE_SOURCE = 0x2000, + D3D12_BARRIER_ACCESS_RAYTRACING_ACCELERATION_STRUCTURE_READ = 0x4000, + D3D12_BARRIER_ACCESS_RAYTRACING_ACCELERATION_STRUCTURE_WRITE = 0x8000, + D3D12_BARRIER_ACCESS_SHADING_RATE_SOURCE = 0x10000, + D3D12_BARRIER_ACCESS_VIDEO_DECODE_READ = 0x20000, + D3D12_BARRIER_ACCESS_VIDEO_DECODE_WRITE = 0x40000, + D3D12_BARRIER_ACCESS_VIDEO_PROCESS_READ = 0x80000, + D3D12_BARRIER_ACCESS_VIDEO_PROCESS_WRITE = 0x100000, + D3D12_BARRIER_ACCESS_VIDEO_ENCODE_READ = 0x200000, + D3D12_BARRIER_ACCESS_VIDEO_ENCODE_WRITE = 0x400000, + D3D12_BARRIER_ACCESS_NO_ACCESS = 0x80000000, +} D3D12_BARRIER_ACCESS; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_BARRIER_ACCESS );" ) + +typedef enum D3D12_BARRIER_TYPE +{ + D3D12_BARRIER_TYPE_GLOBAL, + D3D12_BARRIER_TYPE_TEXTURE, + D3D12_BARRIER_TYPE_BUFFER, +} D3D12_BARRIER_TYPE; + +typedef enum D3D12_TEXTURE_BARRIER_FLAGS +{ + D3D12_TEXTURE_BARRIER_FLAG_NONE = 0x0, + D3D12_TEXTURE_BARRIER_FLAG_DISCARD = 0x1, +} D3D12_TEXTURE_BARRIER_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_TEXTURE_BARRIER_FLAGS );") + +typedef struct D3D12_BARRIER_SUBRESOURCE_RANGE +{ + UINT IndexOrFirstMipLevel; + UINT NumMipLevels; + UINT FirstArraySlice; + UINT NumArraySlices; + UINT FirstPlane; + UINT NumPlanes; +} D3D12_BARRIER_SUBRESOURCE_RANGE; + +typedef struct D3D12_GLOBAL_BARRIER +{ + D3D12_BARRIER_SYNC SyncBefore; + D3D12_BARRIER_SYNC SyncAfter; + D3D12_BARRIER_ACCESS AccessBefore; + D3D12_BARRIER_ACCESS AccessAfter; +} D3D12_GLOBAL_BARRIER; + +typedef struct D3D12_TEXTURE_BARRIER +{ + D3D12_BARRIER_SYNC SyncBefore; + D3D12_BARRIER_SYNC SyncAfter; + D3D12_BARRIER_ACCESS AccessBefore; + D3D12_BARRIER_ACCESS AccessAfter; + D3D12_BARRIER_LAYOUT LayoutBefore; + D3D12_BARRIER_LAYOUT LayoutAfter; + [annotation("_In_")] ID3D12Resource *pResource; + D3D12_BARRIER_SUBRESOURCE_RANGE Subresources; + D3D12_TEXTURE_BARRIER_FLAGS Flags; +} D3D12_TEXTURE_BARRIER; + +typedef struct D3D12_BUFFER_BARRIER +{ + D3D12_BARRIER_SYNC SyncBefore; + D3D12_BARRIER_SYNC SyncAfter; + D3D12_BARRIER_ACCESS AccessBefore; + D3D12_BARRIER_ACCESS AccessAfter; + [annotation("_In_")] ID3D12Resource *pResource; + UINT64 Offset; + UINT64 Size; +} D3D12_BUFFER_BARRIER; + +typedef struct D3D12_BARRIER_GROUP +{ + D3D12_BARRIER_TYPE Type; + UINT32 NumBarriers; + union + { + [annotation("_In_reads_(NumBarriers)")] const D3D12_GLOBAL_BARRIER *pGlobalBarriers; + [annotation("_In_reads_(NumBarriers)")] const D3D12_TEXTURE_BARRIER *pTextureBarriers; + [annotation("_In_reads_(NumBarriers)")] const D3D12_BUFFER_BARRIER *pBufferBarriers; + }; +} D3D12_BARRIER_GROUP; + +[uuid(28e2495d-0f64-4ae4-a6ec-129255dc49a8), object, local, pointer_default(unique)] +interface ID3D12ShaderCacheSession + : ID3D12DeviceChild +{ + HRESULT FindValue( + [in, annotation("_In_reads_bytes_(KeySize)")] const void* pKey, + UINT KeySize, + [out, annotation("_Out_writes_bytes_(*pValueSize)")] void* pValue, + [annotation("_Inout_")] UINT* pValueSize); + HRESULT StoreValue( + [in, annotation("_In_reads_bytes_(KeySize)")] const void* pKey, + UINT KeySize, + [in, annotation("_In_reads_bytes_(ValueSize)")] const void* pValue, + UINT ValueSize); + + void SetDeleteOnDestroy(); + D3D12_SHADER_CACHE_SESSION_DESC GetDesc(); +}; + +typedef enum D3D12_SHADER_CACHE_KIND_FLAGS +{ + D3D12_SHADER_CACHE_KIND_FLAG_IMPLICIT_D3D_CACHE_FOR_DRIVER = 0x1, + D3D12_SHADER_CACHE_KIND_FLAG_IMPLICIT_D3D_CONVERSIONS = 0x2, + D3D12_SHADER_CACHE_KIND_FLAG_IMPLICIT_DRIVER_MANAGED = 0x4, + D3D12_SHADER_CACHE_KIND_FLAG_APPLICATION_MANAGED = 0x8, +} D3D12_SHADER_CACHE_KIND_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_KIND_FLAGS );") + +typedef enum D3D12_SHADER_CACHE_CONTROL_FLAGS +{ + D3D12_SHADER_CACHE_CONTROL_FLAG_DISABLE = 0x1, + D3D12_SHADER_CACHE_CONTROL_FLAG_ENABLE = 0x2, + D3D12_SHADER_CACHE_CONTROL_FLAG_CLEAR = 0x4, +} D3D12_SHADER_CACHE_CONTROL_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_CONTROL_FLAGS );") + +[uuid(4c80e962-f032-4f60-bc9e-ebc2cfa1d83c), object, local, pointer_default(unique)] +interface ID3D12Device9 + : ID3D12Device8 +{ + HRESULT CreateShaderCacheSession( + [annotation("_In_")] const D3D12_SHADER_CACHE_SESSION_DESC* pDesc, + REFIID riid, + [annotation("_COM_Outptr_opt_")] void** ppvSession); + + HRESULT ShaderCacheControl( + D3D12_SHADER_CACHE_KIND_FLAGS Kinds, + D3D12_SHADER_CACHE_CONTROL_FLAGS Control); + + HRESULT CreateCommandQueue1( + [annotation("_In_")] const D3D12_COMMAND_QUEUE_DESC* pDesc, + REFIID CreatorID, + [in] REFIID riid, // Expected: ID3D12CommandQueue + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppCommandQueue + ); +}; + +[uuid(5405c344-d457-444e-b4dd-2366e45aee39), object, local, pointer_default(unique)] +interface ID3D12Device11 + : ID3D12Device10 +{ + void CreateSampler2( + [annotation("_In_")] const D3D12_SAMPLER_DESC2* pDesc, + [annotation("_In_")] D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); +}; + +[uuid(517f8718-aa66-49f9-b02b-a7ab89c06031), object, local, pointer_default(unique)] +interface ID3D12Device10 + : ID3D12Device9 +{ + HRESULT CreateCommittedResource3( + [annotation("_In_")] const D3D12_HEAP_PROPERTIES* pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + [annotation("_In_")] const D3D12_RESOURCE_DESC1* pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + [annotation("_In_opt_")] const D3D12_CLEAR_VALUE* pOptimizedClearValue, + [annotation("_In_opt_")] ID3D12ProtectedResourceSession* pProtectedSession, + UINT32 NumCastableFormats, + [annotation("_In_opt_count_(NumCastableFormats)")] DXGI_FORMAT *pCastableFormats, + [in] REFIID riidResource, // Expected: ID3D12Resource1* + [out, iid_is(riidResource), annotation("_COM_Outptr_opt_")] void** ppvResource); + + HRESULT CreatePlacedResource2( + [annotation("_In_")] ID3D12Heap* pHeap, + UINT64 HeapOffset, + [annotation("_In_")] const D3D12_RESOURCE_DESC1* pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + [annotation("_In_opt_")] const D3D12_CLEAR_VALUE* pOptimizedClearValue, + UINT32 NumCastableFormats, + [annotation("_In_opt_count_(NumCastableFormats)")] DXGI_FORMAT *pCastableFormats, + [in] REFIID riid, // Expected: ID3D12Resource* + [out, iid_is(riid), annotation("_COM_Outptr_opt_")] void** ppvResource); + + HRESULT CreateReservedResource2( + [annotation("_In_")] const D3D12_RESOURCE_DESC* pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + [annotation("_In_opt_")] const D3D12_CLEAR_VALUE* pOptimizedClearValue, + [annotation("_In_opt_")] ID3D12ProtectedResourceSession *pProtectedSession, + UINT32 NumCastableFormats, + [annotation("_In_opt_count_(NumCastableFormats)")] DXGI_FORMAT *pCastableFormats, + [in] REFIID riid, // Expected: ID3D12Resource1* + [out, iid_is(riid), annotation("_COM_Outptr_opt_")] void** ppvResource + ); +}; + +[uuid(bc66d368-7373-4943-8757-fc87dc79e476), object, local, pointer_default(unique)] +interface ID3D12VirtualizationGuestDevice + : IUnknown +{ + HRESULT ShareWithHost( + [annotation("_In_")] ID3D12DeviceChild* pObject, + [annotation("_Out_")] HANDLE* pHandle + ); + + HRESULT CreateFenceFd( + [annotation("_In_")] ID3D12Fence *pFence, + UINT64 FenceValue, + [annotation("_Out_")] int *pFenceFd + ); +}; + + + +[uuid(7071e1f0-e84b-4b33-974f-12fa49de65c5), object, local, pointer_default(unique)] +interface ID3D12Tools + : IUnknown +{ + void EnableShaderInstrumentation(BOOL bEnable); + BOOL ShaderInstrumentationEnabled(); +} + +typedef struct D3D12_SUBRESOURCE_DATA +{ + const void* pData; + LONG_PTR RowPitch; + LONG_PTR SlicePitch; +} D3D12_SUBRESOURCE_DATA; + +typedef struct D3D12_MEMCPY_DEST +{ + void* pData; + SIZE_T RowPitch; + SIZE_T SlicePitch; +} D3D12_MEMCPY_DEST; + + + +cpp_quote( "#if !defined( D3D12_IGNORE_SDK_LAYERS ) ") +cpp_quote( "#include \"d3d12sdklayers.h\" ") +cpp_quote( "#endif ") + + +cpp_quote("") +cpp_quote("///////////////////////////////////////////////////////////////////////////") +cpp_quote("// D3D12CreateDevice") +cpp_quote("// ------------------") +cpp_quote("//") +cpp_quote("// pAdapter") +cpp_quote("// If NULL, D3D12CreateDevice will choose the primary adapter.") +cpp_quote("// If non-NULL, D3D12CreateDevice will use the provided adapter.") +cpp_quote("// MinimumFeatureLevel") +cpp_quote("// The minimum feature level required for successful device creation.") +cpp_quote("// riid") +cpp_quote("// The interface IID of the device to be returned. Expected: ID3D12Device.") +cpp_quote("// ppDevice") +cpp_quote("// Pointer to returned interface. May be NULL.") +cpp_quote("//") +cpp_quote("// Return Values") +cpp_quote("// Any of those documented for ") +cpp_quote("// CreateDXGIFactory1") +cpp_quote("// IDXGIFactory::EnumAdapters") +cpp_quote("// D3D12CreateDevice") +cpp_quote("//") +cpp_quote("///////////////////////////////////////////////////////////////////////////") +cpp_quote("typedef HRESULT (WINAPI* PFN_D3D12_CREATE_DEVICE)( _In_opt_ IUnknown*, ") +cpp_quote(" D3D_FEATURE_LEVEL, ") +cpp_quote(" _In_ REFIID, _COM_Outptr_opt_ void** );") +cpp_quote("") +cpp_quote("HRESULT WINAPI D3D12CreateDevice(") +cpp_quote(" _In_opt_ IUnknown* pAdapter,") +cpp_quote(" D3D_FEATURE_LEVEL MinimumFeatureLevel,") +cpp_quote(" _In_ REFIID riid, // Expected: ID3D12Device") +cpp_quote(" _COM_Outptr_opt_ void** ppDevice );") +cpp_quote("") + +cpp_quote("") +cpp_quote("typedef HRESULT (WINAPI* PFN_D3D12_GET_DEBUG_INTERFACE)( _In_ REFIID, _COM_Outptr_opt_ void** );") +cpp_quote("") +cpp_quote("HRESULT WINAPI D3D12GetDebugInterface( _In_ REFIID riid, _COM_Outptr_opt_ void** ppvDebug );") +cpp_quote("") + +cpp_quote("// --------------------------------------------------------------------------------------------------------------------------------") +cpp_quote("// D3D12EnableExperimentalFeatures") +cpp_quote("//") +cpp_quote("// Pass in a list of feature GUIDs to be enabled together.") +cpp_quote("// ") +cpp_quote("// If a particular feature requires some configuration information on enablement, it will have") +cpp_quote("// a configuration struct that can be passed alongside the GUID.") +cpp_quote("// ") +cpp_quote("// Some features might use an interface IID as the GUID. For these, once the feature is enabled via") +cpp_quote("// D3D12EnableExperimentalFeatures, D3D12GetDebugInterface can then be called with the IID to retrieve the interface") +cpp_quote("// for manipulating the feature. This allows for control that might not cleanly be expressed by just ") +cpp_quote("// the configuration struct that D3D12EnableExperimentalFeatures provides.") +cpp_quote("//") +cpp_quote("// If this method is called and a change to existing feature enablement is made, ") +cpp_quote("// all current D3D12 devices are set to DEVICE_REMOVED state, since under the covers there is really only one") +cpp_quote("// singleton device for a process. Removing the devices when configuration changes prevents") +cpp_quote("// mismatched expectations of how a device is supposed to work after it has been created from the app's point of view.") +cpp_quote("//") +cpp_quote("// The call returns E_NOINTERFACE if an unrecognized feature is passed in or Windows Developer mode is not on.") +cpp_quote("// The call returns E_INVALIDARG if the configuration of a feature is incorrect, the set of features passed") +cpp_quote("// in are known to be incompatible with each other, or other errors.") +cpp_quote("// Returns S_OK otherwise.") +cpp_quote("//") +cpp_quote("// --------------------------------------------------------------------------------------------------------------------------------") +cpp_quote("HRESULT WINAPI D3D12EnableExperimentalFeatures(") +cpp_quote(" UINT NumFeatures,") +cpp_quote(" _In_count_(NumFeatures) const IID* pIIDs,") +cpp_quote(" _In_opt_count_(NumFeatures) void* pConfigurationStructs,") +cpp_quote(" _In_opt_count_(NumFeatures) UINT* pConfigurationStructSizes);") +cpp_quote("") +cpp_quote("// --------------------------------------------------------------------------------------------------------------------------------") +cpp_quote("// Experimental Feature: D3D12ExperimentalShaderModels") +cpp_quote("//") +cpp_quote("// Use with D3D12EnableExperimentalFeatures to enable experimental shader model support,") +cpp_quote("// meaning shader models that haven't been finalized for use in retail.") +cpp_quote("//") +cpp_quote("// Enabling D3D12ExperimentalShaderModels needs no configuration struct, pass NULL in the pConfigurationStructs array.") +cpp_quote("//") +cpp_quote("// --------------------------------------------------------------------------------------------------------------------------------") +cpp_quote("static const UUID D3D12ExperimentalShaderModels = { /* 76f5573e-f13a-40f5-b297-81ce9e18933f */") +cpp_quote(" 0x76f5573e,") +cpp_quote(" 0xf13a,") +cpp_quote(" 0x40f5,") +cpp_quote(" { 0xb2, 0x97, 0x81, 0xce, 0x9e, 0x18, 0x93, 0x3f }") +cpp_quote("};") +cpp_quote("// --------------------------------------------------------------------------------------------------------------------------------") +cpp_quote("// Experimental Feature: D3D12TiledResourceTier4") +cpp_quote("//") +cpp_quote("// Use with D3D12EnableExperimentalFeatures to enable tiled resource tier 4 support,") +cpp_quote("// meaning texture tile data-inheritance is allowed.") +cpp_quote("//") +cpp_quote("// Enabling D3D12TiledResourceTier4 needs no configuration struct, pass NULL in the pConfigurationStructs array.") +cpp_quote("//") +cpp_quote("// --------------------------------------------------------------------------------------------------------------------------------") +cpp_quote("static const UUID D3D12TiledResourceTier4 = { /* c9c4725f-a81a-4f56-8c5b-c51039d694fb */") +cpp_quote(" 0xc9c4725f,") +cpp_quote(" 0xa81a,") +cpp_quote(" 0x4f56,") +cpp_quote(" { 0x8c, 0x5b, 0xc5, 0x10, 0x39, 0xd6, 0x94, 0xfb }") +cpp_quote("};") + +cpp_quote("// --------------------------------------------------------------------------------------------------------------------------------") +cpp_quote("// D3D12GetInterface") +cpp_quote("//") +cpp_quote("// Retrieve Global D3D12 Interface.") +cpp_quote("//") +cpp_quote("") +cpp_quote("DEFINE_GUID(CLSID_D3D12Debug, 0xf2352aeb, 0xdd84, 0x49fe, 0xb9, 0x7b, 0xa9, 0xdc, 0xfd, 0xcc, 0x1b, 0x4f);") +cpp_quote("DEFINE_GUID(CLSID_D3D12Tools, 0xe38216b1, 0x3c8c, 0x4833, 0xaa, 0x09, 0x0a, 0x06, 0xb6, 0x5d, 0x96, 0xc8);") +cpp_quote("DEFINE_GUID(CLSID_D3D12DeviceRemovedExtendedData, 0x4a75bbc4, 0x9ff4, 0x4ad8, 0x9f, 0x18, 0xab, 0xae, 0x84, 0xdc, 0x5f, 0xf2);") +cpp_quote("DEFINE_GUID(CLSID_D3D12SDKConfiguration, 0x7cda6aca, 0xa03e, 0x49c8, 0x94, 0x58, 0x03, 0x34, 0xd2, 0x0e, 0x07, 0xce);") +cpp_quote("DEFINE_GUID(CLSID_D3D12DeviceFactory, 0x114863bf, 0xc386, 0x4aee, 0xb3, 0x9d, 0x8f, 0x0b, 0xbb, 0x06, 0x29, 0x55);") +cpp_quote("") +cpp_quote("typedef HRESULT (WINAPI* PFN_D3D12_GET_INTERFACE)( _In_ REFCLSID, _In_ REFIID, _COM_Outptr_opt_ void** );") +cpp_quote("") +cpp_quote("HRESULT WINAPI D3D12GetInterface( _In_ REFCLSID rclsid, _In_ REFIID riid, _COM_Outptr_opt_ void** ppvDebug );") +cpp_quote("") + +//================================================================================================================================== +// +// SDK Configuration +// +//================================================================================================================================== + +[uuid(e9eb5314-33aa-42b2-a718-d77f58b1f1c7), object, local, pointer_default(unique)] +interface ID3D12SDKConfiguration + : IUnknown +{ + HRESULT SetSDKVersion( + UINT SDKVersion, + [annotation("_In_z_")] LPCSTR SDKPath + ); +} + +[uuid(8aaf9303-ad25-48b9-9a57-d9c37e009d9f), object, local, pointer_default(unique)] +interface ID3D12SDKConfiguration1 + : ID3D12SDKConfiguration +{ + HRESULT CreateDeviceFactory( + UINT SDKVersion, + [annotation("_In_")] LPCSTR SDKPath, + REFIID riid, // Expected: ID3D12DeviceFactory + [annotation("_COM_Outptr_")] void **ppvFactory + ); + void FreeUnusedSDKs(); +} + +typedef enum D3D12_DEVICE_FACTORY_FLAGS +{ + D3D12_DEVICE_FACTORY_FLAG_NONE = 0, + D3D12_DEVICE_FACTORY_FLAG_ALLOW_RETURNING_EXISTING_DEVICE = 0x1, + D3D12_DEVICE_FACTORY_FLAG_ALLOW_RETURNING_INCOMPATIBLE_EXISTING_DEVICE = 0x2, + D3D12_DEVICE_FACTORY_FLAG_DISALLOW_STORING_NEW_DEVICE_AS_SINGLETON = 0x4, +} D3D12_DEVICE_FACTORY_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_DEVICE_FACTORY_FLAGS );") + +[uuid(61f307d3-d34e-4e7c-8374-3ba4de23cccb), object, local, pointer_default(unique)] +interface ID3D12DeviceFactory + : IUnknown +{ + HRESULT InitializeFromGlobalState(); + HRESULT ApplyToGlobalState(); + + HRESULT SetFlags(D3D12_DEVICE_FACTORY_FLAGS flags); + D3D12_DEVICE_FACTORY_FLAGS GetFlags(); + + HRESULT GetConfigurationInterface( + REFCLSID clsid, + REFIID iid, + [annotation("_COM_Outptr_")] void **ppv); + + HRESULT EnableExperimentalFeatures( + UINT NumFeatures, + [annotation("_In_reads_(NumFeatures)")] const IID *pIIDs, + [annotation("_In_reads_opt_(NumFeatures)")] void *pConfigurationStructs, + [annotation("_In_reads_opt_(NumFeatures)")] UINT *pConfigurationStructSizes); + + HRESULT CreateDevice( + [annotation("_In_opt_")] IUnknown *adapter, + D3D_FEATURE_LEVEL FeatureLevel, + REFIID riid, + [annotation("_COM_Outptr_opt_")] void **ppvDevice); +}; + +typedef enum D3D12_DEVICE_FLAGS +{ + D3D12_DEVICE_FLAG_NONE = 0, + D3D12_DEVICE_FLAG_DEBUG_LAYER_ENABLED = 0x1, + D3D12_DEVICE_FLAG_GPU_BASED_VALIDATION_ENABLED = 0x2, + D3D12_DEVICE_FLAG_SYNCHRONIZED_COMMAND_QUEUE_VALIDATION_DISABLED = 0x4, + D3D12_DEVICE_FLAG_DRED_AUTO_BREADCRUMBS_ENABLED = 0x8, + D3D12_DEVICE_FLAG_DRED_PAGE_FAULT_REPORTING_ENABLED = 0x10, + D3D12_DEVICE_FLAG_DRED_WATSON_REPORTING_ENABLED = 0x20, + D3D12_DEVICE_FLAG_DRED_BREADCRUMB_CONTEXT_ENABLED = 0x40, + D3D12_DEVICE_FLAG_DRED_USE_MARKERS_ONLY_BREADCRUMBS = 0x80, + D3D12_DEVICE_FLAG_SHADER_INSTRUMENTATION_ENABLED = 0x100, + D3D12_DEVICE_FLAG_AUTO_DEBUG_NAME_ENABLED = 0x200, + D3D12_DEVICE_FLAG_FORCE_LEGACY_STATE_VALIDATION = 0x400, +} D3D12_DEVICE_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_DEVICE_FLAGS );") + +typedef struct D3D12_DEVICE_CONFIGURATION_DESC +{ + D3D12_DEVICE_FLAGS Flags; + UINT GpuBasedValidationFlags; // D3D12_GPU_BASED_VALIDATION_FLAGS from d3d12sdklayers.h + UINT SDKVersion; + UINT NumEnabledExperimentalFeatures; +} D3D12_DEVICE_CONFIGURATION_DESC; + +[uuid(78dbf87b-f766-422b-a61c-c8c446bdb9ad), object, local, pointer_default(unique)] +interface ID3D12DeviceConfiguration + : IUnknown +{ + D3D12_DEVICE_CONFIGURATION_DESC GetDesc(); + HRESULT GetEnabledExperimentalFeatures([annotation("_Out_writes_(NumGuids)")] GUID *pGuids, UINT NumGuids); + + HRESULT SerializeVersionedRootSignature( + [annotation("_In_")] const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *pDesc, + [annotation("_COM_Outptr_")] ID3DBlob **ppResult, + [annotation("_Always_(_Outptr_opt_result_maybenull_)")] ID3DBlob **ppError); + + HRESULT CreateVersionedRootSignatureDeserializer( + [annotation("_In_reads_bytes_(Size)")] const void *pBlob, + SIZE_T Size, + REFIID riid, + [annotation("_COM_Outptr_")] void **ppvDeserializer); +}; + + +typedef enum D3D12_AXIS_SHADING_RATE +{ + D3D12_AXIS_SHADING_RATE_1X = 0x0, + D3D12_AXIS_SHADING_RATE_2X = 0x1, + D3D12_AXIS_SHADING_RATE_4X = 0x2 +} D3D12_AXIS_SHADING_RATE; + + +cpp_quote("#define D3D12_SHADING_RATE_X_AXIS_SHIFT 2") +cpp_quote("#define D3D12_SHADING_RATE_VALID_MASK 3") + +cpp_quote("#define D3D12_MAKE_COARSE_SHADING_RATE(x,y) ((x) << D3D12_SHADING_RATE_X_AXIS_SHIFT | (y))") + +cpp_quote("#define D3D12_GET_COARSE_SHADING_RATE_X_AXIS(x) (((x) >> D3D12_SHADING_RATE_X_AXIS_SHIFT) & D3D12_SHADING_RATE_VALID_MASK)") +cpp_quote("#define D3D12_GET_COARSE_SHADING_RATE_Y_AXIS(y) ((y) & D3D12_SHADING_RATE_VALID_MASK)") + +typedef enum D3D12_SHADING_RATE +{ + D3D12_SHADING_RATE_1X1 = 0x0, + D3D12_SHADING_RATE_1X2 = 0x1, + D3D12_SHADING_RATE_2X1 = 0x4, + D3D12_SHADING_RATE_2X2 = 0x5, + D3D12_SHADING_RATE_2X4 = 0x6, + D3D12_SHADING_RATE_4X2 = 0x9, + D3D12_SHADING_RATE_4X4 = 0xA +} D3D12_SHADING_RATE; + +typedef enum D3D12_SHADING_RATE_COMBINER +{ + D3D12_SHADING_RATE_COMBINER_PASSTHROUGH = 0, + D3D12_SHADING_RATE_COMBINER_OVERRIDE = 1, + D3D12_SHADING_RATE_COMBINER_MIN = 2, + D3D12_SHADING_RATE_COMBINER_MAX = 3, + D3D12_SHADING_RATE_COMBINER_SUM = 4, +} D3D12_SHADING_RATE_COMBINER; + +[uuid(55050859-4024-474c-87f5-6472eaee44ea), object, local, pointer_default(unique)] +interface ID3D12GraphicsCommandList5 : ID3D12GraphicsCommandList4 +{ + void RSSetShadingRate( + [annotation("_In_")] D3D12_SHADING_RATE baseShadingRate, + [annotation("_In_reads_opt_(D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT)")] const D3D12_SHADING_RATE_COMBINER* combiners); + + void RSSetShadingRateImage( + [annotation("_In_opt_")] ID3D12Resource* shadingRateImage); +} + +typedef struct D3D12_DISPATCH_MESH_ARGUMENTS +{ + UINT ThreadGroupCountX; + UINT ThreadGroupCountY; + UINT ThreadGroupCountZ; +} D3D12_DISPATCH_MESH_ARGUMENTS; + +[uuid(c3827890-e548-4cfa-96cf-5689a9370f80), object, local, pointer_default(unique)] +interface ID3D12GraphicsCommandList6 : ID3D12GraphicsCommandList5 +{ + void DispatchMesh( + [annotation("_In_")] UINT ThreadGroupCountX, + [annotation("_In_")] UINT ThreadGroupCountY, + [annotation("_In_")] UINT ThreadGroupCountZ + ); +} + +[uuid(dd171223-8b61-4769-90e3-160ccde4e2c1), object, local, pointer_default(unique)] +interface ID3D12GraphicsCommandList7 : ID3D12GraphicsCommandList6 +{ + void Barrier( + UINT32 NumBarrierGroups, + [annotation("_In_reads_(NumBarrierGroups)")] const D3D12_BARRIER_GROUP *pBarrierGroups + ); +}; + +[uuid(ee936ef9-599d-4d28-938e-23c4ad05ce51), object, local, pointer_default(unique)] +interface ID3D12GraphicsCommandList8 : ID3D12GraphicsCommandList7 +{ + void OMSetFrontAndBackStencilRef( + [annotation("_In_")] UINT FrontStencilRef, + [annotation("_In_")] UINT BackStencilRef + ); +}; + + +//---------------------------------------------------------------------------------------------------------- +// Old types which are still supported by the runtime for app-compat + +cpp_quote("#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */") +#pragma endregion + +cpp_quote( "DEFINE_GUID(IID_ID3D12Object,0xc4fec28f,0x7966,0x4e95,0x9f,0x94,0xf4,0x31,0xcb,0x56,0xc3,0xb8);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12DeviceChild,0x905db94b,0xa00c,0x4140,0x9d,0xf5,0x2b,0x64,0xca,0x9e,0xa3,0x57);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12RootSignature,0xc54a6b66,0x72df,0x4ee8,0x8b,0xe5,0xa9,0x46,0xa1,0x42,0x92,0x14);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12RootSignatureDeserializer,0x34AB647B,0x3CC8,0x46AC,0x84,0x1B,0xC0,0x96,0x56,0x45,0xC0,0x46);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VersionedRootSignatureDeserializer,0x7F91CE67,0x090C,0x4BB7,0xB7,0x8E,0xED,0x8F,0xF2,0xE3,0x1D,0xA0);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Pageable,0x63ee58fb,0x1268,0x4835,0x86,0xda,0xf0,0x08,0xce,0x62,0xf0,0xd6);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Heap,0x6b3b2502,0x6e51,0x45b3,0x90,0xee,0x98,0x84,0x26,0x5e,0x8d,0xf3);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Resource,0x696442be,0xa72e,0x4059,0xbc,0x79,0x5b,0x5c,0x98,0x04,0x0f,0xad);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12CommandAllocator,0x6102dee4,0xaf59,0x4b09,0xb9,0x99,0xb4,0x4d,0x73,0xf0,0x9b,0x24);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Fence,0x0a753dcf,0xc4d8,0x4b91,0xad,0xf6,0xbe,0x5a,0x60,0xd9,0x5a,0x76);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Fence1,0x433685fe,0xe22b,0x4ca0,0xa8,0xdb,0xb5,0xb4,0xf4,0xdd,0x0e,0x4a);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12PipelineState,0x765a30f3,0xf624,0x4c6f,0xa8,0x28,0xac,0xe9,0x48,0x62,0x24,0x45);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12DescriptorHeap,0x8efb471d,0x616c,0x4f49,0x90,0xf7,0x12,0x7b,0xb7,0x63,0xfa,0x51);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12QueryHeap,0x0d9658ae,0xed45,0x469e,0xa6,0x1d,0x97,0x0e,0xc5,0x83,0xca,0xb4);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12CommandSignature,0xc36a797c,0xec80,0x4f0a,0x89,0x85,0xa7,0xb2,0x47,0x50,0x82,0xd1);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12CommandList,0x7116d91c,0xe7e4,0x47ce,0xb8,0xc6,0xec,0x81,0x68,0xf4,0x37,0xe5);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12GraphicsCommandList,0x5b160d0f,0xac1b,0x4185,0x8b,0xa8,0xb3,0xae,0x42,0xa5,0xa4,0x55);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12GraphicsCommandList1,0x553103fb,0x1fe7,0x4557,0xbb,0x38,0x94,0x6d,0x7d,0x0e,0x7c,0xa7);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12GraphicsCommandList2,0x38C3E585,0xFF17,0x412C,0x91,0x50,0x4F,0xC6,0xF9,0xD7,0x2A,0x28);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12CommandQueue,0x0ec870a6,0x5d7e,0x4c22,0x8c,0xfc,0x5b,0xaa,0xe0,0x76,0x16,0xed);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Device,0x189819f1,0x1db6,0x4b57,0xbe,0x54,0x18,0x21,0x33,0x9b,0x85,0xf7);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12PipelineLibrary,0xc64226a8,0x9201,0x46af,0xb4,0xcc,0x53,0xfb,0x9f,0xf7,0x41,0x4f);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12PipelineLibrary1,0x80eabf42,0x2568,0x4e5e,0xbd,0x82,0xc3,0x7f,0x86,0x96,0x1d,0xc3);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Device1,0x77acce80,0x638e,0x4e65,0x88,0x95,0xc1,0xf2,0x33,0x86,0x86,0x3e);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Device2,0x30baa41e,0xb15b,0x475c,0xa0,0xbb,0x1a,0xf5,0xc5,0xb6,0x43,0x28);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Device3,0x81dadc15,0x2bad,0x4392,0x93,0xc5,0x10,0x13,0x45,0xc4,0xaa,0x98);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12ProtectedSession,0xA1533D18,0x0AC1,0x4084,0x85,0xB9,0x89,0xA9,0x61,0x16,0x80,0x6B);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12ProtectedResourceSession,0x6CD696F4,0xF289,0x40CC,0x80,0x91,0x5A,0x6C,0x0A,0x09,0x9C,0x3D);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Device4,0xe865df17,0xa9ee,0x46f9,0xa4,0x63,0x30,0x98,0x31,0x5a,0xa2,0xe5);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12LifetimeOwner,0xe667af9f,0xcd56,0x4f46,0x83,0xce,0x03,0x2e,0x59,0x5d,0x70,0xa8);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12SwapChainAssistant,0xf1df64b6,0x57fd,0x49cd,0x88,0x07,0xc0,0xeb,0x88,0xb4,0x5c,0x8f);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12LifetimeTracker,0x3fd03d36,0x4eb1,0x424a,0xa5,0x82,0x49,0x4e,0xcb,0x8b,0xa8,0x13);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12StateObject,0x47016943,0xfca8,0x4594,0x93,0xea,0xaf,0x25,0x8b,0x55,0x34,0x6d);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12StateObjectProperties,0xde5fa827,0x9bf9,0x4f26,0x89,0xff,0xd7,0xf5,0x6f,0xde,0x38,0x60);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Device5,0x8b4f173b,0x2fea,0x4b80,0x8f,0x58,0x43,0x07,0x19,0x1a,0xb9,0x5d);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedDataSettings,0x82BC481C,0x6B9B,0x4030,0xAE,0xDB,0x7E,0xE3,0xD1,0xDF,0x1E,0x63);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedDataSettings1,0xDBD5AE51,0x3317,0x4F0A,0xAD,0xF9,0x1D,0x7C,0xED,0xCA,0xAE,0x0B);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedDataSettings2,0x61552388,0x01ab,0x4008,0xa4,0x36,0x83,0xdb,0x18,0x95,0x66,0xea);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedData,0x98931D33,0x5AE8,0x4791,0xAA,0x3C,0x1A,0x73,0xA2,0x93,0x4E,0x71);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedData1,0x9727A022,0xCF1D,0x4DDA,0x9E,0xBA,0xEF,0xFA,0x65,0x3F,0xC5,0x06);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedData2,0x67FC5816,0xE4CA,0x4915,0xBF,0x18,0x42,0x54,0x12,0x72,0xDA,0x54);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Device6,0xc70b221b,0x40e4,0x4a17,0x89,0xaf,0x02,0x5a,0x07,0x27,0xa6,0xdc);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12ProtectedResourceSession1,0xD6F12DD6,0x76FB,0x406E,0x89,0x61,0x42,0x96,0xEE,0xFC,0x04,0x09);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Device7,0x5c014b53,0x68a1,0x4b9b,0x8b,0xd1,0xdd,0x60,0x46,0xb9,0x35,0x8b);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Device8,0x9218E6BB,0xF944,0x4F7E,0xA7,0x5C,0xB1,0xB2,0xC7,0xB7,0x01,0xF3);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Resource1,0x9D5E227A,0x4430,0x4161,0x88,0xB3,0x3E,0xCA,0x6B,0xB1,0x6E,0x19);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Resource2,0xBE36EC3B,0xEA85,0x4AEB,0xA4,0x5A,0xE9,0xD7,0x64,0x04,0xA4,0x95);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Heap1,0x572F7389,0x2168,0x49E3,0x96,0x93,0xD6,0xDF,0x58,0x71,0xBF,0x6D);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12GraphicsCommandList3,0x6FDA83A7,0xB84C,0x4E38,0x9A,0xC8,0xC7,0xBD,0x22,0x01,0x6B,0x3D);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12MetaCommand,0xDBB84C27,0x36CE,0x4FC9,0xB8,0x01,0xF0,0x48,0xC4,0x6A,0xC5,0x70);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12GraphicsCommandList4,0x8754318e,0xd3a9,0x4541,0x98,0xcf,0x64,0x5b,0x50,0xdc,0x48,0x74);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12ShaderCacheSession,0x28e2495d,0x0f64,0x4ae4,0xa6,0xec,0x12,0x92,0x55,0xdc,0x49,0xa8);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Device9,0x4c80e962,0xf032,0x4f60,0xbc,0x9e,0xeb,0xc2,0xcf,0xa1,0xd8,0x3c);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Device10,0x517f8718,0xaa66,0x49f9,0xb0,0x2b,0xa7,0xab,0x89,0xc0,0x60,0x31);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Device11,0x5405c344,0xd457,0x444e,0xb4,0xdd,0x23,0x66,0xe4,0x5a,0xee,0x39);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VirtualizationGuestDevice,0xbc66d368,0x7373,0x4943,0x87,0x57,0xfc,0x87,0xdc,0x79,0xe4,0x76);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Tools,0x7071e1f0,0xe84b,0x4b33,0x97,0x4f,0x12,0xfa,0x49,0xde,0x65,0xc5);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12SDKConfiguration,0xe9eb5314,0x33aa,0x42b2,0xa7,0x18,0xd7,0x7f,0x58,0xb1,0xf1,0xc7);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12SDKConfiguration1,0x8aaf9303,0xad25,0x48b9,0x9a,0x57,0xd9,0xc3,0x7e,0x00,0x9d,0x9f);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12DeviceFactory,0x61f307d3,0xd34e,0x4e7c,0x83,0x74,0x3b,0xa4,0xde,0x23,0xcc,0xcb);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12DeviceConfiguration,0x78dbf87b,0xf766,0x422b,0xa6,0x1c,0xc8,0xc4,0x46,0xbd,0xb9,0xad);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12GraphicsCommandList5,0x55050859,0x4024,0x474c,0x87,0xf5,0x64,0x72,0xea,0xee,0x44,0xea);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12GraphicsCommandList6,0xc3827890,0xe548,0x4cfa,0x96,0xcf,0x56,0x89,0xa9,0x37,0x0f,0x80);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12GraphicsCommandList7,0xdd171223,0x8b61,0x4769,0x90,0xe3,0x16,0x0c,0xcd,0xe4,0xe2,0xc1);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12GraphicsCommandList8,0xee936ef9,0x599d,0x4d28,0x93,0x8e,0x23,0xc4,0xad,0x05,0xce,0x51);" ) diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12compatibility.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12compatibility.h new file mode 100644 index 0000000..1a9430e --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12compatibility.h @@ -0,0 +1,739 @@ +/*------------------------------------------------------------------------------------- + * + * Copyright (c) Microsoft Corporation + * Licensed under the MIT license + * + *-------------------------------------------------------------------------------------*/ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 8.01.0628 */ + + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 500 +#endif + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif /* __RPCNDR_H_VERSION__ */ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __d3d12compatibility_h__ +#define __d3d12compatibility_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +#ifndef DECLSPEC_XFGVIRT +#if defined(_CONTROL_FLOW_GUARD_XFG) +#define DECLSPEC_XFGVIRT(base, func) __declspec(xfg_virtual(base, func)) +#else +#define DECLSPEC_XFGVIRT(base, func) +#endif +#endif + +/* Forward Declarations */ + +#ifndef __ID3D12CompatibilityDevice_FWD_DEFINED__ +#define __ID3D12CompatibilityDevice_FWD_DEFINED__ +typedef interface ID3D12CompatibilityDevice ID3D12CompatibilityDevice; + +#endif /* __ID3D12CompatibilityDevice_FWD_DEFINED__ */ + + +#ifndef __D3D11On12CreatorID_FWD_DEFINED__ +#define __D3D11On12CreatorID_FWD_DEFINED__ +typedef interface D3D11On12CreatorID D3D11On12CreatorID; + +#endif /* __D3D11On12CreatorID_FWD_DEFINED__ */ + + +#ifndef __D3D9On12CreatorID_FWD_DEFINED__ +#define __D3D9On12CreatorID_FWD_DEFINED__ +typedef interface D3D9On12CreatorID D3D9On12CreatorID; + +#endif /* __D3D9On12CreatorID_FWD_DEFINED__ */ + + +#ifndef __OpenGLOn12CreatorID_FWD_DEFINED__ +#define __OpenGLOn12CreatorID_FWD_DEFINED__ +typedef interface OpenGLOn12CreatorID OpenGLOn12CreatorID; + +#endif /* __OpenGLOn12CreatorID_FWD_DEFINED__ */ + + +#ifndef __OpenCLOn12CreatorID_FWD_DEFINED__ +#define __OpenCLOn12CreatorID_FWD_DEFINED__ +typedef interface OpenCLOn12CreatorID OpenCLOn12CreatorID; + +#endif /* __OpenCLOn12CreatorID_FWD_DEFINED__ */ + + +#ifndef __DirectMLTensorFlowCreatorID_FWD_DEFINED__ +#define __DirectMLTensorFlowCreatorID_FWD_DEFINED__ +typedef interface DirectMLTensorFlowCreatorID DirectMLTensorFlowCreatorID; + +#endif /* __DirectMLTensorFlowCreatorID_FWD_DEFINED__ */ + + +#ifndef __DirectMLPyTorchCreatorID_FWD_DEFINED__ +#define __DirectMLPyTorchCreatorID_FWD_DEFINED__ +typedef interface DirectMLPyTorchCreatorID DirectMLPyTorchCreatorID; + +#endif /* __DirectMLPyTorchCreatorID_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" +#include "d3d11on12.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_d3d12compatibility_0000_0000 */ +/* [local] */ + +#include +#pragma region Desktop Family +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) +typedef +enum D3D12_COMPATIBILITY_SHARED_FLAGS + { + D3D12_COMPATIBILITY_SHARED_FLAG_NONE = 0, + D3D12_COMPATIBILITY_SHARED_FLAG_NON_NT_HANDLE = 0x1, + D3D12_COMPATIBILITY_SHARED_FLAG_KEYED_MUTEX = 0x2, + D3D12_COMPATIBILITY_SHARED_FLAG_9_ON_12 = 0x4 + } D3D12_COMPATIBILITY_SHARED_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMPATIBILITY_SHARED_FLAGS ); +typedef +enum D3D12_REFLECT_SHARED_PROPERTY + { + D3D12_REFLECT_SHARED_PROPERTY_D3D11_RESOURCE_FLAGS = 0, + D3D12_REFELCT_SHARED_PROPERTY_COMPATIBILITY_SHARED_FLAGS = ( D3D12_REFLECT_SHARED_PROPERTY_D3D11_RESOURCE_FLAGS + 1 ) , + D3D12_REFLECT_SHARED_PROPERTY_NON_NT_SHARED_HANDLE = ( D3D12_REFELCT_SHARED_PROPERTY_COMPATIBILITY_SHARED_FLAGS + 1 ) + } D3D12_REFLECT_SHARED_PROPERTY; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12compatibility_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12compatibility_0000_0000_v0_0_s_ifspec; + +#ifndef __ID3D12CompatibilityDevice_INTERFACE_DEFINED__ +#define __ID3D12CompatibilityDevice_INTERFACE_DEFINED__ + +/* interface ID3D12CompatibilityDevice */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12CompatibilityDevice; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("8f1c0e3c-fae3-4a82-b098-bfe1708207ff") + ID3D12CompatibilityDevice : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateSharedResource( + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ const D3D11_RESOURCE_FLAGS *pFlags11, + D3D12_COMPATIBILITY_SHARED_FLAGS CompatibilityFlags, + _In_opt_ ID3D12LifetimeTracker *pLifetimeTracker, + _In_opt_ ID3D12SwapChainAssistant *pOwningSwapchain, + REFIID riid, + _COM_Outptr_opt_ void **ppResource) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateSharedHeap( + _In_ const D3D12_HEAP_DESC *pHeapDesc, + D3D12_COMPATIBILITY_SHARED_FLAGS CompatibilityFlags, + REFIID riid, + _COM_Outptr_opt_ void **ppHeap) = 0; + + virtual HRESULT STDMETHODCALLTYPE ReflectSharedProperties( + _In_ ID3D12Object *pHeapOrResource, + D3D12_REFLECT_SHARED_PROPERTY ReflectType, + _Out_writes_bytes_(DataSize) void *pData, + UINT DataSize) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12CompatibilityDeviceVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12CompatibilityDevice * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12CompatibilityDevice * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12CompatibilityDevice * This); + + DECLSPEC_XFGVIRT(ID3D12CompatibilityDevice, CreateSharedResource) + HRESULT ( STDMETHODCALLTYPE *CreateSharedResource )( + ID3D12CompatibilityDevice * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ const D3D11_RESOURCE_FLAGS *pFlags11, + D3D12_COMPATIBILITY_SHARED_FLAGS CompatibilityFlags, + _In_opt_ ID3D12LifetimeTracker *pLifetimeTracker, + _In_opt_ ID3D12SwapChainAssistant *pOwningSwapchain, + REFIID riid, + _COM_Outptr_opt_ void **ppResource); + + DECLSPEC_XFGVIRT(ID3D12CompatibilityDevice, CreateSharedHeap) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHeap )( + ID3D12CompatibilityDevice * This, + _In_ const D3D12_HEAP_DESC *pHeapDesc, + D3D12_COMPATIBILITY_SHARED_FLAGS CompatibilityFlags, + REFIID riid, + _COM_Outptr_opt_ void **ppHeap); + + DECLSPEC_XFGVIRT(ID3D12CompatibilityDevice, ReflectSharedProperties) + HRESULT ( STDMETHODCALLTYPE *ReflectSharedProperties )( + ID3D12CompatibilityDevice * This, + _In_ ID3D12Object *pHeapOrResource, + D3D12_REFLECT_SHARED_PROPERTY ReflectType, + _Out_writes_bytes_(DataSize) void *pData, + UINT DataSize); + + END_INTERFACE + } ID3D12CompatibilityDeviceVtbl; + + interface ID3D12CompatibilityDevice + { + CONST_VTBL struct ID3D12CompatibilityDeviceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12CompatibilityDevice_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12CompatibilityDevice_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12CompatibilityDevice_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12CompatibilityDevice_CreateSharedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pFlags11,CompatibilityFlags,pLifetimeTracker,pOwningSwapchain,riid,ppResource) \ + ( (This)->lpVtbl -> CreateSharedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pFlags11,CompatibilityFlags,pLifetimeTracker,pOwningSwapchain,riid,ppResource) ) + +#define ID3D12CompatibilityDevice_CreateSharedHeap(This,pHeapDesc,CompatibilityFlags,riid,ppHeap) \ + ( (This)->lpVtbl -> CreateSharedHeap(This,pHeapDesc,CompatibilityFlags,riid,ppHeap) ) + +#define ID3D12CompatibilityDevice_ReflectSharedProperties(This,pHeapOrResource,ReflectType,pData,DataSize) \ + ( (This)->lpVtbl -> ReflectSharedProperties(This,pHeapOrResource,ReflectType,pData,DataSize) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12CompatibilityDevice_INTERFACE_DEFINED__ */ + + +#ifndef __D3D11On12CreatorID_INTERFACE_DEFINED__ +#define __D3D11On12CreatorID_INTERFACE_DEFINED__ + +/* interface D3D11On12CreatorID */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_D3D11On12CreatorID; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("edbf5678-2960-4e81-8429-99d4b2630c4e") + D3D11On12CreatorID : public IUnknown + { + public: + }; + + +#else /* C style interface */ + + typedef struct D3D11On12CreatorIDVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + D3D11On12CreatorID * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + D3D11On12CreatorID * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + D3D11On12CreatorID * This); + + END_INTERFACE + } D3D11On12CreatorIDVtbl; + + interface D3D11On12CreatorID + { + CONST_VTBL struct D3D11On12CreatorIDVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define D3D11On12CreatorID_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define D3D11On12CreatorID_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define D3D11On12CreatorID_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __D3D11On12CreatorID_INTERFACE_DEFINED__ */ + + +#ifndef __D3D9On12CreatorID_INTERFACE_DEFINED__ +#define __D3D9On12CreatorID_INTERFACE_DEFINED__ + +/* interface D3D9On12CreatorID */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_D3D9On12CreatorID; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("fffcbb7f-15d3-42a2-841e-9d8d32f37ddd") + D3D9On12CreatorID : public IUnknown + { + public: + }; + + +#else /* C style interface */ + + typedef struct D3D9On12CreatorIDVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + D3D9On12CreatorID * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + D3D9On12CreatorID * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + D3D9On12CreatorID * This); + + END_INTERFACE + } D3D9On12CreatorIDVtbl; + + interface D3D9On12CreatorID + { + CONST_VTBL struct D3D9On12CreatorIDVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define D3D9On12CreatorID_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define D3D9On12CreatorID_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define D3D9On12CreatorID_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __D3D9On12CreatorID_INTERFACE_DEFINED__ */ + + +#ifndef __OpenGLOn12CreatorID_INTERFACE_DEFINED__ +#define __OpenGLOn12CreatorID_INTERFACE_DEFINED__ + +/* interface OpenGLOn12CreatorID */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_OpenGLOn12CreatorID; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6bb3cd34-0d19-45ab-97ed-d720ba3dfc80") + OpenGLOn12CreatorID : public IUnknown + { + public: + }; + + +#else /* C style interface */ + + typedef struct OpenGLOn12CreatorIDVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + OpenGLOn12CreatorID * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + OpenGLOn12CreatorID * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + OpenGLOn12CreatorID * This); + + END_INTERFACE + } OpenGLOn12CreatorIDVtbl; + + interface OpenGLOn12CreatorID + { + CONST_VTBL struct OpenGLOn12CreatorIDVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define OpenGLOn12CreatorID_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define OpenGLOn12CreatorID_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define OpenGLOn12CreatorID_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __OpenGLOn12CreatorID_INTERFACE_DEFINED__ */ + + +#ifndef __OpenCLOn12CreatorID_INTERFACE_DEFINED__ +#define __OpenCLOn12CreatorID_INTERFACE_DEFINED__ + +/* interface OpenCLOn12CreatorID */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_OpenCLOn12CreatorID; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3f76bb74-91b5-4a88-b126-20ca0331cd60") + OpenCLOn12CreatorID : public IUnknown + { + public: + }; + + +#else /* C style interface */ + + typedef struct OpenCLOn12CreatorIDVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + OpenCLOn12CreatorID * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + OpenCLOn12CreatorID * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + OpenCLOn12CreatorID * This); + + END_INTERFACE + } OpenCLOn12CreatorIDVtbl; + + interface OpenCLOn12CreatorID + { + CONST_VTBL struct OpenCLOn12CreatorIDVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define OpenCLOn12CreatorID_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define OpenCLOn12CreatorID_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define OpenCLOn12CreatorID_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __OpenCLOn12CreatorID_INTERFACE_DEFINED__ */ + + +#ifndef __DirectMLTensorFlowCreatorID_INTERFACE_DEFINED__ +#define __DirectMLTensorFlowCreatorID_INTERFACE_DEFINED__ + +/* interface DirectMLTensorFlowCreatorID */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_DirectMLTensorFlowCreatorID; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("cb7490ac-8a0f-44ec-9b7b-6f4cafe8e9ab") + DirectMLTensorFlowCreatorID : public IUnknown + { + public: + }; + + +#else /* C style interface */ + + typedef struct DirectMLTensorFlowCreatorIDVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + DirectMLTensorFlowCreatorID * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + DirectMLTensorFlowCreatorID * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + DirectMLTensorFlowCreatorID * This); + + END_INTERFACE + } DirectMLTensorFlowCreatorIDVtbl; + + interface DirectMLTensorFlowCreatorID + { + CONST_VTBL struct DirectMLTensorFlowCreatorIDVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define DirectMLTensorFlowCreatorID_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define DirectMLTensorFlowCreatorID_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define DirectMLTensorFlowCreatorID_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __DirectMLTensorFlowCreatorID_INTERFACE_DEFINED__ */ + + +#ifndef __DirectMLPyTorchCreatorID_INTERFACE_DEFINED__ +#define __DirectMLPyTorchCreatorID_INTERFACE_DEFINED__ + +/* interface DirectMLPyTorchCreatorID */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_DirectMLPyTorchCreatorID; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("af029192-fba1-4b05-9116-235e06560354") + DirectMLPyTorchCreatorID : public IUnknown + { + public: + }; + + +#else /* C style interface */ + + typedef struct DirectMLPyTorchCreatorIDVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + DirectMLPyTorchCreatorID * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + DirectMLPyTorchCreatorID * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + DirectMLPyTorchCreatorID * This); + + END_INTERFACE + } DirectMLPyTorchCreatorIDVtbl; + + interface DirectMLPyTorchCreatorID + { + CONST_VTBL struct DirectMLPyTorchCreatorIDVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define DirectMLPyTorchCreatorID_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define DirectMLPyTorchCreatorID_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define DirectMLPyTorchCreatorID_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __DirectMLPyTorchCreatorID_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12compatibility_0000_0007 */ +/* [local] */ + +#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */ +#pragma endregion +DEFINE_GUID(IID_ID3D12CompatibilityDevice,0x8f1c0e3c,0xfae3,0x4a82,0xb0,0x98,0xbf,0xe1,0x70,0x82,0x07,0xff); +DEFINE_GUID(IID_D3D11On12CreatorID,0xedbf5678,0x2960,0x4e81,0x84,0x29,0x99,0xd4,0xb2,0x63,0x0c,0x4e); +DEFINE_GUID(IID_D3D9On12CreatorID,0xfffcbb7f,0x15d3,0x42a2,0x84,0x1e,0x9d,0x8d,0x32,0xf3,0x7d,0xdd); +DEFINE_GUID(IID_OpenGLOn12CreatorID,0x6bb3cd34,0x0d19,0x45ab,0x97,0xed,0xd7,0x20,0xba,0x3d,0xfc,0x80); +DEFINE_GUID(IID_OpenCLOn12CreatorID,0x3f76bb74,0x91b5,0x4a88,0xb1,0x26,0x20,0xca,0x03,0x31,0xcd,0x60); +DEFINE_GUID(IID_DirectMLTensorFlowCreatorID,0xcb7490ac,0x8a0f,0x44ec,0x9b,0x7b,0x6f,0x4c,0xaf,0xe8,0xe9,0xab); +DEFINE_GUID(IID_DirectMLPyTorchCreatorID,0xaf029192,0xfba1,0x4b05,0x91,0x16,0x23,0x5e,0x06,0x56,0x03,0x54); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12compatibility_0000_0007_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12compatibility_0000_0007_v0_0_s_ifspec; + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12compatibility.idl b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12compatibility.idl new file mode 100644 index 0000000..179e833 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12compatibility.idl @@ -0,0 +1,92 @@ +/*------------------------------------------------------------------------------------- + * + * Copyright (c) Microsoft Corporation + * Licensed under the MIT license + * + *-------------------------------------------------------------------------------------*/ +import "oaidl.idl"; +import "ocidl.idl"; + +import "d3d11on12.idl"; + +cpp_quote("#include ") + +#pragma region Desktop Family +cpp_quote("#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES)") + +typedef enum D3D12_COMPATIBILITY_SHARED_FLAGS +{ + D3D12_COMPATIBILITY_SHARED_FLAG_NONE = 0, + D3D12_COMPATIBILITY_SHARED_FLAG_NON_NT_HANDLE = 0x1, + D3D12_COMPATIBILITY_SHARED_FLAG_KEYED_MUTEX = 0x2, + D3D12_COMPATIBILITY_SHARED_FLAG_9_ON_12 = 0x4, + +} D3D12_COMPATIBILITY_SHARED_FLAGS; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMPATIBILITY_SHARED_FLAGS );" ) + +typedef enum D3D12_REFLECT_SHARED_PROPERTY +{ + D3D12_REFLECT_SHARED_PROPERTY_D3D11_RESOURCE_FLAGS, // D3D11_RESOURCE_FLAGS + D3D12_REFELCT_SHARED_PROPERTY_COMPATIBILITY_SHARED_FLAGS, // D3D12_COMPATIBILITY_SHARED_FLAGS + D3D12_REFLECT_SHARED_PROPERTY_NON_NT_SHARED_HANDLE, // HANDLE +} D3D12_REFLECT_SHARED_PROPERTY; + +[ uuid( 8f1c0e3c-fae3-4a82-b098-bfe1708207ff ), object, local, pointer_default( unique ) ] +interface ID3D12CompatibilityDevice + : IUnknown +{ + HRESULT CreateSharedResource( + [annotation("_In_")] const D3D12_HEAP_PROPERTIES* pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + [annotation("_In_")] const D3D12_RESOURCE_DESC* pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + [annotation("_In_opt_")] const D3D12_CLEAR_VALUE* pOptimizedClearValue, + [annotation("_In_opt_")] const D3D11_RESOURCE_FLAGS* pFlags11, + D3D12_COMPATIBILITY_SHARED_FLAGS CompatibilityFlags, + [annotation("_In_opt_")] ID3D12LifetimeTracker* pLifetimeTracker, + [annotation("_In_opt_")] ID3D12SwapChainAssistant* pOwningSwapchain, + REFIID riid, + [out, iid_is(riid), annotation("_COM_Outptr_opt_")] void** ppResource); + + HRESULT CreateSharedHeap( + [annotation("_In_")] const D3D12_HEAP_DESC* pHeapDesc, + D3D12_COMPATIBILITY_SHARED_FLAGS CompatibilityFlags, + REFIID riid, + [out, iid_is(riid), annotation("_COM_Outptr_opt_")] void** ppHeap); + + HRESULT ReflectSharedProperties( + [annotation("_In_")] ID3D12Object* pHeapOrResource, + D3D12_REFLECT_SHARED_PROPERTY ReflectType, + [annotation("_Out_writes_bytes_(DataSize)")] void* pData, + UINT DataSize); +} + +[uuid(edbf5678-2960-4e81-8429-99d4b2630c4e), object, local, pointer_default(unique)] +interface D3D11On12CreatorID : IUnknown { }; + +[uuid(fffcbb7f-15d3-42a2-841e-9d8d32f37ddd), object, local, pointer_default(unique)] +interface D3D9On12CreatorID : IUnknown { }; + +[uuid(6bb3cd34-0d19-45ab-97ed-d720ba3dfc80), object, local, pointer_default(unique)] +interface OpenGLOn12CreatorID : IUnknown { }; + +[uuid(3f76bb74-91b5-4a88-b126-20ca0331cd60), object, local, pointer_default(unique)] +interface OpenCLOn12CreatorID : IUnknown { }; + +[uuid(cb7490ac-8a0f-44ec-9b7b-6f4cafe8e9ab), object, local, pointer_default(unique)] +interface DirectMLTensorFlowCreatorID : IUnknown { }; + +[uuid(af029192-fba1-4b05-9116-235e06560354), object, local, pointer_default(unique)] +interface DirectMLPyTorchCreatorID : IUnknown { }; + + +cpp_quote("#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */") +#pragma endregion + +cpp_quote( "DEFINE_GUID(IID_ID3D12CompatibilityDevice,0x8f1c0e3c,0xfae3,0x4a82,0xb0,0x98,0xbf,0xe1,0x70,0x82,0x07,0xff);" ) +cpp_quote( "DEFINE_GUID(IID_D3D11On12CreatorID,0xedbf5678,0x2960,0x4e81,0x84,0x29,0x99,0xd4,0xb2,0x63,0x0c,0x4e);" ) +cpp_quote( "DEFINE_GUID(IID_D3D9On12CreatorID,0xfffcbb7f,0x15d3,0x42a2,0x84,0x1e,0x9d,0x8d,0x32,0xf3,0x7d,0xdd);" ) +cpp_quote( "DEFINE_GUID(IID_OpenGLOn12CreatorID,0x6bb3cd34,0x0d19,0x45ab,0x97,0xed,0xd7,0x20,0xba,0x3d,0xfc,0x80);" ) +cpp_quote( "DEFINE_GUID(IID_OpenCLOn12CreatorID,0x3f76bb74,0x91b5,0x4a88,0xb1,0x26,0x20,0xca,0x03,0x31,0xcd,0x60);" ) +cpp_quote( "DEFINE_GUID(IID_DirectMLTensorFlowCreatorID,0xcb7490ac,0x8a0f,0x44ec,0x9b,0x7b,0x6f,0x4c,0xaf,0xe8,0xe9,0xab);" ) +cpp_quote( "DEFINE_GUID(IID_DirectMLPyTorchCreatorID,0xaf029192,0xfba1,0x4b05,0x91,0x16,0x23,0x5e,0x06,0x56,0x03,0x54);" ) diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12sdklayers.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12sdklayers.h new file mode 100644 index 0000000..b25a8f6 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12sdklayers.h @@ -0,0 +1,4110 @@ +/*------------------------------------------------------------------------------------- + * + * Copyright (c) Microsoft Corporation + * Licensed under the MIT license + * + *-------------------------------------------------------------------------------------*/ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 8.01.0628 */ + + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 500 +#endif + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif /* __RPCNDR_H_VERSION__ */ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __d3d12sdklayers_h__ +#define __d3d12sdklayers_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +#ifndef DECLSPEC_XFGVIRT +#if defined(_CONTROL_FLOW_GUARD_XFG) +#define DECLSPEC_XFGVIRT(base, func) __declspec(xfg_virtual(base, func)) +#else +#define DECLSPEC_XFGVIRT(base, func) +#endif +#endif + +/* Forward Declarations */ + +#ifndef __ID3D12Debug_FWD_DEFINED__ +#define __ID3D12Debug_FWD_DEFINED__ +typedef interface ID3D12Debug ID3D12Debug; + +#endif /* __ID3D12Debug_FWD_DEFINED__ */ + + +#ifndef __ID3D12Debug1_FWD_DEFINED__ +#define __ID3D12Debug1_FWD_DEFINED__ +typedef interface ID3D12Debug1 ID3D12Debug1; + +#endif /* __ID3D12Debug1_FWD_DEFINED__ */ + + +#ifndef __ID3D12Debug2_FWD_DEFINED__ +#define __ID3D12Debug2_FWD_DEFINED__ +typedef interface ID3D12Debug2 ID3D12Debug2; + +#endif /* __ID3D12Debug2_FWD_DEFINED__ */ + + +#ifndef __ID3D12Debug3_FWD_DEFINED__ +#define __ID3D12Debug3_FWD_DEFINED__ +typedef interface ID3D12Debug3 ID3D12Debug3; + +#endif /* __ID3D12Debug3_FWD_DEFINED__ */ + + +#ifndef __ID3D12Debug4_FWD_DEFINED__ +#define __ID3D12Debug4_FWD_DEFINED__ +typedef interface ID3D12Debug4 ID3D12Debug4; + +#endif /* __ID3D12Debug4_FWD_DEFINED__ */ + + +#ifndef __ID3D12Debug5_FWD_DEFINED__ +#define __ID3D12Debug5_FWD_DEFINED__ +typedef interface ID3D12Debug5 ID3D12Debug5; + +#endif /* __ID3D12Debug5_FWD_DEFINED__ */ + + +#ifndef __ID3D12Debug6_FWD_DEFINED__ +#define __ID3D12Debug6_FWD_DEFINED__ +typedef interface ID3D12Debug6 ID3D12Debug6; + +#endif /* __ID3D12Debug6_FWD_DEFINED__ */ + + +#ifndef __ID3D12DebugDevice1_FWD_DEFINED__ +#define __ID3D12DebugDevice1_FWD_DEFINED__ +typedef interface ID3D12DebugDevice1 ID3D12DebugDevice1; + +#endif /* __ID3D12DebugDevice1_FWD_DEFINED__ */ + + +#ifndef __ID3D12DebugDevice_FWD_DEFINED__ +#define __ID3D12DebugDevice_FWD_DEFINED__ +typedef interface ID3D12DebugDevice ID3D12DebugDevice; + +#endif /* __ID3D12DebugDevice_FWD_DEFINED__ */ + + +#ifndef __ID3D12DebugDevice2_FWD_DEFINED__ +#define __ID3D12DebugDevice2_FWD_DEFINED__ +typedef interface ID3D12DebugDevice2 ID3D12DebugDevice2; + +#endif /* __ID3D12DebugDevice2_FWD_DEFINED__ */ + + +#ifndef __ID3D12DebugCommandQueue_FWD_DEFINED__ +#define __ID3D12DebugCommandQueue_FWD_DEFINED__ +typedef interface ID3D12DebugCommandQueue ID3D12DebugCommandQueue; + +#endif /* __ID3D12DebugCommandQueue_FWD_DEFINED__ */ + + +#ifndef __ID3D12DebugCommandQueue1_FWD_DEFINED__ +#define __ID3D12DebugCommandQueue1_FWD_DEFINED__ +typedef interface ID3D12DebugCommandQueue1 ID3D12DebugCommandQueue1; + +#endif /* __ID3D12DebugCommandQueue1_FWD_DEFINED__ */ + + +#ifndef __ID3D12DebugCommandList1_FWD_DEFINED__ +#define __ID3D12DebugCommandList1_FWD_DEFINED__ +typedef interface ID3D12DebugCommandList1 ID3D12DebugCommandList1; + +#endif /* __ID3D12DebugCommandList1_FWD_DEFINED__ */ + + +#ifndef __ID3D12DebugCommandList_FWD_DEFINED__ +#define __ID3D12DebugCommandList_FWD_DEFINED__ +typedef interface ID3D12DebugCommandList ID3D12DebugCommandList; + +#endif /* __ID3D12DebugCommandList_FWD_DEFINED__ */ + + +#ifndef __ID3D12DebugCommandList2_FWD_DEFINED__ +#define __ID3D12DebugCommandList2_FWD_DEFINED__ +typedef interface ID3D12DebugCommandList2 ID3D12DebugCommandList2; + +#endif /* __ID3D12DebugCommandList2_FWD_DEFINED__ */ + + +#ifndef __ID3D12DebugCommandList3_FWD_DEFINED__ +#define __ID3D12DebugCommandList3_FWD_DEFINED__ +typedef interface ID3D12DebugCommandList3 ID3D12DebugCommandList3; + +#endif /* __ID3D12DebugCommandList3_FWD_DEFINED__ */ + + +#ifndef __ID3D12SharingContract_FWD_DEFINED__ +#define __ID3D12SharingContract_FWD_DEFINED__ +typedef interface ID3D12SharingContract ID3D12SharingContract; + +#endif /* __ID3D12SharingContract_FWD_DEFINED__ */ + + +#ifndef __ID3D12InfoQueue_FWD_DEFINED__ +#define __ID3D12InfoQueue_FWD_DEFINED__ +typedef interface ID3D12InfoQueue ID3D12InfoQueue; + +#endif /* __ID3D12InfoQueue_FWD_DEFINED__ */ + + +#ifndef __ID3D12InfoQueue1_FWD_DEFINED__ +#define __ID3D12InfoQueue1_FWD_DEFINED__ +typedef interface ID3D12InfoQueue1 ID3D12InfoQueue1; + +#endif /* __ID3D12InfoQueue1_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" +#include "d3d12.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_d3d12sdklayers_0000_0000 */ +/* [local] */ + +#include +#pragma region App Family +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0000_v0_0_s_ifspec; + +#ifndef __ID3D12Debug_INTERFACE_DEFINED__ +#define __ID3D12Debug_INTERFACE_DEFINED__ + +/* interface ID3D12Debug */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Debug; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("344488b7-6846-474b-b989-f027448245e0") + ID3D12Debug : public IUnknown + { + public: + virtual void STDMETHODCALLTYPE EnableDebugLayer( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DebugVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Debug * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Debug * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Debug * This); + + DECLSPEC_XFGVIRT(ID3D12Debug, EnableDebugLayer) + void ( STDMETHODCALLTYPE *EnableDebugLayer )( + ID3D12Debug * This); + + END_INTERFACE + } ID3D12DebugVtbl; + + interface ID3D12Debug + { + CONST_VTBL struct ID3D12DebugVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#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) ) + + +#define ID3D12Debug_EnableDebugLayer(This) \ + ( (This)->lpVtbl -> EnableDebugLayer(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Debug_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12sdklayers_0000_0001 */ +/* [local] */ + +typedef +enum D3D12_GPU_BASED_VALIDATION_FLAGS + { + D3D12_GPU_BASED_VALIDATION_FLAGS_NONE = 0, + D3D12_GPU_BASED_VALIDATION_FLAGS_DISABLE_STATE_TRACKING = 0x1 + } D3D12_GPU_BASED_VALIDATION_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_GPU_BASED_VALIDATION_FLAGS) + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0001_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0001_v0_0_s_ifspec; + +#ifndef __ID3D12Debug1_INTERFACE_DEFINED__ +#define __ID3D12Debug1_INTERFACE_DEFINED__ + +/* interface ID3D12Debug1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Debug1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("affaa4ca-63fe-4d8e-b8ad-159000af4304") + ID3D12Debug1 : public IUnknown + { + public: + virtual void STDMETHODCALLTYPE EnableDebugLayer( void) = 0; + + virtual void STDMETHODCALLTYPE SetEnableGPUBasedValidation( + BOOL Enable) = 0; + + virtual void STDMETHODCALLTYPE SetEnableSynchronizedCommandQueueValidation( + BOOL Enable) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Debug1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Debug1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Debug1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Debug1 * This); + + DECLSPEC_XFGVIRT(ID3D12Debug1, EnableDebugLayer) + void ( STDMETHODCALLTYPE *EnableDebugLayer )( + ID3D12Debug1 * This); + + DECLSPEC_XFGVIRT(ID3D12Debug1, SetEnableGPUBasedValidation) + void ( STDMETHODCALLTYPE *SetEnableGPUBasedValidation )( + ID3D12Debug1 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Debug1, SetEnableSynchronizedCommandQueueValidation) + void ( STDMETHODCALLTYPE *SetEnableSynchronizedCommandQueueValidation )( + ID3D12Debug1 * This, + BOOL Enable); + + END_INTERFACE + } ID3D12Debug1Vtbl; + + interface ID3D12Debug1 + { + CONST_VTBL struct ID3D12Debug1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Debug1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Debug1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Debug1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Debug1_EnableDebugLayer(This) \ + ( (This)->lpVtbl -> EnableDebugLayer(This) ) + +#define ID3D12Debug1_SetEnableGPUBasedValidation(This,Enable) \ + ( (This)->lpVtbl -> SetEnableGPUBasedValidation(This,Enable) ) + +#define ID3D12Debug1_SetEnableSynchronizedCommandQueueValidation(This,Enable) \ + ( (This)->lpVtbl -> SetEnableSynchronizedCommandQueueValidation(This,Enable) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Debug1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Debug2_INTERFACE_DEFINED__ +#define __ID3D12Debug2_INTERFACE_DEFINED__ + +/* interface ID3D12Debug2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Debug2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("93a665c4-a3b2-4e5d-b692-a26ae14e3374") + ID3D12Debug2 : public IUnknown + { + public: + virtual void STDMETHODCALLTYPE SetGPUBasedValidationFlags( + D3D12_GPU_BASED_VALIDATION_FLAGS Flags) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Debug2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Debug2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Debug2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Debug2 * This); + + DECLSPEC_XFGVIRT(ID3D12Debug2, SetGPUBasedValidationFlags) + void ( STDMETHODCALLTYPE *SetGPUBasedValidationFlags )( + ID3D12Debug2 * This, + D3D12_GPU_BASED_VALIDATION_FLAGS Flags); + + END_INTERFACE + } ID3D12Debug2Vtbl; + + interface ID3D12Debug2 + { + CONST_VTBL struct ID3D12Debug2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Debug2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Debug2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Debug2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Debug2_SetGPUBasedValidationFlags(This,Flags) \ + ( (This)->lpVtbl -> SetGPUBasedValidationFlags(This,Flags) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Debug2_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Debug3_INTERFACE_DEFINED__ +#define __ID3D12Debug3_INTERFACE_DEFINED__ + +/* interface ID3D12Debug3 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Debug3; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("5cf4e58f-f671-4ff1-a542-3686e3d153d1") + ID3D12Debug3 : public ID3D12Debug + { + public: + virtual void STDMETHODCALLTYPE SetEnableGPUBasedValidation( + BOOL Enable) = 0; + + virtual void STDMETHODCALLTYPE SetEnableSynchronizedCommandQueueValidation( + BOOL Enable) = 0; + + virtual void STDMETHODCALLTYPE SetGPUBasedValidationFlags( + D3D12_GPU_BASED_VALIDATION_FLAGS Flags) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Debug3Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Debug3 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Debug3 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Debug3 * This); + + DECLSPEC_XFGVIRT(ID3D12Debug, EnableDebugLayer) + void ( STDMETHODCALLTYPE *EnableDebugLayer )( + ID3D12Debug3 * This); + + DECLSPEC_XFGVIRT(ID3D12Debug3, SetEnableGPUBasedValidation) + void ( STDMETHODCALLTYPE *SetEnableGPUBasedValidation )( + ID3D12Debug3 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Debug3, SetEnableSynchronizedCommandQueueValidation) + void ( STDMETHODCALLTYPE *SetEnableSynchronizedCommandQueueValidation )( + ID3D12Debug3 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Debug3, SetGPUBasedValidationFlags) + void ( STDMETHODCALLTYPE *SetGPUBasedValidationFlags )( + ID3D12Debug3 * This, + D3D12_GPU_BASED_VALIDATION_FLAGS Flags); + + END_INTERFACE + } ID3D12Debug3Vtbl; + + interface ID3D12Debug3 + { + CONST_VTBL struct ID3D12Debug3Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Debug3_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Debug3_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Debug3_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Debug3_EnableDebugLayer(This) \ + ( (This)->lpVtbl -> EnableDebugLayer(This) ) + + +#define ID3D12Debug3_SetEnableGPUBasedValidation(This,Enable) \ + ( (This)->lpVtbl -> SetEnableGPUBasedValidation(This,Enable) ) + +#define ID3D12Debug3_SetEnableSynchronizedCommandQueueValidation(This,Enable) \ + ( (This)->lpVtbl -> SetEnableSynchronizedCommandQueueValidation(This,Enable) ) + +#define ID3D12Debug3_SetGPUBasedValidationFlags(This,Flags) \ + ( (This)->lpVtbl -> SetGPUBasedValidationFlags(This,Flags) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Debug3_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Debug4_INTERFACE_DEFINED__ +#define __ID3D12Debug4_INTERFACE_DEFINED__ + +/* interface ID3D12Debug4 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Debug4; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("014b816e-9ec5-4a2f-a845-ffbe441ce13a") + ID3D12Debug4 : public ID3D12Debug3 + { + public: + virtual void STDMETHODCALLTYPE DisableDebugLayer( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Debug4Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Debug4 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Debug4 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Debug4 * This); + + DECLSPEC_XFGVIRT(ID3D12Debug, EnableDebugLayer) + void ( STDMETHODCALLTYPE *EnableDebugLayer )( + ID3D12Debug4 * This); + + DECLSPEC_XFGVIRT(ID3D12Debug3, SetEnableGPUBasedValidation) + void ( STDMETHODCALLTYPE *SetEnableGPUBasedValidation )( + ID3D12Debug4 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Debug3, SetEnableSynchronizedCommandQueueValidation) + void ( STDMETHODCALLTYPE *SetEnableSynchronizedCommandQueueValidation )( + ID3D12Debug4 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Debug3, SetGPUBasedValidationFlags) + void ( STDMETHODCALLTYPE *SetGPUBasedValidationFlags )( + ID3D12Debug4 * This, + D3D12_GPU_BASED_VALIDATION_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12Debug4, DisableDebugLayer) + void ( STDMETHODCALLTYPE *DisableDebugLayer )( + ID3D12Debug4 * This); + + END_INTERFACE + } ID3D12Debug4Vtbl; + + interface ID3D12Debug4 + { + CONST_VTBL struct ID3D12Debug4Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Debug4_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Debug4_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Debug4_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Debug4_EnableDebugLayer(This) \ + ( (This)->lpVtbl -> EnableDebugLayer(This) ) + + +#define ID3D12Debug4_SetEnableGPUBasedValidation(This,Enable) \ + ( (This)->lpVtbl -> SetEnableGPUBasedValidation(This,Enable) ) + +#define ID3D12Debug4_SetEnableSynchronizedCommandQueueValidation(This,Enable) \ + ( (This)->lpVtbl -> SetEnableSynchronizedCommandQueueValidation(This,Enable) ) + +#define ID3D12Debug4_SetGPUBasedValidationFlags(This,Flags) \ + ( (This)->lpVtbl -> SetGPUBasedValidationFlags(This,Flags) ) + + +#define ID3D12Debug4_DisableDebugLayer(This) \ + ( (This)->lpVtbl -> DisableDebugLayer(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Debug4_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Debug5_INTERFACE_DEFINED__ +#define __ID3D12Debug5_INTERFACE_DEFINED__ + +/* interface ID3D12Debug5 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Debug5; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("548d6b12-09fa-40e0-9069-5dcd589a52c9") + ID3D12Debug5 : public ID3D12Debug4 + { + public: + virtual void STDMETHODCALLTYPE SetEnableAutoName( + BOOL Enable) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Debug5Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Debug5 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Debug5 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Debug5 * This); + + DECLSPEC_XFGVIRT(ID3D12Debug, EnableDebugLayer) + void ( STDMETHODCALLTYPE *EnableDebugLayer )( + ID3D12Debug5 * This); + + DECLSPEC_XFGVIRT(ID3D12Debug3, SetEnableGPUBasedValidation) + void ( STDMETHODCALLTYPE *SetEnableGPUBasedValidation )( + ID3D12Debug5 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Debug3, SetEnableSynchronizedCommandQueueValidation) + void ( STDMETHODCALLTYPE *SetEnableSynchronizedCommandQueueValidation )( + ID3D12Debug5 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Debug3, SetGPUBasedValidationFlags) + void ( STDMETHODCALLTYPE *SetGPUBasedValidationFlags )( + ID3D12Debug5 * This, + D3D12_GPU_BASED_VALIDATION_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12Debug4, DisableDebugLayer) + void ( STDMETHODCALLTYPE *DisableDebugLayer )( + ID3D12Debug5 * This); + + DECLSPEC_XFGVIRT(ID3D12Debug5, SetEnableAutoName) + void ( STDMETHODCALLTYPE *SetEnableAutoName )( + ID3D12Debug5 * This, + BOOL Enable); + + END_INTERFACE + } ID3D12Debug5Vtbl; + + interface ID3D12Debug5 + { + CONST_VTBL struct ID3D12Debug5Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Debug5_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Debug5_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Debug5_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Debug5_EnableDebugLayer(This) \ + ( (This)->lpVtbl -> EnableDebugLayer(This) ) + + +#define ID3D12Debug5_SetEnableGPUBasedValidation(This,Enable) \ + ( (This)->lpVtbl -> SetEnableGPUBasedValidation(This,Enable) ) + +#define ID3D12Debug5_SetEnableSynchronizedCommandQueueValidation(This,Enable) \ + ( (This)->lpVtbl -> SetEnableSynchronizedCommandQueueValidation(This,Enable) ) + +#define ID3D12Debug5_SetGPUBasedValidationFlags(This,Flags) \ + ( (This)->lpVtbl -> SetGPUBasedValidationFlags(This,Flags) ) + + +#define ID3D12Debug5_DisableDebugLayer(This) \ + ( (This)->lpVtbl -> DisableDebugLayer(This) ) + + +#define ID3D12Debug5_SetEnableAutoName(This,Enable) \ + ( (This)->lpVtbl -> SetEnableAutoName(This,Enable) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Debug5_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Debug6_INTERFACE_DEFINED__ +#define __ID3D12Debug6_INTERFACE_DEFINED__ + +/* interface ID3D12Debug6 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Debug6; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("82a816d6-5d01-4157-97d0-4975463fd1ed") + ID3D12Debug6 : public ID3D12Debug5 + { + public: + virtual void STDMETHODCALLTYPE SetForceLegacyBarrierValidation( + BOOL Enable) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Debug6Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Debug6 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Debug6 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Debug6 * This); + + DECLSPEC_XFGVIRT(ID3D12Debug, EnableDebugLayer) + void ( STDMETHODCALLTYPE *EnableDebugLayer )( + ID3D12Debug6 * This); + + DECLSPEC_XFGVIRT(ID3D12Debug3, SetEnableGPUBasedValidation) + void ( STDMETHODCALLTYPE *SetEnableGPUBasedValidation )( + ID3D12Debug6 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Debug3, SetEnableSynchronizedCommandQueueValidation) + void ( STDMETHODCALLTYPE *SetEnableSynchronizedCommandQueueValidation )( + ID3D12Debug6 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Debug3, SetGPUBasedValidationFlags) + void ( STDMETHODCALLTYPE *SetGPUBasedValidationFlags )( + ID3D12Debug6 * This, + D3D12_GPU_BASED_VALIDATION_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12Debug4, DisableDebugLayer) + void ( STDMETHODCALLTYPE *DisableDebugLayer )( + ID3D12Debug6 * This); + + DECLSPEC_XFGVIRT(ID3D12Debug5, SetEnableAutoName) + void ( STDMETHODCALLTYPE *SetEnableAutoName )( + ID3D12Debug6 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Debug6, SetForceLegacyBarrierValidation) + void ( STDMETHODCALLTYPE *SetForceLegacyBarrierValidation )( + ID3D12Debug6 * This, + BOOL Enable); + + END_INTERFACE + } ID3D12Debug6Vtbl; + + interface ID3D12Debug6 + { + CONST_VTBL struct ID3D12Debug6Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Debug6_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Debug6_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Debug6_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Debug6_EnableDebugLayer(This) \ + ( (This)->lpVtbl -> EnableDebugLayer(This) ) + + +#define ID3D12Debug6_SetEnableGPUBasedValidation(This,Enable) \ + ( (This)->lpVtbl -> SetEnableGPUBasedValidation(This,Enable) ) + +#define ID3D12Debug6_SetEnableSynchronizedCommandQueueValidation(This,Enable) \ + ( (This)->lpVtbl -> SetEnableSynchronizedCommandQueueValidation(This,Enable) ) + +#define ID3D12Debug6_SetGPUBasedValidationFlags(This,Flags) \ + ( (This)->lpVtbl -> SetGPUBasedValidationFlags(This,Flags) ) + + +#define ID3D12Debug6_DisableDebugLayer(This) \ + ( (This)->lpVtbl -> DisableDebugLayer(This) ) + + +#define ID3D12Debug6_SetEnableAutoName(This,Enable) \ + ( (This)->lpVtbl -> SetEnableAutoName(This,Enable) ) + + +#define ID3D12Debug6_SetForceLegacyBarrierValidation(This,Enable) \ + ( (This)->lpVtbl -> SetForceLegacyBarrierValidation(This,Enable) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Debug6_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12sdklayers_0000_0007 */ +/* [local] */ + +DEFINE_GUID(WKPDID_D3DAutoDebugObjectNameW, 0xd4902e36, 0x757a, 0x4942, 0x95, 0x94, 0xb6, 0x76, 0x9a, 0xfa, 0x43, 0xcd); +typedef +enum D3D12_RLDO_FLAGS + { + D3D12_RLDO_NONE = 0, + D3D12_RLDO_SUMMARY = 0x1, + D3D12_RLDO_DETAIL = 0x2, + D3D12_RLDO_IGNORE_INTERNAL = 0x4 + } D3D12_RLDO_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_RLDO_FLAGS) +typedef +enum D3D12_DEBUG_DEVICE_PARAMETER_TYPE + { + D3D12_DEBUG_DEVICE_PARAMETER_FEATURE_FLAGS = 0, + D3D12_DEBUG_DEVICE_PARAMETER_GPU_BASED_VALIDATION_SETTINGS = ( D3D12_DEBUG_DEVICE_PARAMETER_FEATURE_FLAGS + 1 ) , + D3D12_DEBUG_DEVICE_PARAMETER_GPU_SLOWDOWN_PERFORMANCE_FACTOR = ( D3D12_DEBUG_DEVICE_PARAMETER_GPU_BASED_VALIDATION_SETTINGS + 1 ) + } D3D12_DEBUG_DEVICE_PARAMETER_TYPE; + +typedef +enum D3D12_DEBUG_FEATURE + { + D3D12_DEBUG_FEATURE_NONE = 0, + D3D12_DEBUG_FEATURE_ALLOW_BEHAVIOR_CHANGING_DEBUG_AIDS = 0x1, + D3D12_DEBUG_FEATURE_CONSERVATIVE_RESOURCE_STATE_TRACKING = 0x2, + D3D12_DEBUG_FEATURE_DISABLE_VIRTUALIZED_BUNDLES_VALIDATION = 0x4, + D3D12_DEBUG_FEATURE_EMULATE_WINDOWS7 = 0x8 + } D3D12_DEBUG_FEATURE; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_DEBUG_FEATURE) +typedef +enum D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE + { + D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_NONE = 0, + D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_STATE_TRACKING_ONLY = ( D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_NONE + 1 ) , + D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_UNGUARDED_VALIDATION = ( D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_STATE_TRACKING_ONLY + 1 ) , + D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_GUARDED_VALIDATION = ( D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_UNGUARDED_VALIDATION + 1 ) , + NUM_D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODES = ( D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_GUARDED_VALIDATION + 1 ) + } D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE; + +typedef +enum D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS + { + D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_NONE = 0, + D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_FRONT_LOAD_CREATE_TRACKING_ONLY_SHADERS = 0x1, + D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_FRONT_LOAD_CREATE_UNGUARDED_VALIDATION_SHADERS = 0x2, + D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_FRONT_LOAD_CREATE_GUARDED_VALIDATION_SHADERS = 0x4, + D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS_VALID_MASK = 0x7 + } D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS) +typedef struct D3D12_DEBUG_DEVICE_GPU_BASED_VALIDATION_SETTINGS + { + UINT MaxMessagesPerCommandList; + D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE DefaultShaderPatchMode; + D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS PipelineStateCreateFlags; + } D3D12_DEBUG_DEVICE_GPU_BASED_VALIDATION_SETTINGS; + +typedef struct D3D12_DEBUG_DEVICE_GPU_SLOWDOWN_PERFORMANCE_FACTOR + { + FLOAT SlowdownFactor; + } D3D12_DEBUG_DEVICE_GPU_SLOWDOWN_PERFORMANCE_FACTOR; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0007_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0007_v0_0_s_ifspec; + +#ifndef __ID3D12DebugDevice1_INTERFACE_DEFINED__ +#define __ID3D12DebugDevice1_INTERFACE_DEFINED__ + +/* interface ID3D12DebugDevice1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DebugDevice1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("a9b71770-d099-4a65-a698-3dee10020f88") + ID3D12DebugDevice1 : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetDebugParameter( + D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type, + _In_reads_bytes_(DataSize) const void *pData, + UINT DataSize) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDebugParameter( + D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type, + _Out_writes_bytes_(DataSize) void *pData, + UINT DataSize) = 0; + + virtual HRESULT STDMETHODCALLTYPE ReportLiveDeviceObjects( + D3D12_RLDO_FLAGS Flags) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DebugDevice1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DebugDevice1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DebugDevice1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DebugDevice1 * This); + + DECLSPEC_XFGVIRT(ID3D12DebugDevice1, SetDebugParameter) + HRESULT ( STDMETHODCALLTYPE *SetDebugParameter )( + ID3D12DebugDevice1 * This, + D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type, + _In_reads_bytes_(DataSize) const void *pData, + UINT DataSize); + + DECLSPEC_XFGVIRT(ID3D12DebugDevice1, GetDebugParameter) + HRESULT ( STDMETHODCALLTYPE *GetDebugParameter )( + ID3D12DebugDevice1 * This, + D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type, + _Out_writes_bytes_(DataSize) void *pData, + UINT DataSize); + + DECLSPEC_XFGVIRT(ID3D12DebugDevice1, ReportLiveDeviceObjects) + HRESULT ( STDMETHODCALLTYPE *ReportLiveDeviceObjects )( + ID3D12DebugDevice1 * This, + D3D12_RLDO_FLAGS Flags); + + END_INTERFACE + } ID3D12DebugDevice1Vtbl; + + interface ID3D12DebugDevice1 + { + CONST_VTBL struct ID3D12DebugDevice1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DebugDevice1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DebugDevice1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DebugDevice1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DebugDevice1_SetDebugParameter(This,Type,pData,DataSize) \ + ( (This)->lpVtbl -> SetDebugParameter(This,Type,pData,DataSize) ) + +#define ID3D12DebugDevice1_GetDebugParameter(This,Type,pData,DataSize) \ + ( (This)->lpVtbl -> GetDebugParameter(This,Type,pData,DataSize) ) + +#define ID3D12DebugDevice1_ReportLiveDeviceObjects(This,Flags) \ + ( (This)->lpVtbl -> ReportLiveDeviceObjects(This,Flags) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DebugDevice1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DebugDevice_INTERFACE_DEFINED__ +#define __ID3D12DebugDevice_INTERFACE_DEFINED__ + +/* interface ID3D12DebugDevice */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DebugDevice; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3febd6dd-4973-4787-8194-e45f9e28923e") + ID3D12DebugDevice : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetFeatureMask( + D3D12_DEBUG_FEATURE Mask) = 0; + + virtual D3D12_DEBUG_FEATURE STDMETHODCALLTYPE GetFeatureMask( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE ReportLiveDeviceObjects( + D3D12_RLDO_FLAGS Flags) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DebugDeviceVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DebugDevice * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DebugDevice * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DebugDevice * This); + + DECLSPEC_XFGVIRT(ID3D12DebugDevice, SetFeatureMask) + HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )( + ID3D12DebugDevice * This, + D3D12_DEBUG_FEATURE Mask); + + DECLSPEC_XFGVIRT(ID3D12DebugDevice, GetFeatureMask) + D3D12_DEBUG_FEATURE ( STDMETHODCALLTYPE *GetFeatureMask )( + ID3D12DebugDevice * This); + + DECLSPEC_XFGVIRT(ID3D12DebugDevice, ReportLiveDeviceObjects) + HRESULT ( STDMETHODCALLTYPE *ReportLiveDeviceObjects )( + ID3D12DebugDevice * This, + D3D12_RLDO_FLAGS Flags); + + END_INTERFACE + } ID3D12DebugDeviceVtbl; + + interface ID3D12DebugDevice + { + CONST_VTBL struct ID3D12DebugDeviceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DebugDevice_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DebugDevice_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DebugDevice_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DebugDevice_SetFeatureMask(This,Mask) \ + ( (This)->lpVtbl -> SetFeatureMask(This,Mask) ) + +#define ID3D12DebugDevice_GetFeatureMask(This) \ + ( (This)->lpVtbl -> GetFeatureMask(This) ) + +#define ID3D12DebugDevice_ReportLiveDeviceObjects(This,Flags) \ + ( (This)->lpVtbl -> ReportLiveDeviceObjects(This,Flags) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DebugDevice_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DebugDevice2_INTERFACE_DEFINED__ +#define __ID3D12DebugDevice2_INTERFACE_DEFINED__ + +/* interface ID3D12DebugDevice2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DebugDevice2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("60eccbc1-378d-4df1-894c-f8ac5ce4d7dd") + ID3D12DebugDevice2 : public ID3D12DebugDevice + { + public: + virtual HRESULT STDMETHODCALLTYPE SetDebugParameter( + D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type, + _In_reads_bytes_(DataSize) const void *pData, + UINT DataSize) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDebugParameter( + D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type, + _Out_writes_bytes_(DataSize) void *pData, + UINT DataSize) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DebugDevice2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DebugDevice2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DebugDevice2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DebugDevice2 * This); + + DECLSPEC_XFGVIRT(ID3D12DebugDevice, SetFeatureMask) + HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )( + ID3D12DebugDevice2 * This, + D3D12_DEBUG_FEATURE Mask); + + DECLSPEC_XFGVIRT(ID3D12DebugDevice, GetFeatureMask) + D3D12_DEBUG_FEATURE ( STDMETHODCALLTYPE *GetFeatureMask )( + ID3D12DebugDevice2 * This); + + DECLSPEC_XFGVIRT(ID3D12DebugDevice, ReportLiveDeviceObjects) + HRESULT ( STDMETHODCALLTYPE *ReportLiveDeviceObjects )( + ID3D12DebugDevice2 * This, + D3D12_RLDO_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12DebugDevice2, SetDebugParameter) + HRESULT ( STDMETHODCALLTYPE *SetDebugParameter )( + ID3D12DebugDevice2 * This, + D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type, + _In_reads_bytes_(DataSize) const void *pData, + UINT DataSize); + + DECLSPEC_XFGVIRT(ID3D12DebugDevice2, GetDebugParameter) + HRESULT ( STDMETHODCALLTYPE *GetDebugParameter )( + ID3D12DebugDevice2 * This, + D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type, + _Out_writes_bytes_(DataSize) void *pData, + UINT DataSize); + + END_INTERFACE + } ID3D12DebugDevice2Vtbl; + + interface ID3D12DebugDevice2 + { + CONST_VTBL struct ID3D12DebugDevice2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DebugDevice2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DebugDevice2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DebugDevice2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DebugDevice2_SetFeatureMask(This,Mask) \ + ( (This)->lpVtbl -> SetFeatureMask(This,Mask) ) + +#define ID3D12DebugDevice2_GetFeatureMask(This) \ + ( (This)->lpVtbl -> GetFeatureMask(This) ) + +#define ID3D12DebugDevice2_ReportLiveDeviceObjects(This,Flags) \ + ( (This)->lpVtbl -> ReportLiveDeviceObjects(This,Flags) ) + + +#define ID3D12DebugDevice2_SetDebugParameter(This,Type,pData,DataSize) \ + ( (This)->lpVtbl -> SetDebugParameter(This,Type,pData,DataSize) ) + +#define ID3D12DebugDevice2_GetDebugParameter(This,Type,pData,DataSize) \ + ( (This)->lpVtbl -> GetDebugParameter(This,Type,pData,DataSize) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DebugDevice2_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12sdklayers_0000_0010 */ +/* [local] */ + +DEFINE_GUID(DXGI_DEBUG_D3D12, 0xcf59a98c, 0xa950, 0x4326, 0x91, 0xef, 0x9b, 0xba, 0xa1, 0x7b, 0xfd, 0x95); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0010_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0010_v0_0_s_ifspec; + +#ifndef __ID3D12DebugCommandQueue_INTERFACE_DEFINED__ +#define __ID3D12DebugCommandQueue_INTERFACE_DEFINED__ + +/* interface ID3D12DebugCommandQueue */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DebugCommandQueue; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("09e0bf36-54ac-484f-8847-4baeeab6053a") + ID3D12DebugCommandQueue : public IUnknown + { + public: + virtual BOOL STDMETHODCALLTYPE AssertResourceState( + _In_ ID3D12Resource *pResource, + UINT Subresource, + UINT State) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DebugCommandQueueVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DebugCommandQueue * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DebugCommandQueue * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DebugCommandQueue * This); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandQueue, AssertResourceState) + BOOL ( STDMETHODCALLTYPE *AssertResourceState )( + ID3D12DebugCommandQueue * This, + _In_ ID3D12Resource *pResource, + UINT Subresource, + UINT State); + + END_INTERFACE + } ID3D12DebugCommandQueueVtbl; + + interface ID3D12DebugCommandQueue + { + CONST_VTBL struct ID3D12DebugCommandQueueVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DebugCommandQueue_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DebugCommandQueue_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DebugCommandQueue_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DebugCommandQueue_AssertResourceState(This,pResource,Subresource,State) \ + ( (This)->lpVtbl -> AssertResourceState(This,pResource,Subresource,State) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DebugCommandQueue_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DebugCommandQueue1_INTERFACE_DEFINED__ +#define __ID3D12DebugCommandQueue1_INTERFACE_DEFINED__ + +/* interface ID3D12DebugCommandQueue1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DebugCommandQueue1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("16be35a2-bfd6-49f2-bcae-eaae4aff862d") + ID3D12DebugCommandQueue1 : public ID3D12DebugCommandQueue + { + public: + virtual void STDMETHODCALLTYPE AssertResourceAccess( + _In_ ID3D12Resource *pResource, + UINT Subresource, + D3D12_BARRIER_ACCESS Access) = 0; + + virtual void STDMETHODCALLTYPE AssertTextureLayout( + _In_ ID3D12Resource *pResource, + UINT Subresource, + D3D12_BARRIER_LAYOUT Layout) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DebugCommandQueue1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DebugCommandQueue1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DebugCommandQueue1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DebugCommandQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandQueue, AssertResourceState) + BOOL ( STDMETHODCALLTYPE *AssertResourceState )( + ID3D12DebugCommandQueue1 * This, + _In_ ID3D12Resource *pResource, + UINT Subresource, + UINT State); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandQueue1, AssertResourceAccess) + void ( STDMETHODCALLTYPE *AssertResourceAccess )( + ID3D12DebugCommandQueue1 * This, + _In_ ID3D12Resource *pResource, + UINT Subresource, + D3D12_BARRIER_ACCESS Access); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandQueue1, AssertTextureLayout) + void ( STDMETHODCALLTYPE *AssertTextureLayout )( + ID3D12DebugCommandQueue1 * This, + _In_ ID3D12Resource *pResource, + UINT Subresource, + D3D12_BARRIER_LAYOUT Layout); + + END_INTERFACE + } ID3D12DebugCommandQueue1Vtbl; + + interface ID3D12DebugCommandQueue1 + { + CONST_VTBL struct ID3D12DebugCommandQueue1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DebugCommandQueue1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DebugCommandQueue1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DebugCommandQueue1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DebugCommandQueue1_AssertResourceState(This,pResource,Subresource,State) \ + ( (This)->lpVtbl -> AssertResourceState(This,pResource,Subresource,State) ) + + +#define ID3D12DebugCommandQueue1_AssertResourceAccess(This,pResource,Subresource,Access) \ + ( (This)->lpVtbl -> AssertResourceAccess(This,pResource,Subresource,Access) ) + +#define ID3D12DebugCommandQueue1_AssertTextureLayout(This,pResource,Subresource,Layout) \ + ( (This)->lpVtbl -> AssertTextureLayout(This,pResource,Subresource,Layout) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DebugCommandQueue1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12sdklayers_0000_0012 */ +/* [local] */ + +typedef +enum D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE + { + D3D12_DEBUG_COMMAND_LIST_PARAMETER_GPU_BASED_VALIDATION_SETTINGS = 0 + } D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE; + +typedef struct D3D12_DEBUG_COMMAND_LIST_GPU_BASED_VALIDATION_SETTINGS + { + D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE ShaderPatchMode; + } D3D12_DEBUG_COMMAND_LIST_GPU_BASED_VALIDATION_SETTINGS; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0012_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0012_v0_0_s_ifspec; + +#ifndef __ID3D12DebugCommandList1_INTERFACE_DEFINED__ +#define __ID3D12DebugCommandList1_INTERFACE_DEFINED__ + +/* interface ID3D12DebugCommandList1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DebugCommandList1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("102ca951-311b-4b01-b11f-ecb83e061b37") + ID3D12DebugCommandList1 : public IUnknown + { + public: + virtual BOOL STDMETHODCALLTYPE AssertResourceState( + _In_ ID3D12Resource *pResource, + UINT Subresource, + UINT State) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetDebugParameter( + D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type, + _In_reads_bytes_(DataSize) const void *pData, + UINT DataSize) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDebugParameter( + D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type, + _Out_writes_bytes_(DataSize) void *pData, + UINT DataSize) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DebugCommandList1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DebugCommandList1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DebugCommandList1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DebugCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList1, AssertResourceState) + BOOL ( STDMETHODCALLTYPE *AssertResourceState )( + ID3D12DebugCommandList1 * This, + _In_ ID3D12Resource *pResource, + UINT Subresource, + UINT State); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList1, SetDebugParameter) + HRESULT ( STDMETHODCALLTYPE *SetDebugParameter )( + ID3D12DebugCommandList1 * This, + D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type, + _In_reads_bytes_(DataSize) const void *pData, + UINT DataSize); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList1, GetDebugParameter) + HRESULT ( STDMETHODCALLTYPE *GetDebugParameter )( + ID3D12DebugCommandList1 * This, + D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type, + _Out_writes_bytes_(DataSize) void *pData, + UINT DataSize); + + END_INTERFACE + } ID3D12DebugCommandList1Vtbl; + + interface ID3D12DebugCommandList1 + { + CONST_VTBL struct ID3D12DebugCommandList1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DebugCommandList1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DebugCommandList1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DebugCommandList1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DebugCommandList1_AssertResourceState(This,pResource,Subresource,State) \ + ( (This)->lpVtbl -> AssertResourceState(This,pResource,Subresource,State) ) + +#define ID3D12DebugCommandList1_SetDebugParameter(This,Type,pData,DataSize) \ + ( (This)->lpVtbl -> SetDebugParameter(This,Type,pData,DataSize) ) + +#define ID3D12DebugCommandList1_GetDebugParameter(This,Type,pData,DataSize) \ + ( (This)->lpVtbl -> GetDebugParameter(This,Type,pData,DataSize) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DebugCommandList1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DebugCommandList_INTERFACE_DEFINED__ +#define __ID3D12DebugCommandList_INTERFACE_DEFINED__ + +/* interface ID3D12DebugCommandList */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DebugCommandList; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("09e0bf36-54ac-484f-8847-4baeeab6053f") + ID3D12DebugCommandList : public IUnknown + { + public: + virtual BOOL STDMETHODCALLTYPE AssertResourceState( + _In_ ID3D12Resource *pResource, + UINT Subresource, + UINT State) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetFeatureMask( + D3D12_DEBUG_FEATURE Mask) = 0; + + virtual D3D12_DEBUG_FEATURE STDMETHODCALLTYPE GetFeatureMask( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DebugCommandListVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DebugCommandList * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DebugCommandList * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DebugCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList, AssertResourceState) + BOOL ( STDMETHODCALLTYPE *AssertResourceState )( + ID3D12DebugCommandList * This, + _In_ ID3D12Resource *pResource, + UINT Subresource, + UINT State); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList, SetFeatureMask) + HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )( + ID3D12DebugCommandList * This, + D3D12_DEBUG_FEATURE Mask); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList, GetFeatureMask) + D3D12_DEBUG_FEATURE ( STDMETHODCALLTYPE *GetFeatureMask )( + ID3D12DebugCommandList * This); + + END_INTERFACE + } ID3D12DebugCommandListVtbl; + + interface ID3D12DebugCommandList + { + CONST_VTBL struct ID3D12DebugCommandListVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DebugCommandList_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DebugCommandList_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DebugCommandList_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DebugCommandList_AssertResourceState(This,pResource,Subresource,State) \ + ( (This)->lpVtbl -> AssertResourceState(This,pResource,Subresource,State) ) + +#define ID3D12DebugCommandList_SetFeatureMask(This,Mask) \ + ( (This)->lpVtbl -> SetFeatureMask(This,Mask) ) + +#define ID3D12DebugCommandList_GetFeatureMask(This) \ + ( (This)->lpVtbl -> GetFeatureMask(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DebugCommandList_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DebugCommandList2_INTERFACE_DEFINED__ +#define __ID3D12DebugCommandList2_INTERFACE_DEFINED__ + +/* interface ID3D12DebugCommandList2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DebugCommandList2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("aeb575cf-4e06-48be-ba3b-c450fc96652e") + ID3D12DebugCommandList2 : public ID3D12DebugCommandList + { + public: + virtual HRESULT STDMETHODCALLTYPE SetDebugParameter( + D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type, + _In_reads_bytes_(DataSize) const void *pData, + UINT DataSize) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDebugParameter( + D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type, + _Out_writes_bytes_(DataSize) void *pData, + UINT DataSize) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DebugCommandList2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DebugCommandList2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DebugCommandList2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DebugCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList, AssertResourceState) + BOOL ( STDMETHODCALLTYPE *AssertResourceState )( + ID3D12DebugCommandList2 * This, + _In_ ID3D12Resource *pResource, + UINT Subresource, + UINT State); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList, SetFeatureMask) + HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )( + ID3D12DebugCommandList2 * This, + D3D12_DEBUG_FEATURE Mask); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList, GetFeatureMask) + D3D12_DEBUG_FEATURE ( STDMETHODCALLTYPE *GetFeatureMask )( + ID3D12DebugCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList2, SetDebugParameter) + HRESULT ( STDMETHODCALLTYPE *SetDebugParameter )( + ID3D12DebugCommandList2 * This, + D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type, + _In_reads_bytes_(DataSize) const void *pData, + UINT DataSize); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList2, GetDebugParameter) + HRESULT ( STDMETHODCALLTYPE *GetDebugParameter )( + ID3D12DebugCommandList2 * This, + D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type, + _Out_writes_bytes_(DataSize) void *pData, + UINT DataSize); + + END_INTERFACE + } ID3D12DebugCommandList2Vtbl; + + interface ID3D12DebugCommandList2 + { + CONST_VTBL struct ID3D12DebugCommandList2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DebugCommandList2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DebugCommandList2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DebugCommandList2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DebugCommandList2_AssertResourceState(This,pResource,Subresource,State) \ + ( (This)->lpVtbl -> AssertResourceState(This,pResource,Subresource,State) ) + +#define ID3D12DebugCommandList2_SetFeatureMask(This,Mask) \ + ( (This)->lpVtbl -> SetFeatureMask(This,Mask) ) + +#define ID3D12DebugCommandList2_GetFeatureMask(This) \ + ( (This)->lpVtbl -> GetFeatureMask(This) ) + + +#define ID3D12DebugCommandList2_SetDebugParameter(This,Type,pData,DataSize) \ + ( (This)->lpVtbl -> SetDebugParameter(This,Type,pData,DataSize) ) + +#define ID3D12DebugCommandList2_GetDebugParameter(This,Type,pData,DataSize) \ + ( (This)->lpVtbl -> GetDebugParameter(This,Type,pData,DataSize) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DebugCommandList2_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DebugCommandList3_INTERFACE_DEFINED__ +#define __ID3D12DebugCommandList3_INTERFACE_DEFINED__ + +/* interface ID3D12DebugCommandList3 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DebugCommandList3; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("197d5e15-4d37-4d34-af78-724cd70fdb1f") + ID3D12DebugCommandList3 : public ID3D12DebugCommandList2 + { + public: + virtual void STDMETHODCALLTYPE AssertResourceAccess( + _In_ ID3D12Resource *pResource, + UINT Subresource, + D3D12_BARRIER_ACCESS Access) = 0; + + virtual void STDMETHODCALLTYPE AssertTextureLayout( + _In_ ID3D12Resource *pResource, + UINT Subresource, + D3D12_BARRIER_LAYOUT Layout) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DebugCommandList3Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DebugCommandList3 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DebugCommandList3 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DebugCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList, AssertResourceState) + BOOL ( STDMETHODCALLTYPE *AssertResourceState )( + ID3D12DebugCommandList3 * This, + _In_ ID3D12Resource *pResource, + UINT Subresource, + UINT State); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList, SetFeatureMask) + HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )( + ID3D12DebugCommandList3 * This, + D3D12_DEBUG_FEATURE Mask); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList, GetFeatureMask) + D3D12_DEBUG_FEATURE ( STDMETHODCALLTYPE *GetFeatureMask )( + ID3D12DebugCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList2, SetDebugParameter) + HRESULT ( STDMETHODCALLTYPE *SetDebugParameter )( + ID3D12DebugCommandList3 * This, + D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type, + _In_reads_bytes_(DataSize) const void *pData, + UINT DataSize); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList2, GetDebugParameter) + HRESULT ( STDMETHODCALLTYPE *GetDebugParameter )( + ID3D12DebugCommandList3 * This, + D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type, + _Out_writes_bytes_(DataSize) void *pData, + UINT DataSize); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList3, AssertResourceAccess) + void ( STDMETHODCALLTYPE *AssertResourceAccess )( + ID3D12DebugCommandList3 * This, + _In_ ID3D12Resource *pResource, + UINT Subresource, + D3D12_BARRIER_ACCESS Access); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList3, AssertTextureLayout) + void ( STDMETHODCALLTYPE *AssertTextureLayout )( + ID3D12DebugCommandList3 * This, + _In_ ID3D12Resource *pResource, + UINT Subresource, + D3D12_BARRIER_LAYOUT Layout); + + END_INTERFACE + } ID3D12DebugCommandList3Vtbl; + + interface ID3D12DebugCommandList3 + { + CONST_VTBL struct ID3D12DebugCommandList3Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DebugCommandList3_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DebugCommandList3_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DebugCommandList3_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DebugCommandList3_AssertResourceState(This,pResource,Subresource,State) \ + ( (This)->lpVtbl -> AssertResourceState(This,pResource,Subresource,State) ) + +#define ID3D12DebugCommandList3_SetFeatureMask(This,Mask) \ + ( (This)->lpVtbl -> SetFeatureMask(This,Mask) ) + +#define ID3D12DebugCommandList3_GetFeatureMask(This) \ + ( (This)->lpVtbl -> GetFeatureMask(This) ) + + +#define ID3D12DebugCommandList3_SetDebugParameter(This,Type,pData,DataSize) \ + ( (This)->lpVtbl -> SetDebugParameter(This,Type,pData,DataSize) ) + +#define ID3D12DebugCommandList3_GetDebugParameter(This,Type,pData,DataSize) \ + ( (This)->lpVtbl -> GetDebugParameter(This,Type,pData,DataSize) ) + + +#define ID3D12DebugCommandList3_AssertResourceAccess(This,pResource,Subresource,Access) \ + ( (This)->lpVtbl -> AssertResourceAccess(This,pResource,Subresource,Access) ) + +#define ID3D12DebugCommandList3_AssertTextureLayout(This,pResource,Subresource,Layout) \ + ( (This)->lpVtbl -> AssertTextureLayout(This,pResource,Subresource,Layout) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DebugCommandList3_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12SharingContract_INTERFACE_DEFINED__ +#define __ID3D12SharingContract_INTERFACE_DEFINED__ + +/* interface ID3D12SharingContract */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12SharingContract; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0adf7d52-929c-4e61-addb-ffed30de66ef") + ID3D12SharingContract : public IUnknown + { + public: + virtual void STDMETHODCALLTYPE Present( + _In_ ID3D12Resource *pResource, + UINT Subresource, + _In_ HWND window) = 0; + + virtual void STDMETHODCALLTYPE SharedFenceSignal( + _In_ ID3D12Fence *pFence, + UINT64 FenceValue) = 0; + + virtual void STDMETHODCALLTYPE BeginCapturableWork( + _In_ REFGUID guid) = 0; + + virtual void STDMETHODCALLTYPE EndCapturableWork( + _In_ REFGUID guid) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12SharingContractVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12SharingContract * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12SharingContract * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12SharingContract * This); + + DECLSPEC_XFGVIRT(ID3D12SharingContract, Present) + void ( STDMETHODCALLTYPE *Present )( + ID3D12SharingContract * This, + _In_ ID3D12Resource *pResource, + UINT Subresource, + _In_ HWND window); + + DECLSPEC_XFGVIRT(ID3D12SharingContract, SharedFenceSignal) + void ( STDMETHODCALLTYPE *SharedFenceSignal )( + ID3D12SharingContract * This, + _In_ ID3D12Fence *pFence, + UINT64 FenceValue); + + DECLSPEC_XFGVIRT(ID3D12SharingContract, BeginCapturableWork) + void ( STDMETHODCALLTYPE *BeginCapturableWork )( + ID3D12SharingContract * This, + _In_ REFGUID guid); + + DECLSPEC_XFGVIRT(ID3D12SharingContract, EndCapturableWork) + void ( STDMETHODCALLTYPE *EndCapturableWork )( + ID3D12SharingContract * This, + _In_ REFGUID guid); + + END_INTERFACE + } ID3D12SharingContractVtbl; + + interface ID3D12SharingContract + { + CONST_VTBL struct ID3D12SharingContractVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12SharingContract_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12SharingContract_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12SharingContract_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12SharingContract_Present(This,pResource,Subresource,window) \ + ( (This)->lpVtbl -> Present(This,pResource,Subresource,window) ) + +#define ID3D12SharingContract_SharedFenceSignal(This,pFence,FenceValue) \ + ( (This)->lpVtbl -> SharedFenceSignal(This,pFence,FenceValue) ) + +#define ID3D12SharingContract_BeginCapturableWork(This,guid) \ + ( (This)->lpVtbl -> BeginCapturableWork(This,guid) ) + +#define ID3D12SharingContract_EndCapturableWork(This,guid) \ + ( (This)->lpVtbl -> EndCapturableWork(This,guid) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12SharingContract_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12sdklayers_0000_0017 */ +/* [local] */ + +typedef +enum D3D12_MESSAGE_CATEGORY + { + D3D12_MESSAGE_CATEGORY_APPLICATION_DEFINED = 0, + D3D12_MESSAGE_CATEGORY_MISCELLANEOUS = ( D3D12_MESSAGE_CATEGORY_APPLICATION_DEFINED + 1 ) , + D3D12_MESSAGE_CATEGORY_INITIALIZATION = ( D3D12_MESSAGE_CATEGORY_MISCELLANEOUS + 1 ) , + D3D12_MESSAGE_CATEGORY_CLEANUP = ( D3D12_MESSAGE_CATEGORY_INITIALIZATION + 1 ) , + D3D12_MESSAGE_CATEGORY_COMPILATION = ( D3D12_MESSAGE_CATEGORY_CLEANUP + 1 ) , + D3D12_MESSAGE_CATEGORY_STATE_CREATION = ( D3D12_MESSAGE_CATEGORY_COMPILATION + 1 ) , + D3D12_MESSAGE_CATEGORY_STATE_SETTING = ( D3D12_MESSAGE_CATEGORY_STATE_CREATION + 1 ) , + D3D12_MESSAGE_CATEGORY_STATE_GETTING = ( D3D12_MESSAGE_CATEGORY_STATE_SETTING + 1 ) , + D3D12_MESSAGE_CATEGORY_RESOURCE_MANIPULATION = ( D3D12_MESSAGE_CATEGORY_STATE_GETTING + 1 ) , + D3D12_MESSAGE_CATEGORY_EXECUTION = ( D3D12_MESSAGE_CATEGORY_RESOURCE_MANIPULATION + 1 ) , + D3D12_MESSAGE_CATEGORY_SHADER = ( D3D12_MESSAGE_CATEGORY_EXECUTION + 1 ) + } D3D12_MESSAGE_CATEGORY; + +typedef +enum D3D12_MESSAGE_SEVERITY + { + D3D12_MESSAGE_SEVERITY_CORRUPTION = 0, + D3D12_MESSAGE_SEVERITY_ERROR = ( D3D12_MESSAGE_SEVERITY_CORRUPTION + 1 ) , + D3D12_MESSAGE_SEVERITY_WARNING = ( D3D12_MESSAGE_SEVERITY_ERROR + 1 ) , + D3D12_MESSAGE_SEVERITY_INFO = ( D3D12_MESSAGE_SEVERITY_WARNING + 1 ) , + D3D12_MESSAGE_SEVERITY_MESSAGE = ( D3D12_MESSAGE_SEVERITY_INFO + 1 ) + } D3D12_MESSAGE_SEVERITY; + +typedef +enum D3D12_MESSAGE_ID + { + D3D12_MESSAGE_ID_UNKNOWN = 0, + D3D12_MESSAGE_ID_STRING_FROM_APPLICATION = 1, + D3D12_MESSAGE_ID_CORRUPTED_THIS = 2, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER1 = 3, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER2 = 4, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER3 = 5, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER4 = 6, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER5 = 7, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER6 = 8, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER7 = 9, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER8 = 10, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER9 = 11, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER10 = 12, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER11 = 13, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER12 = 14, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER13 = 15, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER14 = 16, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER15 = 17, + D3D12_MESSAGE_ID_CORRUPTED_MULTITHREADING = 18, + D3D12_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY = 19, + D3D12_MESSAGE_ID_GETPRIVATEDATA_MOREDATA = 20, + D3D12_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA = 21, + D3D12_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS = 24, + D3D12_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY = 25, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT = 26, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC = 27, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT = 28, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDVIDEOPLANESLICE = 29, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDPLANESLICE = 30, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS = 31, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE = 32, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT = 35, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT = 36, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC = 37, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT = 38, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDVIDEOPLANESLICE = 39, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDPLANESLICE = 40, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS = 41, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE = 42, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT = 45, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC = 46, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT = 47, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS = 48, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE = 49, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY = 52, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS = 53, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT = 54, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT = 55, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT = 56, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS = 57, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH = 58, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE = 59, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE = 60, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT = 61, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC = 62, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE = 63, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC = 64, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT = 65, + D3D12_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY = 66, + D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE = 67, + D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE = 68, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY = 69, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE = 70, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE = 71, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY = 72, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE = 73, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE = 74, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES = 75, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED = 76, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED = 79, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT = 80, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT = 81, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT = 82, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT = 83, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION = 84, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT = 85, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE = 86, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC = 87, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH = 88, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS = 89, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX = 90, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE = 91, + D3D12_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY = 92, + D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE = 93, + D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE = 94, + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE = 95, + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE = 96, + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP = 97, + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS = 98, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK = 100, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC = 101, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP = 102, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP = 103, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP = 104, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC = 105, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP = 106, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP = 107, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP = 108, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC = 109, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND = 111, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND = 112, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP = 113, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA = 114, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA = 115, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA = 116, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK = 117, + D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID = 135, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ROOT_SIGNATURE_NOT_SET = 200, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ROOT_SIGNATURE_MISMATCH = 201, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_NOT_SET = 202, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL = 209, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_TOO_SMALL = 210, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_NOT_SET = 211, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_FORMAT_INVALID = 212, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_TOO_SMALL = 213, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INVALID_PRIMITIVETOPOLOGY = 219, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_STRIDE_UNALIGNED = 221, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_OFFSET_UNALIGNED = 222, + D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT = 232, + D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT = 233, + D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT = 234, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC = 239, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC = 240, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH = 245, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT = 253, + D3D12_MESSAGE_ID_LIVE_OBJECT_SUMMARY = 255, + D3D12_MESSAGE_ID_LIVE_DEVICE = 274, + D3D12_MESSAGE_ID_LIVE_SWAPCHAIN = 275, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFLAGS = 276, + D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDCLASSLINKAGE = 277, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDCLASSLINKAGE = 278, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAMTORASTERIZER = 280, + D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDCLASSLINKAGE = 283, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAM = 284, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDENTRIES = 285, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTRIDES = 286, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTRIDES = 287, + D3D12_MESSAGE_ID_CREATEHULLSHADER_OUTOFMEMORY = 289, + D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERBYTECODE = 290, + D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERTYPE = 291, + D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDCLASSLINKAGE = 292, + D3D12_MESSAGE_ID_CREATEDOMAINSHADER_OUTOFMEMORY = 294, + D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERBYTECODE = 295, + D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERTYPE = 296, + D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCLASSLINKAGE = 297, + D3D12_MESSAGE_ID_RESOURCE_UNMAP_NOTMAPPED = 310, + D3D12_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_MISMATCHED_DATA_SIZE = 318, + D3D12_MESSAGE_ID_CREATECOMPUTESHADER_OUTOFMEMORY = 321, + D3D12_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERBYTECODE = 322, + D3D12_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCLASSLINKAGE = 323, + D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEFLOATOPSNOTSUPPORTED = 331, + D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEFLOATOPSNOTSUPPORTED = 332, + D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEFLOATOPSNOTSUPPORTED = 333, + D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEFLOATOPSNOTSUPPORTED = 334, + D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEFLOATOPSNOTSUPPORTED = 335, + D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEFLOATOPSNOTSUPPORTED = 336, + D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEFLOATOPSNOTSUPPORTED = 337, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDRESOURCE = 340, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDESC = 341, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFORMAT = 342, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDVIDEOPLANESLICE = 343, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDPLANESLICE = 344, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDIMENSIONS = 345, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_UNRECOGNIZEDFORMAT = 346, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFLAGS = 354, + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFORCEDSAMPLECOUNT = 401, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDLOGICOPS = 403, + D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 410, + D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 412, + D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 414, + D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 416, + D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEEXTENSIONSNOTSUPPORTED = 418, + D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 420, + D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 422, + D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_UAVSNOTSUPPORTED = 425, + D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_UAVSNOTSUPPORTED = 426, + D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_UAVSNOTSUPPORTED = 427, + D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_UAVSNOTSUPPORTED = 428, + D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UAVSNOTSUPPORTED = 429, + D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_UAVSNOTSUPPORTED = 430, + D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_UAVSNOTSUPPORTED = 431, + D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDSOURCERECT = 447, + D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_EMPTYRECT = 448, + D3D12_MESSAGE_ID_UPDATETILEMAPPINGS_INVALID_PARAMETER = 493, + D3D12_MESSAGE_ID_COPYTILEMAPPINGS_INVALID_PARAMETER = 494, + D3D12_MESSAGE_ID_CREATEDEVICE_INVALIDARGS = 506, + D3D12_MESSAGE_ID_CREATEDEVICE_WARNING = 507, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_TYPE = 519, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_NULL_POINTER = 520, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_SUBRESOURCE = 521, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_RESERVED_BITS = 522, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISSING_BIND_FLAGS = 523, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_MISC_FLAGS = 524, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_MATCHING_STATES = 525, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMBINATION = 526, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_BEFORE_AFTER_MISMATCH = 527, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_RESOURCE = 528, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_SAMPLE_COUNT = 529, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAGS = 530, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMBINED_FLAGS = 531, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAGS_FOR_FORMAT = 532, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_SPLIT_BARRIER = 533, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_UNMATCHED_END = 534, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_UNMATCHED_BEGIN = 535, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAG = 536, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMMAND_LIST_TYPE = 537, + D3D12_MESSAGE_ID_INVALID_SUBRESOURCE_STATE = 538, + D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_CONTENTION = 540, + D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_RESET = 541, + D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_RESET_BUNDLE = 542, + D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_CANNOT_RESET = 543, + D3D12_MESSAGE_ID_COMMAND_LIST_OPEN = 544, + D3D12_MESSAGE_ID_INVALID_BUNDLE_API = 546, + D3D12_MESSAGE_ID_COMMAND_LIST_CLOSED = 547, + D3D12_MESSAGE_ID_WRONG_COMMAND_ALLOCATOR_TYPE = 549, + D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_SYNC = 552, + D3D12_MESSAGE_ID_COMMAND_LIST_SYNC = 553, + D3D12_MESSAGE_ID_SET_DESCRIPTOR_HEAP_INVALID = 554, + D3D12_MESSAGE_ID_CREATE_COMMANDQUEUE = 557, + D3D12_MESSAGE_ID_CREATE_COMMANDALLOCATOR = 558, + D3D12_MESSAGE_ID_CREATE_PIPELINESTATE = 559, + D3D12_MESSAGE_ID_CREATE_COMMANDLIST12 = 560, + D3D12_MESSAGE_ID_CREATE_RESOURCE = 562, + D3D12_MESSAGE_ID_CREATE_DESCRIPTORHEAP = 563, + D3D12_MESSAGE_ID_CREATE_ROOTSIGNATURE = 564, + D3D12_MESSAGE_ID_CREATE_LIBRARY = 565, + D3D12_MESSAGE_ID_CREATE_HEAP = 566, + D3D12_MESSAGE_ID_CREATE_MONITOREDFENCE = 567, + D3D12_MESSAGE_ID_CREATE_QUERYHEAP = 568, + D3D12_MESSAGE_ID_CREATE_COMMANDSIGNATURE = 569, + D3D12_MESSAGE_ID_LIVE_COMMANDQUEUE = 570, + D3D12_MESSAGE_ID_LIVE_COMMANDALLOCATOR = 571, + D3D12_MESSAGE_ID_LIVE_PIPELINESTATE = 572, + D3D12_MESSAGE_ID_LIVE_COMMANDLIST12 = 573, + D3D12_MESSAGE_ID_LIVE_RESOURCE = 575, + D3D12_MESSAGE_ID_LIVE_DESCRIPTORHEAP = 576, + D3D12_MESSAGE_ID_LIVE_ROOTSIGNATURE = 577, + D3D12_MESSAGE_ID_LIVE_LIBRARY = 578, + D3D12_MESSAGE_ID_LIVE_HEAP = 579, + D3D12_MESSAGE_ID_LIVE_MONITOREDFENCE = 580, + D3D12_MESSAGE_ID_LIVE_QUERYHEAP = 581, + D3D12_MESSAGE_ID_LIVE_COMMANDSIGNATURE = 582, + D3D12_MESSAGE_ID_DESTROY_COMMANDQUEUE = 583, + D3D12_MESSAGE_ID_DESTROY_COMMANDALLOCATOR = 584, + D3D12_MESSAGE_ID_DESTROY_PIPELINESTATE = 585, + D3D12_MESSAGE_ID_DESTROY_COMMANDLIST12 = 586, + D3D12_MESSAGE_ID_DESTROY_RESOURCE = 588, + D3D12_MESSAGE_ID_DESTROY_DESCRIPTORHEAP = 589, + D3D12_MESSAGE_ID_DESTROY_ROOTSIGNATURE = 590, + D3D12_MESSAGE_ID_DESTROY_LIBRARY = 591, + D3D12_MESSAGE_ID_DESTROY_HEAP = 592, + D3D12_MESSAGE_ID_DESTROY_MONITOREDFENCE = 593, + D3D12_MESSAGE_ID_DESTROY_QUERYHEAP = 594, + D3D12_MESSAGE_ID_DESTROY_COMMANDSIGNATURE = 595, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDIMENSIONS = 597, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDMISCFLAGS = 599, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDARG_RETURN = 602, + D3D12_MESSAGE_ID_CREATERESOURCE_OUTOFMEMORY_RETURN = 603, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDESC = 604, + D3D12_MESSAGE_ID_POSSIBLY_INVALID_SUBRESOURCE_STATE = 607, + D3D12_MESSAGE_ID_INVALID_USE_OF_NON_RESIDENT_RESOURCE = 608, + D3D12_MESSAGE_ID_POSSIBLE_INVALID_USE_OF_NON_RESIDENT_RESOURCE = 609, + D3D12_MESSAGE_ID_BUNDLE_PIPELINE_STATE_MISMATCH = 610, + D3D12_MESSAGE_ID_PRIMITIVE_TOPOLOGY_MISMATCH_PIPELINE_STATE = 611, + D3D12_MESSAGE_ID_RENDER_TARGET_FORMAT_MISMATCH_PIPELINE_STATE = 613, + D3D12_MESSAGE_ID_RENDER_TARGET_SAMPLE_DESC_MISMATCH_PIPELINE_STATE = 614, + D3D12_MESSAGE_ID_DEPTH_STENCIL_FORMAT_MISMATCH_PIPELINE_STATE = 615, + D3D12_MESSAGE_ID_DEPTH_STENCIL_SAMPLE_DESC_MISMATCH_PIPELINE_STATE = 616, + D3D12_MESSAGE_ID_CREATESHADER_INVALIDBYTECODE = 622, + D3D12_MESSAGE_ID_CREATEHEAP_NULLDESC = 623, + D3D12_MESSAGE_ID_CREATEHEAP_INVALIDSIZE = 624, + D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDHEAPTYPE = 625, + D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDCPUPAGEPROPERTIES = 626, + D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDMEMORYPOOL = 627, + D3D12_MESSAGE_ID_CREATEHEAP_INVALIDPROPERTIES = 628, + D3D12_MESSAGE_ID_CREATEHEAP_INVALIDALIGNMENT = 629, + D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDMISCFLAGS = 630, + D3D12_MESSAGE_ID_CREATEHEAP_INVALIDMISCFLAGS = 631, + D3D12_MESSAGE_ID_CREATEHEAP_INVALIDARG_RETURN = 632, + D3D12_MESSAGE_ID_CREATEHEAP_OUTOFMEMORY_RETURN = 633, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLHEAPPROPERTIES = 634, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDHEAPTYPE = 635, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDCPUPAGEPROPERTIES = 636, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDMEMORYPOOL = 637, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDHEAPPROPERTIES = 638, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDHEAPMISCFLAGS = 639, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDHEAPMISCFLAGS = 640, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDARG_RETURN = 641, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_OUTOFMEMORY_RETURN = 642, + D3D12_MESSAGE_ID_GETCUSTOMHEAPPROPERTIES_UNRECOGNIZEDHEAPTYPE = 643, + D3D12_MESSAGE_ID_GETCUSTOMHEAPPROPERTIES_INVALIDHEAPTYPE = 644, + D3D12_MESSAGE_ID_CREATE_DESCRIPTOR_HEAP_INVALID_DESC = 645, + D3D12_MESSAGE_ID_INVALID_DESCRIPTOR_HANDLE = 646, + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALID_CONSERVATIVERASTERMODE = 647, + D3D12_MESSAGE_ID_CREATE_CONSTANT_BUFFER_VIEW_INVALID_RESOURCE = 649, + D3D12_MESSAGE_ID_CREATE_CONSTANT_BUFFER_VIEW_INVALID_DESC = 650, + D3D12_MESSAGE_ID_CREATE_UNORDEREDACCESS_VIEW_INVALID_COUNTER_USAGE = 652, + D3D12_MESSAGE_ID_COPY_DESCRIPTORS_INVALID_RANGES = 653, + D3D12_MESSAGE_ID_COPY_DESCRIPTORS_WRITE_ONLY_DESCRIPTOR = 654, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RTV_FORMAT_NOT_UNKNOWN = 655, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_RENDER_TARGET_COUNT = 656, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_VERTEX_SHADER_NOT_SET = 657, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INPUTLAYOUT_NOT_SET = 658, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_HS_DS_SIGNATURE_MISMATCH = 659, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_REGISTERINDEX = 660, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_COMPONENTTYPE = 661, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_REGISTERMASK = 662, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_SYSTEMVALUE = 663, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS = 664, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_MINPRECISION = 665, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND = 666, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_XOR_DS_MISMATCH = 667, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HULL_SHADER_INPUT_TOPOLOGY_MISMATCH = 668, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_DS_CONTROL_POINT_COUNT_MISMATCH = 669, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_DS_TESSELLATOR_DOMAIN_MISMATCH = 670, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN = 671, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_USE_OF_FORCED_SAMPLE_COUNT = 672, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_PRIMITIVETOPOLOGY = 673, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_SYSTEMVALUE = 674, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 = 675, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING = 676, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_OUTPUT_TYPE_MISMATCH = 677, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_RENDER_TARGET_DOES_NOT_SUPPORT_LOGIC_OPS = 678, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RENDERTARGETVIEW_NOT_SET = 679, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_DEPTHSTENCILVIEW_NOT_SET = 680, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_GS_INPUT_PRIMITIVE_MISMATCH = 681, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_POSITION_NOT_PRESENT = 682, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MISSING_ROOT_SIGNATURE_FLAGS = 683, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_INDEX_BUFFER_PROPERTIES = 684, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_SAMPLE_DESC = 685, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_ROOT_SIGNATURE_MISMATCH = 686, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_DS_ROOT_SIGNATURE_MISMATCH = 687, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_VS_ROOT_SIGNATURE_MISMATCH = 688, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_GS_ROOT_SIGNATURE_MISMATCH = 689, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_ROOT_SIGNATURE_MISMATCH = 690, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MISSING_ROOT_SIGNATURE = 691, + D3D12_MESSAGE_ID_EXECUTE_BUNDLE_OPEN_BUNDLE = 692, + D3D12_MESSAGE_ID_EXECUTE_BUNDLE_DESCRIPTOR_HEAP_MISMATCH = 693, + D3D12_MESSAGE_ID_EXECUTE_BUNDLE_TYPE = 694, + D3D12_MESSAGE_ID_DRAW_EMPTY_SCISSOR_RECTANGLE = 695, + D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_BLOB_NOT_FOUND = 696, + D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_DESERIALIZE_FAILED = 697, + D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_INVALID_CONFIGURATION = 698, + D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_NOT_SUPPORTED_ON_DEVICE = 699, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLRESOURCEPROPERTIES = 700, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLHEAP = 701, + D3D12_MESSAGE_ID_GETRESOURCEALLOCATIONINFO_INVALIDRDESCS = 702, + D3D12_MESSAGE_ID_MAKERESIDENT_NULLOBJECTARRAY = 703, + D3D12_MESSAGE_ID_EVICT_NULLOBJECTARRAY = 705, + D3D12_MESSAGE_ID_SET_DESCRIPTOR_TABLE_INVALID = 708, + D3D12_MESSAGE_ID_SET_ROOT_CONSTANT_INVALID = 709, + D3D12_MESSAGE_ID_SET_ROOT_CONSTANT_BUFFER_VIEW_INVALID = 710, + D3D12_MESSAGE_ID_SET_ROOT_SHADER_RESOURCE_VIEW_INVALID = 711, + D3D12_MESSAGE_ID_SET_ROOT_UNORDERED_ACCESS_VIEW_INVALID = 712, + D3D12_MESSAGE_ID_SET_VERTEX_BUFFERS_INVALID_DESC = 713, + D3D12_MESSAGE_ID_SET_INDEX_BUFFER_INVALID_DESC = 715, + D3D12_MESSAGE_ID_SET_STREAM_OUTPUT_BUFFERS_INVALID_DESC = 717, + D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDDIMENSIONALITY = 718, + D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDLAYOUT = 719, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDIMENSIONALITY = 720, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDALIGNMENT = 721, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDMIPLEVELS = 722, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDSAMPLEDESC = 723, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDLAYOUT = 724, + D3D12_MESSAGE_ID_SET_INDEX_BUFFER_INVALID = 725, + D3D12_MESSAGE_ID_SET_VERTEX_BUFFERS_INVALID = 726, + D3D12_MESSAGE_ID_SET_STREAM_OUTPUT_BUFFERS_INVALID = 727, + D3D12_MESSAGE_ID_SET_RENDER_TARGETS_INVALID = 728, + D3D12_MESSAGE_ID_CREATEQUERY_HEAP_INVALID_PARAMETERS = 729, + D3D12_MESSAGE_ID_BEGIN_END_QUERY_INVALID_PARAMETERS = 731, + D3D12_MESSAGE_ID_CLOSE_COMMAND_LIST_OPEN_QUERY = 732, + D3D12_MESSAGE_ID_RESOLVE_QUERY_DATA_INVALID_PARAMETERS = 733, + D3D12_MESSAGE_ID_SET_PREDICATION_INVALID_PARAMETERS = 734, + D3D12_MESSAGE_ID_TIMESTAMPS_NOT_SUPPORTED = 735, + D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDFORMAT = 737, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDFORMAT = 738, + D3D12_MESSAGE_ID_GETCOPYABLEFOOTPRINTS_INVALIDSUBRESOURCERANGE = 739, + D3D12_MESSAGE_ID_GETCOPYABLEFOOTPRINTS_INVALIDBASEOFFSET = 740, + D3D12_MESSAGE_ID_GETCOPYABLELAYOUT_INVALIDSUBRESOURCERANGE = 739, + D3D12_MESSAGE_ID_GETCOPYABLELAYOUT_INVALIDBASEOFFSET = 740, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_HEAP = 741, + D3D12_MESSAGE_ID_CREATE_SAMPLER_INVALID = 742, + D3D12_MESSAGE_ID_CREATECOMMANDSIGNATURE_INVALID = 743, + D3D12_MESSAGE_ID_EXECUTE_INDIRECT_INVALID_PARAMETERS = 744, + D3D12_MESSAGE_ID_GETGPUVIRTUALADDRESS_INVALID_RESOURCE_DIMENSION = 745, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDCLEARVALUE = 815, + D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDCLEARVALUEFORMAT = 816, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDCLEARVALUEFORMAT = 817, + D3D12_MESSAGE_ID_CREATERESOURCE_CLEARVALUEDENORMFLUSH = 818, + D3D12_MESSAGE_ID_CLEARRENDERTARGETVIEW_MISMATCHINGCLEARVALUE = 820, + D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_MISMATCHINGCLEARVALUE = 821, + D3D12_MESSAGE_ID_MAP_INVALIDHEAP = 822, + D3D12_MESSAGE_ID_UNMAP_INVALIDHEAP = 823, + D3D12_MESSAGE_ID_MAP_INVALIDRESOURCE = 824, + D3D12_MESSAGE_ID_UNMAP_INVALIDRESOURCE = 825, + D3D12_MESSAGE_ID_MAP_INVALIDSUBRESOURCE = 826, + D3D12_MESSAGE_ID_UNMAP_INVALIDSUBRESOURCE = 827, + D3D12_MESSAGE_ID_MAP_INVALIDRANGE = 828, + D3D12_MESSAGE_ID_UNMAP_INVALIDRANGE = 829, + D3D12_MESSAGE_ID_MAP_INVALIDDATAPOINTER = 832, + D3D12_MESSAGE_ID_MAP_INVALIDARG_RETURN = 833, + D3D12_MESSAGE_ID_MAP_OUTOFMEMORY_RETURN = 834, + D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_BUNDLENOTSUPPORTED = 835, + D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_COMMANDLISTMISMATCH = 836, + D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_OPENCOMMANDLIST = 837, + D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_FAILEDCOMMANDLIST = 838, + D3D12_MESSAGE_ID_COPYBUFFERREGION_NULLDST = 839, + D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDDSTRESOURCEDIMENSION = 840, + D3D12_MESSAGE_ID_COPYBUFFERREGION_DSTRANGEOUTOFBOUNDS = 841, + D3D12_MESSAGE_ID_COPYBUFFERREGION_NULLSRC = 842, + D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDSRCRESOURCEDIMENSION = 843, + D3D12_MESSAGE_ID_COPYBUFFERREGION_SRCRANGEOUTOFBOUNDS = 844, + D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDCOPYFLAGS = 845, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_NULLDST = 846, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDDSTTYPE = 847, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTRESOURCEDIMENSION = 848, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTRESOURCE = 849, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTSUBRESOURCE = 850, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTOFFSET = 851, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDDSTFORMAT = 852, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTFORMAT = 853, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTDIMENSIONS = 854, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTROWPITCH = 855, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTPLACEMENT = 856, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTDSPLACEDFOOTPRINTFORMAT = 857, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_DSTREGIONOUTOFBOUNDS = 858, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_NULLSRC = 859, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDSRCTYPE = 860, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCRESOURCEDIMENSION = 861, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCRESOURCE = 862, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCSUBRESOURCE = 863, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCOFFSET = 864, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDSRCFORMAT = 865, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCFORMAT = 866, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCDIMENSIONS = 867, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCROWPITCH = 868, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCPLACEMENT = 869, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCDSPLACEDFOOTPRINTFORMAT = 870, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_SRCREGIONOUTOFBOUNDS = 871, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTCOORDINATES = 872, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCBOX = 873, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_FORMATMISMATCH = 874, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_EMPTYBOX = 875, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDCOPYFLAGS = 876, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_SUBRESOURCE_INDEX = 877, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_FORMAT = 878, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_RESOURCE_MISMATCH = 879, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_SAMPLE_COUNT = 880, + D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_INVALID_SHADER = 881, + D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_CS_ROOT_SIGNATURE_MISMATCH = 882, + D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_MISSING_ROOT_SIGNATURE = 883, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALIDCACHEDBLOB = 884, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBADAPTERMISMATCH = 885, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBDRIVERVERSIONMISMATCH = 886, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBDESCMISMATCH = 887, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBIGNORED = 888, + D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDHEAP = 889, + D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDRESOURCE = 890, + D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDBOX = 891, + D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDSUBRESOURCE = 892, + D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_EMPTYBOX = 893, + D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDHEAP = 894, + D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDRESOURCE = 895, + D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDBOX = 896, + D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDSUBRESOURCE = 897, + D3D12_MESSAGE_ID_READFROMSUBRESOURCE_EMPTYBOX = 898, + D3D12_MESSAGE_ID_TOO_MANY_NODES_SPECIFIED = 899, + D3D12_MESSAGE_ID_INVALID_NODE_INDEX = 900, + D3D12_MESSAGE_ID_GETHEAPPROPERTIES_INVALIDRESOURCE = 901, + D3D12_MESSAGE_ID_NODE_MASK_MISMATCH = 902, + D3D12_MESSAGE_ID_COMMAND_LIST_OUTOFMEMORY = 903, + D3D12_MESSAGE_ID_COMMAND_LIST_MULTIPLE_SWAPCHAIN_BUFFER_REFERENCES = 904, + D3D12_MESSAGE_ID_COMMAND_LIST_TOO_MANY_SWAPCHAIN_REFERENCES = 905, + D3D12_MESSAGE_ID_COMMAND_QUEUE_TOO_MANY_SWAPCHAIN_REFERENCES = 906, + D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_WRONGSWAPCHAINBUFFERREFERENCE = 907, + D3D12_MESSAGE_ID_COMMAND_LIST_SETRENDERTARGETS_INVALIDNUMRENDERTARGETS = 908, + D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_TYPE = 909, + D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_FLAGS = 910, + D3D12_MESSAGE_ID_CREATESHAREDRESOURCE_INVALIDFLAGS = 911, + D3D12_MESSAGE_ID_CREATESHAREDRESOURCE_INVALIDFORMAT = 912, + D3D12_MESSAGE_ID_CREATESHAREDHEAP_INVALIDFLAGS = 913, + D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_UNRECOGNIZEDPROPERTIES = 914, + D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_INVALIDSIZE = 915, + D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_INVALIDOBJECT = 916, + D3D12_MESSAGE_ID_KEYEDMUTEX_INVALIDOBJECT = 917, + D3D12_MESSAGE_ID_KEYEDMUTEX_INVALIDKEY = 918, + D3D12_MESSAGE_ID_KEYEDMUTEX_WRONGSTATE = 919, + D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_PRIORITY = 920, + D3D12_MESSAGE_ID_OBJECT_DELETED_WHILE_STILL_IN_USE = 921, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALID_FLAGS = 922, + D3D12_MESSAGE_ID_HEAP_ADDRESS_RANGE_HAS_NO_RESOURCE = 923, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RENDER_TARGET_DELETED = 924, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_ALL_RENDER_TARGETS_HAVE_UNKNOWN_FORMAT = 925, + D3D12_MESSAGE_ID_HEAP_ADDRESS_RANGE_INTERSECTS_MULTIPLE_BUFFERS = 926, + D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_GPU_WRITTEN_READBACK_RESOURCE_MAPPED = 927, + D3D12_MESSAGE_ID_UNMAP_RANGE_NOT_EMPTY = 929, + D3D12_MESSAGE_ID_MAP_INVALID_NULLRANGE = 930, + D3D12_MESSAGE_ID_UNMAP_INVALID_NULLRANGE = 931, + D3D12_MESSAGE_ID_NO_GRAPHICS_API_SUPPORT = 932, + D3D12_MESSAGE_ID_NO_COMPUTE_API_SUPPORT = 933, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_RESOURCE_FLAGS_NOT_SUPPORTED = 934, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_ROOT_ARGUMENT_UNINITIALIZED = 935, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_HEAP_INDEX_OUT_OF_BOUNDS = 936, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_TABLE_REGISTER_INDEX_OUT_OF_BOUNDS = 937, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_UNINITIALIZED = 938, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_TYPE_MISMATCH = 939, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_SRV_RESOURCE_DIMENSION_MISMATCH = 940, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_UAV_RESOURCE_DIMENSION_MISMATCH = 941, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_INCOMPATIBLE_RESOURCE_STATE = 942, + D3D12_MESSAGE_ID_COPYRESOURCE_NULLDST = 943, + D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDDSTRESOURCE = 944, + D3D12_MESSAGE_ID_COPYRESOURCE_NULLSRC = 945, + D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDSRCRESOURCE = 946, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_NULLDST = 947, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALIDDSTRESOURCE = 948, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_NULLSRC = 949, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALIDSRCRESOURCE = 950, + D3D12_MESSAGE_ID_PIPELINE_STATE_TYPE_MISMATCH = 951, + D3D12_MESSAGE_ID_COMMAND_LIST_DISPATCH_ROOT_SIGNATURE_NOT_SET = 952, + D3D12_MESSAGE_ID_COMMAND_LIST_DISPATCH_ROOT_SIGNATURE_MISMATCH = 953, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_ZERO_BARRIERS = 954, + D3D12_MESSAGE_ID_BEGIN_END_EVENT_MISMATCH = 955, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_POSSIBLE_BEFORE_AFTER_MISMATCH = 956, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_BEGIN_END = 957, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_INVALID_RESOURCE = 958, + D3D12_MESSAGE_ID_USE_OF_ZERO_REFCOUNT_OBJECT = 959, + D3D12_MESSAGE_ID_OBJECT_EVICTED_WHILE_STILL_IN_USE = 960, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_ROOT_DESCRIPTOR_ACCESS_OUT_OF_BOUNDS = 961, + D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_INVALIDLIBRARYBLOB = 962, + D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_DRIVERVERSIONMISMATCH = 963, + D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_ADAPTERVERSIONMISMATCH = 964, + D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_UNSUPPORTED = 965, + D3D12_MESSAGE_ID_CREATE_PIPELINELIBRARY = 966, + D3D12_MESSAGE_ID_LIVE_PIPELINELIBRARY = 967, + D3D12_MESSAGE_ID_DESTROY_PIPELINELIBRARY = 968, + D3D12_MESSAGE_ID_STOREPIPELINE_NONAME = 969, + D3D12_MESSAGE_ID_STOREPIPELINE_DUPLICATENAME = 970, + D3D12_MESSAGE_ID_LOADPIPELINE_NAMENOTFOUND = 971, + D3D12_MESSAGE_ID_LOADPIPELINE_INVALIDDESC = 972, + D3D12_MESSAGE_ID_PIPELINELIBRARY_SERIALIZE_NOTENOUGHMEMORY = 973, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_OUTPUT_RT_OUTPUT_MISMATCH = 974, + D3D12_MESSAGE_ID_SETEVENTONMULTIPLEFENCECOMPLETION_INVALIDFLAGS = 975, + D3D12_MESSAGE_ID_CREATE_QUEUE_VIDEO_NOT_SUPPORTED = 976, + D3D12_MESSAGE_ID_CREATE_COMMAND_ALLOCATOR_VIDEO_NOT_SUPPORTED = 977, + D3D12_MESSAGE_ID_CREATEQUERY_HEAP_VIDEO_DECODE_STATISTICS_NOT_SUPPORTED = 978, + D3D12_MESSAGE_ID_CREATE_VIDEODECODECOMMANDLIST = 979, + D3D12_MESSAGE_ID_CREATE_VIDEODECODER = 980, + D3D12_MESSAGE_ID_CREATE_VIDEODECODESTREAM = 981, + D3D12_MESSAGE_ID_LIVE_VIDEODECODECOMMANDLIST = 982, + D3D12_MESSAGE_ID_LIVE_VIDEODECODER = 983, + D3D12_MESSAGE_ID_LIVE_VIDEODECODESTREAM = 984, + D3D12_MESSAGE_ID_DESTROY_VIDEODECODECOMMANDLIST = 985, + D3D12_MESSAGE_ID_DESTROY_VIDEODECODER = 986, + D3D12_MESSAGE_ID_DESTROY_VIDEODECODESTREAM = 987, + D3D12_MESSAGE_ID_DECODE_FRAME_INVALID_PARAMETERS = 988, + D3D12_MESSAGE_ID_DEPRECATED_API = 989, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_COMMAND_LIST_TYPE = 990, + D3D12_MESSAGE_ID_COMMAND_LIST_DESCRIPTOR_TABLE_NOT_SET = 991, + D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_CONSTANT_BUFFER_VIEW_NOT_SET = 992, + D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_SHADER_RESOURCE_VIEW_NOT_SET = 993, + D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_UNORDERED_ACCESS_VIEW_NOT_SET = 994, + D3D12_MESSAGE_ID_DISCARD_INVALID_SUBRESOURCE_RANGE = 995, + D3D12_MESSAGE_ID_DISCARD_ONE_SUBRESOURCE_FOR_MIPS_WITH_RECTS = 996, + D3D12_MESSAGE_ID_DISCARD_NO_RECTS_FOR_NON_TEXTURE2D = 997, + D3D12_MESSAGE_ID_COPY_ON_SAME_SUBRESOURCE = 998, + D3D12_MESSAGE_ID_SETRESIDENCYPRIORITY_INVALID_PAGEABLE = 999, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_UNSUPPORTED = 1000, + D3D12_MESSAGE_ID_STATIC_DESCRIPTOR_INVALID_DESCRIPTOR_CHANGE = 1001, + D3D12_MESSAGE_ID_DATA_STATIC_DESCRIPTOR_INVALID_DATA_CHANGE = 1002, + D3D12_MESSAGE_ID_DATA_STATIC_WHILE_SET_AT_EXECUTE_DESCRIPTOR_INVALID_DATA_CHANGE = 1003, + D3D12_MESSAGE_ID_EXECUTE_BUNDLE_STATIC_DESCRIPTOR_DATA_STATIC_NOT_SET = 1004, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_RESOURCE_ACCESS_OUT_OF_BOUNDS = 1005, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_SAMPLER_MODE_MISMATCH = 1006, + D3D12_MESSAGE_ID_CREATE_FENCE_INVALID_FLAGS = 1007, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_DUPLICATE_SUBRESOURCE_TRANSITIONS = 1008, + D3D12_MESSAGE_ID_SETRESIDENCYPRIORITY_INVALID_PRIORITY = 1009, + D3D12_MESSAGE_ID_CREATE_DESCRIPTOR_HEAP_LARGE_NUM_DESCRIPTORS = 1013, + D3D12_MESSAGE_ID_BEGIN_EVENT = 1014, + D3D12_MESSAGE_ID_END_EVENT = 1015, + D3D12_MESSAGE_ID_CREATEDEVICE_DEBUG_LAYER_STARTUP_OPTIONS = 1016, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_DEPTHBOUNDSTEST_UNSUPPORTED = 1017, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_DUPLICATE_SUBOBJECT = 1018, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_UNKNOWN_SUBOBJECT = 1019, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_ZERO_SIZE_STREAM = 1020, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALID_STREAM = 1021, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CANNOT_DEDUCE_TYPE = 1022, + D3D12_MESSAGE_ID_COMMAND_LIST_STATIC_DESCRIPTOR_RESOURCE_DIMENSION_MISMATCH = 1023, + D3D12_MESSAGE_ID_CREATE_COMMAND_QUEUE_INSUFFICIENT_PRIVILEGE_FOR_GLOBAL_REALTIME = 1024, + D3D12_MESSAGE_ID_CREATE_COMMAND_QUEUE_INSUFFICIENT_HARDWARE_SUPPORT_FOR_GLOBAL_REALTIME = 1025, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_ARCHITECTURE = 1026, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DST = 1027, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DST_RESOURCE_DIMENSION = 1028, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DST_RANGE_OUT_OF_BOUNDS = 1029, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_SRC = 1030, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_SRC_RESOURCE_DIMENSION = 1031, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_SRC_RANGE_OUT_OF_BOUNDS = 1032, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_OFFSET_ALIGNMENT = 1033, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DEPENDENT_RESOURCES = 1034, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DEPENDENT_SUBRESOURCE_RANGES = 1035, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DEPENDENT_RESOURCE = 1036, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DEPENDENT_SUBRESOURCE_RANGE = 1037, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DEPENDENT_SUBRESOURCE_OUT_OF_BOUNDS = 1038, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DEPENDENT_RANGE_OUT_OF_BOUNDS = 1039, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_ZERO_DEPENDENCIES = 1040, + D3D12_MESSAGE_ID_DEVICE_CREATE_SHARED_HANDLE_INVALIDARG = 1041, + D3D12_MESSAGE_ID_DESCRIPTOR_HANDLE_WITH_INVALID_RESOURCE = 1042, + D3D12_MESSAGE_ID_SETDEPTHBOUNDS_INVALIDARGS = 1043, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_RESOURCE_STATE_IMPRECISE = 1044, + D3D12_MESSAGE_ID_COMMAND_LIST_PIPELINE_STATE_NOT_SET = 1045, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_MODEL_MISMATCH = 1046, + D3D12_MESSAGE_ID_OBJECT_ACCESSED_WHILE_STILL_IN_USE = 1047, + D3D12_MESSAGE_ID_PROGRAMMABLE_MSAA_UNSUPPORTED = 1048, + D3D12_MESSAGE_ID_SETSAMPLEPOSITIONS_INVALIDARGS = 1049, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCEREGION_INVALID_RECT = 1050, + D3D12_MESSAGE_ID_CREATE_VIDEODECODECOMMANDQUEUE = 1051, + D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSCOMMANDLIST = 1052, + D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSCOMMANDQUEUE = 1053, + D3D12_MESSAGE_ID_LIVE_VIDEODECODECOMMANDQUEUE = 1054, + D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSCOMMANDLIST = 1055, + D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSCOMMANDQUEUE = 1056, + D3D12_MESSAGE_ID_DESTROY_VIDEODECODECOMMANDQUEUE = 1057, + D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSCOMMANDLIST = 1058, + D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSCOMMANDQUEUE = 1059, + D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSOR = 1060, + D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSSTREAM = 1061, + D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSOR = 1062, + D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSSTREAM = 1063, + D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSOR = 1064, + D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSSTREAM = 1065, + D3D12_MESSAGE_ID_PROCESS_FRAME_INVALID_PARAMETERS = 1066, + D3D12_MESSAGE_ID_COPY_INVALIDLAYOUT = 1067, + D3D12_MESSAGE_ID_CREATE_CRYPTO_SESSION = 1068, + D3D12_MESSAGE_ID_CREATE_CRYPTO_SESSION_POLICY = 1069, + D3D12_MESSAGE_ID_CREATE_PROTECTED_RESOURCE_SESSION = 1070, + D3D12_MESSAGE_ID_LIVE_CRYPTO_SESSION = 1071, + D3D12_MESSAGE_ID_LIVE_CRYPTO_SESSION_POLICY = 1072, + D3D12_MESSAGE_ID_LIVE_PROTECTED_RESOURCE_SESSION = 1073, + D3D12_MESSAGE_ID_DESTROY_CRYPTO_SESSION = 1074, + D3D12_MESSAGE_ID_DESTROY_CRYPTO_SESSION_POLICY = 1075, + D3D12_MESSAGE_ID_DESTROY_PROTECTED_RESOURCE_SESSION = 1076, + D3D12_MESSAGE_ID_PROTECTED_RESOURCE_SESSION_UNSUPPORTED = 1077, + D3D12_MESSAGE_ID_FENCE_INVALIDOPERATION = 1078, + D3D12_MESSAGE_ID_CREATEQUERY_HEAP_COPY_QUEUE_TIMESTAMPS_NOT_SUPPORTED = 1079, + D3D12_MESSAGE_ID_SAMPLEPOSITIONS_MISMATCH_DEFERRED = 1080, + D3D12_MESSAGE_ID_SAMPLEPOSITIONS_MISMATCH_RECORDTIME_ASSUMEDFROMFIRSTUSE = 1081, + D3D12_MESSAGE_ID_SAMPLEPOSITIONS_MISMATCH_RECORDTIME_ASSUMEDFROMCLEAR = 1082, + D3D12_MESSAGE_ID_CREATE_VIDEODECODERHEAP = 1083, + D3D12_MESSAGE_ID_LIVE_VIDEODECODERHEAP = 1084, + D3D12_MESSAGE_ID_DESTROY_VIDEODECODERHEAP = 1085, + D3D12_MESSAGE_ID_OPENEXISTINGHEAP_INVALIDARG_RETURN = 1086, + D3D12_MESSAGE_ID_OPENEXISTINGHEAP_OUTOFMEMORY_RETURN = 1087, + D3D12_MESSAGE_ID_OPENEXISTINGHEAP_INVALIDADDRESS = 1088, + D3D12_MESSAGE_ID_OPENEXISTINGHEAP_INVALIDHANDLE = 1089, + D3D12_MESSAGE_ID_WRITEBUFFERIMMEDIATE_INVALID_DEST = 1090, + D3D12_MESSAGE_ID_WRITEBUFFERIMMEDIATE_INVALID_MODE = 1091, + D3D12_MESSAGE_ID_WRITEBUFFERIMMEDIATE_INVALID_ALIGNMENT = 1092, + D3D12_MESSAGE_ID_WRITEBUFFERIMMEDIATE_NOT_SUPPORTED = 1093, + D3D12_MESSAGE_ID_SETVIEWINSTANCEMASK_INVALIDARGS = 1094, + D3D12_MESSAGE_ID_VIEW_INSTANCING_UNSUPPORTED = 1095, + D3D12_MESSAGE_ID_VIEW_INSTANCING_INVALIDARGS = 1096, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_MISMATCH_DECODE_REFERENCE_ONLY_FLAG = 1097, + D3D12_MESSAGE_ID_COPYRESOURCE_MISMATCH_DECODE_REFERENCE_ONLY_FLAG = 1098, + D3D12_MESSAGE_ID_CREATE_VIDEO_DECODE_HEAP_CAPS_FAILURE = 1099, + D3D12_MESSAGE_ID_CREATE_VIDEO_DECODE_HEAP_CAPS_UNSUPPORTED = 1100, + D3D12_MESSAGE_ID_VIDEO_DECODE_SUPPORT_INVALID_INPUT = 1101, + D3D12_MESSAGE_ID_CREATE_VIDEO_DECODER_UNSUPPORTED = 1102, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_METADATA_ERROR = 1103, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_VIEW_INSTANCING_VERTEX_SIZE_EXCEEDED = 1104, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RUNTIME_INTERNAL_ERROR = 1105, + D3D12_MESSAGE_ID_NO_VIDEO_API_SUPPORT = 1106, + D3D12_MESSAGE_ID_VIDEO_PROCESS_SUPPORT_INVALID_INPUT = 1107, + D3D12_MESSAGE_ID_CREATE_VIDEO_PROCESSOR_CAPS_FAILURE = 1108, + D3D12_MESSAGE_ID_VIDEO_PROCESS_SUPPORT_UNSUPPORTED_FORMAT = 1109, + D3D12_MESSAGE_ID_VIDEO_DECODE_FRAME_INVALID_ARGUMENT = 1110, + D3D12_MESSAGE_ID_ENQUEUE_MAKE_RESIDENT_INVALID_FLAGS = 1111, + D3D12_MESSAGE_ID_OPENEXISTINGHEAP_UNSUPPORTED = 1112, + D3D12_MESSAGE_ID_VIDEO_PROCESS_FRAMES_INVALID_ARGUMENT = 1113, + D3D12_MESSAGE_ID_VIDEO_DECODE_SUPPORT_UNSUPPORTED = 1114, + D3D12_MESSAGE_ID_CREATE_COMMANDRECORDER = 1115, + D3D12_MESSAGE_ID_LIVE_COMMANDRECORDER = 1116, + D3D12_MESSAGE_ID_DESTROY_COMMANDRECORDER = 1117, + D3D12_MESSAGE_ID_CREATE_COMMAND_RECORDER_VIDEO_NOT_SUPPORTED = 1118, + D3D12_MESSAGE_ID_CREATE_COMMAND_RECORDER_INVALID_SUPPORT_FLAGS = 1119, + D3D12_MESSAGE_ID_CREATE_COMMAND_RECORDER_INVALID_FLAGS = 1120, + D3D12_MESSAGE_ID_CREATE_COMMAND_RECORDER_MORE_RECORDERS_THAN_LOGICAL_PROCESSORS = 1121, + D3D12_MESSAGE_ID_CREATE_COMMANDPOOL = 1122, + D3D12_MESSAGE_ID_LIVE_COMMANDPOOL = 1123, + D3D12_MESSAGE_ID_DESTROY_COMMANDPOOL = 1124, + D3D12_MESSAGE_ID_CREATE_COMMAND_POOL_INVALID_FLAGS = 1125, + D3D12_MESSAGE_ID_CREATE_COMMAND_LIST_VIDEO_NOT_SUPPORTED = 1126, + D3D12_MESSAGE_ID_COMMAND_RECORDER_SUPPORT_FLAGS_MISMATCH = 1127, + D3D12_MESSAGE_ID_COMMAND_RECORDER_CONTENTION = 1128, + D3D12_MESSAGE_ID_COMMAND_RECORDER_USAGE_WITH_CREATECOMMANDLIST_COMMAND_LIST = 1129, + D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_USAGE_WITH_CREATECOMMANDLIST1_COMMAND_LIST = 1130, + D3D12_MESSAGE_ID_CANNOT_EXECUTE_EMPTY_COMMAND_LIST = 1131, + D3D12_MESSAGE_ID_CANNOT_RESET_COMMAND_POOL_WITH_OPEN_COMMAND_LISTS = 1132, + D3D12_MESSAGE_ID_CANNOT_USE_COMMAND_RECORDER_WITHOUT_CURRENT_TARGET = 1133, + D3D12_MESSAGE_ID_CANNOT_CHANGE_COMMAND_RECORDER_TARGET_WHILE_RECORDING = 1134, + D3D12_MESSAGE_ID_COMMAND_POOL_SYNC = 1135, + D3D12_MESSAGE_ID_EVICT_UNDERFLOW = 1136, + D3D12_MESSAGE_ID_CREATE_META_COMMAND = 1137, + D3D12_MESSAGE_ID_LIVE_META_COMMAND = 1138, + D3D12_MESSAGE_ID_DESTROY_META_COMMAND = 1139, + D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALID_DST_RESOURCE = 1140, + D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALID_SRC_RESOURCE = 1141, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DST_RESOURCE = 1142, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_SRC_RESOURCE = 1143, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_NULL_BUFFER = 1144, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_NULL_RESOURCE_DESC = 1145, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_UNSUPPORTED = 1146, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_INVALID_BUFFER_DIMENSION = 1147, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_INVALID_BUFFER_FLAGS = 1148, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_INVALID_BUFFER_OFFSET = 1149, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_INVALID_RESOURCE_DIMENSION = 1150, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_INVALID_RESOURCE_FLAGS = 1151, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_OUTOFMEMORY_RETURN = 1152, + D3D12_MESSAGE_ID_CANNOT_CREATE_GRAPHICS_AND_VIDEO_COMMAND_RECORDER = 1153, + D3D12_MESSAGE_ID_UPDATETILEMAPPINGS_POSSIBLY_MISMATCHING_PROPERTIES = 1154, + D3D12_MESSAGE_ID_CREATE_COMMAND_LIST_INVALID_COMMAND_LIST_TYPE = 1155, + D3D12_MESSAGE_ID_CLEARUNORDEREDACCESSVIEW_INCOMPATIBLE_WITH_STRUCTURED_BUFFERS = 1156, + D3D12_MESSAGE_ID_COMPUTE_ONLY_DEVICE_OPERATION_UNSUPPORTED = 1157, + D3D12_MESSAGE_ID_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INVALID = 1158, + D3D12_MESSAGE_ID_EMIT_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_INVALID = 1159, + D3D12_MESSAGE_ID_COPY_RAYTRACING_ACCELERATION_STRUCTURE_INVALID = 1160, + D3D12_MESSAGE_ID_DISPATCH_RAYS_INVALID = 1161, + D3D12_MESSAGE_ID_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_INVALID = 1162, + D3D12_MESSAGE_ID_CREATE_LIFETIMETRACKER = 1163, + D3D12_MESSAGE_ID_LIVE_LIFETIMETRACKER = 1164, + D3D12_MESSAGE_ID_DESTROY_LIFETIMETRACKER = 1165, + D3D12_MESSAGE_ID_DESTROYOWNEDOBJECT_OBJECTNOTOWNED = 1166, + D3D12_MESSAGE_ID_CREATE_TRACKEDWORKLOAD = 1167, + D3D12_MESSAGE_ID_LIVE_TRACKEDWORKLOAD = 1168, + D3D12_MESSAGE_ID_DESTROY_TRACKEDWORKLOAD = 1169, + D3D12_MESSAGE_ID_RENDER_PASS_ERROR = 1170, + D3D12_MESSAGE_ID_META_COMMAND_ID_INVALID = 1171, + D3D12_MESSAGE_ID_META_COMMAND_UNSUPPORTED_PARAMS = 1172, + D3D12_MESSAGE_ID_META_COMMAND_FAILED_ENUMERATION = 1173, + D3D12_MESSAGE_ID_META_COMMAND_PARAMETER_SIZE_MISMATCH = 1174, + D3D12_MESSAGE_ID_UNINITIALIZED_META_COMMAND = 1175, + D3D12_MESSAGE_ID_META_COMMAND_INVALID_GPU_VIRTUAL_ADDRESS = 1176, + D3D12_MESSAGE_ID_CREATE_VIDEOENCODECOMMANDLIST = 1177, + D3D12_MESSAGE_ID_LIVE_VIDEOENCODECOMMANDLIST = 1178, + D3D12_MESSAGE_ID_DESTROY_VIDEOENCODECOMMANDLIST = 1179, + D3D12_MESSAGE_ID_CREATE_VIDEOENCODECOMMANDQUEUE = 1180, + D3D12_MESSAGE_ID_LIVE_VIDEOENCODECOMMANDQUEUE = 1181, + D3D12_MESSAGE_ID_DESTROY_VIDEOENCODECOMMANDQUEUE = 1182, + D3D12_MESSAGE_ID_CREATE_VIDEOMOTIONESTIMATOR = 1183, + D3D12_MESSAGE_ID_LIVE_VIDEOMOTIONESTIMATOR = 1184, + D3D12_MESSAGE_ID_DESTROY_VIDEOMOTIONESTIMATOR = 1185, + D3D12_MESSAGE_ID_CREATE_VIDEOMOTIONVECTORHEAP = 1186, + D3D12_MESSAGE_ID_LIVE_VIDEOMOTIONVECTORHEAP = 1187, + D3D12_MESSAGE_ID_DESTROY_VIDEOMOTIONVECTORHEAP = 1188, + D3D12_MESSAGE_ID_MULTIPLE_TRACKED_WORKLOADS = 1189, + D3D12_MESSAGE_ID_MULTIPLE_TRACKED_WORKLOAD_PAIRS = 1190, + D3D12_MESSAGE_ID_OUT_OF_ORDER_TRACKED_WORKLOAD_PAIR = 1191, + D3D12_MESSAGE_ID_CANNOT_ADD_TRACKED_WORKLOAD = 1192, + D3D12_MESSAGE_ID_INCOMPLETE_TRACKED_WORKLOAD_PAIR = 1193, + D3D12_MESSAGE_ID_CREATE_STATE_OBJECT_ERROR = 1194, + D3D12_MESSAGE_ID_GET_SHADER_IDENTIFIER_ERROR = 1195, + D3D12_MESSAGE_ID_GET_SHADER_STACK_SIZE_ERROR = 1196, + D3D12_MESSAGE_ID_GET_PIPELINE_STACK_SIZE_ERROR = 1197, + D3D12_MESSAGE_ID_SET_PIPELINE_STACK_SIZE_ERROR = 1198, + D3D12_MESSAGE_ID_GET_SHADER_IDENTIFIER_SIZE_INVALID = 1199, + D3D12_MESSAGE_ID_CHECK_DRIVER_MATCHING_IDENTIFIER_INVALID = 1200, + D3D12_MESSAGE_ID_CHECK_DRIVER_MATCHING_IDENTIFIER_DRIVER_REPORTED_ISSUE = 1201, + D3D12_MESSAGE_ID_RENDER_PASS_INVALID_RESOURCE_BARRIER = 1202, + D3D12_MESSAGE_ID_RENDER_PASS_DISALLOWED_API_CALLED = 1203, + D3D12_MESSAGE_ID_RENDER_PASS_CANNOT_NEST_RENDER_PASSES = 1204, + D3D12_MESSAGE_ID_RENDER_PASS_CANNOT_END_WITHOUT_BEGIN = 1205, + D3D12_MESSAGE_ID_RENDER_PASS_CANNOT_CLOSE_COMMAND_LIST = 1206, + D3D12_MESSAGE_ID_RENDER_PASS_GPU_WORK_WHILE_SUSPENDED = 1207, + D3D12_MESSAGE_ID_RENDER_PASS_MISMATCHING_SUSPEND_RESUME = 1208, + D3D12_MESSAGE_ID_RENDER_PASS_NO_PRIOR_SUSPEND_WITHIN_EXECUTECOMMANDLISTS = 1209, + D3D12_MESSAGE_ID_RENDER_PASS_NO_SUBSEQUENT_RESUME_WITHIN_EXECUTECOMMANDLISTS = 1210, + D3D12_MESSAGE_ID_TRACKED_WORKLOAD_COMMAND_QUEUE_MISMATCH = 1211, + D3D12_MESSAGE_ID_TRACKED_WORKLOAD_NOT_SUPPORTED = 1212, + D3D12_MESSAGE_ID_RENDER_PASS_MISMATCHING_NO_ACCESS = 1213, + D3D12_MESSAGE_ID_RENDER_PASS_UNSUPPORTED_RESOLVE = 1214, + D3D12_MESSAGE_ID_CLEARUNORDEREDACCESSVIEW_INVALID_RESOURCE_PTR = 1215, + D3D12_MESSAGE_ID_WINDOWS7_FENCE_OUTOFORDER_SIGNAL = 1216, + D3D12_MESSAGE_ID_WINDOWS7_FENCE_OUTOFORDER_WAIT = 1217, + D3D12_MESSAGE_ID_VIDEO_CREATE_MOTION_ESTIMATOR_INVALID_ARGUMENT = 1218, + D3D12_MESSAGE_ID_VIDEO_CREATE_MOTION_VECTOR_HEAP_INVALID_ARGUMENT = 1219, + D3D12_MESSAGE_ID_ESTIMATE_MOTION_INVALID_ARGUMENT = 1220, + D3D12_MESSAGE_ID_RESOLVE_MOTION_VECTOR_HEAP_INVALID_ARGUMENT = 1221, + D3D12_MESSAGE_ID_GETGPUVIRTUALADDRESS_INVALID_HEAP_TYPE = 1222, + D3D12_MESSAGE_ID_SET_BACKGROUND_PROCESSING_MODE_INVALID_ARGUMENT = 1223, + D3D12_MESSAGE_ID_CREATE_COMMAND_LIST_INVALID_COMMAND_LIST_TYPE_FOR_FEATURE_LEVEL = 1224, + D3D12_MESSAGE_ID_CREATE_VIDEOEXTENSIONCOMMAND = 1225, + D3D12_MESSAGE_ID_LIVE_VIDEOEXTENSIONCOMMAND = 1226, + D3D12_MESSAGE_ID_DESTROY_VIDEOEXTENSIONCOMMAND = 1227, + D3D12_MESSAGE_ID_INVALID_VIDEO_EXTENSION_COMMAND_ID = 1228, + D3D12_MESSAGE_ID_VIDEO_EXTENSION_COMMAND_INVALID_ARGUMENT = 1229, + D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_NOT_UNIQUE_IN_DXIL_LIBRARY = 1230, + D3D12_MESSAGE_ID_VARIABLE_SHADING_RATE_NOT_ALLOWED_WITH_TIR = 1231, + D3D12_MESSAGE_ID_GEOMETRY_SHADER_OUTPUTTING_BOTH_VIEWPORT_ARRAY_INDEX_AND_SHADING_RATE_NOT_SUPPORTED_ON_DEVICE = 1232, + D3D12_MESSAGE_ID_RSSETSHADING_RATE_INVALID_SHADING_RATE = 1233, + D3D12_MESSAGE_ID_RSSETSHADING_RATE_SHADING_RATE_NOT_PERMITTED_BY_CAP = 1234, + D3D12_MESSAGE_ID_RSSETSHADING_RATE_INVALID_COMBINER = 1235, + D3D12_MESSAGE_ID_RSSETSHADINGRATEIMAGE_REQUIRES_TIER_2 = 1236, + D3D12_MESSAGE_ID_RSSETSHADINGRATE_REQUIRES_TIER_1 = 1237, + D3D12_MESSAGE_ID_SHADING_RATE_IMAGE_INCORRECT_FORMAT = 1238, + D3D12_MESSAGE_ID_SHADING_RATE_IMAGE_INCORRECT_ARRAY_SIZE = 1239, + D3D12_MESSAGE_ID_SHADING_RATE_IMAGE_INCORRECT_MIP_LEVEL = 1240, + D3D12_MESSAGE_ID_SHADING_RATE_IMAGE_INCORRECT_SAMPLE_COUNT = 1241, + D3D12_MESSAGE_ID_SHADING_RATE_IMAGE_INCORRECT_SAMPLE_QUALITY = 1242, + D3D12_MESSAGE_ID_NON_RETAIL_SHADER_MODEL_WONT_VALIDATE = 1243, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_AS_ROOT_SIGNATURE_MISMATCH = 1244, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MS_ROOT_SIGNATURE_MISMATCH = 1245, + D3D12_MESSAGE_ID_ADD_TO_STATE_OBJECT_ERROR = 1246, + D3D12_MESSAGE_ID_CREATE_PROTECTED_RESOURCE_SESSION_INVALID_ARGUMENT = 1247, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MS_PSO_DESC_MISMATCH = 1248, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_MS_INCOMPLETE_TYPE = 1249, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_AS_NOT_MS_MISMATCH = 1250, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MS_NOT_PS_MISMATCH = 1251, + D3D12_MESSAGE_ID_NONZERO_SAMPLER_FEEDBACK_MIP_REGION_WITH_INCOMPATIBLE_FORMAT = 1252, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INPUTLAYOUT_SHADER_MISMATCH = 1253, + D3D12_MESSAGE_ID_EMPTY_DISPATCH = 1254, + D3D12_MESSAGE_ID_RESOURCE_FORMAT_REQUIRES_SAMPLER_FEEDBACK_CAPABILITY = 1255, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_MAP_INVALID_MIP_REGION = 1256, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_MAP_INVALID_DIMENSION = 1257, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_MAP_INVALID_SAMPLE_COUNT = 1258, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_MAP_INVALID_SAMPLE_QUALITY = 1259, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_MAP_INVALID_LAYOUT = 1260, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_MAP_REQUIRES_UNORDERED_ACCESS_FLAG = 1261, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_CREATE_UAV_NULL_ARGUMENTS = 1262, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_UAV_REQUIRES_SAMPLER_FEEDBACK_CAPABILITY = 1263, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_CREATE_UAV_REQUIRES_FEEDBACK_MAP_FORMAT = 1264, + D3D12_MESSAGE_ID_CREATEMESHSHADER_INVALIDSHADERBYTECODE = 1265, + D3D12_MESSAGE_ID_CREATEMESHSHADER_OUTOFMEMORY = 1266, + D3D12_MESSAGE_ID_CREATEMESHSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE = 1267, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_SAMPLER_FEEDBACK_TRANSCODE_INVALID_FORMAT = 1268, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_SAMPLER_FEEDBACK_INVALID_MIP_LEVEL_COUNT = 1269, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_SAMPLER_FEEDBACK_TRANSCODE_ARRAY_SIZE_MISMATCH = 1270, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_CREATE_UAV_MISMATCHING_TARGETED_RESOURCE = 1271, + D3D12_MESSAGE_ID_CREATEMESHSHADER_OUTPUTEXCEEDSMAXSIZE = 1272, + D3D12_MESSAGE_ID_CREATEMESHSHADER_GROUPSHAREDEXCEEDSMAXSIZE = 1273, + D3D12_MESSAGE_ID_VERTEX_SHADER_OUTPUTTING_BOTH_VIEWPORT_ARRAY_INDEX_AND_SHADING_RATE_NOT_SUPPORTED_ON_DEVICE = 1274, + D3D12_MESSAGE_ID_MESH_SHADER_OUTPUTTING_BOTH_VIEWPORT_ARRAY_INDEX_AND_SHADING_RATE_NOT_SUPPORTED_ON_DEVICE = 1275, + D3D12_MESSAGE_ID_CREATEMESHSHADER_MISMATCHEDASMSPAYLOADSIZE = 1276, + D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_UNBOUNDED_STATIC_DESCRIPTORS = 1277, + D3D12_MESSAGE_ID_CREATEAMPLIFICATIONSHADER_INVALIDSHADERBYTECODE = 1278, + D3D12_MESSAGE_ID_CREATEAMPLIFICATIONSHADER_OUTOFMEMORY = 1279, + D3D12_MESSAGE_ID_CREATE_SHADERCACHESESSION = 1280, + D3D12_MESSAGE_ID_LIVE_SHADERCACHESESSION = 1281, + D3D12_MESSAGE_ID_DESTROY_SHADERCACHESESSION = 1282, + D3D12_MESSAGE_ID_CREATESHADERCACHESESSION_INVALIDARGS = 1283, + D3D12_MESSAGE_ID_CREATESHADERCACHESESSION_DISABLED = 1284, + D3D12_MESSAGE_ID_CREATESHADERCACHESESSION_ALREADYOPEN = 1285, + D3D12_MESSAGE_ID_SHADERCACHECONTROL_DEVELOPERMODE = 1286, + D3D12_MESSAGE_ID_SHADERCACHECONTROL_INVALIDFLAGS = 1287, + D3D12_MESSAGE_ID_SHADERCACHECONTROL_STATEALREADYSET = 1288, + D3D12_MESSAGE_ID_SHADERCACHECONTROL_IGNOREDFLAG = 1289, + D3D12_MESSAGE_ID_SHADERCACHESESSION_STOREVALUE_ALREADYPRESENT = 1290, + D3D12_MESSAGE_ID_SHADERCACHESESSION_STOREVALUE_HASHCOLLISION = 1291, + D3D12_MESSAGE_ID_SHADERCACHESESSION_STOREVALUE_CACHEFULL = 1292, + D3D12_MESSAGE_ID_SHADERCACHESESSION_FINDVALUE_NOTFOUND = 1293, + D3D12_MESSAGE_ID_SHADERCACHESESSION_CORRUPT = 1294, + D3D12_MESSAGE_ID_SHADERCACHESESSION_DISABLED = 1295, + D3D12_MESSAGE_ID_OVERSIZED_DISPATCH = 1296, + D3D12_MESSAGE_ID_CREATE_VIDEOENCODER = 1297, + D3D12_MESSAGE_ID_LIVE_VIDEOENCODER = 1298, + D3D12_MESSAGE_ID_DESTROY_VIDEOENCODER = 1299, + D3D12_MESSAGE_ID_CREATE_VIDEOENCODERHEAP = 1300, + D3D12_MESSAGE_ID_LIVE_VIDEOENCODERHEAP = 1301, + D3D12_MESSAGE_ID_DESTROY_VIDEOENCODERHEAP = 1302, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_MISMATCH_ENCODE_REFERENCE_ONLY_FLAG = 1303, + D3D12_MESSAGE_ID_COPYRESOURCE_MISMATCH_ENCODE_REFERENCE_ONLY_FLAG = 1304, + D3D12_MESSAGE_ID_ENCODE_FRAME_INVALID_PARAMETERS = 1305, + D3D12_MESSAGE_ID_ENCODE_FRAME_UNSUPPORTED_PARAMETERS = 1306, + D3D12_MESSAGE_ID_RESOLVE_ENCODER_OUTPUT_METADATA_INVALID_PARAMETERS = 1307, + D3D12_MESSAGE_ID_RESOLVE_ENCODER_OUTPUT_METADATA_UNSUPPORTED_PARAMETERS = 1308, + D3D12_MESSAGE_ID_CREATE_VIDEO_ENCODER_INVALID_PARAMETERS = 1309, + D3D12_MESSAGE_ID_CREATE_VIDEO_ENCODER_UNSUPPORTED_PARAMETERS = 1310, + D3D12_MESSAGE_ID_CREATE_VIDEO_ENCODER_HEAP_INVALID_PARAMETERS = 1311, + D3D12_MESSAGE_ID_CREATE_VIDEO_ENCODER_HEAP_UNSUPPORTED_PARAMETERS = 1312, + D3D12_MESSAGE_ID_CREATECOMMANDLIST_NULL_COMMANDALLOCATOR = 1313, + D3D12_MESSAGE_ID_CLEAR_UNORDERED_ACCESS_VIEW_INVALID_DESCRIPTOR_HANDLE = 1314, + D3D12_MESSAGE_ID_DESCRIPTOR_HEAP_NOT_SHADER_VISIBLE = 1315, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_BLENDOP_WARNING = 1316, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_BLENDOPALPHA_WARNING = 1317, + D3D12_MESSAGE_ID_WRITE_COMBINE_PERFORMANCE_WARNING = 1318, + D3D12_MESSAGE_ID_RESOLVE_QUERY_INVALID_QUERY_STATE = 1319, + D3D12_MESSAGE_ID_SETPRIVATEDATA_NO_ACCESS = 1320, + D3D12_MESSAGE_ID_COMMAND_LIST_STATIC_DESCRIPTOR_SAMPLER_MODE_MISMATCH = 1321, + D3D12_MESSAGE_ID_GETCOPYABLEFOOTPRINTS_UNSUPPORTED_BUFFER_WIDTH = 1322, + D3D12_MESSAGE_ID_CREATEMESHSHADER_TOPOLOGY_MISMATCH = 1323, + D3D12_MESSAGE_ID_VRS_SUM_COMBINER_REQUIRES_CAPABILITY = 1324, + D3D12_MESSAGE_ID_SETTING_SHADING_RATE_FROM_MS_REQUIRES_CAPABILITY = 1325, + D3D12_MESSAGE_ID_SHADERCACHESESSION_SHADERCACHEDELETE_NOTSUPPORTED = 1326, + D3D12_MESSAGE_ID_SHADERCACHECONTROL_SHADERCACHECLEAR_NOTSUPPORTED = 1327, + D3D12_MESSAGE_ID_CREATERESOURCE_STATE_IGNORED = 1328, + D3D12_MESSAGE_ID_UNUSED_CROSS_EXECUTE_SPLIT_BARRIER = 1329, + D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_HANDLE_ACCESS_DENIED = 1330, + D3D12_MESSAGE_ID_INCOMPATIBLE_BARRIER_VALUES = 1331, + D3D12_MESSAGE_ID_INCOMPATIBLE_BARRIER_ACCESS = 1332, + D3D12_MESSAGE_ID_INCOMPATIBLE_BARRIER_SYNC = 1333, + D3D12_MESSAGE_ID_INCOMPATIBLE_BARRIER_LAYOUT = 1334, + D3D12_MESSAGE_ID_INCOMPATIBLE_BARRIER_TYPE = 1335, + D3D12_MESSAGE_ID_OUT_OF_BOUNDS_BARRIER_SUBRESOURCE_RANGE = 1336, + D3D12_MESSAGE_ID_INCOMPATIBLE_BARRIER_RESOURCE_DIMENSION = 1337, + D3D12_MESSAGE_ID_SET_SCISSOR_RECTS_INVALID_RECT = 1338, + D3D12_MESSAGE_ID_SHADING_RATE_SOURCE_REQUIRES_DIMENSION_TEXTURE2D = 1339, + D3D12_MESSAGE_ID_BUFFER_BARRIER_SUBREGION_OUT_OF_BOUNDS = 1340, + D3D12_MESSAGE_ID_UNSUPPORTED_BARRIER_LAYOUT = 1341, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALID_PARAMETERS = 1342, + D3D12_MESSAGE_ID_ENHANCED_BARRIERS_NOT_SUPPORTED = 1343, + D3D12_MESSAGE_ID_CAST_TARGET_TEXEL_SIZE_MISMATCH = 1344, + D3D12_MESSAGE_ID_CAST_TO_PLANAR_NOT_SUPORTED = 1345, + D3D12_MESSAGE_ID_LEGACY_BARRIER_VALIDATION_FORCED_ON = 1346, + D3D12_MESSAGE_ID_EMPTY_ROOT_DESCRIPTOR_TABLE = 1347, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ELEMENT_OFFSET_UNALIGNED = 1348, + D3D12_MESSAGE_ID_ALPHA_BLEND_FACTOR_NOT_SUPPORTED = 1349, + D3D12_MESSAGE_ID_BARRIER_INTEROP_INVALID_LAYOUT = 1350, + D3D12_MESSAGE_ID_BARRIER_INTEROP_INVALID_STATE = 1351, + D3D12_MESSAGE_ID_GRAPHICS_PIPELINE_STATE_DESC_ZERO_SAMPLE_MASK = 1352, + D3D12_MESSAGE_ID_INDEPENDENT_STENCIL_REF_NOT_SUPPORTED = 1353, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INDEPENDENT_MASKS_UNSUPPORTED = 1354, + D3D12_MESSAGE_ID_TEXTURE_BARRIER_SUBRESOURCES_OUT_OF_BOUNDS = 1355, + D3D12_MESSAGE_ID_NON_OPTIMAL_BARRIER_ONLY_EXECUTE_COMMAND_LISTS = 1356, + D3D12_MESSAGE_ID_EXECUTE_INDIRECT_ZERO_COMMAND_COUNT = 1357, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_INCOMPATIBLE_TEXTURE_LAYOUT = 1358, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_DYNAMIC_INDEX_BUFFER_STRIP_CUT_NOT_SUPPORTED = 1359, + D3D12_MESSAGE_ID_PRIMITIVE_TOPOLOGY_TRIANGLE_FANS_NOT_SUPPORTED = 1360, + D3D12_MESSAGE_ID_CREATE_SAMPLER_COMPARISON_FUNC_IGNORED = 1361, + D3D12_MESSAGE_ID_D3D12_MESSAGES_END = ( D3D12_MESSAGE_ID_CREATE_SAMPLER_COMPARISON_FUNC_IGNORED + 1 ) + } D3D12_MESSAGE_ID; + +typedef struct D3D12_MESSAGE + { + D3D12_MESSAGE_CATEGORY Category; + D3D12_MESSAGE_SEVERITY Severity; + D3D12_MESSAGE_ID ID; + _Field_size_(DescriptionByteLength) const char *pDescription; + SIZE_T DescriptionByteLength; + } D3D12_MESSAGE; + +typedef struct D3D12_INFO_QUEUE_FILTER_DESC + { + UINT NumCategories; + _Field_size_(NumCategories) D3D12_MESSAGE_CATEGORY *pCategoryList; + UINT NumSeverities; + _Field_size_(NumSeverities) D3D12_MESSAGE_SEVERITY *pSeverityList; + UINT NumIDs; + _Field_size_(NumIDs) D3D12_MESSAGE_ID *pIDList; + } D3D12_INFO_QUEUE_FILTER_DESC; + +typedef struct D3D12_INFO_QUEUE_FILTER + { + D3D12_INFO_QUEUE_FILTER_DESC AllowList; + D3D12_INFO_QUEUE_FILTER_DESC DenyList; + } D3D12_INFO_QUEUE_FILTER; + +#define D3D12_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT 1024 + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0017_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0017_v0_0_s_ifspec; + +#ifndef __ID3D12InfoQueue_INTERFACE_DEFINED__ +#define __ID3D12InfoQueue_INTERFACE_DEFINED__ + +/* interface ID3D12InfoQueue */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12InfoQueue; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0742a90b-c387-483f-b946-30a7e4e61458") + ID3D12InfoQueue : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetMessageCountLimit( + _In_ UINT64 MessageCountLimit) = 0; + + virtual void STDMETHODCALLTYPE ClearStoredMessages( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetMessage( + _In_ UINT64 MessageIndex, + _Out_writes_bytes_opt_(*pMessageByteLength) D3D12_MESSAGE *pMessage, + _Inout_ SIZE_T *pMessageByteLength) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumMessagesAllowedByStorageFilter( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDeniedByStorageFilter( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessages( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessagesAllowedByRetrievalFilter( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDiscardedByMessageCountLimit( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetMessageCountLimit( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddStorageFilterEntries( + _In_ D3D12_INFO_QUEUE_FILTER *pFilter) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetStorageFilter( + _Out_writes_bytes_opt_(*pFilterByteLength) D3D12_INFO_QUEUE_FILTER *pFilter, + _Inout_ SIZE_T *pFilterByteLength) = 0; + + virtual void STDMETHODCALLTYPE ClearStorageFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushEmptyStorageFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushCopyOfStorageFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushStorageFilter( + _In_ D3D12_INFO_QUEUE_FILTER *pFilter) = 0; + + virtual void STDMETHODCALLTYPE PopStorageFilter( void) = 0; + + virtual UINT STDMETHODCALLTYPE GetStorageFilterStackSize( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddRetrievalFilterEntries( + _In_ D3D12_INFO_QUEUE_FILTER *pFilter) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetRetrievalFilter( + _Out_writes_bytes_opt_(*pFilterByteLength) D3D12_INFO_QUEUE_FILTER *pFilter, + _Inout_ SIZE_T *pFilterByteLength) = 0; + + virtual void STDMETHODCALLTYPE ClearRetrievalFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushEmptyRetrievalFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushCopyOfRetrievalFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushRetrievalFilter( + _In_ D3D12_INFO_QUEUE_FILTER *pFilter) = 0; + + virtual void STDMETHODCALLTYPE PopRetrievalFilter( void) = 0; + + virtual UINT STDMETHODCALLTYPE GetRetrievalFilterStackSize( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddMessage( + _In_ D3D12_MESSAGE_CATEGORY Category, + _In_ D3D12_MESSAGE_SEVERITY Severity, + _In_ D3D12_MESSAGE_ID ID, + _In_ LPCSTR pDescription) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddApplicationMessage( + _In_ D3D12_MESSAGE_SEVERITY Severity, + _In_ LPCSTR pDescription) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetBreakOnCategory( + _In_ D3D12_MESSAGE_CATEGORY Category, + _In_ BOOL bEnable) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetBreakOnSeverity( + _In_ D3D12_MESSAGE_SEVERITY Severity, + _In_ BOOL bEnable) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetBreakOnID( + _In_ D3D12_MESSAGE_ID ID, + _In_ BOOL bEnable) = 0; + + virtual BOOL STDMETHODCALLTYPE GetBreakOnCategory( + _In_ D3D12_MESSAGE_CATEGORY Category) = 0; + + virtual BOOL STDMETHODCALLTYPE GetBreakOnSeverity( + _In_ D3D12_MESSAGE_SEVERITY Severity) = 0; + + virtual BOOL STDMETHODCALLTYPE GetBreakOnID( + _In_ D3D12_MESSAGE_ID ID) = 0; + + virtual void STDMETHODCALLTYPE SetMuteDebugOutput( + _In_ BOOL bMute) = 0; + + virtual BOOL STDMETHODCALLTYPE GetMuteDebugOutput( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12InfoQueueVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12InfoQueue * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetMessageCountLimit) + HRESULT ( STDMETHODCALLTYPE *SetMessageCountLimit )( + ID3D12InfoQueue * This, + _In_ UINT64 MessageCountLimit); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, ClearStoredMessages) + void ( STDMETHODCALLTYPE *ClearStoredMessages )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetMessage) + HRESULT ( STDMETHODCALLTYPE *GetMessage )( + ID3D12InfoQueue * This, + _In_ UINT64 MessageIndex, + _Out_writes_bytes_opt_(*pMessageByteLength) D3D12_MESSAGE *pMessage, + _Inout_ SIZE_T *pMessageByteLength); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumMessagesAllowedByStorageFilter) + UINT64 ( STDMETHODCALLTYPE *GetNumMessagesAllowedByStorageFilter )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumMessagesDeniedByStorageFilter) + UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDeniedByStorageFilter )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumStoredMessages) + UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessages )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumStoredMessagesAllowedByRetrievalFilter) + UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessagesAllowedByRetrievalFilter )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumMessagesDiscardedByMessageCountLimit) + UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDiscardedByMessageCountLimit )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetMessageCountLimit) + UINT64 ( STDMETHODCALLTYPE *GetMessageCountLimit )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, AddStorageFilterEntries) + HRESULT ( STDMETHODCALLTYPE *AddStorageFilterEntries )( + ID3D12InfoQueue * This, + _In_ D3D12_INFO_QUEUE_FILTER *pFilter); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetStorageFilter) + HRESULT ( STDMETHODCALLTYPE *GetStorageFilter )( + ID3D12InfoQueue * This, + _Out_writes_bytes_opt_(*pFilterByteLength) D3D12_INFO_QUEUE_FILTER *pFilter, + _Inout_ SIZE_T *pFilterByteLength); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, ClearStorageFilter) + void ( STDMETHODCALLTYPE *ClearStorageFilter )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushEmptyStorageFilter) + HRESULT ( STDMETHODCALLTYPE *PushEmptyStorageFilter )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushCopyOfStorageFilter) + HRESULT ( STDMETHODCALLTYPE *PushCopyOfStorageFilter )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushStorageFilter) + HRESULT ( STDMETHODCALLTYPE *PushStorageFilter )( + ID3D12InfoQueue * This, + _In_ D3D12_INFO_QUEUE_FILTER *pFilter); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PopStorageFilter) + void ( STDMETHODCALLTYPE *PopStorageFilter )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetStorageFilterStackSize) + UINT ( STDMETHODCALLTYPE *GetStorageFilterStackSize )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, AddRetrievalFilterEntries) + HRESULT ( STDMETHODCALLTYPE *AddRetrievalFilterEntries )( + ID3D12InfoQueue * This, + _In_ D3D12_INFO_QUEUE_FILTER *pFilter); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetRetrievalFilter) + HRESULT ( STDMETHODCALLTYPE *GetRetrievalFilter )( + ID3D12InfoQueue * This, + _Out_writes_bytes_opt_(*pFilterByteLength) D3D12_INFO_QUEUE_FILTER *pFilter, + _Inout_ SIZE_T *pFilterByteLength); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, ClearRetrievalFilter) + void ( STDMETHODCALLTYPE *ClearRetrievalFilter )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushEmptyRetrievalFilter) + HRESULT ( STDMETHODCALLTYPE *PushEmptyRetrievalFilter )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushCopyOfRetrievalFilter) + HRESULT ( STDMETHODCALLTYPE *PushCopyOfRetrievalFilter )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushRetrievalFilter) + HRESULT ( STDMETHODCALLTYPE *PushRetrievalFilter )( + ID3D12InfoQueue * This, + _In_ D3D12_INFO_QUEUE_FILTER *pFilter); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PopRetrievalFilter) + void ( STDMETHODCALLTYPE *PopRetrievalFilter )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetRetrievalFilterStackSize) + UINT ( STDMETHODCALLTYPE *GetRetrievalFilterStackSize )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, AddMessage) + HRESULT ( STDMETHODCALLTYPE *AddMessage )( + ID3D12InfoQueue * This, + _In_ D3D12_MESSAGE_CATEGORY Category, + _In_ D3D12_MESSAGE_SEVERITY Severity, + _In_ D3D12_MESSAGE_ID ID, + _In_ LPCSTR pDescription); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, AddApplicationMessage) + HRESULT ( STDMETHODCALLTYPE *AddApplicationMessage )( + ID3D12InfoQueue * This, + _In_ D3D12_MESSAGE_SEVERITY Severity, + _In_ LPCSTR pDescription); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetBreakOnCategory) + HRESULT ( STDMETHODCALLTYPE *SetBreakOnCategory )( + ID3D12InfoQueue * This, + _In_ D3D12_MESSAGE_CATEGORY Category, + _In_ BOOL bEnable); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetBreakOnSeverity) + HRESULT ( STDMETHODCALLTYPE *SetBreakOnSeverity )( + ID3D12InfoQueue * This, + _In_ D3D12_MESSAGE_SEVERITY Severity, + _In_ BOOL bEnable); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetBreakOnID) + HRESULT ( STDMETHODCALLTYPE *SetBreakOnID )( + ID3D12InfoQueue * This, + _In_ D3D12_MESSAGE_ID ID, + _In_ BOOL bEnable); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetBreakOnCategory) + BOOL ( STDMETHODCALLTYPE *GetBreakOnCategory )( + ID3D12InfoQueue * This, + _In_ D3D12_MESSAGE_CATEGORY Category); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetBreakOnSeverity) + BOOL ( STDMETHODCALLTYPE *GetBreakOnSeverity )( + ID3D12InfoQueue * This, + _In_ D3D12_MESSAGE_SEVERITY Severity); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetBreakOnID) + BOOL ( STDMETHODCALLTYPE *GetBreakOnID )( + ID3D12InfoQueue * This, + _In_ D3D12_MESSAGE_ID ID); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetMuteDebugOutput) + void ( STDMETHODCALLTYPE *SetMuteDebugOutput )( + ID3D12InfoQueue * This, + _In_ BOOL bMute); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetMuteDebugOutput) + BOOL ( STDMETHODCALLTYPE *GetMuteDebugOutput )( + ID3D12InfoQueue * This); + + END_INTERFACE + } ID3D12InfoQueueVtbl; + + interface ID3D12InfoQueue + { + CONST_VTBL struct ID3D12InfoQueueVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12InfoQueue_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12InfoQueue_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12InfoQueue_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12InfoQueue_SetMessageCountLimit(This,MessageCountLimit) \ + ( (This)->lpVtbl -> SetMessageCountLimit(This,MessageCountLimit) ) + +#define ID3D12InfoQueue_ClearStoredMessages(This) \ + ( (This)->lpVtbl -> ClearStoredMessages(This) ) + +#define ID3D12InfoQueue_GetMessage(This,MessageIndex,pMessage,pMessageByteLength) \ + ( (This)->lpVtbl -> GetMessage(This,MessageIndex,pMessage,pMessageByteLength) ) + +#define ID3D12InfoQueue_GetNumMessagesAllowedByStorageFilter(This) \ + ( (This)->lpVtbl -> GetNumMessagesAllowedByStorageFilter(This) ) + +#define ID3D12InfoQueue_GetNumMessagesDeniedByStorageFilter(This) \ + ( (This)->lpVtbl -> GetNumMessagesDeniedByStorageFilter(This) ) + +#define ID3D12InfoQueue_GetNumStoredMessages(This) \ + ( (This)->lpVtbl -> GetNumStoredMessages(This) ) + +#define ID3D12InfoQueue_GetNumStoredMessagesAllowedByRetrievalFilter(This) \ + ( (This)->lpVtbl -> GetNumStoredMessagesAllowedByRetrievalFilter(This) ) + +#define ID3D12InfoQueue_GetNumMessagesDiscardedByMessageCountLimit(This) \ + ( (This)->lpVtbl -> GetNumMessagesDiscardedByMessageCountLimit(This) ) + +#define ID3D12InfoQueue_GetMessageCountLimit(This) \ + ( (This)->lpVtbl -> GetMessageCountLimit(This) ) + +#define ID3D12InfoQueue_AddStorageFilterEntries(This,pFilter) \ + ( (This)->lpVtbl -> AddStorageFilterEntries(This,pFilter) ) + +#define ID3D12InfoQueue_GetStorageFilter(This,pFilter,pFilterByteLength) \ + ( (This)->lpVtbl -> GetStorageFilter(This,pFilter,pFilterByteLength) ) + +#define ID3D12InfoQueue_ClearStorageFilter(This) \ + ( (This)->lpVtbl -> ClearStorageFilter(This) ) + +#define ID3D12InfoQueue_PushEmptyStorageFilter(This) \ + ( (This)->lpVtbl -> PushEmptyStorageFilter(This) ) + +#define ID3D12InfoQueue_PushCopyOfStorageFilter(This) \ + ( (This)->lpVtbl -> PushCopyOfStorageFilter(This) ) + +#define ID3D12InfoQueue_PushStorageFilter(This,pFilter) \ + ( (This)->lpVtbl -> PushStorageFilter(This,pFilter) ) + +#define ID3D12InfoQueue_PopStorageFilter(This) \ + ( (This)->lpVtbl -> PopStorageFilter(This) ) + +#define ID3D12InfoQueue_GetStorageFilterStackSize(This) \ + ( (This)->lpVtbl -> GetStorageFilterStackSize(This) ) + +#define ID3D12InfoQueue_AddRetrievalFilterEntries(This,pFilter) \ + ( (This)->lpVtbl -> AddRetrievalFilterEntries(This,pFilter) ) + +#define ID3D12InfoQueue_GetRetrievalFilter(This,pFilter,pFilterByteLength) \ + ( (This)->lpVtbl -> GetRetrievalFilter(This,pFilter,pFilterByteLength) ) + +#define ID3D12InfoQueue_ClearRetrievalFilter(This) \ + ( (This)->lpVtbl -> ClearRetrievalFilter(This) ) + +#define ID3D12InfoQueue_PushEmptyRetrievalFilter(This) \ + ( (This)->lpVtbl -> PushEmptyRetrievalFilter(This) ) + +#define ID3D12InfoQueue_PushCopyOfRetrievalFilter(This) \ + ( (This)->lpVtbl -> PushCopyOfRetrievalFilter(This) ) + +#define ID3D12InfoQueue_PushRetrievalFilter(This,pFilter) \ + ( (This)->lpVtbl -> PushRetrievalFilter(This,pFilter) ) + +#define ID3D12InfoQueue_PopRetrievalFilter(This) \ + ( (This)->lpVtbl -> PopRetrievalFilter(This) ) + +#define ID3D12InfoQueue_GetRetrievalFilterStackSize(This) \ + ( (This)->lpVtbl -> GetRetrievalFilterStackSize(This) ) + +#define ID3D12InfoQueue_AddMessage(This,Category,Severity,ID,pDescription) \ + ( (This)->lpVtbl -> AddMessage(This,Category,Severity,ID,pDescription) ) + +#define ID3D12InfoQueue_AddApplicationMessage(This,Severity,pDescription) \ + ( (This)->lpVtbl -> AddApplicationMessage(This,Severity,pDescription) ) + +#define ID3D12InfoQueue_SetBreakOnCategory(This,Category,bEnable) \ + ( (This)->lpVtbl -> SetBreakOnCategory(This,Category,bEnable) ) + +#define ID3D12InfoQueue_SetBreakOnSeverity(This,Severity,bEnable) \ + ( (This)->lpVtbl -> SetBreakOnSeverity(This,Severity,bEnable) ) + +#define ID3D12InfoQueue_SetBreakOnID(This,ID,bEnable) \ + ( (This)->lpVtbl -> SetBreakOnID(This,ID,bEnable) ) + +#define ID3D12InfoQueue_GetBreakOnCategory(This,Category) \ + ( (This)->lpVtbl -> GetBreakOnCategory(This,Category) ) + +#define ID3D12InfoQueue_GetBreakOnSeverity(This,Severity) \ + ( (This)->lpVtbl -> GetBreakOnSeverity(This,Severity) ) + +#define ID3D12InfoQueue_GetBreakOnID(This,ID) \ + ( (This)->lpVtbl -> GetBreakOnID(This,ID) ) + +#define ID3D12InfoQueue_SetMuteDebugOutput(This,bMute) \ + ( (This)->lpVtbl -> SetMuteDebugOutput(This,bMute) ) + +#define ID3D12InfoQueue_GetMuteDebugOutput(This) \ + ( (This)->lpVtbl -> GetMuteDebugOutput(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12InfoQueue_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12sdklayers_0000_0018 */ +/* [local] */ + +typedef +enum D3D12_MESSAGE_CALLBACK_FLAGS + { + D3D12_MESSAGE_CALLBACK_FLAG_NONE = 0, + D3D12_MESSAGE_CALLBACK_IGNORE_FILTERS = 0x1 + } D3D12_MESSAGE_CALLBACK_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_MESSAGE_CALLBACK_FLAGS) +typedef void ( __stdcall *D3D12MessageFunc )( + D3D12_MESSAGE_CATEGORY Category, + D3D12_MESSAGE_SEVERITY Severity, + D3D12_MESSAGE_ID ID, + LPCSTR pDescription, + void *pContext); + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0018_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0018_v0_0_s_ifspec; + +#ifndef __ID3D12InfoQueue1_INTERFACE_DEFINED__ +#define __ID3D12InfoQueue1_INTERFACE_DEFINED__ + +/* interface ID3D12InfoQueue1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12InfoQueue1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2852dd88-b484-4c0c-b6b1-67168500e600") + ID3D12InfoQueue1 : public ID3D12InfoQueue + { + public: + virtual HRESULT STDMETHODCALLTYPE RegisterMessageCallback( + _In_ D3D12MessageFunc CallbackFunc, + _In_ D3D12_MESSAGE_CALLBACK_FLAGS CallbackFilterFlags, + _In_ void *pContext, + _Inout_ DWORD *pCallbackCookie) = 0; + + virtual HRESULT STDMETHODCALLTYPE UnregisterMessageCallback( + _In_ DWORD CallbackCookie) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12InfoQueue1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12InfoQueue1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetMessageCountLimit) + HRESULT ( STDMETHODCALLTYPE *SetMessageCountLimit )( + ID3D12InfoQueue1 * This, + _In_ UINT64 MessageCountLimit); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, ClearStoredMessages) + void ( STDMETHODCALLTYPE *ClearStoredMessages )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetMessage) + HRESULT ( STDMETHODCALLTYPE *GetMessage )( + ID3D12InfoQueue1 * This, + _In_ UINT64 MessageIndex, + _Out_writes_bytes_opt_(*pMessageByteLength) D3D12_MESSAGE *pMessage, + _Inout_ SIZE_T *pMessageByteLength); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumMessagesAllowedByStorageFilter) + UINT64 ( STDMETHODCALLTYPE *GetNumMessagesAllowedByStorageFilter )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumMessagesDeniedByStorageFilter) + UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDeniedByStorageFilter )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumStoredMessages) + UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessages )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumStoredMessagesAllowedByRetrievalFilter) + UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessagesAllowedByRetrievalFilter )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumMessagesDiscardedByMessageCountLimit) + UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDiscardedByMessageCountLimit )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetMessageCountLimit) + UINT64 ( STDMETHODCALLTYPE *GetMessageCountLimit )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, AddStorageFilterEntries) + HRESULT ( STDMETHODCALLTYPE *AddStorageFilterEntries )( + ID3D12InfoQueue1 * This, + _In_ D3D12_INFO_QUEUE_FILTER *pFilter); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetStorageFilter) + HRESULT ( STDMETHODCALLTYPE *GetStorageFilter )( + ID3D12InfoQueue1 * This, + _Out_writes_bytes_opt_(*pFilterByteLength) D3D12_INFO_QUEUE_FILTER *pFilter, + _Inout_ SIZE_T *pFilterByteLength); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, ClearStorageFilter) + void ( STDMETHODCALLTYPE *ClearStorageFilter )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushEmptyStorageFilter) + HRESULT ( STDMETHODCALLTYPE *PushEmptyStorageFilter )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushCopyOfStorageFilter) + HRESULT ( STDMETHODCALLTYPE *PushCopyOfStorageFilter )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushStorageFilter) + HRESULT ( STDMETHODCALLTYPE *PushStorageFilter )( + ID3D12InfoQueue1 * This, + _In_ D3D12_INFO_QUEUE_FILTER *pFilter); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PopStorageFilter) + void ( STDMETHODCALLTYPE *PopStorageFilter )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetStorageFilterStackSize) + UINT ( STDMETHODCALLTYPE *GetStorageFilterStackSize )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, AddRetrievalFilterEntries) + HRESULT ( STDMETHODCALLTYPE *AddRetrievalFilterEntries )( + ID3D12InfoQueue1 * This, + _In_ D3D12_INFO_QUEUE_FILTER *pFilter); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetRetrievalFilter) + HRESULT ( STDMETHODCALLTYPE *GetRetrievalFilter )( + ID3D12InfoQueue1 * This, + _Out_writes_bytes_opt_(*pFilterByteLength) D3D12_INFO_QUEUE_FILTER *pFilter, + _Inout_ SIZE_T *pFilterByteLength); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, ClearRetrievalFilter) + void ( STDMETHODCALLTYPE *ClearRetrievalFilter )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushEmptyRetrievalFilter) + HRESULT ( STDMETHODCALLTYPE *PushEmptyRetrievalFilter )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushCopyOfRetrievalFilter) + HRESULT ( STDMETHODCALLTYPE *PushCopyOfRetrievalFilter )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushRetrievalFilter) + HRESULT ( STDMETHODCALLTYPE *PushRetrievalFilter )( + ID3D12InfoQueue1 * This, + _In_ D3D12_INFO_QUEUE_FILTER *pFilter); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PopRetrievalFilter) + void ( STDMETHODCALLTYPE *PopRetrievalFilter )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetRetrievalFilterStackSize) + UINT ( STDMETHODCALLTYPE *GetRetrievalFilterStackSize )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, AddMessage) + HRESULT ( STDMETHODCALLTYPE *AddMessage )( + ID3D12InfoQueue1 * This, + _In_ D3D12_MESSAGE_CATEGORY Category, + _In_ D3D12_MESSAGE_SEVERITY Severity, + _In_ D3D12_MESSAGE_ID ID, + _In_ LPCSTR pDescription); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, AddApplicationMessage) + HRESULT ( STDMETHODCALLTYPE *AddApplicationMessage )( + ID3D12InfoQueue1 * This, + _In_ D3D12_MESSAGE_SEVERITY Severity, + _In_ LPCSTR pDescription); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetBreakOnCategory) + HRESULT ( STDMETHODCALLTYPE *SetBreakOnCategory )( + ID3D12InfoQueue1 * This, + _In_ D3D12_MESSAGE_CATEGORY Category, + _In_ BOOL bEnable); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetBreakOnSeverity) + HRESULT ( STDMETHODCALLTYPE *SetBreakOnSeverity )( + ID3D12InfoQueue1 * This, + _In_ D3D12_MESSAGE_SEVERITY Severity, + _In_ BOOL bEnable); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetBreakOnID) + HRESULT ( STDMETHODCALLTYPE *SetBreakOnID )( + ID3D12InfoQueue1 * This, + _In_ D3D12_MESSAGE_ID ID, + _In_ BOOL bEnable); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetBreakOnCategory) + BOOL ( STDMETHODCALLTYPE *GetBreakOnCategory )( + ID3D12InfoQueue1 * This, + _In_ D3D12_MESSAGE_CATEGORY Category); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetBreakOnSeverity) + BOOL ( STDMETHODCALLTYPE *GetBreakOnSeverity )( + ID3D12InfoQueue1 * This, + _In_ D3D12_MESSAGE_SEVERITY Severity); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetBreakOnID) + BOOL ( STDMETHODCALLTYPE *GetBreakOnID )( + ID3D12InfoQueue1 * This, + _In_ D3D12_MESSAGE_ID ID); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetMuteDebugOutput) + void ( STDMETHODCALLTYPE *SetMuteDebugOutput )( + ID3D12InfoQueue1 * This, + _In_ BOOL bMute); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetMuteDebugOutput) + BOOL ( STDMETHODCALLTYPE *GetMuteDebugOutput )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue1, RegisterMessageCallback) + HRESULT ( STDMETHODCALLTYPE *RegisterMessageCallback )( + ID3D12InfoQueue1 * This, + _In_ D3D12MessageFunc CallbackFunc, + _In_ D3D12_MESSAGE_CALLBACK_FLAGS CallbackFilterFlags, + _In_ void *pContext, + _Inout_ DWORD *pCallbackCookie); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue1, UnregisterMessageCallback) + HRESULT ( STDMETHODCALLTYPE *UnregisterMessageCallback )( + ID3D12InfoQueue1 * This, + _In_ DWORD CallbackCookie); + + END_INTERFACE + } ID3D12InfoQueue1Vtbl; + + interface ID3D12InfoQueue1 + { + CONST_VTBL struct ID3D12InfoQueue1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12InfoQueue1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12InfoQueue1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12InfoQueue1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12InfoQueue1_SetMessageCountLimit(This,MessageCountLimit) \ + ( (This)->lpVtbl -> SetMessageCountLimit(This,MessageCountLimit) ) + +#define ID3D12InfoQueue1_ClearStoredMessages(This) \ + ( (This)->lpVtbl -> ClearStoredMessages(This) ) + +#define ID3D12InfoQueue1_GetMessage(This,MessageIndex,pMessage,pMessageByteLength) \ + ( (This)->lpVtbl -> GetMessage(This,MessageIndex,pMessage,pMessageByteLength) ) + +#define ID3D12InfoQueue1_GetNumMessagesAllowedByStorageFilter(This) \ + ( (This)->lpVtbl -> GetNumMessagesAllowedByStorageFilter(This) ) + +#define ID3D12InfoQueue1_GetNumMessagesDeniedByStorageFilter(This) \ + ( (This)->lpVtbl -> GetNumMessagesDeniedByStorageFilter(This) ) + +#define ID3D12InfoQueue1_GetNumStoredMessages(This) \ + ( (This)->lpVtbl -> GetNumStoredMessages(This) ) + +#define ID3D12InfoQueue1_GetNumStoredMessagesAllowedByRetrievalFilter(This) \ + ( (This)->lpVtbl -> GetNumStoredMessagesAllowedByRetrievalFilter(This) ) + +#define ID3D12InfoQueue1_GetNumMessagesDiscardedByMessageCountLimit(This) \ + ( (This)->lpVtbl -> GetNumMessagesDiscardedByMessageCountLimit(This) ) + +#define ID3D12InfoQueue1_GetMessageCountLimit(This) \ + ( (This)->lpVtbl -> GetMessageCountLimit(This) ) + +#define ID3D12InfoQueue1_AddStorageFilterEntries(This,pFilter) \ + ( (This)->lpVtbl -> AddStorageFilterEntries(This,pFilter) ) + +#define ID3D12InfoQueue1_GetStorageFilter(This,pFilter,pFilterByteLength) \ + ( (This)->lpVtbl -> GetStorageFilter(This,pFilter,pFilterByteLength) ) + +#define ID3D12InfoQueue1_ClearStorageFilter(This) \ + ( (This)->lpVtbl -> ClearStorageFilter(This) ) + +#define ID3D12InfoQueue1_PushEmptyStorageFilter(This) \ + ( (This)->lpVtbl -> PushEmptyStorageFilter(This) ) + +#define ID3D12InfoQueue1_PushCopyOfStorageFilter(This) \ + ( (This)->lpVtbl -> PushCopyOfStorageFilter(This) ) + +#define ID3D12InfoQueue1_PushStorageFilter(This,pFilter) \ + ( (This)->lpVtbl -> PushStorageFilter(This,pFilter) ) + +#define ID3D12InfoQueue1_PopStorageFilter(This) \ + ( (This)->lpVtbl -> PopStorageFilter(This) ) + +#define ID3D12InfoQueue1_GetStorageFilterStackSize(This) \ + ( (This)->lpVtbl -> GetStorageFilterStackSize(This) ) + +#define ID3D12InfoQueue1_AddRetrievalFilterEntries(This,pFilter) \ + ( (This)->lpVtbl -> AddRetrievalFilterEntries(This,pFilter) ) + +#define ID3D12InfoQueue1_GetRetrievalFilter(This,pFilter,pFilterByteLength) \ + ( (This)->lpVtbl -> GetRetrievalFilter(This,pFilter,pFilterByteLength) ) + +#define ID3D12InfoQueue1_ClearRetrievalFilter(This) \ + ( (This)->lpVtbl -> ClearRetrievalFilter(This) ) + +#define ID3D12InfoQueue1_PushEmptyRetrievalFilter(This) \ + ( (This)->lpVtbl -> PushEmptyRetrievalFilter(This) ) + +#define ID3D12InfoQueue1_PushCopyOfRetrievalFilter(This) \ + ( (This)->lpVtbl -> PushCopyOfRetrievalFilter(This) ) + +#define ID3D12InfoQueue1_PushRetrievalFilter(This,pFilter) \ + ( (This)->lpVtbl -> PushRetrievalFilter(This,pFilter) ) + +#define ID3D12InfoQueue1_PopRetrievalFilter(This) \ + ( (This)->lpVtbl -> PopRetrievalFilter(This) ) + +#define ID3D12InfoQueue1_GetRetrievalFilterStackSize(This) \ + ( (This)->lpVtbl -> GetRetrievalFilterStackSize(This) ) + +#define ID3D12InfoQueue1_AddMessage(This,Category,Severity,ID,pDescription) \ + ( (This)->lpVtbl -> AddMessage(This,Category,Severity,ID,pDescription) ) + +#define ID3D12InfoQueue1_AddApplicationMessage(This,Severity,pDescription) \ + ( (This)->lpVtbl -> AddApplicationMessage(This,Severity,pDescription) ) + +#define ID3D12InfoQueue1_SetBreakOnCategory(This,Category,bEnable) \ + ( (This)->lpVtbl -> SetBreakOnCategory(This,Category,bEnable) ) + +#define ID3D12InfoQueue1_SetBreakOnSeverity(This,Severity,bEnable) \ + ( (This)->lpVtbl -> SetBreakOnSeverity(This,Severity,bEnable) ) + +#define ID3D12InfoQueue1_SetBreakOnID(This,ID,bEnable) \ + ( (This)->lpVtbl -> SetBreakOnID(This,ID,bEnable) ) + +#define ID3D12InfoQueue1_GetBreakOnCategory(This,Category) \ + ( (This)->lpVtbl -> GetBreakOnCategory(This,Category) ) + +#define ID3D12InfoQueue1_GetBreakOnSeverity(This,Severity) \ + ( (This)->lpVtbl -> GetBreakOnSeverity(This,Severity) ) + +#define ID3D12InfoQueue1_GetBreakOnID(This,ID) \ + ( (This)->lpVtbl -> GetBreakOnID(This,ID) ) + +#define ID3D12InfoQueue1_SetMuteDebugOutput(This,bMute) \ + ( (This)->lpVtbl -> SetMuteDebugOutput(This,bMute) ) + +#define ID3D12InfoQueue1_GetMuteDebugOutput(This) \ + ( (This)->lpVtbl -> GetMuteDebugOutput(This) ) + + +#define ID3D12InfoQueue1_RegisterMessageCallback(This,CallbackFunc,CallbackFilterFlags,pContext,pCallbackCookie) \ + ( (This)->lpVtbl -> RegisterMessageCallback(This,CallbackFunc,CallbackFilterFlags,pContext,pCallbackCookie) ) + +#define ID3D12InfoQueue1_UnregisterMessageCallback(This,CallbackCookie) \ + ( (This)->lpVtbl -> UnregisterMessageCallback(This,CallbackCookie) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12InfoQueue1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12sdklayers_0000_0019 */ +/* [local] */ + +#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */ +#pragma endregion +DEFINE_GUID(IID_ID3D12Debug,0x344488b7,0x6846,0x474b,0xb9,0x89,0xf0,0x27,0x44,0x82,0x45,0xe0); +DEFINE_GUID(IID_ID3D12Debug1,0xaffaa4ca,0x63fe,0x4d8e,0xb8,0xad,0x15,0x90,0x00,0xaf,0x43,0x04); +DEFINE_GUID(IID_ID3D12Debug2,0x93a665c4,0xa3b2,0x4e5d,0xb6,0x92,0xa2,0x6a,0xe1,0x4e,0x33,0x74); +DEFINE_GUID(IID_ID3D12Debug3,0x5cf4e58f,0xf671,0x4ff1,0xa5,0x42,0x36,0x86,0xe3,0xd1,0x53,0xd1); +DEFINE_GUID(IID_ID3D12Debug4,0x014b816e,0x9ec5,0x4a2f,0xa8,0x45,0xff,0xbe,0x44,0x1c,0xe1,0x3a); +DEFINE_GUID(IID_ID3D12Debug5,0x548d6b12,0x09fa,0x40e0,0x90,0x69,0x5d,0xcd,0x58,0x9a,0x52,0xc9); +DEFINE_GUID(IID_ID3D12Debug6,0x82a816d6,0x5d01,0x4157,0x97,0xd0,0x49,0x75,0x46,0x3f,0xd1,0xed); +DEFINE_GUID(IID_ID3D12DebugDevice1,0xa9b71770,0xd099,0x4a65,0xa6,0x98,0x3d,0xee,0x10,0x02,0x0f,0x88); +DEFINE_GUID(IID_ID3D12DebugDevice,0x3febd6dd,0x4973,0x4787,0x81,0x94,0xe4,0x5f,0x9e,0x28,0x92,0x3e); +DEFINE_GUID(IID_ID3D12DebugDevice2,0x60eccbc1,0x378d,0x4df1,0x89,0x4c,0xf8,0xac,0x5c,0xe4,0xd7,0xdd); +DEFINE_GUID(IID_ID3D12DebugCommandQueue,0x09e0bf36,0x54ac,0x484f,0x88,0x47,0x4b,0xae,0xea,0xb6,0x05,0x3a); +DEFINE_GUID(IID_ID3D12DebugCommandQueue1,0x16be35a2,0xbfd6,0x49f2,0xbc,0xae,0xea,0xae,0x4a,0xff,0x86,0x2d); +DEFINE_GUID(IID_ID3D12DebugCommandList1,0x102ca951,0x311b,0x4b01,0xb1,0x1f,0xec,0xb8,0x3e,0x06,0x1b,0x37); +DEFINE_GUID(IID_ID3D12DebugCommandList,0x09e0bf36,0x54ac,0x484f,0x88,0x47,0x4b,0xae,0xea,0xb6,0x05,0x3f); +DEFINE_GUID(IID_ID3D12DebugCommandList2,0xaeb575cf,0x4e06,0x48be,0xba,0x3b,0xc4,0x50,0xfc,0x96,0x65,0x2e); +DEFINE_GUID(IID_ID3D12DebugCommandList3,0x197d5e15,0x4d37,0x4d34,0xaf,0x78,0x72,0x4c,0xd7,0x0f,0xdb,0x1f); +DEFINE_GUID(IID_ID3D12SharingContract,0x0adf7d52,0x929c,0x4e61,0xad,0xdb,0xff,0xed,0x30,0xde,0x66,0xef); +DEFINE_GUID(IID_ID3D12InfoQueue,0x0742a90b,0xc387,0x483f,0xb9,0x46,0x30,0xa7,0xe4,0xe6,0x14,0x58); +DEFINE_GUID(IID_ID3D12InfoQueue1,0x2852dd88,0xb484,0x4c0c,0xb6,0xb1,0x67,0x16,0x85,0x00,0xe6,0x00); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0019_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0019_v0_0_s_ifspec; + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12sdklayers.idl b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12sdklayers.idl new file mode 100644 index 0000000..c80c0d0 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12sdklayers.idl @@ -0,0 +1,1761 @@ +/*------------------------------------------------------------------------------------- + * + * Copyright (c) Microsoft Corporation + * Licensed under the MIT license + * + *-------------------------------------------------------------------------------------*/ +import "oaidl.idl"; +import "ocidl.idl"; + +import "d3d12.idl"; + +cpp_quote("#include ") + +#pragma region App Family +cpp_quote("#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES)") + +//================================================================================================================================== +// +// Debugging Layer +// +//================================================================================================================================== + +[uuid(344488b7-6846-474b-b989-f027448245e0), object, local, pointer_default(unique)] +interface ID3D12Debug + : IUnknown +{ + void EnableDebugLayer(); +} + +typedef enum D3D12_GPU_BASED_VALIDATION_FLAGS +{ + D3D12_GPU_BASED_VALIDATION_FLAGS_NONE = 0x00, + D3D12_GPU_BASED_VALIDATION_FLAGS_DISABLE_STATE_TRACKING = 0x01, + +} D3D12_GPU_BASED_VALIDATION_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_GPU_BASED_VALIDATION_FLAGS)") + + +[uuid(affaa4ca-63fe-4d8e-b8ad-159000af4304), object, local, pointer_default(unique)] +interface ID3D12Debug1 + : IUnknown +{ + void EnableDebugLayer(); + void SetEnableGPUBasedValidation(BOOL Enable); + void SetEnableSynchronizedCommandQueueValidation(BOOL Enable); +} + +[uuid(93a665c4-a3b2-4e5d-b692-a26ae14e3374), object, local, pointer_default(unique)] +interface ID3D12Debug2 + : IUnknown +{ + void SetGPUBasedValidationFlags(D3D12_GPU_BASED_VALIDATION_FLAGS Flags); +} + +[uuid(5cf4e58f-f671-4ff1-a542-3686e3d153d1), object, local, pointer_default(unique)] +interface ID3D12Debug3 + : ID3D12Debug +{ + void SetEnableGPUBasedValidation(BOOL Enable); + void SetEnableSynchronizedCommandQueueValidation(BOOL Enable); + void SetGPUBasedValidationFlags(D3D12_GPU_BASED_VALIDATION_FLAGS Flags); +} + +[uuid(014b816e-9ec5-4a2f-a845-ffbe441ce13a), object, local, pointer_default(unique)] +interface ID3D12Debug4 + : ID3D12Debug3 +{ + void DisableDebugLayer(); +} + +[uuid(548d6b12-09fa-40e0-9069-5dcd589a52c9), object, local, pointer_default(unique)] +interface ID3D12Debug5 + : ID3D12Debug4 +{ + void SetEnableAutoName(BOOL Enable); +} + +[uuid(82a816d6-5d01-4157-97d0-4975463fd1ed), object, local, pointer_default(unique)] +interface ID3D12Debug6 + : ID3D12Debug5 +{ + void SetForceLegacyBarrierValidation(BOOL Enable); +} + +cpp_quote("DEFINE_GUID(WKPDID_D3DAutoDebugObjectNameW, 0xd4902e36, 0x757a, 0x4942, 0x95, 0x94, 0xb6, 0x76, 0x9a, 0xfa, 0x43, 0xcd);") + +typedef enum D3D12_RLDO_FLAGS +{ + D3D12_RLDO_NONE = 0x0, + D3D12_RLDO_SUMMARY = 0x1, + D3D12_RLDO_DETAIL = 0x2, + D3D12_RLDO_IGNORE_INTERNAL = 0x4, + +} D3D12_RLDO_FLAGS; + +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS(D3D12_RLDO_FLAGS)") + +typedef enum D3D12_DEBUG_DEVICE_PARAMETER_TYPE +{ + D3D12_DEBUG_DEVICE_PARAMETER_FEATURE_FLAGS, + D3D12_DEBUG_DEVICE_PARAMETER_GPU_BASED_VALIDATION_SETTINGS, + D3D12_DEBUG_DEVICE_PARAMETER_GPU_SLOWDOWN_PERFORMANCE_FACTOR, +} D3D12_DEBUG_DEVICE_PARAMETER_TYPE; + +typedef enum D3D12_DEBUG_FEATURE +{ + D3D12_DEBUG_FEATURE_NONE = 0x00, + D3D12_DEBUG_FEATURE_ALLOW_BEHAVIOR_CHANGING_DEBUG_AIDS = 0x01, + D3D12_DEBUG_FEATURE_CONSERVATIVE_RESOURCE_STATE_TRACKING = 0x02, + D3D12_DEBUG_FEATURE_DISABLE_VIRTUALIZED_BUNDLES_VALIDATION = 0x04, + D3D12_DEBUG_FEATURE_EMULATE_WINDOWS7 = 0x08, +} D3D12_DEBUG_FEATURE; + +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_DEBUG_FEATURE)") + +typedef enum D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE +{ + D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_NONE, + D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_STATE_TRACKING_ONLY, + D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_UNGUARDED_VALIDATION, + D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_GUARDED_VALIDATION, + NUM_D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODES +} D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE; + +typedef enum D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS +{ + D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_NONE = 0x00, + D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_FRONT_LOAD_CREATE_TRACKING_ONLY_SHADERS = 0x01, + D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_FRONT_LOAD_CREATE_UNGUARDED_VALIDATION_SHADERS = 0x02, + D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_FRONT_LOAD_CREATE_GUARDED_VALIDATION_SHADERS = 0x04, + D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS_VALID_MASK = 0x07 +} D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS; + +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS)") + +typedef struct D3D12_DEBUG_DEVICE_GPU_BASED_VALIDATION_SETTINGS +{ + UINT MaxMessagesPerCommandList; + D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE DefaultShaderPatchMode; + D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS PipelineStateCreateFlags; +} D3D12_DEBUG_DEVICE_GPU_BASED_VALIDATION_SETTINGS; + +typedef struct D3D12_DEBUG_DEVICE_GPU_SLOWDOWN_PERFORMANCE_FACTOR +{ + FLOAT SlowdownFactor; +} D3D12_DEBUG_DEVICE_GPU_SLOWDOWN_PERFORMANCE_FACTOR; + +[uuid(a9b71770-d099-4a65-a698-3dee10020f88), object, local, pointer_default(unique)] +interface ID3D12DebugDevice1 + : IUnknown +{ + HRESULT SetDebugParameter(D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type, [annotation("_In_reads_bytes_(DataSize)")] const void *pData, UINT DataSize); + HRESULT GetDebugParameter(D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type, [annotation("_Out_writes_bytes_(DataSize)")] void *pData, UINT DataSize); + HRESULT ReportLiveDeviceObjects( D3D12_RLDO_FLAGS Flags ); +} + +[uuid(3febd6dd-4973-4787-8194-e45f9e28923e), object, local, pointer_default(unique)] +interface ID3D12DebugDevice + : IUnknown +{ + HRESULT SetFeatureMask(D3D12_DEBUG_FEATURE Mask); + D3D12_DEBUG_FEATURE GetFeatureMask(); + HRESULT ReportLiveDeviceObjects(D3D12_RLDO_FLAGS Flags); +} + +[uuid(60eccbc1-378d-4df1-894c-f8ac5ce4d7dd), object, local, pointer_default(unique)] +interface ID3D12DebugDevice2 + : ID3D12DebugDevice +{ + HRESULT SetDebugParameter(D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type, [annotation("_In_reads_bytes_(DataSize)")] const void *pData, UINT DataSize); + HRESULT GetDebugParameter(D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type, [annotation("_Out_writes_bytes_(DataSize)")] void *pData, UINT DataSize); +} + +cpp_quote("DEFINE_GUID(DXGI_DEBUG_D3D12, 0xcf59a98c, 0xa950, 0x4326, 0x91, 0xef, 0x9b, 0xba, 0xa1, 0x7b, 0xfd, 0x95);") + + +[ uuid( 09e0bf36-54ac-484f-8847-4baeeab6053a ), object, local, pointer_default( unique ) ] +interface ID3D12DebugCommandQueue + : IUnknown +{ + BOOL AssertResourceState( [annotation("_In_")] ID3D12Resource* pResource, UINT Subresource, UINT State ); +// TODO: Stale BOOL AssertResourceStateThroughView( [annotation("_In_")] ID3D12View* pView, UINT State ); +}; + +[ uuid( 16be35a2-bfd6-49f2-bcae-eaae4aff862d ), object, local, pointer_default( unique ) ] +interface ID3D12DebugCommandQueue1 + : ID3D12DebugCommandQueue +{ + void AssertResourceAccess([annotation("_In_")] ID3D12Resource* pResource, UINT Subresource, D3D12_BARRIER_ACCESS Access); + void AssertTextureLayout([annotation("_In_")] ID3D12Resource* pResource, UINT Subresource, D3D12_BARRIER_LAYOUT Layout); +}; + +typedef enum D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE +{ + D3D12_DEBUG_COMMAND_LIST_PARAMETER_GPU_BASED_VALIDATION_SETTINGS, +} D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE; + +typedef struct D3D12_DEBUG_COMMAND_LIST_GPU_BASED_VALIDATION_SETTINGS +{ + D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE ShaderPatchMode; +} D3D12_DEBUG_COMMAND_LIST_GPU_BASED_VALIDATION_SETTINGS; + +[ uuid( 102ca951-311b-4b01-b11f-ecb83e061b37 ), object, local, pointer_default( unique ) ] +interface ID3D12DebugCommandList1 + : IUnknown +{ + BOOL AssertResourceState( [annotation("_In_")] ID3D12Resource* pResource, UINT Subresource, UINT State ); + HRESULT SetDebugParameter(D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type, [annotation("_In_reads_bytes_(DataSize)")] const void *pData, UINT DataSize); + HRESULT GetDebugParameter(D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type, [annotation("_Out_writes_bytes_(DataSize)")] void *pData, UINT DataSize); +}; + +[uuid(09e0bf36-54ac-484f-8847-4baeeab6053f), object, local, pointer_default(unique)] +interface ID3D12DebugCommandList + : IUnknown +{ + BOOL AssertResourceState([annotation("_In_")] ID3D12Resource* pResource, UINT Subresource, UINT State); + HRESULT SetFeatureMask(D3D12_DEBUG_FEATURE Mask); + D3D12_DEBUG_FEATURE GetFeatureMask(); +}; + +[ uuid(aeb575cf-4e06-48be-ba3b-c450fc96652e), object, local, pointer_default( unique ) ] +interface ID3D12DebugCommandList2 + : ID3D12DebugCommandList +{ + HRESULT SetDebugParameter(D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type, [annotation("_In_reads_bytes_(DataSize)")] const void *pData, UINT DataSize); + HRESULT GetDebugParameter(D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type, [annotation("_Out_writes_bytes_(DataSize)")] void *pData, UINT DataSize); +}; + +[ uuid(197d5e15-4d37-4d34-af78-724cd70fdb1f), object, local, pointer_default( unique ) ] +interface ID3D12DebugCommandList3 + : ID3D12DebugCommandList2 +{ + void AssertResourceAccess([annotation("_In_")] ID3D12Resource* pResource, UINT Subresource, D3D12_BARRIER_ACCESS Access); + void AssertTextureLayout([annotation("_In_")] ID3D12Resource* pResource, UINT Subresource, D3D12_BARRIER_LAYOUT Layout); +}; + +[uuid(0adf7d52-929c-4e61-addb-ffed30de66ef), object, local, pointer_default(unique)] +interface ID3D12SharingContract + : IUnknown +{ + void Present([annotation("_In_")] ID3D12Resource* pResource, UINT Subresource, [annotation("_In_")] HWND window); + void SharedFenceSignal([annotation("_In_")] ID3D12Fence* pFence, UINT64 FenceValue); + void BeginCapturableWork([annotation("_In_")] REFGUID guid); + void EndCapturableWork([annotation("_In_")] REFGUID guid); +}; + + +//================================================================================================================================== +// +// Info Queue +// +//================================================================================================================================== +typedef enum D3D12_MESSAGE_CATEGORY { + D3D12_MESSAGE_CATEGORY_APPLICATION_DEFINED, + D3D12_MESSAGE_CATEGORY_MISCELLANEOUS, + D3D12_MESSAGE_CATEGORY_INITIALIZATION, + D3D12_MESSAGE_CATEGORY_CLEANUP, + D3D12_MESSAGE_CATEGORY_COMPILATION, + D3D12_MESSAGE_CATEGORY_STATE_CREATION, + D3D12_MESSAGE_CATEGORY_STATE_SETTING, + D3D12_MESSAGE_CATEGORY_STATE_GETTING, + D3D12_MESSAGE_CATEGORY_RESOURCE_MANIPULATION, + D3D12_MESSAGE_CATEGORY_EXECUTION, + D3D12_MESSAGE_CATEGORY_SHADER, +} D3D12_MESSAGE_CATEGORY; + +typedef enum D3D12_MESSAGE_SEVERITY { + D3D12_MESSAGE_SEVERITY_CORRUPTION, + D3D12_MESSAGE_SEVERITY_ERROR, + D3D12_MESSAGE_SEVERITY_WARNING, + D3D12_MESSAGE_SEVERITY_INFO, + D3D12_MESSAGE_SEVERITY_MESSAGE +} D3D12_MESSAGE_SEVERITY; + +// Unique ID for every error +// CAUTION: New enum values should be appended to the list only. Inserting +// new enum values into the middle of the list results in changing the numeric +// values of some ID's from one SDK release to the next. This in-turn breaks +// PIX and customer tools/filters. +typedef enum D3D12_MESSAGE_ID { + D3D12_MESSAGE_ID_UNKNOWN = 0, + + //-------------------------------------------------------------------------- + // Messages Used by Core + // Message IDs generated from core are at the beginning + // since the core changes less frequently than the debug layer. + + // End of Messages used by Core + // ------------------------------------------------------------------------ + D3D12_MESSAGE_ID_STRING_FROM_APPLICATION = 1, + D3D12_MESSAGE_ID_CORRUPTED_THIS = 2, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER1 = 3, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER2 = 4, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER3 = 5, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER4 = 6, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER5 = 7, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER6 = 8, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER7 = 9, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER8 = 10, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER9 = 11, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER10 = 12, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER11 = 13, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER12 = 14, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER13 = 15, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER14 = 16, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER15 = 17, + D3D12_MESSAGE_ID_CORRUPTED_MULTITHREADING = 18, + D3D12_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY = 19, + + D3D12_MESSAGE_ID_GETPRIVATEDATA_MOREDATA = 20, + D3D12_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA = 21, + D3D12_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS = 24, + D3D12_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY = 25, + + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT = 26, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC = 27, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT = 28, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDVIDEOPLANESLICE = 29, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDPLANESLICE = 30, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS = 31, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE = 32, + + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT = 35, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT = 36, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC = 37, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT = 38, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDVIDEOPLANESLICE = 39, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDPLANESLICE = 40, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS = 41, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE = 42, + + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT = 45, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC = 46, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT = 47, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS = 48, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE = 49, + + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY = 52, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS = 53, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT = 54, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT = 55, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT = 56, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS = 57, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH = 58, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE = 59, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE = 60, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT = 61, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC = 62, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE = 63, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC = 64, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT = 65, + + D3D12_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY = 66, + D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE = 67, + D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE = 68, + + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY = 69, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE = 70, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE = 71, + + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY = 72, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE = 73, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE = 74, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES = 75, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED = 76, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED = 79, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT = 80, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT = 81, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT = 82, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT = 83, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION = 84, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT = 85, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE = 86, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC = 87, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH = 88, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS = 89, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX = 90, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE = 91, + + D3D12_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY = 92, + D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE = 93, + D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE = 94, + + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE = 95, + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE = 96, + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP = 97, + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS = 98, + + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK = 100, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC = 101, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP = 102, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP = 103, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP = 104, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC = 105, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP = 106, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP = 107, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP = 108, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC = 109, + + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND = 111, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND = 112, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP = 113, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA = 114, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA = 115, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA = 116, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK = 117, + + D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID = 135, + + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ROOT_SIGNATURE_NOT_SET = 200, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ROOT_SIGNATURE_MISMATCH = 201, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_NOT_SET = 202, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL = 209, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_TOO_SMALL = 210, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_NOT_SET = 211, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_FORMAT_INVALID = 212, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_TOO_SMALL = 213, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INVALID_PRIMITIVETOPOLOGY = 219, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_STRIDE_UNALIGNED = 221, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_OFFSET_UNALIGNED = 222, + D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT = 232, + D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT = 233, + D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT = 234, + + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC = 239, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC = 240, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH = 245, + + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT = 253, + + D3D12_MESSAGE_ID_LIVE_OBJECT_SUMMARY = 255, + D3D12_MESSAGE_ID_LIVE_DEVICE = 274, + D3D12_MESSAGE_ID_LIVE_SWAPCHAIN = 275, + + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFLAGS = 276, + D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDCLASSLINKAGE = 277, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDCLASSLINKAGE = 278, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAMTORASTERIZER = 280, + D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDCLASSLINKAGE = 283, + + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAM = 284, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDENTRIES = 285, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTRIDES = 286, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTRIDES = 287, + + D3D12_MESSAGE_ID_CREATEHULLSHADER_OUTOFMEMORY = 289, + D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERBYTECODE = 290, + D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERTYPE = 291, + D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDCLASSLINKAGE = 292, + + D3D12_MESSAGE_ID_CREATEDOMAINSHADER_OUTOFMEMORY = 294, + D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERBYTECODE = 295, + D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERTYPE = 296, + D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCLASSLINKAGE = 297, + + D3D12_MESSAGE_ID_RESOURCE_UNMAP_NOTMAPPED = 310, + + D3D12_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_MISMATCHED_DATA_SIZE = 318, + + D3D12_MESSAGE_ID_CREATECOMPUTESHADER_OUTOFMEMORY = 321, + D3D12_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERBYTECODE = 322, + D3D12_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCLASSLINKAGE = 323, + + D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEFLOATOPSNOTSUPPORTED = 331, + D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEFLOATOPSNOTSUPPORTED = 332, + D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEFLOATOPSNOTSUPPORTED = 333, + D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEFLOATOPSNOTSUPPORTED = 334, + D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEFLOATOPSNOTSUPPORTED = 335, + D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEFLOATOPSNOTSUPPORTED = 336, + D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEFLOATOPSNOTSUPPORTED = 337, + + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDRESOURCE = 340, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDESC = 341, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFORMAT = 342, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDVIDEOPLANESLICE = 343, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDPLANESLICE = 344, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDIMENSIONS = 345, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_UNRECOGNIZEDFORMAT = 346, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFLAGS = 354, + + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFORCEDSAMPLECOUNT = 401, + + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDLOGICOPS = 403, + + D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 410, + D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 412, + D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 414, + D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 416, + D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEEXTENSIONSNOTSUPPORTED = 418, + D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 420, + D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 422, + + D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_UAVSNOTSUPPORTED = 425, + D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_UAVSNOTSUPPORTED = 426, + D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_UAVSNOTSUPPORTED = 427, + D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_UAVSNOTSUPPORTED = 428, + D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UAVSNOTSUPPORTED = 429, + D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_UAVSNOTSUPPORTED = 430, + D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_UAVSNOTSUPPORTED = 431, + + D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDSOURCERECT = 447, + D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_EMPTYRECT = 448, + + D3D12_MESSAGE_ID_UPDATETILEMAPPINGS_INVALID_PARAMETER = 493, + D3D12_MESSAGE_ID_COPYTILEMAPPINGS_INVALID_PARAMETER = 494, + + D3D12_MESSAGE_ID_CREATEDEVICE_INVALIDARGS = 506, + D3D12_MESSAGE_ID_CREATEDEVICE_WARNING = 507, + + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_TYPE = 519, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_NULL_POINTER = 520, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_SUBRESOURCE = 521, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_RESERVED_BITS = 522, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISSING_BIND_FLAGS = 523, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_MISC_FLAGS = 524, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_MATCHING_STATES = 525, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMBINATION = 526, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_BEFORE_AFTER_MISMATCH = 527, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_RESOURCE = 528, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_SAMPLE_COUNT = 529, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAGS = 530, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMBINED_FLAGS = 531, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAGS_FOR_FORMAT = 532, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_SPLIT_BARRIER = 533, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_UNMATCHED_END = 534, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_UNMATCHED_BEGIN = 535, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAG = 536, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMMAND_LIST_TYPE = 537, + D3D12_MESSAGE_ID_INVALID_SUBRESOURCE_STATE = 538, + D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_CONTENTION = 540, + D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_RESET = 541, + D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_RESET_BUNDLE = 542, + D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_CANNOT_RESET = 543, + D3D12_MESSAGE_ID_COMMAND_LIST_OPEN = 544, + D3D12_MESSAGE_ID_INVALID_BUNDLE_API = 546, + D3D12_MESSAGE_ID_COMMAND_LIST_CLOSED = 547, + D3D12_MESSAGE_ID_WRONG_COMMAND_ALLOCATOR_TYPE = 549, + D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_SYNC = 552, + D3D12_MESSAGE_ID_COMMAND_LIST_SYNC = 553, + D3D12_MESSAGE_ID_SET_DESCRIPTOR_HEAP_INVALID = 554, + + D3D12_MESSAGE_ID_CREATE_COMMANDQUEUE = 557, + D3D12_MESSAGE_ID_CREATE_COMMANDALLOCATOR = 558, + D3D12_MESSAGE_ID_CREATE_PIPELINESTATE = 559, + D3D12_MESSAGE_ID_CREATE_COMMANDLIST12 = 560, + D3D12_MESSAGE_ID_CREATE_RESOURCE = 562, + D3D12_MESSAGE_ID_CREATE_DESCRIPTORHEAP = 563, + D3D12_MESSAGE_ID_CREATE_ROOTSIGNATURE = 564, + D3D12_MESSAGE_ID_CREATE_LIBRARY = 565, + D3D12_MESSAGE_ID_CREATE_HEAP = 566, + D3D12_MESSAGE_ID_CREATE_MONITOREDFENCE = 567, + D3D12_MESSAGE_ID_CREATE_QUERYHEAP = 568, + D3D12_MESSAGE_ID_CREATE_COMMANDSIGNATURE = 569, + + D3D12_MESSAGE_ID_LIVE_COMMANDQUEUE = 570, + D3D12_MESSAGE_ID_LIVE_COMMANDALLOCATOR = 571, + D3D12_MESSAGE_ID_LIVE_PIPELINESTATE = 572, + D3D12_MESSAGE_ID_LIVE_COMMANDLIST12 = 573, + D3D12_MESSAGE_ID_LIVE_RESOURCE = 575, + D3D12_MESSAGE_ID_LIVE_DESCRIPTORHEAP = 576, + D3D12_MESSAGE_ID_LIVE_ROOTSIGNATURE = 577, + D3D12_MESSAGE_ID_LIVE_LIBRARY = 578, + D3D12_MESSAGE_ID_LIVE_HEAP = 579, + D3D12_MESSAGE_ID_LIVE_MONITOREDFENCE = 580, + D3D12_MESSAGE_ID_LIVE_QUERYHEAP = 581, + D3D12_MESSAGE_ID_LIVE_COMMANDSIGNATURE = 582, + + D3D12_MESSAGE_ID_DESTROY_COMMANDQUEUE = 583, + D3D12_MESSAGE_ID_DESTROY_COMMANDALLOCATOR = 584, + D3D12_MESSAGE_ID_DESTROY_PIPELINESTATE = 585, + D3D12_MESSAGE_ID_DESTROY_COMMANDLIST12 = 586, + D3D12_MESSAGE_ID_DESTROY_RESOURCE = 588, + D3D12_MESSAGE_ID_DESTROY_DESCRIPTORHEAP = 589, + D3D12_MESSAGE_ID_DESTROY_ROOTSIGNATURE = 590, + D3D12_MESSAGE_ID_DESTROY_LIBRARY = 591, + D3D12_MESSAGE_ID_DESTROY_HEAP = 592, + D3D12_MESSAGE_ID_DESTROY_MONITOREDFENCE = 593, + D3D12_MESSAGE_ID_DESTROY_QUERYHEAP = 594, + D3D12_MESSAGE_ID_DESTROY_COMMANDSIGNATURE = 595, + + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDIMENSIONS = 597, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDMISCFLAGS = 599, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDARG_RETURN = 602, + D3D12_MESSAGE_ID_CREATERESOURCE_OUTOFMEMORY_RETURN = 603, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDESC = 604, + // This was shipped, but is no longer used. Do not reuse. + //D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDINITIALSTATE = 605, + D3D12_MESSAGE_ID_POSSIBLY_INVALID_SUBRESOURCE_STATE = 607, + D3D12_MESSAGE_ID_INVALID_USE_OF_NON_RESIDENT_RESOURCE = 608, + D3D12_MESSAGE_ID_POSSIBLE_INVALID_USE_OF_NON_RESIDENT_RESOURCE = 609, + D3D12_MESSAGE_ID_BUNDLE_PIPELINE_STATE_MISMATCH = 610, + D3D12_MESSAGE_ID_PRIMITIVE_TOPOLOGY_MISMATCH_PIPELINE_STATE = 611, + D3D12_MESSAGE_ID_RENDER_TARGET_FORMAT_MISMATCH_PIPELINE_STATE = 613, + D3D12_MESSAGE_ID_RENDER_TARGET_SAMPLE_DESC_MISMATCH_PIPELINE_STATE = 614, + D3D12_MESSAGE_ID_DEPTH_STENCIL_FORMAT_MISMATCH_PIPELINE_STATE = 615, + D3D12_MESSAGE_ID_DEPTH_STENCIL_SAMPLE_DESC_MISMATCH_PIPELINE_STATE = 616, + D3D12_MESSAGE_ID_CREATESHADER_INVALIDBYTECODE = 622, + D3D12_MESSAGE_ID_CREATEHEAP_NULLDESC = 623, + D3D12_MESSAGE_ID_CREATEHEAP_INVALIDSIZE = 624, + D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDHEAPTYPE = 625, + D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDCPUPAGEPROPERTIES = 626, + D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDMEMORYPOOL = 627, + D3D12_MESSAGE_ID_CREATEHEAP_INVALIDPROPERTIES = 628, + D3D12_MESSAGE_ID_CREATEHEAP_INVALIDALIGNMENT = 629, + D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDMISCFLAGS = 630, + D3D12_MESSAGE_ID_CREATEHEAP_INVALIDMISCFLAGS = 631, + D3D12_MESSAGE_ID_CREATEHEAP_INVALIDARG_RETURN = 632, + D3D12_MESSAGE_ID_CREATEHEAP_OUTOFMEMORY_RETURN = 633, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLHEAPPROPERTIES = 634, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDHEAPTYPE = 635, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDCPUPAGEPROPERTIES = 636, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDMEMORYPOOL = 637, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDHEAPPROPERTIES = 638, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDHEAPMISCFLAGS = 639, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDHEAPMISCFLAGS = 640, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDARG_RETURN = 641, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_OUTOFMEMORY_RETURN = 642, + D3D12_MESSAGE_ID_GETCUSTOMHEAPPROPERTIES_UNRECOGNIZEDHEAPTYPE = 643, + D3D12_MESSAGE_ID_GETCUSTOMHEAPPROPERTIES_INVALIDHEAPTYPE = 644, + D3D12_MESSAGE_ID_CREATE_DESCRIPTOR_HEAP_INVALID_DESC = 645, + D3D12_MESSAGE_ID_INVALID_DESCRIPTOR_HANDLE = 646, + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALID_CONSERVATIVERASTERMODE = 647, + D3D12_MESSAGE_ID_CREATE_CONSTANT_BUFFER_VIEW_INVALID_RESOURCE = 649, + D3D12_MESSAGE_ID_CREATE_CONSTANT_BUFFER_VIEW_INVALID_DESC = 650, + D3D12_MESSAGE_ID_CREATE_UNORDEREDACCESS_VIEW_INVALID_COUNTER_USAGE = 652, + D3D12_MESSAGE_ID_COPY_DESCRIPTORS_INVALID_RANGES = 653, + D3D12_MESSAGE_ID_COPY_DESCRIPTORS_WRITE_ONLY_DESCRIPTOR = 654, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RTV_FORMAT_NOT_UNKNOWN = 655, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_RENDER_TARGET_COUNT = 656, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_VERTEX_SHADER_NOT_SET = 657, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INPUTLAYOUT_NOT_SET = 658, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_HS_DS_SIGNATURE_MISMATCH = 659, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_REGISTERINDEX = 660, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_COMPONENTTYPE = 661, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_REGISTERMASK = 662, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_SYSTEMVALUE = 663, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS = 664, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_MINPRECISION = 665, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND = 666, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_XOR_DS_MISMATCH = 667, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HULL_SHADER_INPUT_TOPOLOGY_MISMATCH = 668, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_DS_CONTROL_POINT_COUNT_MISMATCH = 669, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_DS_TESSELLATOR_DOMAIN_MISMATCH = 670, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN = 671, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_USE_OF_FORCED_SAMPLE_COUNT = 672, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_PRIMITIVETOPOLOGY = 673, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_SYSTEMVALUE = 674, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 = 675, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING = 676, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_OUTPUT_TYPE_MISMATCH = 677, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_RENDER_TARGET_DOES_NOT_SUPPORT_LOGIC_OPS = 678, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RENDERTARGETVIEW_NOT_SET = 679, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_DEPTHSTENCILVIEW_NOT_SET = 680, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_GS_INPUT_PRIMITIVE_MISMATCH = 681, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_POSITION_NOT_PRESENT = 682, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MISSING_ROOT_SIGNATURE_FLAGS = 683, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_INDEX_BUFFER_PROPERTIES = 684, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_SAMPLE_DESC = 685, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_ROOT_SIGNATURE_MISMATCH = 686, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_DS_ROOT_SIGNATURE_MISMATCH = 687, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_VS_ROOT_SIGNATURE_MISMATCH = 688, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_GS_ROOT_SIGNATURE_MISMATCH = 689, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_ROOT_SIGNATURE_MISMATCH = 690, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MISSING_ROOT_SIGNATURE = 691, + D3D12_MESSAGE_ID_EXECUTE_BUNDLE_OPEN_BUNDLE = 692, + D3D12_MESSAGE_ID_EXECUTE_BUNDLE_DESCRIPTOR_HEAP_MISMATCH = 693, + D3D12_MESSAGE_ID_EXECUTE_BUNDLE_TYPE = 694, + D3D12_MESSAGE_ID_DRAW_EMPTY_SCISSOR_RECTANGLE = 695, + D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_BLOB_NOT_FOUND = 696, + D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_DESERIALIZE_FAILED = 697, + D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_INVALID_CONFIGURATION = 698, + D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_NOT_SUPPORTED_ON_DEVICE = 699, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLRESOURCEPROPERTIES = 700, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLHEAP = 701, + D3D12_MESSAGE_ID_GETRESOURCEALLOCATIONINFO_INVALIDRDESCS = 702, + D3D12_MESSAGE_ID_MAKERESIDENT_NULLOBJECTARRAY = 703, + D3D12_MESSAGE_ID_EVICT_NULLOBJECTARRAY = 705, + D3D12_MESSAGE_ID_SET_DESCRIPTOR_TABLE_INVALID = 708, + D3D12_MESSAGE_ID_SET_ROOT_CONSTANT_INVALID = 709, + D3D12_MESSAGE_ID_SET_ROOT_CONSTANT_BUFFER_VIEW_INVALID = 710, + D3D12_MESSAGE_ID_SET_ROOT_SHADER_RESOURCE_VIEW_INVALID = 711, + D3D12_MESSAGE_ID_SET_ROOT_UNORDERED_ACCESS_VIEW_INVALID = 712, + D3D12_MESSAGE_ID_SET_VERTEX_BUFFERS_INVALID_DESC = 713, + D3D12_MESSAGE_ID_SET_INDEX_BUFFER_INVALID_DESC = 715, + D3D12_MESSAGE_ID_SET_STREAM_OUTPUT_BUFFERS_INVALID_DESC = 717, + D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDDIMENSIONALITY = 718, + D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDLAYOUT = 719, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDIMENSIONALITY = 720, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDALIGNMENT = 721, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDMIPLEVELS = 722, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDSAMPLEDESC = 723, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDLAYOUT = 724, + D3D12_MESSAGE_ID_SET_INDEX_BUFFER_INVALID = 725, + D3D12_MESSAGE_ID_SET_VERTEX_BUFFERS_INVALID = 726, + D3D12_MESSAGE_ID_SET_STREAM_OUTPUT_BUFFERS_INVALID = 727, + D3D12_MESSAGE_ID_SET_RENDER_TARGETS_INVALID = 728, + D3D12_MESSAGE_ID_CREATEQUERY_HEAP_INVALID_PARAMETERS = 729, + D3D12_MESSAGE_ID_BEGIN_END_QUERY_INVALID_PARAMETERS = 731, + D3D12_MESSAGE_ID_CLOSE_COMMAND_LIST_OPEN_QUERY = 732, + D3D12_MESSAGE_ID_RESOLVE_QUERY_DATA_INVALID_PARAMETERS = 733, + D3D12_MESSAGE_ID_SET_PREDICATION_INVALID_PARAMETERS = 734, + D3D12_MESSAGE_ID_TIMESTAMPS_NOT_SUPPORTED = 735, + // This was shipped, but is no longer used. Do not reuse. + //D3D12_MESSAGE_ID_UNSTABLE_POWER_STATE = 736, + D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDFORMAT = 737, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDFORMAT = 738, + D3D12_MESSAGE_ID_GETCOPYABLEFOOTPRINTS_INVALIDSUBRESOURCERANGE = 739, + D3D12_MESSAGE_ID_GETCOPYABLEFOOTPRINTS_INVALIDBASEOFFSET = 740, + // Note: These are the same as the above two, with the original (incorrect) name + D3D12_MESSAGE_ID_GETCOPYABLELAYOUT_INVALIDSUBRESOURCERANGE = 739, + D3D12_MESSAGE_ID_GETCOPYABLELAYOUT_INVALIDBASEOFFSET = 740, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_HEAP = 741, + D3D12_MESSAGE_ID_CREATE_SAMPLER_INVALID = 742, + D3D12_MESSAGE_ID_CREATECOMMANDSIGNATURE_INVALID = 743, + D3D12_MESSAGE_ID_EXECUTE_INDIRECT_INVALID_PARAMETERS = 744, + D3D12_MESSAGE_ID_GETGPUVIRTUALADDRESS_INVALID_RESOURCE_DIMENSION = 745, + + // These values shipped, but are no longer used. Do not reuse. + //D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDCONTEXTTYPE = 746, + //D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_DECODENOTSUPPORTED = 747, + //D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_ENCODENOTSUPPORTED = 748, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDCLEARVALUE = 815, + D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDCLEARVALUEFORMAT = 816, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDCLEARVALUEFORMAT = 817, + D3D12_MESSAGE_ID_CREATERESOURCE_CLEARVALUEDENORMFLUSH = 818, + D3D12_MESSAGE_ID_CLEARRENDERTARGETVIEW_MISMATCHINGCLEARVALUE = 820, + D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_MISMATCHINGCLEARVALUE = 821, + D3D12_MESSAGE_ID_MAP_INVALIDHEAP = 822, + D3D12_MESSAGE_ID_UNMAP_INVALIDHEAP = 823, + D3D12_MESSAGE_ID_MAP_INVALIDRESOURCE = 824, + D3D12_MESSAGE_ID_UNMAP_INVALIDRESOURCE = 825, + D3D12_MESSAGE_ID_MAP_INVALIDSUBRESOURCE = 826, + D3D12_MESSAGE_ID_UNMAP_INVALIDSUBRESOURCE = 827, + D3D12_MESSAGE_ID_MAP_INVALIDRANGE = 828, + D3D12_MESSAGE_ID_UNMAP_INVALIDRANGE = 829, + D3D12_MESSAGE_ID_MAP_INVALIDDATAPOINTER = 832, + D3D12_MESSAGE_ID_MAP_INVALIDARG_RETURN = 833, + D3D12_MESSAGE_ID_MAP_OUTOFMEMORY_RETURN = 834, + D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_BUNDLENOTSUPPORTED = 835, + D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_COMMANDLISTMISMATCH = 836, + D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_OPENCOMMANDLIST = 837, + D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_FAILEDCOMMANDLIST = 838, + D3D12_MESSAGE_ID_COPYBUFFERREGION_NULLDST = 839, + D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDDSTRESOURCEDIMENSION = 840, + D3D12_MESSAGE_ID_COPYBUFFERREGION_DSTRANGEOUTOFBOUNDS = 841, + D3D12_MESSAGE_ID_COPYBUFFERREGION_NULLSRC = 842, + D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDSRCRESOURCEDIMENSION = 843, + D3D12_MESSAGE_ID_COPYBUFFERREGION_SRCRANGEOUTOFBOUNDS = 844, + D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDCOPYFLAGS = 845, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_NULLDST = 846, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDDSTTYPE = 847, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTRESOURCEDIMENSION = 848, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTRESOURCE = 849, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTSUBRESOURCE = 850, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTOFFSET = 851, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDDSTFORMAT = 852, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTFORMAT = 853, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTDIMENSIONS = 854, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTROWPITCH = 855, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTPLACEMENT = 856, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTDSPLACEDFOOTPRINTFORMAT = 857, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_DSTREGIONOUTOFBOUNDS = 858, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_NULLSRC = 859, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDSRCTYPE = 860, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCRESOURCEDIMENSION = 861, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCRESOURCE = 862, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCSUBRESOURCE = 863, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCOFFSET = 864, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDSRCFORMAT = 865, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCFORMAT = 866, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCDIMENSIONS = 867, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCROWPITCH = 868, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCPLACEMENT = 869, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCDSPLACEDFOOTPRINTFORMAT = 870, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_SRCREGIONOUTOFBOUNDS = 871, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTCOORDINATES = 872, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCBOX = 873, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_FORMATMISMATCH = 874, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_EMPTYBOX = 875, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDCOPYFLAGS = 876, + + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_SUBRESOURCE_INDEX = 877, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_FORMAT = 878, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_RESOURCE_MISMATCH = 879, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_SAMPLE_COUNT = 880, + + D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_INVALID_SHADER = 881, + D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_CS_ROOT_SIGNATURE_MISMATCH = 882, + D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_MISSING_ROOT_SIGNATURE = 883, + + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALIDCACHEDBLOB = 884, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBADAPTERMISMATCH = 885, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBDRIVERVERSIONMISMATCH = 886, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBDESCMISMATCH = 887, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBIGNORED = 888, + D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDHEAP = 889, + D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDRESOURCE = 890, + D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDBOX = 891, + D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDSUBRESOURCE = 892, + D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_EMPTYBOX = 893, + D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDHEAP = 894, + D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDRESOURCE = 895, + D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDBOX = 896, + D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDSUBRESOURCE = 897, + D3D12_MESSAGE_ID_READFROMSUBRESOURCE_EMPTYBOX = 898, + + D3D12_MESSAGE_ID_TOO_MANY_NODES_SPECIFIED = 899, + D3D12_MESSAGE_ID_INVALID_NODE_INDEX = 900, + + D3D12_MESSAGE_ID_GETHEAPPROPERTIES_INVALIDRESOURCE = 901, + D3D12_MESSAGE_ID_NODE_MASK_MISMATCH = 902, + D3D12_MESSAGE_ID_COMMAND_LIST_OUTOFMEMORY = 903, + D3D12_MESSAGE_ID_COMMAND_LIST_MULTIPLE_SWAPCHAIN_BUFFER_REFERENCES = 904, + D3D12_MESSAGE_ID_COMMAND_LIST_TOO_MANY_SWAPCHAIN_REFERENCES = 905, + D3D12_MESSAGE_ID_COMMAND_QUEUE_TOO_MANY_SWAPCHAIN_REFERENCES = 906, + D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_WRONGSWAPCHAINBUFFERREFERENCE = 907, + D3D12_MESSAGE_ID_COMMAND_LIST_SETRENDERTARGETS_INVALIDNUMRENDERTARGETS = 908, + D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_TYPE = 909, + D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_FLAGS = 910, + + D3D12_MESSAGE_ID_CREATESHAREDRESOURCE_INVALIDFLAGS = 911, + D3D12_MESSAGE_ID_CREATESHAREDRESOURCE_INVALIDFORMAT = 912, + D3D12_MESSAGE_ID_CREATESHAREDHEAP_INVALIDFLAGS = 913, + D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_UNRECOGNIZEDPROPERTIES = 914, + D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_INVALIDSIZE = 915, + D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_INVALIDOBJECT = 916, + D3D12_MESSAGE_ID_KEYEDMUTEX_INVALIDOBJECT = 917, + D3D12_MESSAGE_ID_KEYEDMUTEX_INVALIDKEY = 918, + D3D12_MESSAGE_ID_KEYEDMUTEX_WRONGSTATE = 919, + D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_PRIORITY = 920, + + D3D12_MESSAGE_ID_OBJECT_DELETED_WHILE_STILL_IN_USE = 921, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALID_FLAGS = 922, + + D3D12_MESSAGE_ID_HEAP_ADDRESS_RANGE_HAS_NO_RESOURCE = 923, + + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RENDER_TARGET_DELETED = 924, + + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_ALL_RENDER_TARGETS_HAVE_UNKNOWN_FORMAT = 925, + + D3D12_MESSAGE_ID_HEAP_ADDRESS_RANGE_INTERSECTS_MULTIPLE_BUFFERS = 926, + + D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_GPU_WRITTEN_READBACK_RESOURCE_MAPPED = 927, + + D3D12_MESSAGE_ID_UNMAP_RANGE_NOT_EMPTY = 929, + D3D12_MESSAGE_ID_MAP_INVALID_NULLRANGE = 930, + D3D12_MESSAGE_ID_UNMAP_INVALID_NULLRANGE = 931, + + D3D12_MESSAGE_ID_NO_GRAPHICS_API_SUPPORT = 932, + D3D12_MESSAGE_ID_NO_COMPUTE_API_SUPPORT = 933, + + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_RESOURCE_FLAGS_NOT_SUPPORTED = 934, + + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_ROOT_ARGUMENT_UNINITIALIZED = 935, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_HEAP_INDEX_OUT_OF_BOUNDS = 936, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_TABLE_REGISTER_INDEX_OUT_OF_BOUNDS = 937, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_UNINITIALIZED = 938, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_TYPE_MISMATCH = 939, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_SRV_RESOURCE_DIMENSION_MISMATCH = 940, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_UAV_RESOURCE_DIMENSION_MISMATCH = 941, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_INCOMPATIBLE_RESOURCE_STATE = 942, + + D3D12_MESSAGE_ID_COPYRESOURCE_NULLDST = 943, + D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDDSTRESOURCE = 944, + D3D12_MESSAGE_ID_COPYRESOURCE_NULLSRC = 945, + D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDSRCRESOURCE = 946, + + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_NULLDST = 947, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALIDDSTRESOURCE = 948, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_NULLSRC = 949, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALIDSRCRESOURCE = 950, + + D3D12_MESSAGE_ID_PIPELINE_STATE_TYPE_MISMATCH = 951, + D3D12_MESSAGE_ID_COMMAND_LIST_DISPATCH_ROOT_SIGNATURE_NOT_SET = 952, + D3D12_MESSAGE_ID_COMMAND_LIST_DISPATCH_ROOT_SIGNATURE_MISMATCH = 953, + + D3D12_MESSAGE_ID_RESOURCE_BARRIER_ZERO_BARRIERS = 954, + + D3D12_MESSAGE_ID_BEGIN_END_EVENT_MISMATCH = 955, + + D3D12_MESSAGE_ID_RESOURCE_BARRIER_POSSIBLE_BEFORE_AFTER_MISMATCH = 956, + + D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_BEGIN_END = 957, + + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_INVALID_RESOURCE = 958, + + D3D12_MESSAGE_ID_USE_OF_ZERO_REFCOUNT_OBJECT = 959, + + D3D12_MESSAGE_ID_OBJECT_EVICTED_WHILE_STILL_IN_USE = 960, + + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_ROOT_DESCRIPTOR_ACCESS_OUT_OF_BOUNDS = 961, + + D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_INVALIDLIBRARYBLOB = 962, + D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_DRIVERVERSIONMISMATCH = 963, + D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_ADAPTERVERSIONMISMATCH = 964, + D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_UNSUPPORTED = 965, + D3D12_MESSAGE_ID_CREATE_PIPELINELIBRARY = 966, + D3D12_MESSAGE_ID_LIVE_PIPELINELIBRARY = 967, + D3D12_MESSAGE_ID_DESTROY_PIPELINELIBRARY = 968, + + D3D12_MESSAGE_ID_STOREPIPELINE_NONAME = 969, + D3D12_MESSAGE_ID_STOREPIPELINE_DUPLICATENAME = 970, + D3D12_MESSAGE_ID_LOADPIPELINE_NAMENOTFOUND = 971, + D3D12_MESSAGE_ID_LOADPIPELINE_INVALIDDESC = 972, + D3D12_MESSAGE_ID_PIPELINELIBRARY_SERIALIZE_NOTENOUGHMEMORY = 973, + + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_OUTPUT_RT_OUTPUT_MISMATCH = 974, + + D3D12_MESSAGE_ID_SETEVENTONMULTIPLEFENCECOMPLETION_INVALIDFLAGS = 975, + + D3D12_MESSAGE_ID_CREATE_QUEUE_VIDEO_NOT_SUPPORTED = 976, + D3D12_MESSAGE_ID_CREATE_COMMAND_ALLOCATOR_VIDEO_NOT_SUPPORTED = 977, + D3D12_MESSAGE_ID_CREATEQUERY_HEAP_VIDEO_DECODE_STATISTICS_NOT_SUPPORTED = 978, + D3D12_MESSAGE_ID_CREATE_VIDEODECODECOMMANDLIST = 979, + D3D12_MESSAGE_ID_CREATE_VIDEODECODER = 980, + D3D12_MESSAGE_ID_CREATE_VIDEODECODESTREAM = 981, + D3D12_MESSAGE_ID_LIVE_VIDEODECODECOMMANDLIST = 982, + D3D12_MESSAGE_ID_LIVE_VIDEODECODER = 983, + D3D12_MESSAGE_ID_LIVE_VIDEODECODESTREAM = 984, + D3D12_MESSAGE_ID_DESTROY_VIDEODECODECOMMANDLIST = 985, + D3D12_MESSAGE_ID_DESTROY_VIDEODECODER = 986, + D3D12_MESSAGE_ID_DESTROY_VIDEODECODESTREAM = 987, + D3D12_MESSAGE_ID_DECODE_FRAME_INVALID_PARAMETERS = 988, + + D3D12_MESSAGE_ID_DEPRECATED_API = 989, + + D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_COMMAND_LIST_TYPE = 990, + + D3D12_MESSAGE_ID_COMMAND_LIST_DESCRIPTOR_TABLE_NOT_SET = 991, + D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_CONSTANT_BUFFER_VIEW_NOT_SET = 992, + D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_SHADER_RESOURCE_VIEW_NOT_SET = 993, + D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_UNORDERED_ACCESS_VIEW_NOT_SET = 994, + + D3D12_MESSAGE_ID_DISCARD_INVALID_SUBRESOURCE_RANGE = 995, + D3D12_MESSAGE_ID_DISCARD_ONE_SUBRESOURCE_FOR_MIPS_WITH_RECTS = 996, + D3D12_MESSAGE_ID_DISCARD_NO_RECTS_FOR_NON_TEXTURE2D = 997, + + D3D12_MESSAGE_ID_COPY_ON_SAME_SUBRESOURCE = 998, + + D3D12_MESSAGE_ID_SETRESIDENCYPRIORITY_INVALID_PAGEABLE = 999, + + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_UNSUPPORTED = 1000, + + D3D12_MESSAGE_ID_STATIC_DESCRIPTOR_INVALID_DESCRIPTOR_CHANGE = 1001, + D3D12_MESSAGE_ID_DATA_STATIC_DESCRIPTOR_INVALID_DATA_CHANGE = 1002, + D3D12_MESSAGE_ID_DATA_STATIC_WHILE_SET_AT_EXECUTE_DESCRIPTOR_INVALID_DATA_CHANGE = 1003, + D3D12_MESSAGE_ID_EXECUTE_BUNDLE_STATIC_DESCRIPTOR_DATA_STATIC_NOT_SET = 1004, + + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_RESOURCE_ACCESS_OUT_OF_BOUNDS = 1005, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_SAMPLER_MODE_MISMATCH = 1006, + + D3D12_MESSAGE_ID_CREATE_FENCE_INVALID_FLAGS = 1007, + + D3D12_MESSAGE_ID_RESOURCE_BARRIER_DUPLICATE_SUBRESOURCE_TRANSITIONS = 1008, + D3D12_MESSAGE_ID_SETRESIDENCYPRIORITY_INVALID_PRIORITY = 1009, + D3D12_MESSAGE_ID_CREATE_DESCRIPTOR_HEAP_LARGE_NUM_DESCRIPTORS = 1013, + + D3D12_MESSAGE_ID_BEGIN_EVENT = 1014, + D3D12_MESSAGE_ID_END_EVENT = 1015, + + D3D12_MESSAGE_ID_CREATEDEVICE_DEBUG_LAYER_STARTUP_OPTIONS = 1016, + + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_DEPTHBOUNDSTEST_UNSUPPORTED = 1017, + + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_DUPLICATE_SUBOBJECT = 1018, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_UNKNOWN_SUBOBJECT = 1019, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_ZERO_SIZE_STREAM = 1020, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALID_STREAM = 1021, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CANNOT_DEDUCE_TYPE = 1022, + + D3D12_MESSAGE_ID_COMMAND_LIST_STATIC_DESCRIPTOR_RESOURCE_DIMENSION_MISMATCH = 1023, + + D3D12_MESSAGE_ID_CREATE_COMMAND_QUEUE_INSUFFICIENT_PRIVILEGE_FOR_GLOBAL_REALTIME = 1024, + D3D12_MESSAGE_ID_CREATE_COMMAND_QUEUE_INSUFFICIENT_HARDWARE_SUPPORT_FOR_GLOBAL_REALTIME = 1025, + + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_ARCHITECTURE = 1026, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DST = 1027, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DST_RESOURCE_DIMENSION = 1028, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DST_RANGE_OUT_OF_BOUNDS = 1029, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_SRC = 1030, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_SRC_RESOURCE_DIMENSION = 1031, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_SRC_RANGE_OUT_OF_BOUNDS = 1032, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_OFFSET_ALIGNMENT = 1033, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DEPENDENT_RESOURCES = 1034, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DEPENDENT_SUBRESOURCE_RANGES = 1035, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DEPENDENT_RESOURCE = 1036, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DEPENDENT_SUBRESOURCE_RANGE = 1037, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DEPENDENT_SUBRESOURCE_OUT_OF_BOUNDS = 1038, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DEPENDENT_RANGE_OUT_OF_BOUNDS = 1039, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_ZERO_DEPENDENCIES = 1040, + + D3D12_MESSAGE_ID_DEVICE_CREATE_SHARED_HANDLE_INVALIDARG = 1041, + + D3D12_MESSAGE_ID_DESCRIPTOR_HANDLE_WITH_INVALID_RESOURCE = 1042, + + D3D12_MESSAGE_ID_SETDEPTHBOUNDS_INVALIDARGS = 1043, + + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_RESOURCE_STATE_IMPRECISE = 1044, + + D3D12_MESSAGE_ID_COMMAND_LIST_PIPELINE_STATE_NOT_SET = 1045, + + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_MODEL_MISMATCH = 1046, + + D3D12_MESSAGE_ID_OBJECT_ACCESSED_WHILE_STILL_IN_USE = 1047, + + D3D12_MESSAGE_ID_PROGRAMMABLE_MSAA_UNSUPPORTED = 1048, + + D3D12_MESSAGE_ID_SETSAMPLEPOSITIONS_INVALIDARGS = 1049, + + D3D12_MESSAGE_ID_RESOLVESUBRESOURCEREGION_INVALID_RECT = 1050, + + D3D12_MESSAGE_ID_CREATE_VIDEODECODECOMMANDQUEUE = 1051, + D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSCOMMANDLIST = 1052, + D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSCOMMANDQUEUE = 1053, + D3D12_MESSAGE_ID_LIVE_VIDEODECODECOMMANDQUEUE = 1054, + D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSCOMMANDLIST = 1055, + D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSCOMMANDQUEUE = 1056, + D3D12_MESSAGE_ID_DESTROY_VIDEODECODECOMMANDQUEUE = 1057, + D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSCOMMANDLIST = 1058, + D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSCOMMANDQUEUE = 1059, + D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSOR = 1060, + D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSSTREAM = 1061, + D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSOR = 1062, + D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSSTREAM = 1063, + D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSOR = 1064, + D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSSTREAM = 1065, + + D3D12_MESSAGE_ID_PROCESS_FRAME_INVALID_PARAMETERS = 1066, + + D3D12_MESSAGE_ID_COPY_INVALIDLAYOUT = 1067, + + D3D12_MESSAGE_ID_CREATE_CRYPTO_SESSION = 1068, + D3D12_MESSAGE_ID_CREATE_CRYPTO_SESSION_POLICY = 1069, + D3D12_MESSAGE_ID_CREATE_PROTECTED_RESOURCE_SESSION = 1070, + D3D12_MESSAGE_ID_LIVE_CRYPTO_SESSION = 1071, + D3D12_MESSAGE_ID_LIVE_CRYPTO_SESSION_POLICY = 1072, + D3D12_MESSAGE_ID_LIVE_PROTECTED_RESOURCE_SESSION = 1073, + D3D12_MESSAGE_ID_DESTROY_CRYPTO_SESSION = 1074, + D3D12_MESSAGE_ID_DESTROY_CRYPTO_SESSION_POLICY = 1075, + D3D12_MESSAGE_ID_DESTROY_PROTECTED_RESOURCE_SESSION = 1076, + D3D12_MESSAGE_ID_PROTECTED_RESOURCE_SESSION_UNSUPPORTED = 1077, + + D3D12_MESSAGE_ID_FENCE_INVALIDOPERATION = 1078, + + D3D12_MESSAGE_ID_CREATEQUERY_HEAP_COPY_QUEUE_TIMESTAMPS_NOT_SUPPORTED = 1079, + + D3D12_MESSAGE_ID_SAMPLEPOSITIONS_MISMATCH_DEFERRED = 1080, + D3D12_MESSAGE_ID_SAMPLEPOSITIONS_MISMATCH_RECORDTIME_ASSUMEDFROMFIRSTUSE = 1081, + D3D12_MESSAGE_ID_SAMPLEPOSITIONS_MISMATCH_RECORDTIME_ASSUMEDFROMCLEAR = 1082, + + D3D12_MESSAGE_ID_CREATE_VIDEODECODERHEAP = 1083, + D3D12_MESSAGE_ID_LIVE_VIDEODECODERHEAP = 1084, + D3D12_MESSAGE_ID_DESTROY_VIDEODECODERHEAP = 1085, + + D3D12_MESSAGE_ID_OPENEXISTINGHEAP_INVALIDARG_RETURN = 1086, + D3D12_MESSAGE_ID_OPENEXISTINGHEAP_OUTOFMEMORY_RETURN = 1087, + D3D12_MESSAGE_ID_OPENEXISTINGHEAP_INVALIDADDRESS = 1088, + D3D12_MESSAGE_ID_OPENEXISTINGHEAP_INVALIDHANDLE = 1089, + + D3D12_MESSAGE_ID_WRITEBUFFERIMMEDIATE_INVALID_DEST = 1090, + D3D12_MESSAGE_ID_WRITEBUFFERIMMEDIATE_INVALID_MODE = 1091, + D3D12_MESSAGE_ID_WRITEBUFFERIMMEDIATE_INVALID_ALIGNMENT = 1092, + D3D12_MESSAGE_ID_WRITEBUFFERIMMEDIATE_NOT_SUPPORTED = 1093, + + D3D12_MESSAGE_ID_SETVIEWINSTANCEMASK_INVALIDARGS = 1094, + D3D12_MESSAGE_ID_VIEW_INSTANCING_UNSUPPORTED = 1095, + D3D12_MESSAGE_ID_VIEW_INSTANCING_INVALIDARGS = 1096, + + D3D12_MESSAGE_ID_COPYTEXTUREREGION_MISMATCH_DECODE_REFERENCE_ONLY_FLAG = 1097, + D3D12_MESSAGE_ID_COPYRESOURCE_MISMATCH_DECODE_REFERENCE_ONLY_FLAG = 1098, + + D3D12_MESSAGE_ID_CREATE_VIDEO_DECODE_HEAP_CAPS_FAILURE = 1099, + D3D12_MESSAGE_ID_CREATE_VIDEO_DECODE_HEAP_CAPS_UNSUPPORTED = 1100, + D3D12_MESSAGE_ID_VIDEO_DECODE_SUPPORT_INVALID_INPUT = 1101, + D3D12_MESSAGE_ID_CREATE_VIDEO_DECODER_UNSUPPORTED = 1102, + + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_METADATA_ERROR = 1103, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_VIEW_INSTANCING_VERTEX_SIZE_EXCEEDED = 1104, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RUNTIME_INTERNAL_ERROR = 1105, + + D3D12_MESSAGE_ID_NO_VIDEO_API_SUPPORT = 1106, + + D3D12_MESSAGE_ID_VIDEO_PROCESS_SUPPORT_INVALID_INPUT = 1107, + D3D12_MESSAGE_ID_CREATE_VIDEO_PROCESSOR_CAPS_FAILURE = 1108, + D3D12_MESSAGE_ID_VIDEO_PROCESS_SUPPORT_UNSUPPORTED_FORMAT = 1109, + + D3D12_MESSAGE_ID_VIDEO_DECODE_FRAME_INVALID_ARGUMENT = 1110, + + D3D12_MESSAGE_ID_ENQUEUE_MAKE_RESIDENT_INVALID_FLAGS = 1111, + D3D12_MESSAGE_ID_OPENEXISTINGHEAP_UNSUPPORTED = 1112, + + D3D12_MESSAGE_ID_VIDEO_PROCESS_FRAMES_INVALID_ARGUMENT = 1113, + + D3D12_MESSAGE_ID_VIDEO_DECODE_SUPPORT_UNSUPPORTED = 1114, + + D3D12_MESSAGE_ID_CREATE_COMMANDRECORDER = 1115, + D3D12_MESSAGE_ID_LIVE_COMMANDRECORDER = 1116, + D3D12_MESSAGE_ID_DESTROY_COMMANDRECORDER = 1117, + D3D12_MESSAGE_ID_CREATE_COMMAND_RECORDER_VIDEO_NOT_SUPPORTED = 1118, + D3D12_MESSAGE_ID_CREATE_COMMAND_RECORDER_INVALID_SUPPORT_FLAGS = 1119, + D3D12_MESSAGE_ID_CREATE_COMMAND_RECORDER_INVALID_FLAGS = 1120, + D3D12_MESSAGE_ID_CREATE_COMMAND_RECORDER_MORE_RECORDERS_THAN_LOGICAL_PROCESSORS = 1121, + + D3D12_MESSAGE_ID_CREATE_COMMANDPOOL = 1122, + D3D12_MESSAGE_ID_LIVE_COMMANDPOOL = 1123, + D3D12_MESSAGE_ID_DESTROY_COMMANDPOOL = 1124, + D3D12_MESSAGE_ID_CREATE_COMMAND_POOL_INVALID_FLAGS = 1125, + + D3D12_MESSAGE_ID_CREATE_COMMAND_LIST_VIDEO_NOT_SUPPORTED = 1126, + + D3D12_MESSAGE_ID_COMMAND_RECORDER_SUPPORT_FLAGS_MISMATCH = 1127, + D3D12_MESSAGE_ID_COMMAND_RECORDER_CONTENTION = 1128, + + D3D12_MESSAGE_ID_COMMAND_RECORDER_USAGE_WITH_CREATECOMMANDLIST_COMMAND_LIST = 1129, + D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_USAGE_WITH_CREATECOMMANDLIST1_COMMAND_LIST = 1130, + D3D12_MESSAGE_ID_CANNOT_EXECUTE_EMPTY_COMMAND_LIST = 1131, + + D3D12_MESSAGE_ID_CANNOT_RESET_COMMAND_POOL_WITH_OPEN_COMMAND_LISTS = 1132, + D3D12_MESSAGE_ID_CANNOT_USE_COMMAND_RECORDER_WITHOUT_CURRENT_TARGET = 1133, + D3D12_MESSAGE_ID_CANNOT_CHANGE_COMMAND_RECORDER_TARGET_WHILE_RECORDING = 1134, + D3D12_MESSAGE_ID_COMMAND_POOL_SYNC = 1135, + + D3D12_MESSAGE_ID_EVICT_UNDERFLOW = 1136, + + D3D12_MESSAGE_ID_CREATE_META_COMMAND = 1137, + D3D12_MESSAGE_ID_LIVE_META_COMMAND = 1138, + D3D12_MESSAGE_ID_DESTROY_META_COMMAND = 1139, + D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALID_DST_RESOURCE = 1140, + D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALID_SRC_RESOURCE = 1141, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DST_RESOURCE = 1142, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_SRC_RESOURCE = 1143, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_NULL_BUFFER = 1144, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_NULL_RESOURCE_DESC = 1145, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_UNSUPPORTED = 1146, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_INVALID_BUFFER_DIMENSION = 1147, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_INVALID_BUFFER_FLAGS = 1148, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_INVALID_BUFFER_OFFSET = 1149, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_INVALID_RESOURCE_DIMENSION = 1150, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_INVALID_RESOURCE_FLAGS = 1151, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_OUTOFMEMORY_RETURN = 1152, + + D3D12_MESSAGE_ID_CANNOT_CREATE_GRAPHICS_AND_VIDEO_COMMAND_RECORDER = 1153, + D3D12_MESSAGE_ID_UPDATETILEMAPPINGS_POSSIBLY_MISMATCHING_PROPERTIES = 1154, + + D3D12_MESSAGE_ID_CREATE_COMMAND_LIST_INVALID_COMMAND_LIST_TYPE = 1155, + + D3D12_MESSAGE_ID_CLEARUNORDEREDACCESSVIEW_INCOMPATIBLE_WITH_STRUCTURED_BUFFERS = 1156, + + D3D12_MESSAGE_ID_COMPUTE_ONLY_DEVICE_OPERATION_UNSUPPORTED = 1157, + + D3D12_MESSAGE_ID_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INVALID = 1158, + D3D12_MESSAGE_ID_EMIT_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_INVALID = 1159, + D3D12_MESSAGE_ID_COPY_RAYTRACING_ACCELERATION_STRUCTURE_INVALID = 1160, + D3D12_MESSAGE_ID_DISPATCH_RAYS_INVALID = 1161, + D3D12_MESSAGE_ID_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_INVALID = 1162, + + D3D12_MESSAGE_ID_CREATE_LIFETIMETRACKER = 1163, + D3D12_MESSAGE_ID_LIVE_LIFETIMETRACKER = 1164, + D3D12_MESSAGE_ID_DESTROY_LIFETIMETRACKER = 1165, + D3D12_MESSAGE_ID_DESTROYOWNEDOBJECT_OBJECTNOTOWNED = 1166, + + D3D12_MESSAGE_ID_CREATE_TRACKEDWORKLOAD = 1167, + D3D12_MESSAGE_ID_LIVE_TRACKEDWORKLOAD = 1168, + D3D12_MESSAGE_ID_DESTROY_TRACKEDWORKLOAD = 1169, + + D3D12_MESSAGE_ID_RENDER_PASS_ERROR = 1170, + + D3D12_MESSAGE_ID_META_COMMAND_ID_INVALID = 1171, + D3D12_MESSAGE_ID_META_COMMAND_UNSUPPORTED_PARAMS = 1172, + D3D12_MESSAGE_ID_META_COMMAND_FAILED_ENUMERATION = 1173, + D3D12_MESSAGE_ID_META_COMMAND_PARAMETER_SIZE_MISMATCH = 1174, + D3D12_MESSAGE_ID_UNINITIALIZED_META_COMMAND = 1175, + D3D12_MESSAGE_ID_META_COMMAND_INVALID_GPU_VIRTUAL_ADDRESS = 1176, + + D3D12_MESSAGE_ID_CREATE_VIDEOENCODECOMMANDLIST = 1177, + D3D12_MESSAGE_ID_LIVE_VIDEOENCODECOMMANDLIST = 1178, + D3D12_MESSAGE_ID_DESTROY_VIDEOENCODECOMMANDLIST = 1179, + + D3D12_MESSAGE_ID_CREATE_VIDEOENCODECOMMANDQUEUE = 1180, + D3D12_MESSAGE_ID_LIVE_VIDEOENCODECOMMANDQUEUE = 1181, + D3D12_MESSAGE_ID_DESTROY_VIDEOENCODECOMMANDQUEUE = 1182, + + D3D12_MESSAGE_ID_CREATE_VIDEOMOTIONESTIMATOR = 1183, + D3D12_MESSAGE_ID_LIVE_VIDEOMOTIONESTIMATOR = 1184, + D3D12_MESSAGE_ID_DESTROY_VIDEOMOTIONESTIMATOR = 1185, + + D3D12_MESSAGE_ID_CREATE_VIDEOMOTIONVECTORHEAP = 1186, + D3D12_MESSAGE_ID_LIVE_VIDEOMOTIONVECTORHEAP = 1187, + D3D12_MESSAGE_ID_DESTROY_VIDEOMOTIONVECTORHEAP = 1188, + + D3D12_MESSAGE_ID_MULTIPLE_TRACKED_WORKLOADS = 1189, + D3D12_MESSAGE_ID_MULTIPLE_TRACKED_WORKLOAD_PAIRS = 1190, + D3D12_MESSAGE_ID_OUT_OF_ORDER_TRACKED_WORKLOAD_PAIR = 1191, + D3D12_MESSAGE_ID_CANNOT_ADD_TRACKED_WORKLOAD = 1192, + D3D12_MESSAGE_ID_INCOMPLETE_TRACKED_WORKLOAD_PAIR = 1193, + D3D12_MESSAGE_ID_CREATE_STATE_OBJECT_ERROR = 1194, + D3D12_MESSAGE_ID_GET_SHADER_IDENTIFIER_ERROR = 1195, + D3D12_MESSAGE_ID_GET_SHADER_STACK_SIZE_ERROR = 1196, + D3D12_MESSAGE_ID_GET_PIPELINE_STACK_SIZE_ERROR = 1197, + D3D12_MESSAGE_ID_SET_PIPELINE_STACK_SIZE_ERROR = 1198, + D3D12_MESSAGE_ID_GET_SHADER_IDENTIFIER_SIZE_INVALID = 1199, + D3D12_MESSAGE_ID_CHECK_DRIVER_MATCHING_IDENTIFIER_INVALID = 1200, + D3D12_MESSAGE_ID_CHECK_DRIVER_MATCHING_IDENTIFIER_DRIVER_REPORTED_ISSUE = 1201, + + D3D12_MESSAGE_ID_RENDER_PASS_INVALID_RESOURCE_BARRIER = 1202, + D3D12_MESSAGE_ID_RENDER_PASS_DISALLOWED_API_CALLED = 1203, + D3D12_MESSAGE_ID_RENDER_PASS_CANNOT_NEST_RENDER_PASSES = 1204, + D3D12_MESSAGE_ID_RENDER_PASS_CANNOT_END_WITHOUT_BEGIN = 1205, + D3D12_MESSAGE_ID_RENDER_PASS_CANNOT_CLOSE_COMMAND_LIST = 1206, + D3D12_MESSAGE_ID_RENDER_PASS_GPU_WORK_WHILE_SUSPENDED = 1207, + D3D12_MESSAGE_ID_RENDER_PASS_MISMATCHING_SUSPEND_RESUME = 1208, + D3D12_MESSAGE_ID_RENDER_PASS_NO_PRIOR_SUSPEND_WITHIN_EXECUTECOMMANDLISTS = 1209, + D3D12_MESSAGE_ID_RENDER_PASS_NO_SUBSEQUENT_RESUME_WITHIN_EXECUTECOMMANDLISTS = 1210, + + D3D12_MESSAGE_ID_TRACKED_WORKLOAD_COMMAND_QUEUE_MISMATCH = 1211, + D3D12_MESSAGE_ID_TRACKED_WORKLOAD_NOT_SUPPORTED = 1212, + + D3D12_MESSAGE_ID_RENDER_PASS_MISMATCHING_NO_ACCESS = 1213, + D3D12_MESSAGE_ID_RENDER_PASS_UNSUPPORTED_RESOLVE = 1214, + + D3D12_MESSAGE_ID_CLEARUNORDEREDACCESSVIEW_INVALID_RESOURCE_PTR = 1215, + + D3D12_MESSAGE_ID_WINDOWS7_FENCE_OUTOFORDER_SIGNAL = 1216, + D3D12_MESSAGE_ID_WINDOWS7_FENCE_OUTOFORDER_WAIT = 1217, + + D3D12_MESSAGE_ID_VIDEO_CREATE_MOTION_ESTIMATOR_INVALID_ARGUMENT = 1218, + D3D12_MESSAGE_ID_VIDEO_CREATE_MOTION_VECTOR_HEAP_INVALID_ARGUMENT = 1219, + D3D12_MESSAGE_ID_ESTIMATE_MOTION_INVALID_ARGUMENT = 1220, + D3D12_MESSAGE_ID_RESOLVE_MOTION_VECTOR_HEAP_INVALID_ARGUMENT = 1221, + + D3D12_MESSAGE_ID_GETGPUVIRTUALADDRESS_INVALID_HEAP_TYPE = 1222, + D3D12_MESSAGE_ID_SET_BACKGROUND_PROCESSING_MODE_INVALID_ARGUMENT = 1223, + D3D12_MESSAGE_ID_CREATE_COMMAND_LIST_INVALID_COMMAND_LIST_TYPE_FOR_FEATURE_LEVEL = 1224, + + D3D12_MESSAGE_ID_CREATE_VIDEOEXTENSIONCOMMAND = 1225, + D3D12_MESSAGE_ID_LIVE_VIDEOEXTENSIONCOMMAND = 1226, + D3D12_MESSAGE_ID_DESTROY_VIDEOEXTENSIONCOMMAND = 1227, + D3D12_MESSAGE_ID_INVALID_VIDEO_EXTENSION_COMMAND_ID = 1228, + D3D12_MESSAGE_ID_VIDEO_EXTENSION_COMMAND_INVALID_ARGUMENT = 1229, + + D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_NOT_UNIQUE_IN_DXIL_LIBRARY = 1230, + + D3D12_MESSAGE_ID_VARIABLE_SHADING_RATE_NOT_ALLOWED_WITH_TIR = 1231, + D3D12_MESSAGE_ID_GEOMETRY_SHADER_OUTPUTTING_BOTH_VIEWPORT_ARRAY_INDEX_AND_SHADING_RATE_NOT_SUPPORTED_ON_DEVICE = 1232, + D3D12_MESSAGE_ID_RSSETSHADING_RATE_INVALID_SHADING_RATE = 1233, + D3D12_MESSAGE_ID_RSSETSHADING_RATE_SHADING_RATE_NOT_PERMITTED_BY_CAP = 1234, + D3D12_MESSAGE_ID_RSSETSHADING_RATE_INVALID_COMBINER = 1235, + D3D12_MESSAGE_ID_RSSETSHADINGRATEIMAGE_REQUIRES_TIER_2 = 1236, + D3D12_MESSAGE_ID_RSSETSHADINGRATE_REQUIRES_TIER_1 = 1237, + D3D12_MESSAGE_ID_SHADING_RATE_IMAGE_INCORRECT_FORMAT = 1238, + D3D12_MESSAGE_ID_SHADING_RATE_IMAGE_INCORRECT_ARRAY_SIZE = 1239, + D3D12_MESSAGE_ID_SHADING_RATE_IMAGE_INCORRECT_MIP_LEVEL = 1240, + D3D12_MESSAGE_ID_SHADING_RATE_IMAGE_INCORRECT_SAMPLE_COUNT = 1241, + D3D12_MESSAGE_ID_SHADING_RATE_IMAGE_INCORRECT_SAMPLE_QUALITY = 1242, + + D3D12_MESSAGE_ID_NON_RETAIL_SHADER_MODEL_WONT_VALIDATE = 1243, + + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_AS_ROOT_SIGNATURE_MISMATCH = 1244, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MS_ROOT_SIGNATURE_MISMATCH = 1245, + + D3D12_MESSAGE_ID_ADD_TO_STATE_OBJECT_ERROR = 1246, + + D3D12_MESSAGE_ID_CREATE_PROTECTED_RESOURCE_SESSION_INVALID_ARGUMENT = 1247, + + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MS_PSO_DESC_MISMATCH = 1248, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_MS_INCOMPLETE_TYPE = 1249, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_AS_NOT_MS_MISMATCH = 1250, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MS_NOT_PS_MISMATCH = 1251, + D3D12_MESSAGE_ID_NONZERO_SAMPLER_FEEDBACK_MIP_REGION_WITH_INCOMPATIBLE_FORMAT = 1252, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INPUTLAYOUT_SHADER_MISMATCH = 1253, + + D3D12_MESSAGE_ID_EMPTY_DISPATCH = 1254, + + + D3D12_MESSAGE_ID_RESOURCE_FORMAT_REQUIRES_SAMPLER_FEEDBACK_CAPABILITY = 1255, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_MAP_INVALID_MIP_REGION = 1256, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_MAP_INVALID_DIMENSION = 1257, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_MAP_INVALID_SAMPLE_COUNT = 1258, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_MAP_INVALID_SAMPLE_QUALITY = 1259, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_MAP_INVALID_LAYOUT = 1260, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_MAP_REQUIRES_UNORDERED_ACCESS_FLAG = 1261, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_CREATE_UAV_NULL_ARGUMENTS = 1262, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_UAV_REQUIRES_SAMPLER_FEEDBACK_CAPABILITY = 1263, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_CREATE_UAV_REQUIRES_FEEDBACK_MAP_FORMAT = 1264, + + D3D12_MESSAGE_ID_CREATEMESHSHADER_INVALIDSHADERBYTECODE = 1265, + D3D12_MESSAGE_ID_CREATEMESHSHADER_OUTOFMEMORY = 1266, + D3D12_MESSAGE_ID_CREATEMESHSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE = 1267, + + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_SAMPLER_FEEDBACK_TRANSCODE_INVALID_FORMAT = 1268, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_SAMPLER_FEEDBACK_INVALID_MIP_LEVEL_COUNT = 1269, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_SAMPLER_FEEDBACK_TRANSCODE_ARRAY_SIZE_MISMATCH = 1270, + + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_CREATE_UAV_MISMATCHING_TARGETED_RESOURCE = 1271, + + D3D12_MESSAGE_ID_CREATEMESHSHADER_OUTPUTEXCEEDSMAXSIZE = 1272, + D3D12_MESSAGE_ID_CREATEMESHSHADER_GROUPSHAREDEXCEEDSMAXSIZE = 1273, + + D3D12_MESSAGE_ID_VERTEX_SHADER_OUTPUTTING_BOTH_VIEWPORT_ARRAY_INDEX_AND_SHADING_RATE_NOT_SUPPORTED_ON_DEVICE = 1274, + D3D12_MESSAGE_ID_MESH_SHADER_OUTPUTTING_BOTH_VIEWPORT_ARRAY_INDEX_AND_SHADING_RATE_NOT_SUPPORTED_ON_DEVICE = 1275, + D3D12_MESSAGE_ID_CREATEMESHSHADER_MISMATCHEDASMSPAYLOADSIZE = 1276, + + D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_UNBOUNDED_STATIC_DESCRIPTORS = 1277, + + D3D12_MESSAGE_ID_CREATEAMPLIFICATIONSHADER_INVALIDSHADERBYTECODE = 1278, + D3D12_MESSAGE_ID_CREATEAMPLIFICATIONSHADER_OUTOFMEMORY = 1279, + + D3D12_MESSAGE_ID_CREATE_SHADERCACHESESSION = 1280, + D3D12_MESSAGE_ID_LIVE_SHADERCACHESESSION = 1281, + D3D12_MESSAGE_ID_DESTROY_SHADERCACHESESSION = 1282, + + D3D12_MESSAGE_ID_CREATESHADERCACHESESSION_INVALIDARGS = 1283, + D3D12_MESSAGE_ID_CREATESHADERCACHESESSION_DISABLED = 1284, + D3D12_MESSAGE_ID_CREATESHADERCACHESESSION_ALREADYOPEN = 1285, + + D3D12_MESSAGE_ID_SHADERCACHECONTROL_DEVELOPERMODE = 1286, + D3D12_MESSAGE_ID_SHADERCACHECONTROL_INVALIDFLAGS = 1287, + D3D12_MESSAGE_ID_SHADERCACHECONTROL_STATEALREADYSET = 1288, + D3D12_MESSAGE_ID_SHADERCACHECONTROL_IGNOREDFLAG = 1289, + + D3D12_MESSAGE_ID_SHADERCACHESESSION_STOREVALUE_ALREADYPRESENT = 1290, + D3D12_MESSAGE_ID_SHADERCACHESESSION_STOREVALUE_HASHCOLLISION = 1291, + D3D12_MESSAGE_ID_SHADERCACHESESSION_STOREVALUE_CACHEFULL = 1292, + D3D12_MESSAGE_ID_SHADERCACHESESSION_FINDVALUE_NOTFOUND = 1293, + D3D12_MESSAGE_ID_SHADERCACHESESSION_CORRUPT = 1294, + D3D12_MESSAGE_ID_SHADERCACHESESSION_DISABLED = 1295, + + D3D12_MESSAGE_ID_OVERSIZED_DISPATCH = 1296, + D3D12_MESSAGE_ID_CREATE_VIDEOENCODER = 1297, + D3D12_MESSAGE_ID_LIVE_VIDEOENCODER = 1298, + D3D12_MESSAGE_ID_DESTROY_VIDEOENCODER = 1299, + D3D12_MESSAGE_ID_CREATE_VIDEOENCODERHEAP = 1300, + D3D12_MESSAGE_ID_LIVE_VIDEOENCODERHEAP = 1301, + D3D12_MESSAGE_ID_DESTROY_VIDEOENCODERHEAP = 1302, + + D3D12_MESSAGE_ID_COPYTEXTUREREGION_MISMATCH_ENCODE_REFERENCE_ONLY_FLAG = 1303, + D3D12_MESSAGE_ID_COPYRESOURCE_MISMATCH_ENCODE_REFERENCE_ONLY_FLAG = 1304, + D3D12_MESSAGE_ID_ENCODE_FRAME_INVALID_PARAMETERS = 1305, + D3D12_MESSAGE_ID_ENCODE_FRAME_UNSUPPORTED_PARAMETERS = 1306, + D3D12_MESSAGE_ID_RESOLVE_ENCODER_OUTPUT_METADATA_INVALID_PARAMETERS = 1307, + D3D12_MESSAGE_ID_RESOLVE_ENCODER_OUTPUT_METADATA_UNSUPPORTED_PARAMETERS = 1308, + D3D12_MESSAGE_ID_CREATE_VIDEO_ENCODER_INVALID_PARAMETERS = 1309, + D3D12_MESSAGE_ID_CREATE_VIDEO_ENCODER_UNSUPPORTED_PARAMETERS = 1310, + D3D12_MESSAGE_ID_CREATE_VIDEO_ENCODER_HEAP_INVALID_PARAMETERS = 1311, + D3D12_MESSAGE_ID_CREATE_VIDEO_ENCODER_HEAP_UNSUPPORTED_PARAMETERS = 1312, + D3D12_MESSAGE_ID_CREATECOMMANDLIST_NULL_COMMANDALLOCATOR = 1313, + D3D12_MESSAGE_ID_CLEAR_UNORDERED_ACCESS_VIEW_INVALID_DESCRIPTOR_HANDLE = 1314, + D3D12_MESSAGE_ID_DESCRIPTOR_HEAP_NOT_SHADER_VISIBLE = 1315, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_BLENDOP_WARNING = 1316, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_BLENDOPALPHA_WARNING = 1317, + D3D12_MESSAGE_ID_WRITE_COMBINE_PERFORMANCE_WARNING = 1318, + D3D12_MESSAGE_ID_RESOLVE_QUERY_INVALID_QUERY_STATE = 1319, + D3D12_MESSAGE_ID_SETPRIVATEDATA_NO_ACCESS = 1320, + D3D12_MESSAGE_ID_COMMAND_LIST_STATIC_DESCRIPTOR_SAMPLER_MODE_MISMATCH = 1321, + D3D12_MESSAGE_ID_GETCOPYABLEFOOTPRINTS_UNSUPPORTED_BUFFER_WIDTH = 1322, + D3D12_MESSAGE_ID_CREATEMESHSHADER_TOPOLOGY_MISMATCH = 1323, + D3D12_MESSAGE_ID_VRS_SUM_COMBINER_REQUIRES_CAPABILITY = 1324, + D3D12_MESSAGE_ID_SETTING_SHADING_RATE_FROM_MS_REQUIRES_CAPABILITY = 1325, + D3D12_MESSAGE_ID_SHADERCACHESESSION_SHADERCACHEDELETE_NOTSUPPORTED = 1326, + D3D12_MESSAGE_ID_SHADERCACHECONTROL_SHADERCACHECLEAR_NOTSUPPORTED = 1327, + D3D12_MESSAGE_ID_CREATERESOURCE_STATE_IGNORED = 1328, + D3D12_MESSAGE_ID_UNUSED_CROSS_EXECUTE_SPLIT_BARRIER = 1329, + D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_HANDLE_ACCESS_DENIED = 1330, + + D3D12_MESSAGE_ID_INCOMPATIBLE_BARRIER_VALUES = 1331, + D3D12_MESSAGE_ID_INCOMPATIBLE_BARRIER_ACCESS = 1332, + D3D12_MESSAGE_ID_INCOMPATIBLE_BARRIER_SYNC = 1333, + D3D12_MESSAGE_ID_INCOMPATIBLE_BARRIER_LAYOUT = 1334, + D3D12_MESSAGE_ID_INCOMPATIBLE_BARRIER_TYPE = 1335, + D3D12_MESSAGE_ID_OUT_OF_BOUNDS_BARRIER_SUBRESOURCE_RANGE = 1336, + D3D12_MESSAGE_ID_INCOMPATIBLE_BARRIER_RESOURCE_DIMENSION = 1337, + + D3D12_MESSAGE_ID_SET_SCISSOR_RECTS_INVALID_RECT = 1338, + + D3D12_MESSAGE_ID_SHADING_RATE_SOURCE_REQUIRES_DIMENSION_TEXTURE2D = 1339, + + D3D12_MESSAGE_ID_BUFFER_BARRIER_SUBREGION_OUT_OF_BOUNDS = 1340, + + D3D12_MESSAGE_ID_UNSUPPORTED_BARRIER_LAYOUT = 1341, + + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALID_PARAMETERS = 1342, + + D3D12_MESSAGE_ID_ENHANCED_BARRIERS_NOT_SUPPORTED = 1343, + + D3D12_MESSAGE_ID_CAST_TARGET_TEXEL_SIZE_MISMATCH = 1344, + D3D12_MESSAGE_ID_CAST_TO_PLANAR_NOT_SUPORTED = 1345, + + D3D12_MESSAGE_ID_LEGACY_BARRIER_VALIDATION_FORCED_ON = 1346, + + D3D12_MESSAGE_ID_EMPTY_ROOT_DESCRIPTOR_TABLE = 1347, + + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ELEMENT_OFFSET_UNALIGNED = 1348, + + D3D12_MESSAGE_ID_ALPHA_BLEND_FACTOR_NOT_SUPPORTED = 1349, + + D3D12_MESSAGE_ID_BARRIER_INTEROP_INVALID_LAYOUT = 1350, + D3D12_MESSAGE_ID_BARRIER_INTEROP_INVALID_STATE = 1351, + + D3D12_MESSAGE_ID_GRAPHICS_PIPELINE_STATE_DESC_ZERO_SAMPLE_MASK = 1352, + + D3D12_MESSAGE_ID_INDEPENDENT_STENCIL_REF_NOT_SUPPORTED = 1353, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INDEPENDENT_MASKS_UNSUPPORTED = 1354, + + D3D12_MESSAGE_ID_TEXTURE_BARRIER_SUBRESOURCES_OUT_OF_BOUNDS = 1355, + + D3D12_MESSAGE_ID_NON_OPTIMAL_BARRIER_ONLY_EXECUTE_COMMAND_LISTS = 1356, + + D3D12_MESSAGE_ID_EXECUTE_INDIRECT_ZERO_COMMAND_COUNT = 1357, + + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_INCOMPATIBLE_TEXTURE_LAYOUT = 1358, + + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_DYNAMIC_INDEX_BUFFER_STRIP_CUT_NOT_SUPPORTED = 1359, + D3D12_MESSAGE_ID_PRIMITIVE_TOPOLOGY_TRIANGLE_FANS_NOT_SUPPORTED = 1360, + + D3D12_MESSAGE_ID_CREATE_SAMPLER_COMPARISON_FUNC_IGNORED = 1361, + + D3D12_MESSAGE_ID_D3D12_MESSAGES_END +} D3D12_MESSAGE_ID; + +typedef struct D3D12_MESSAGE +{ + D3D12_MESSAGE_CATEGORY Category; + D3D12_MESSAGE_SEVERITY Severity; + D3D12_MESSAGE_ID ID; + [annotation("_Field_size_(DescriptionByteLength)")] const char* pDescription; + SIZE_T DescriptionByteLength; +} D3D12_MESSAGE; + +typedef struct D3D12_INFO_QUEUE_FILTER_DESC +{ + UINT NumCategories; + [annotation("_Field_size_(NumCategories)")] D3D12_MESSAGE_CATEGORY* pCategoryList; + UINT NumSeverities; + [annotation("_Field_size_(NumSeverities)")] D3D12_MESSAGE_SEVERITY* pSeverityList; + UINT NumIDs; + [annotation("_Field_size_(NumIDs)")] D3D12_MESSAGE_ID* pIDList; +} D3D12_INFO_QUEUE_FILTER_DESC; + +// To use, memset to 0, then fill in what you need. +typedef struct D3D12_INFO_QUEUE_FILTER +{ + D3D12_INFO_QUEUE_FILTER_DESC AllowList; + D3D12_INFO_QUEUE_FILTER_DESC DenyList; +} D3D12_INFO_QUEUE_FILTER; + +//============================================================================= +// ID3D12InfoQueue +// +// Logs D3D12 Messages. +// This interface can be queried from ID3D12Device, as long as the device +// was created with the debug layer. +// +// +cpp_quote("#define D3D12_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT 1024") +[uuid(0742a90b-c387-483f-b946-30a7e4e61458), object, local, pointer_default(unique)] +interface ID3D12InfoQueue + : IUnknown +{ + //========================================================================= + // Methods for configuring how much data is stored in the queue. + + // SetMessageCountLimit() + // This sets how many messages are stored. When the queue is full, + // new messages coming in push old messages out. + // Passing -1 to SetMessageCountLimit means the queue has + // unlimited size (go until out of memory or ClearStoredMessages()). + // The default message count size is + // D3D12_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT + // Returns S_OK or E_INVALIDARG. + HRESULT SetMessageCountLimit([annotation("_In_")] UINT64 MessageCountLimit); + + // ClearStoredMessages + void ClearStoredMessages(); + + //========================================================================= + // Methods for retrieving data or statistics from the queue. + + // GetMessage() + // Retrieves messages, one at a time, from the queue which pass any + // retrieval filter currently defined. If there is no retrieval filter, + // all messages can be retrieved. + // The MessageIndex parameter is a 0 based index into the results passing + // the filter. The number of results is returned by + // GetNumStoredMessagesAllowedByRetrievalFilter(). + // + // Note this does not remove the message from the queue. + // + // pMessageByteLength inputs the size of the buffer passed in via + // pMessage, and outputs the size of the message. pMessage can be NULL + // when the size of the required buffer is being queried (return S_FALSE). + // + // NOTE: The returned buffer pMessage is NOT just the size of D3D12_MESSAGE, + // it includes extra memory after the D3D12_MESSAGE for storing the string + // description, which is pointed to from within D3D12_MESSAGE. Therefore + // applications should check the size needed for pMessage as described above. + // + // Watch out for thread safety when making consecutive calls first to + // determine the buffer size required and then to pass in the buffer and + // retrieve the message, and also between calling + // GetNumStoredMessagesAllowedByRetrievalFilter() and enumerating through + // the results via GetMessagE(). + // + // Returns: S_OK, S_FALSE, E_INVALIDARG or E_OUTOFMEMORY. + HRESULT GetMessage( + [annotation("_In_")] UINT64 MessageIndex, + [annotation("_Out_writes_bytes_opt_(*pMessageByteLength)")] D3D12_MESSAGE* pMessage, + [annotation("_Inout_")] SIZE_T* pMessageByteLength); + + // GetNumMessagesAllowedByStorageFilter() + // Returns how many messages sent to the queue passed + // whatever storage filter was active upon receipt of + // the message. + // This can be a larger value than the message count limit, + // returned by GetMessageCountLimit(), since old messages are discarded + // when the queue is full to prevent overflow. + UINT64 GetNumMessagesAllowedByStorageFilter(); + + // GetNumMessagesDeniedByStorageFilter() + UINT64 GetNumMessagesDeniedByStorageFilter(); + + // GetNumStoredMessages() + // Returns how many messages are currently stored in the queue. + UINT64 GetNumStoredMessages(); + + // GetNumStoredMessagesAllowedByRetrievalFilter() + // Returns how many messages that are currently in the queue + // pass any retrieval filter that is currently set. + // The MessageIndex parameter to GetMessage() indexes + // an array of this many results. + UINT64 GetNumStoredMessagesAllowedByRetrievalFilter(); + + // GetNumMessagesDiscardedByMessageCountLimit() + UINT64 GetNumMessagesDiscardedByMessageCountLimit(); + + // GetMessageCountLimit + // This is how many messages can be stored in the queue. + // When the queue is full, new messages coming in push old messages out. + // -1 means there is no limit. + UINT64 GetMessageCountLimit(); + + //========================================================================= + // Methods for filtering what gets stored in the queue + + // AddStorageFilterEntries() + // Adds to the existing entries at top of stack + // Returns: S_OK, E_INVALIDARG or E_OUTOFMEMORY. + HRESULT AddStorageFilterEntries( + [annotation("_In_")] D3D12_INFO_QUEUE_FILTER* pFilter); + + // GetStorageFilter() + // Gets all entries at top of stack. + // The application must allocate the output buffer. The size required can be + // queried by passing null for pFilter and looking at the returned + // pFilterByteLength (HRESULT is S_FALSE). Note that D3D12_INFO_QUEUE_FILTER contains + // pointers - these will point to locations within the same + // contiguous buffer - *pFilterByteLength is the total storage needed for all + // data. So the application needs to only allocate/free the memory for pFilter. + // Returns S_OK, S_FALSE, E_INVALIDARG or E_OUTOFMEMORY + HRESULT GetStorageFilter( + [annotation("_Out_writes_bytes_opt_(*pFilterByteLength)")] D3D12_INFO_QUEUE_FILTER* pFilter, + [annotation("_Inout_")] SIZE_T* pFilterByteLength); + + // ClearStorageFilter() + // Clears filter at the top of the stack (if there is one) + void ClearStorageFilter(); + + // PushEmptyStorageFilter() + // Push an empty storage filter on the stack to allow local filtering changes. + // For convenience, this is automatically called by SetStorageFilter() + // if the stack is empty. Thus if the stack is not needed, filters can be + // defined without ever bothering to push or pop. + // Returns S_OK or E_OUTOFMEMORY + HRESULT PushEmptyStorageFilter(); + + // PushCopyOfStorageFilter() + // Push a copy of the current filter so that local modifications can be made + // starting from what currently exists. + // Returns S_OK or E_OUTOFMEMORY + HRESULT PushCopyOfStorageFilter(); + + // PushStorageFilter() + // Push a filter passed as a parameter onto the stack. This is + // just a helper for calling PushEmptyStorageFilter() followed + // by AddStorageFilterEntries() + // Returns S_OK, E_INVALIDARG or E_OUTOFMEMORY. + HRESULT PushStorageFilter( + [annotation("_In_")] D3D12_INFO_QUEUE_FILTER* pFilter); + + // PopStorageFilter() + // Pop the current storage filter off the stack (if there is one) + void PopStorageFilter(); + + // GetStorageFilterStackSize() + UINT GetStorageFilterStackSize(); + + //========================================================================= + // Methods for filtering what gets read out of the queue by GetMessage(). + + // AddRetrievalFilterEntries() + // Adds to the existing entries at top of stack + // Returns: S_OK, E_INVALIDARG or E_OUTOFMEMORY. + HRESULT AddRetrievalFilterEntries( + [annotation("_In_")] D3D12_INFO_QUEUE_FILTER* pFilter); + + // GetRetrievalFilter() + // Gets all entries at top of stack. + // The application must allocate the output buffer. The size required can be + // queried by passing null for pFilter and looking at the returned + // pFilterByteLength (HRESULT is S_FALSE). Note that D3D12_INFO_QUEUE_FILTER contains + // pointers - these will point to locations within the same + // contiguous buffer - *pFilterByteLength is the total storage needed for all + // data. So the application needs to only allocate/free the memory for pFilter. + // Returns S_OK, S_FALSE, E_INVALIDARG or E_OUTOFMEMORY + HRESULT GetRetrievalFilter( + [annotation("_Out_writes_bytes_opt_(*pFilterByteLength)")] D3D12_INFO_QUEUE_FILTER* pFilter, + [annotation("_Inout_")] SIZE_T* pFilterByteLength); + + // ClearRetrievalFilter() + // Clears filter at the top of the stack (if there is one) + void ClearRetrievalFilter(); + + // PushEmptyRetrievalFilter() + // Push an empty storage filter on the stack to allow local filtering changes. + // For convenience, this is automatically called by SetRetrievalFilter() + // if the stack is empty. Thus if the stack is not needed, filters can be + // defined without ever bothering to push or pop. + // Returns S_OK or E_OUTOFMEMORY + HRESULT PushEmptyRetrievalFilter(); + + // PushCopyOfRetrievalFilter() + // Push a copy of the current filter so that local modifications can be made + // starting from what currently exists. + // Returns S_OK or E_OUTOFMEMORY + HRESULT PushCopyOfRetrievalFilter(); + + // PushRetrievalFilter() + // Push a filter passed as a parameter onto the stack. This is + // just a helper for calling PushEmptyRetrievalFilter() followed + // by AddRetrievalFilterEntries() + // Returns S_OK, E_INVALIDARG or E_OUTOFMEMORY. + HRESULT PushRetrievalFilter( + [annotation("_In_")] D3D12_INFO_QUEUE_FILTER* pFilter); + + // PopRetrievalFilter() + // Pop the current storage filter off the stack (if there is one) + void PopRetrievalFilter(); + + // GetRetrievalFilterStackSize() + UINT GetRetrievalFilterStackSize(); + + //========================================================================= + // Methods for adding entries to the queue. + + // AddMessage() + // This is used by D3D12 components to log messages. Nothing stops + // applications from calling this, but it isn’t particularly useful. + // If an application wishes to insert custom strings into the queue, + // AddApplicationMessage() below is suggested. See below. + // + // Returns S_OK, E_INVALIDARG or E_OUTOFMEMORY + HRESULT AddMessage( + [annotation("_In_")] D3D12_MESSAGE_CATEGORY Category, + [annotation("_In_")] D3D12_MESSAGE_SEVERITY Severity, + [annotation("_In_")] D3D12_MESSAGE_ID ID, + [annotation("_In_")] LPCSTR pDescription); + + // AddApplicationMessage() + // This is a convenience for applications that want + // to insert strings of their own into the queue, perhaps to log issues + // of its own, or to mark out points in time in the queue. This + // has the same effect as calling AddMessage() above with the + // following settings: + // Category = D3D12_MESSAGE_CATEGORY_APPLICATION_DEFINED + // Severity = + // ID = D3D12_MESSAGE_ID_STRING_FROM_APPLICATION + // pDescription = + // + // Returns S_OK, E_INVALIDARG or E_OUTOFMEMORY + HRESULT AddApplicationMessage( + [annotation("_In_")] D3D12_MESSAGE_SEVERITY Severity, + [annotation("_In_")] LPCSTR pDescription); + + //========================================================================= + // Methods for breaking on errors that pass the storage filter. + HRESULT SetBreakOnCategory( + [annotation("_In_")] D3D12_MESSAGE_CATEGORY Category, + [annotation("_In_")] BOOL bEnable); + HRESULT SetBreakOnSeverity( + [annotation("_In_")] D3D12_MESSAGE_SEVERITY Severity, + [annotation("_In_")] BOOL bEnable); + HRESULT SetBreakOnID( + [annotation("_In_")] D3D12_MESSAGE_ID ID, + [annotation("_In_")] BOOL bEnable); + + BOOL GetBreakOnCategory( + [annotation("_In_")] D3D12_MESSAGE_CATEGORY Category); + BOOL GetBreakOnSeverity( + [annotation("_In_")] D3D12_MESSAGE_SEVERITY Severity); + BOOL GetBreakOnID( + [annotation("_In_")] D3D12_MESSAGE_ID ID); + + //========================================================================= + // Methods for globally muting debug spte from the InfoQueue + void SetMuteDebugOutput( + [annotation("_In_")] BOOL bMute); + BOOL GetMuteDebugOutput(); +}; + +typedef enum D3D12_MESSAGE_CALLBACK_FLAGS +{ + D3D12_MESSAGE_CALLBACK_FLAG_NONE = 0x00, + D3D12_MESSAGE_CALLBACK_IGNORE_FILTERS = 0x01, + +} D3D12_MESSAGE_CALLBACK_FLAGS; + +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS(D3D12_MESSAGE_CALLBACK_FLAGS)") + +typedef void (__stdcall *D3D12MessageFunc) (D3D12_MESSAGE_CATEGORY Category, + D3D12_MESSAGE_SEVERITY Severity, + D3D12_MESSAGE_ID ID, + LPCSTR pDescription, + void* pContext); + +[ uuid( 2852dd88-b484-4c0c-b6b1-67168500e600 ), object, local, pointer_default( unique ) ] +interface ID3D12InfoQueue1 + : ID3D12InfoQueue +{ + HRESULT RegisterMessageCallback( + [annotation("_In_")] D3D12MessageFunc CallbackFunc, + [annotation("_In_")] D3D12_MESSAGE_CALLBACK_FLAGS CallbackFilterFlags, + [annotation("_In_")] void* pContext, + [annotation("_Inout_")] DWORD *pCallbackCookie); + + HRESULT UnregisterMessageCallback( + [annotation("_In_")] DWORD CallbackCookie); +}; + + + +cpp_quote("#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */") +#pragma endregion + +cpp_quote( "DEFINE_GUID(IID_ID3D12Debug,0x344488b7,0x6846,0x474b,0xb9,0x89,0xf0,0x27,0x44,0x82,0x45,0xe0);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Debug1,0xaffaa4ca,0x63fe,0x4d8e,0xb8,0xad,0x15,0x90,0x00,0xaf,0x43,0x04);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Debug2,0x93a665c4,0xa3b2,0x4e5d,0xb6,0x92,0xa2,0x6a,0xe1,0x4e,0x33,0x74);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Debug3,0x5cf4e58f,0xf671,0x4ff1,0xa5,0x42,0x36,0x86,0xe3,0xd1,0x53,0xd1);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Debug4,0x014b816e,0x9ec5,0x4a2f,0xa8,0x45,0xff,0xbe,0x44,0x1c,0xe1,0x3a);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Debug5,0x548d6b12,0x09fa,0x40e0,0x90,0x69,0x5d,0xcd,0x58,0x9a,0x52,0xc9);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Debug6,0x82a816d6,0x5d01,0x4157,0x97,0xd0,0x49,0x75,0x46,0x3f,0xd1,0xed);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12DebugDevice1,0xa9b71770,0xd099,0x4a65,0xa6,0x98,0x3d,0xee,0x10,0x02,0x0f,0x88);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12DebugDevice,0x3febd6dd,0x4973,0x4787,0x81,0x94,0xe4,0x5f,0x9e,0x28,0x92,0x3e);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12DebugDevice2,0x60eccbc1,0x378d,0x4df1,0x89,0x4c,0xf8,0xac,0x5c,0xe4,0xd7,0xdd);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12DebugCommandQueue,0x09e0bf36,0x54ac,0x484f,0x88,0x47,0x4b,0xae,0xea,0xb6,0x05,0x3a);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12DebugCommandQueue1,0x16be35a2,0xbfd6,0x49f2,0xbc,0xae,0xea,0xae,0x4a,0xff,0x86,0x2d);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12DebugCommandList1,0x102ca951,0x311b,0x4b01,0xb1,0x1f,0xec,0xb8,0x3e,0x06,0x1b,0x37);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12DebugCommandList,0x09e0bf36,0x54ac,0x484f,0x88,0x47,0x4b,0xae,0xea,0xb6,0x05,0x3f);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12DebugCommandList2,0xaeb575cf,0x4e06,0x48be,0xba,0x3b,0xc4,0x50,0xfc,0x96,0x65,0x2e);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12DebugCommandList3,0x197d5e15,0x4d37,0x4d34,0xaf,0x78,0x72,0x4c,0xd7,0x0f,0xdb,0x1f);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12SharingContract,0x0adf7d52,0x929c,0x4e61,0xad,0xdb,0xff,0xed,0x30,0xde,0x66,0xef);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12InfoQueue,0x0742a90b,0xc387,0x483f,0xb9,0x46,0x30,0xa7,0xe4,0xe6,0x14,0x58);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12InfoQueue1,0x2852dd88,0xb484,0x4c0c,0xb6,0xb1,0x67,0x16,0x85,0x00,0xe6,0x00);" ) diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12shader.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12shader.h new file mode 100644 index 0000000..0acf584 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12shader.h @@ -0,0 +1,490 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +// +// File: D3D12Shader.h +// Content: D3D12 Shader Types and APIs +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef __D3D12SHADER_H__ +#define __D3D12SHADER_H__ + +#include "d3dcommon.h" + +typedef enum D3D12_SHADER_VERSION_TYPE +{ + D3D12_SHVER_PIXEL_SHADER = 0, + D3D12_SHVER_VERTEX_SHADER = 1, + D3D12_SHVER_GEOMETRY_SHADER = 2, + + // D3D11 Shaders + D3D12_SHVER_HULL_SHADER = 3, + D3D12_SHVER_DOMAIN_SHADER = 4, + D3D12_SHVER_COMPUTE_SHADER = 5, + + // D3D12 Shaders + D3D12_SHVER_LIBRARY = 6, + + D3D12_SHVER_RAY_GENERATION_SHADER = 7, + D3D12_SHVER_INTERSECTION_SHADER = 8, + D3D12_SHVER_ANY_HIT_SHADER = 9, + D3D12_SHVER_CLOSEST_HIT_SHADER = 10, + D3D12_SHVER_MISS_SHADER = 11, + D3D12_SHVER_CALLABLE_SHADER = 12, + + D3D12_SHVER_MESH_SHADER = 13, + D3D12_SHVER_AMPLIFICATION_SHADER = 14, + + D3D12_SHVER_RESERVED0 = 0xFFF0, +} D3D12_SHADER_VERSION_TYPE; + +#define D3D12_SHVER_GET_TYPE(_Version) \ + (((_Version) >> 16) & 0xffff) +#define D3D12_SHVER_GET_MAJOR(_Version) \ + (((_Version) >> 4) & 0xf) +#define D3D12_SHVER_GET_MINOR(_Version) \ + (((_Version) >> 0) & 0xf) + +// Slot ID for library function return +#define D3D_RETURN_PARAMETER_INDEX (-1) + +typedef D3D_RESOURCE_RETURN_TYPE D3D12_RESOURCE_RETURN_TYPE; + +typedef D3D_CBUFFER_TYPE D3D12_CBUFFER_TYPE; + + +typedef struct _D3D12_SIGNATURE_PARAMETER_DESC +{ + LPCSTR SemanticName; // Name of the semantic + UINT SemanticIndex; // Index of the semantic + UINT Register; // Number of member variables + D3D_NAME SystemValueType;// A predefined system value, or D3D_NAME_UNDEFINED if not applicable + D3D_REGISTER_COMPONENT_TYPE ComponentType; // Scalar type (e.g. uint, float, etc.) + BYTE Mask; // Mask to indicate which components of the register + // are used (combination of D3D10_COMPONENT_MASK values) + BYTE ReadWriteMask; // Mask to indicate whether a given component is + // never written (if this is an output signature) or + // always read (if this is an input signature). + // (combination of D3D_MASK_* values) + UINT Stream; // Stream index + D3D_MIN_PRECISION MinPrecision; // Minimum desired interpolation precision +} D3D12_SIGNATURE_PARAMETER_DESC; + +typedef struct _D3D12_SHADER_BUFFER_DESC +{ + LPCSTR Name; // Name of the constant buffer + D3D_CBUFFER_TYPE Type; // Indicates type of buffer content + UINT Variables; // Number of member variables + UINT Size; // Size of CB (in bytes) + UINT uFlags; // Buffer description flags +} D3D12_SHADER_BUFFER_DESC; + +typedef struct _D3D12_SHADER_VARIABLE_DESC +{ + LPCSTR Name; // Name of the variable + UINT StartOffset; // Offset in constant buffer's backing store + UINT Size; // Size of variable (in bytes) + UINT uFlags; // Variable flags + LPVOID DefaultValue; // Raw pointer to default value + UINT StartTexture; // First texture index (or -1 if no textures used) + UINT TextureSize; // Number of texture slots possibly used. + UINT StartSampler; // First sampler index (or -1 if no textures used) + UINT SamplerSize; // Number of sampler slots possibly used. +} D3D12_SHADER_VARIABLE_DESC; + +typedef struct _D3D12_SHADER_TYPE_DESC +{ + D3D_SHADER_VARIABLE_CLASS Class; // Variable class (e.g. object, matrix, etc.) + D3D_SHADER_VARIABLE_TYPE Type; // Variable type (e.g. float, sampler, etc.) + UINT Rows; // Number of rows (for matrices, 1 for other numeric, 0 if not applicable) + UINT Columns; // Number of columns (for vectors & matrices, 1 for other numeric, 0 if not applicable) + UINT Elements; // Number of elements (0 if not an array) + UINT Members; // Number of members (0 if not a structure) + UINT Offset; // Offset from the start of structure (0 if not a structure member) + LPCSTR Name; // Name of type, can be NULL +} D3D12_SHADER_TYPE_DESC; + +typedef D3D_TESSELLATOR_DOMAIN D3D12_TESSELLATOR_DOMAIN; + +typedef D3D_TESSELLATOR_PARTITIONING D3D12_TESSELLATOR_PARTITIONING; + +typedef D3D_TESSELLATOR_OUTPUT_PRIMITIVE D3D12_TESSELLATOR_OUTPUT_PRIMITIVE; + +typedef struct _D3D12_SHADER_DESC +{ + UINT Version; // Shader version + LPCSTR Creator; // Creator string + UINT Flags; // Shader compilation/parse flags + + UINT ConstantBuffers; // Number of constant buffers + UINT BoundResources; // Number of bound resources + UINT InputParameters; // Number of parameters in the input signature + UINT OutputParameters; // Number of parameters in the output signature + + UINT InstructionCount; // Number of emitted instructions + UINT TempRegisterCount; // Number of temporary registers used + UINT TempArrayCount; // Number of temporary arrays used + UINT DefCount; // Number of constant defines + UINT DclCount; // Number of declarations (input + output) + UINT TextureNormalInstructions; // Number of non-categorized texture instructions + UINT TextureLoadInstructions; // Number of texture load instructions + UINT TextureCompInstructions; // Number of texture comparison instructions + UINT TextureBiasInstructions; // Number of texture bias instructions + UINT TextureGradientInstructions; // Number of texture gradient instructions + UINT FloatInstructionCount; // Number of floating point arithmetic instructions used + UINT IntInstructionCount; // Number of signed integer arithmetic instructions used + UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used + UINT StaticFlowControlCount; // Number of static flow control instructions used + UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used + UINT MacroInstructionCount; // Number of macro instructions used + UINT ArrayInstructionCount; // Number of array instructions used + UINT CutInstructionCount; // Number of cut instructions used + UINT EmitInstructionCount; // Number of emit instructions used + D3D_PRIMITIVE_TOPOLOGY GSOutputTopology; // Geometry shader output topology + UINT GSMaxOutputVertexCount; // Geometry shader maximum output vertex count + D3D_PRIMITIVE InputPrimitive; // GS/HS input primitive + UINT PatchConstantParameters; // Number of parameters in the patch constant signature + UINT cGSInstanceCount; // Number of Geometry shader instances + UINT cControlPoints; // Number of control points in the HS->DS stage + D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive; // Primitive output by the tessellator + D3D_TESSELLATOR_PARTITIONING HSPartitioning; // Partitioning mode of the tessellator + D3D_TESSELLATOR_DOMAIN TessellatorDomain; // Domain of the tessellator (quad, tri, isoline) + // instruction counts + UINT cBarrierInstructions; // Number of barrier instructions in a compute shader + UINT cInterlockedInstructions; // Number of interlocked instructions + UINT cTextureStoreInstructions; // Number of texture writes +} D3D12_SHADER_DESC; + +typedef struct _D3D12_SHADER_INPUT_BIND_DESC +{ + LPCSTR Name; // Name of the resource + D3D_SHADER_INPUT_TYPE Type; // Type of resource (e.g. texture, cbuffer, etc.) + UINT BindPoint; // Starting bind point + UINT BindCount; // Number of contiguous bind points (for arrays) + + UINT uFlags; // Input binding flags + D3D_RESOURCE_RETURN_TYPE ReturnType; // Return type (if texture) + D3D_SRV_DIMENSION Dimension; // Dimension (if texture) + UINT NumSamples; // Number of samples (0 if not MS texture) + UINT Space; // Register space + UINT uID; // Range ID in the bytecode +} D3D12_SHADER_INPUT_BIND_DESC; + +#define D3D_SHADER_REQUIRES_DOUBLES 0x00000001 +#define D3D_SHADER_REQUIRES_EARLY_DEPTH_STENCIL 0x00000002 +#define D3D_SHADER_REQUIRES_UAVS_AT_EVERY_STAGE 0x00000004 +#define D3D_SHADER_REQUIRES_64_UAVS 0x00000008 +#define D3D_SHADER_REQUIRES_MINIMUM_PRECISION 0x00000010 +#define D3D_SHADER_REQUIRES_11_1_DOUBLE_EXTENSIONS 0x00000020 +#define D3D_SHADER_REQUIRES_11_1_SHADER_EXTENSIONS 0x00000040 +#define D3D_SHADER_REQUIRES_LEVEL_9_COMPARISON_FILTERING 0x00000080 +#define D3D_SHADER_REQUIRES_TILED_RESOURCES 0x00000100 +#define D3D_SHADER_REQUIRES_STENCIL_REF 0x00000200 +#define D3D_SHADER_REQUIRES_INNER_COVERAGE 0x00000400 +#define D3D_SHADER_REQUIRES_TYPED_UAV_LOAD_ADDITIONAL_FORMATS 0x00000800 +#define D3D_SHADER_REQUIRES_ROVS 0x00001000 +#define D3D_SHADER_REQUIRES_VIEWPORT_AND_RT_ARRAY_INDEX_FROM_ANY_SHADER_FEEDING_RASTERIZER 0x00002000 +#define D3D_SHADER_REQUIRES_WAVE_OPS 0x00004000 +#define D3D_SHADER_REQUIRES_INT64_OPS 0x00008000 +#define D3D_SHADER_REQUIRES_VIEW_ID 0x00010000 +#define D3D_SHADER_REQUIRES_BARYCENTRICS 0x00020000 +#define D3D_SHADER_REQUIRES_NATIVE_16BIT_OPS 0x00040000 +#define D3D_SHADER_REQUIRES_SHADING_RATE 0x00080000 +#define D3D_SHADER_REQUIRES_RAYTRACING_TIER_1_1 0x00100000 +#define D3D_SHADER_REQUIRES_SAMPLER_FEEDBACK 0x00200000 +#define D3D_SHADER_REQUIRES_ATOMIC_INT64_ON_TYPED_RESOURCE 0x00400000 +#define D3D_SHADER_REQUIRES_ATOMIC_INT64_ON_GROUP_SHARED 0x00800000 +#define D3D_SHADER_REQUIRES_DERIVATIVES_IN_MESH_AND_AMPLIFICATION_SHADERS 0x01000000 +#define D3D_SHADER_REQUIRES_RESOURCE_DESCRIPTOR_HEAP_INDEXING 0x02000000 +#define D3D_SHADER_REQUIRES_SAMPLER_DESCRIPTOR_HEAP_INDEXING 0x04000000 +#define D3D_SHADER_REQUIRES_WAVE_MMA 0x08000000 +#define D3D_SHADER_REQUIRES_ATOMIC_INT64_ON_DESCRIPTOR_HEAP_RESOURCE 0x10000000 +#define D3D_SHADER_FEATURE_ADVANCED_TEXTURE_OPS 0x20000000 +#define D3D_SHADER_FEATURE_WRITEABLE_MSAA_TEXTURES 0x40000000 + + +typedef struct _D3D12_LIBRARY_DESC +{ + LPCSTR Creator; // The name of the originator of the library. + UINT Flags; // Compilation flags. + UINT FunctionCount; // Number of functions exported from the library. +} D3D12_LIBRARY_DESC; + +typedef struct _D3D12_FUNCTION_DESC +{ + UINT Version; // Shader version + LPCSTR Creator; // Creator string + UINT Flags; // Shader compilation/parse flags + + UINT ConstantBuffers; // Number of constant buffers + UINT BoundResources; // Number of bound resources + + UINT InstructionCount; // Number of emitted instructions + UINT TempRegisterCount; // Number of temporary registers used + UINT TempArrayCount; // Number of temporary arrays used + UINT DefCount; // Number of constant defines + UINT DclCount; // Number of declarations (input + output) + UINT TextureNormalInstructions; // Number of non-categorized texture instructions + UINT TextureLoadInstructions; // Number of texture load instructions + UINT TextureCompInstructions; // Number of texture comparison instructions + UINT TextureBiasInstructions; // Number of texture bias instructions + UINT TextureGradientInstructions; // Number of texture gradient instructions + UINT FloatInstructionCount; // Number of floating point arithmetic instructions used + UINT IntInstructionCount; // Number of signed integer arithmetic instructions used + UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used + UINT StaticFlowControlCount; // Number of static flow control instructions used + UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used + UINT MacroInstructionCount; // Number of macro instructions used + UINT ArrayInstructionCount; // Number of array instructions used + UINT MovInstructionCount; // Number of mov instructions used + UINT MovcInstructionCount; // Number of movc instructions used + UINT ConversionInstructionCount; // Number of type conversion instructions used + UINT BitwiseInstructionCount; // Number of bitwise arithmetic instructions used + D3D_FEATURE_LEVEL MinFeatureLevel; // Min target of the function byte code + UINT64 RequiredFeatureFlags; // Required feature flags + + LPCSTR Name; // Function name + INT FunctionParameterCount; // Number of logical parameters in the function signature (not including return) + BOOL HasReturn; // TRUE, if function returns a value, false - it is a subroutine + BOOL Has10Level9VertexShader; // TRUE, if there is a 10L9 VS blob + BOOL Has10Level9PixelShader; // TRUE, if there is a 10L9 PS blob +} D3D12_FUNCTION_DESC; + +typedef struct _D3D12_PARAMETER_DESC +{ + LPCSTR Name; // Parameter name. + LPCSTR SemanticName; // Parameter semantic name (+index). + D3D_SHADER_VARIABLE_TYPE Type; // Element type. + D3D_SHADER_VARIABLE_CLASS Class; // Scalar/Vector/Matrix. + UINT Rows; // Rows are for matrix parameters. + UINT Columns; // Components or Columns in matrix. + D3D_INTERPOLATION_MODE InterpolationMode; // Interpolation mode. + D3D_PARAMETER_FLAGS Flags; // Parameter modifiers. + + UINT FirstInRegister; // The first input register for this parameter. + UINT FirstInComponent; // The first input register component for this parameter. + UINT FirstOutRegister; // The first output register for this parameter. + UINT FirstOutComponent; // The first output register component for this parameter. +} D3D12_PARAMETER_DESC; + + +////////////////////////////////////////////////////////////////////////////// +// Interfaces //////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D12ShaderReflectionType ID3D12ShaderReflectionType; +typedef interface ID3D12ShaderReflectionType *LPD3D12SHADERREFLECTIONTYPE; + +typedef interface ID3D12ShaderReflectionVariable ID3D12ShaderReflectionVariable; +typedef interface ID3D12ShaderReflectionVariable *LPD3D12SHADERREFLECTIONVARIABLE; + +typedef interface ID3D12ShaderReflectionConstantBuffer ID3D12ShaderReflectionConstantBuffer; +typedef interface ID3D12ShaderReflectionConstantBuffer *LPD3D12SHADERREFLECTIONCONSTANTBUFFER; + +typedef interface ID3D12ShaderReflection ID3D12ShaderReflection; +typedef interface ID3D12ShaderReflection *LPD3D12SHADERREFLECTION; + +typedef interface ID3D12LibraryReflection ID3D12LibraryReflection; +typedef interface ID3D12LibraryReflection *LPD3D12LIBRARYREFLECTION; + +typedef interface ID3D12FunctionReflection ID3D12FunctionReflection; +typedef interface ID3D12FunctionReflection *LPD3D12FUNCTIONREFLECTION; + +typedef interface ID3D12FunctionParameterReflection ID3D12FunctionParameterReflection; +typedef interface ID3D12FunctionParameterReflection *LPD3D12FUNCTIONPARAMETERREFLECTION; + + +// {E913C351-783D-48CA-A1D1-4F306284AD56} +interface DECLSPEC_UUID("E913C351-783D-48CA-A1D1-4F306284AD56") ID3D12ShaderReflectionType; +DEFINE_GUID(IID_ID3D12ShaderReflectionType, +0xe913c351, 0x783d, 0x48ca, 0xa1, 0xd1, 0x4f, 0x30, 0x62, 0x84, 0xad, 0x56); + +#undef INTERFACE +#define INTERFACE ID3D12ShaderReflectionType + +DECLARE_INTERFACE(ID3D12ShaderReflectionType) +{ + STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_TYPE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D12ShaderReflectionType*, GetMemberTypeByIndex)(THIS_ _In_ UINT Index) PURE; + STDMETHOD_(ID3D12ShaderReflectionType*, GetMemberTypeByName)(THIS_ _In_ LPCSTR Name) PURE; + STDMETHOD_(LPCSTR, GetMemberTypeName)(THIS_ _In_ UINT Index) PURE; + + STDMETHOD(IsEqual)(THIS_ _In_ ID3D12ShaderReflectionType* pType) PURE; + STDMETHOD_(ID3D12ShaderReflectionType*, GetSubType)(THIS) PURE; + STDMETHOD_(ID3D12ShaderReflectionType*, GetBaseClass)(THIS) PURE; + STDMETHOD_(UINT, GetNumInterfaces)(THIS) PURE; + STDMETHOD_(ID3D12ShaderReflectionType*, GetInterfaceByIndex)(THIS_ _In_ UINT uIndex) PURE; + STDMETHOD(IsOfType)(THIS_ _In_ ID3D12ShaderReflectionType* pType) PURE; + STDMETHOD(ImplementsInterface)(THIS_ _In_ ID3D12ShaderReflectionType* pBase) PURE; +}; + +// {8337A8A6-A216-444A-B2F4-314733A73AEA} +interface DECLSPEC_UUID("8337A8A6-A216-444A-B2F4-314733A73AEA") ID3D12ShaderReflectionVariable; +DEFINE_GUID(IID_ID3D12ShaderReflectionVariable, +0x8337a8a6, 0xa216, 0x444a, 0xb2, 0xf4, 0x31, 0x47, 0x33, 0xa7, 0x3a, 0xea); + +#undef INTERFACE +#define INTERFACE ID3D12ShaderReflectionVariable + +DECLARE_INTERFACE(ID3D12ShaderReflectionVariable) +{ + STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D12ShaderReflectionType*, GetType)(THIS) PURE; + STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetBuffer)(THIS) PURE; + + STDMETHOD_(UINT, GetInterfaceSlot)(THIS_ _In_ UINT uArrayIndex) PURE; +}; + +// {C59598B4-48B3-4869-B9B1-B1618B14A8B7} +interface DECLSPEC_UUID("C59598B4-48B3-4869-B9B1-B1618B14A8B7") ID3D12ShaderReflectionConstantBuffer; +DEFINE_GUID(IID_ID3D12ShaderReflectionConstantBuffer, +0xc59598b4, 0x48b3, 0x4869, 0xb9, 0xb1, 0xb1, 0x61, 0x8b, 0x14, 0xa8, 0xb7); + +#undef INTERFACE +#define INTERFACE ID3D12ShaderReflectionConstantBuffer + +DECLARE_INTERFACE(ID3D12ShaderReflectionConstantBuffer) +{ + STDMETHOD(GetDesc)(THIS_ D3D12_SHADER_BUFFER_DESC *pDesc) PURE; + + STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByIndex)(THIS_ _In_ UINT Index) PURE; + STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE; +}; + +// The ID3D12ShaderReflection IID may change from SDK version to SDK version +// if the reflection API changes. This prevents new code with the new API +// from working with an old binary. Recompiling with the new header +// will pick up the new IID. + +// {5A58797D-A72C-478D-8BA2-EFC6B0EFE88E} +interface DECLSPEC_UUID("5A58797D-A72C-478D-8BA2-EFC6B0EFE88E") ID3D12ShaderReflection; +DEFINE_GUID(IID_ID3D12ShaderReflection, +0x5a58797d, 0xa72c, 0x478d, 0x8b, 0xa2, 0xef, 0xc6, 0xb0, 0xef, 0xe8, 0x8e); + +#undef INTERFACE +#define INTERFACE ID3D12ShaderReflection + +DECLARE_INTERFACE_(ID3D12ShaderReflection, IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, + _Out_ LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_DESC *pDesc) PURE; + + STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ _In_ UINT Index) PURE; + STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE; + + STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex, + _Out_ D3D12_SHADER_INPUT_BIND_DESC *pDesc) PURE; + + STDMETHOD(GetInputParameterDesc)(THIS_ _In_ UINT ParameterIndex, + _Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE; + STDMETHOD(GetOutputParameterDesc)(THIS_ _In_ UINT ParameterIndex, + _Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE; + STDMETHOD(GetPatchConstantParameterDesc)(THIS_ _In_ UINT ParameterIndex, + _Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE; + + STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE; + + STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name, + _Out_ D3D12_SHADER_INPUT_BIND_DESC *pDesc) PURE; + + STDMETHOD_(UINT, GetMovInstructionCount)(THIS) PURE; + STDMETHOD_(UINT, GetMovcInstructionCount)(THIS) PURE; + STDMETHOD_(UINT, GetConversionInstructionCount)(THIS) PURE; + STDMETHOD_(UINT, GetBitwiseInstructionCount)(THIS) PURE; + + STDMETHOD_(D3D_PRIMITIVE, GetGSInputPrimitive)(THIS) PURE; + STDMETHOD_(BOOL, IsSampleFrequencyShader)(THIS) PURE; + + STDMETHOD_(UINT, GetNumInterfaceSlots)(THIS) PURE; + STDMETHOD(GetMinFeatureLevel)(THIS_ _Out_ enum D3D_FEATURE_LEVEL* pLevel) PURE; + + STDMETHOD_(UINT, GetThreadGroupSize)(THIS_ + _Out_opt_ UINT* pSizeX, + _Out_opt_ UINT* pSizeY, + _Out_opt_ UINT* pSizeZ) PURE; + + STDMETHOD_(UINT64, GetRequiresFlags)(THIS) PURE; +}; + +// {8E349D19-54DB-4A56-9DC9-119D87BDB804} +interface DECLSPEC_UUID("8E349D19-54DB-4A56-9DC9-119D87BDB804") ID3D12LibraryReflection; +DEFINE_GUID(IID_ID3D12LibraryReflection, +0x8e349d19, 0x54db, 0x4a56, 0x9d, 0xc9, 0x11, 0x9d, 0x87, 0xbd, 0xb8, 0x4); + +#undef INTERFACE +#define INTERFACE ID3D12LibraryReflection + +DECLARE_INTERFACE_(ID3D12LibraryReflection, IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_LIBRARY_DESC * pDesc) PURE; + + STDMETHOD_(ID3D12FunctionReflection *, GetFunctionByIndex)(THIS_ _In_ INT FunctionIndex) PURE; +}; + +// {1108795C-2772-4BA9-B2A8-D464DC7E2799} +interface DECLSPEC_UUID("1108795C-2772-4BA9-B2A8-D464DC7E2799") ID3D12FunctionReflection; +DEFINE_GUID(IID_ID3D12FunctionReflection, +0x1108795c, 0x2772, 0x4ba9, 0xb2, 0xa8, 0xd4, 0x64, 0xdc, 0x7e, 0x27, 0x99); + +#undef INTERFACE +#define INTERFACE ID3D12FunctionReflection + +DECLARE_INTERFACE(ID3D12FunctionReflection) +{ + STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_FUNCTION_DESC * pDesc) PURE; + + STDMETHOD_(ID3D12ShaderReflectionConstantBuffer *, GetConstantBufferByIndex)(THIS_ _In_ UINT BufferIndex) PURE; + STDMETHOD_(ID3D12ShaderReflectionConstantBuffer *, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE; + + STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex, + _Out_ D3D12_SHADER_INPUT_BIND_DESC * pDesc) PURE; + + STDMETHOD_(ID3D12ShaderReflectionVariable *, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE; + + STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name, + _Out_ D3D12_SHADER_INPUT_BIND_DESC * pDesc) PURE; + + // Use D3D_RETURN_PARAMETER_INDEX to get description of the return value. + STDMETHOD_(ID3D12FunctionParameterReflection *, GetFunctionParameter)(THIS_ _In_ INT ParameterIndex) PURE; +}; + +// {EC25F42D-7006-4F2B-B33E-02CC3375733F} +interface DECLSPEC_UUID("EC25F42D-7006-4F2B-B33E-02CC3375733F") ID3D12FunctionParameterReflection; +DEFINE_GUID(IID_ID3D12FunctionParameterReflection, +0xec25f42d, 0x7006, 0x4f2b, 0xb3, 0x3e, 0x2, 0xcc, 0x33, 0x75, 0x73, 0x3f); + +#undef INTERFACE +#define INTERFACE ID3D12FunctionParameterReflection + +DECLARE_INTERFACE(ID3D12FunctionParameterReflection) +{ + STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_PARAMETER_DESC * pDesc) PURE; +}; + + +////////////////////////////////////////////////////////////////////////////// +// APIs ////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3D12SHADER_H__ + diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12video.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12video.h new file mode 100644 index 0000000..add372e --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12video.h @@ -0,0 +1,8584 @@ +/*------------------------------------------------------------------------------------- + * + * Copyright (c) Microsoft Corporation + * Licensed under the MIT license + * + *-------------------------------------------------------------------------------------*/ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 8.01.0628 */ + + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 500 +#endif + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif /* __RPCNDR_H_VERSION__ */ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __d3d12video_h__ +#define __d3d12video_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +#ifndef DECLSPEC_XFGVIRT +#if defined(_CONTROL_FLOW_GUARD_XFG) +#define DECLSPEC_XFGVIRT(base, func) __declspec(xfg_virtual(base, func)) +#else +#define DECLSPEC_XFGVIRT(base, func) +#endif +#endif + +/* Forward Declarations */ + +#ifndef __ID3D12VideoDecoderHeap_FWD_DEFINED__ +#define __ID3D12VideoDecoderHeap_FWD_DEFINED__ +typedef interface ID3D12VideoDecoderHeap ID3D12VideoDecoderHeap; + +#endif /* __ID3D12VideoDecoderHeap_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoDevice_FWD_DEFINED__ +#define __ID3D12VideoDevice_FWD_DEFINED__ +typedef interface ID3D12VideoDevice ID3D12VideoDevice; + +#endif /* __ID3D12VideoDevice_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoDecoder_FWD_DEFINED__ +#define __ID3D12VideoDecoder_FWD_DEFINED__ +typedef interface ID3D12VideoDecoder ID3D12VideoDecoder; + +#endif /* __ID3D12VideoDecoder_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoProcessor_FWD_DEFINED__ +#define __ID3D12VideoProcessor_FWD_DEFINED__ +typedef interface ID3D12VideoProcessor ID3D12VideoProcessor; + +#endif /* __ID3D12VideoProcessor_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoDecodeCommandList_FWD_DEFINED__ +#define __ID3D12VideoDecodeCommandList_FWD_DEFINED__ +typedef interface ID3D12VideoDecodeCommandList ID3D12VideoDecodeCommandList; + +#endif /* __ID3D12VideoDecodeCommandList_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoProcessCommandList_FWD_DEFINED__ +#define __ID3D12VideoProcessCommandList_FWD_DEFINED__ +typedef interface ID3D12VideoProcessCommandList ID3D12VideoProcessCommandList; + +#endif /* __ID3D12VideoProcessCommandList_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoDecodeCommandList1_FWD_DEFINED__ +#define __ID3D12VideoDecodeCommandList1_FWD_DEFINED__ +typedef interface ID3D12VideoDecodeCommandList1 ID3D12VideoDecodeCommandList1; + +#endif /* __ID3D12VideoDecodeCommandList1_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoProcessCommandList1_FWD_DEFINED__ +#define __ID3D12VideoProcessCommandList1_FWD_DEFINED__ +typedef interface ID3D12VideoProcessCommandList1 ID3D12VideoProcessCommandList1; + +#endif /* __ID3D12VideoProcessCommandList1_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoMotionEstimator_FWD_DEFINED__ +#define __ID3D12VideoMotionEstimator_FWD_DEFINED__ +typedef interface ID3D12VideoMotionEstimator ID3D12VideoMotionEstimator; + +#endif /* __ID3D12VideoMotionEstimator_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoMotionVectorHeap_FWD_DEFINED__ +#define __ID3D12VideoMotionVectorHeap_FWD_DEFINED__ +typedef interface ID3D12VideoMotionVectorHeap ID3D12VideoMotionVectorHeap; + +#endif /* __ID3D12VideoMotionVectorHeap_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoDevice1_FWD_DEFINED__ +#define __ID3D12VideoDevice1_FWD_DEFINED__ +typedef interface ID3D12VideoDevice1 ID3D12VideoDevice1; + +#endif /* __ID3D12VideoDevice1_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoEncodeCommandList_FWD_DEFINED__ +#define __ID3D12VideoEncodeCommandList_FWD_DEFINED__ +typedef interface ID3D12VideoEncodeCommandList ID3D12VideoEncodeCommandList; + +#endif /* __ID3D12VideoEncodeCommandList_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoDecoder1_FWD_DEFINED__ +#define __ID3D12VideoDecoder1_FWD_DEFINED__ +typedef interface ID3D12VideoDecoder1 ID3D12VideoDecoder1; + +#endif /* __ID3D12VideoDecoder1_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoDecoderHeap1_FWD_DEFINED__ +#define __ID3D12VideoDecoderHeap1_FWD_DEFINED__ +typedef interface ID3D12VideoDecoderHeap1 ID3D12VideoDecoderHeap1; + +#endif /* __ID3D12VideoDecoderHeap1_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoProcessor1_FWD_DEFINED__ +#define __ID3D12VideoProcessor1_FWD_DEFINED__ +typedef interface ID3D12VideoProcessor1 ID3D12VideoProcessor1; + +#endif /* __ID3D12VideoProcessor1_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoExtensionCommand_FWD_DEFINED__ +#define __ID3D12VideoExtensionCommand_FWD_DEFINED__ +typedef interface ID3D12VideoExtensionCommand ID3D12VideoExtensionCommand; + +#endif /* __ID3D12VideoExtensionCommand_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoDevice2_FWD_DEFINED__ +#define __ID3D12VideoDevice2_FWD_DEFINED__ +typedef interface ID3D12VideoDevice2 ID3D12VideoDevice2; + +#endif /* __ID3D12VideoDevice2_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoDecodeCommandList2_FWD_DEFINED__ +#define __ID3D12VideoDecodeCommandList2_FWD_DEFINED__ +typedef interface ID3D12VideoDecodeCommandList2 ID3D12VideoDecodeCommandList2; + +#endif /* __ID3D12VideoDecodeCommandList2_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoDecodeCommandList3_FWD_DEFINED__ +#define __ID3D12VideoDecodeCommandList3_FWD_DEFINED__ +typedef interface ID3D12VideoDecodeCommandList3 ID3D12VideoDecodeCommandList3; + +#endif /* __ID3D12VideoDecodeCommandList3_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoProcessCommandList2_FWD_DEFINED__ +#define __ID3D12VideoProcessCommandList2_FWD_DEFINED__ +typedef interface ID3D12VideoProcessCommandList2 ID3D12VideoProcessCommandList2; + +#endif /* __ID3D12VideoProcessCommandList2_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoProcessCommandList3_FWD_DEFINED__ +#define __ID3D12VideoProcessCommandList3_FWD_DEFINED__ +typedef interface ID3D12VideoProcessCommandList3 ID3D12VideoProcessCommandList3; + +#endif /* __ID3D12VideoProcessCommandList3_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoEncodeCommandList1_FWD_DEFINED__ +#define __ID3D12VideoEncodeCommandList1_FWD_DEFINED__ +typedef interface ID3D12VideoEncodeCommandList1 ID3D12VideoEncodeCommandList1; + +#endif /* __ID3D12VideoEncodeCommandList1_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoEncoder_FWD_DEFINED__ +#define __ID3D12VideoEncoder_FWD_DEFINED__ +typedef interface ID3D12VideoEncoder ID3D12VideoEncoder; + +#endif /* __ID3D12VideoEncoder_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoEncoderHeap_FWD_DEFINED__ +#define __ID3D12VideoEncoderHeap_FWD_DEFINED__ +typedef interface ID3D12VideoEncoderHeap ID3D12VideoEncoderHeap; + +#endif /* __ID3D12VideoEncoderHeap_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoDevice3_FWD_DEFINED__ +#define __ID3D12VideoDevice3_FWD_DEFINED__ +typedef interface ID3D12VideoDevice3 ID3D12VideoDevice3; + +#endif /* __ID3D12VideoDevice3_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoEncodeCommandList2_FWD_DEFINED__ +#define __ID3D12VideoEncodeCommandList2_FWD_DEFINED__ +typedef interface ID3D12VideoEncodeCommandList2 ID3D12VideoEncodeCommandList2; + +#endif /* __ID3D12VideoEncodeCommandList2_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoEncodeCommandList3_FWD_DEFINED__ +#define __ID3D12VideoEncodeCommandList3_FWD_DEFINED__ +typedef interface ID3D12VideoEncodeCommandList3 ID3D12VideoEncodeCommandList3; + +#endif /* __ID3D12VideoEncodeCommandList3_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" +#include "dxgicommon.h" +#include "d3d12.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_d3d12video_0000_0000 */ +/* [local] */ + +#include +#pragma region App Family +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) +typedef +enum D3D12_VIDEO_FIELD_TYPE + { + D3D12_VIDEO_FIELD_TYPE_NONE = 0, + D3D12_VIDEO_FIELD_TYPE_INTERLACED_TOP_FIELD_FIRST = 1, + D3D12_VIDEO_FIELD_TYPE_INTERLACED_BOTTOM_FIELD_FIRST = 2 + } D3D12_VIDEO_FIELD_TYPE; + +typedef +enum D3D12_VIDEO_FRAME_STEREO_FORMAT + { + D3D12_VIDEO_FRAME_STEREO_FORMAT_NONE = 0, + D3D12_VIDEO_FRAME_STEREO_FORMAT_MONO = 1, + D3D12_VIDEO_FRAME_STEREO_FORMAT_HORIZONTAL = 2, + D3D12_VIDEO_FRAME_STEREO_FORMAT_VERTICAL = 3, + D3D12_VIDEO_FRAME_STEREO_FORMAT_SEPARATE = 4 + } D3D12_VIDEO_FRAME_STEREO_FORMAT; + +typedef struct D3D12_VIDEO_FORMAT + { + DXGI_FORMAT Format; + DXGI_COLOR_SPACE_TYPE ColorSpace; + } D3D12_VIDEO_FORMAT; + +typedef struct D3D12_VIDEO_SAMPLE + { + UINT Width; + UINT Height; + D3D12_VIDEO_FORMAT Format; + } D3D12_VIDEO_SAMPLE; + +typedef +enum D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE + { + D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE_NONE = 0, + D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE_FIELD_BASED = 1 + } D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE; + +typedef +enum D3D12_FEATURE_VIDEO + { + D3D12_FEATURE_VIDEO_DECODE_SUPPORT = 0, + D3D12_FEATURE_VIDEO_DECODE_PROFILES = 1, + D3D12_FEATURE_VIDEO_DECODE_FORMATS = 2, + D3D12_FEATURE_VIDEO_DECODE_CONVERSION_SUPPORT = 3, + D3D12_FEATURE_VIDEO_PROCESS_SUPPORT = 5, + D3D12_FEATURE_VIDEO_PROCESS_MAX_INPUT_STREAMS = 6, + D3D12_FEATURE_VIDEO_PROCESS_REFERENCE_INFO = 7, + D3D12_FEATURE_VIDEO_DECODER_HEAP_SIZE = 8, + D3D12_FEATURE_VIDEO_PROCESSOR_SIZE = 9, + D3D12_FEATURE_VIDEO_DECODE_PROFILE_COUNT = 10, + D3D12_FEATURE_VIDEO_DECODE_FORMAT_COUNT = 11, + D3D12_FEATURE_VIDEO_ARCHITECTURE = 17, + D3D12_FEATURE_VIDEO_DECODE_HISTOGRAM = 18, + D3D12_FEATURE_VIDEO_FEATURE_AREA_SUPPORT = 19, + D3D12_FEATURE_VIDEO_MOTION_ESTIMATOR = 20, + D3D12_FEATURE_VIDEO_MOTION_ESTIMATOR_SIZE = 21, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_COUNT = 22, + D3D12_FEATURE_VIDEO_EXTENSION_COMMANDS = 23, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_PARAMETER_COUNT = 24, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_PARAMETERS = 25, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_SUPPORT = 26, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_SIZE = 27, + D3D12_FEATURE_VIDEO_DECODE_PROTECTED_RESOURCES = 28, + D3D12_FEATURE_VIDEO_PROCESS_PROTECTED_RESOURCES = 29, + D3D12_FEATURE_VIDEO_MOTION_ESTIMATOR_PROTECTED_RESOURCES = 30, + D3D12_FEATURE_VIDEO_DECODER_HEAP_SIZE1 = 31, + D3D12_FEATURE_VIDEO_PROCESSOR_SIZE1 = 32, + D3D12_FEATURE_VIDEO_ENCODER_CODEC = 33, + D3D12_FEATURE_VIDEO_ENCODER_PROFILE_LEVEL = 34, + D3D12_FEATURE_VIDEO_ENCODER_OUTPUT_RESOLUTION_RATIOS_COUNT = 35, + D3D12_FEATURE_VIDEO_ENCODER_OUTPUT_RESOLUTION = 36, + D3D12_FEATURE_VIDEO_ENCODER_INPUT_FORMAT = 37, + D3D12_FEATURE_VIDEO_ENCODER_RATE_CONTROL_MODE = 38, + D3D12_FEATURE_VIDEO_ENCODER_INTRA_REFRESH_MODE = 39, + D3D12_FEATURE_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE = 40, + D3D12_FEATURE_VIDEO_ENCODER_HEAP_SIZE = 41, + D3D12_FEATURE_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT = 42, + D3D12_FEATURE_VIDEO_ENCODER_SUPPORT = 43, + D3D12_FEATURE_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT = 44, + D3D12_FEATURE_VIDEO_ENCODER_RESOURCE_REQUIREMENTS = 45 + } D3D12_FEATURE_VIDEO; + +typedef +enum D3D12_BITSTREAM_ENCRYPTION_TYPE + { + D3D12_BITSTREAM_ENCRYPTION_TYPE_NONE = 0 + } D3D12_BITSTREAM_ENCRYPTION_TYPE; + +typedef struct D3D12_VIDEO_DECODE_CONFIGURATION + { + GUID DecodeProfile; + D3D12_BITSTREAM_ENCRYPTION_TYPE BitstreamEncryption; + D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE InterlaceType; + } D3D12_VIDEO_DECODE_CONFIGURATION; + +typedef struct D3D12_VIDEO_DECODER_DESC + { + UINT NodeMask; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; + } D3D12_VIDEO_DECODER_DESC; + +typedef struct D3D12_VIDEO_DECODER_HEAP_DESC + { + UINT NodeMask; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; + UINT DecodeWidth; + UINT DecodeHeight; + DXGI_FORMAT Format; + DXGI_RATIONAL FrameRate; + UINT BitRate; + UINT MaxDecodePictureBufferCount; + } D3D12_VIDEO_DECODER_HEAP_DESC; + +typedef struct D3D12_VIDEO_SIZE_RANGE + { + UINT MaxWidth; + UINT MaxHeight; + UINT MinWidth; + UINT MinHeight; + } D3D12_VIDEO_SIZE_RANGE; + +typedef +enum D3D12_VIDEO_PROCESS_FILTER + { + D3D12_VIDEO_PROCESS_FILTER_BRIGHTNESS = 0, + D3D12_VIDEO_PROCESS_FILTER_CONTRAST = 1, + D3D12_VIDEO_PROCESS_FILTER_HUE = 2, + D3D12_VIDEO_PROCESS_FILTER_SATURATION = 3, + D3D12_VIDEO_PROCESS_FILTER_NOISE_REDUCTION = 4, + D3D12_VIDEO_PROCESS_FILTER_EDGE_ENHANCEMENT = 5, + D3D12_VIDEO_PROCESS_FILTER_ANAMORPHIC_SCALING = 6, + D3D12_VIDEO_PROCESS_FILTER_STEREO_ADJUSTMENT = 7 + } D3D12_VIDEO_PROCESS_FILTER; + +typedef +enum D3D12_VIDEO_PROCESS_FILTER_FLAGS + { + D3D12_VIDEO_PROCESS_FILTER_FLAG_NONE = 0, + D3D12_VIDEO_PROCESS_FILTER_FLAG_BRIGHTNESS = ( 1 << D3D12_VIDEO_PROCESS_FILTER_BRIGHTNESS ) , + D3D12_VIDEO_PROCESS_FILTER_FLAG_CONTRAST = ( 1 << D3D12_VIDEO_PROCESS_FILTER_CONTRAST ) , + D3D12_VIDEO_PROCESS_FILTER_FLAG_HUE = ( 1 << D3D12_VIDEO_PROCESS_FILTER_HUE ) , + D3D12_VIDEO_PROCESS_FILTER_FLAG_SATURATION = ( 1 << D3D12_VIDEO_PROCESS_FILTER_SATURATION ) , + D3D12_VIDEO_PROCESS_FILTER_FLAG_NOISE_REDUCTION = ( 1 << D3D12_VIDEO_PROCESS_FILTER_NOISE_REDUCTION ) , + D3D12_VIDEO_PROCESS_FILTER_FLAG_EDGE_ENHANCEMENT = ( 1 << D3D12_VIDEO_PROCESS_FILTER_EDGE_ENHANCEMENT ) , + D3D12_VIDEO_PROCESS_FILTER_FLAG_ANAMORPHIC_SCALING = ( 1 << D3D12_VIDEO_PROCESS_FILTER_ANAMORPHIC_SCALING ) , + D3D12_VIDEO_PROCESS_FILTER_FLAG_STEREO_ADJUSTMENT = ( 1 << D3D12_VIDEO_PROCESS_FILTER_STEREO_ADJUSTMENT ) + } D3D12_VIDEO_PROCESS_FILTER_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_FILTER_FLAGS ); +typedef +enum D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS + { + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG_NONE = 0, + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG_BOB = 0x1, + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG_CUSTOM = 0x80000000 + } D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS ); +typedef struct D3D12_VIDEO_PROCESS_ALPHA_BLENDING + { + BOOL Enable; + FLOAT Alpha; + } D3D12_VIDEO_PROCESS_ALPHA_BLENDING; + +typedef struct D3D12_VIDEO_PROCESS_LUMA_KEY + { + BOOL Enable; + FLOAT Lower; + FLOAT Upper; + } D3D12_VIDEO_PROCESS_LUMA_KEY; + +typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC + { + DXGI_FORMAT Format; + DXGI_COLOR_SPACE_TYPE ColorSpace; + DXGI_RATIONAL SourceAspectRatio; + DXGI_RATIONAL DestinationAspectRatio; + DXGI_RATIONAL FrameRate; + D3D12_VIDEO_SIZE_RANGE SourceSizeRange; + D3D12_VIDEO_SIZE_RANGE DestinationSizeRange; + BOOL EnableOrientation; + D3D12_VIDEO_PROCESS_FILTER_FLAGS FilterFlags; + D3D12_VIDEO_FRAME_STEREO_FORMAT StereoFormat; + D3D12_VIDEO_FIELD_TYPE FieldType; + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS DeinterlaceMode; + BOOL EnableAlphaBlending; + D3D12_VIDEO_PROCESS_LUMA_KEY LumaKey; + UINT NumPastFrames; + UINT NumFutureFrames; + BOOL EnableAutoProcessing; + } D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC; + +typedef +enum D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE + { + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_OPAQUE = 0, + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_BACKGROUND = 1, + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_DESTINATION = 2, + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_SOURCE_STREAM = 3 + } D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE; + +typedef struct D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC + { + DXGI_FORMAT Format; + DXGI_COLOR_SPACE_TYPE ColorSpace; + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE AlphaFillMode; + UINT AlphaFillModeSourceStreamIndex; + FLOAT BackgroundColor[ 4 ]; + DXGI_RATIONAL FrameRate; + BOOL EnableStereo; + } D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0000_v0_0_s_ifspec; + +#ifndef __ID3D12VideoDecoderHeap_INTERFACE_DEFINED__ +#define __ID3D12VideoDecoderHeap_INTERFACE_DEFINED__ + +/* interface ID3D12VideoDecoderHeap */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoDecoderHeap; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0946B7C9-EBF6-4047-BB73-8683E27DBB1F") + ID3D12VideoDecoderHeap : public ID3D12Pageable + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_VIDEO_DECODER_HEAP_DESC STDMETHODCALLTYPE GetDesc( void) = 0; +#else + virtual D3D12_VIDEO_DECODER_HEAP_DESC *STDMETHODCALLTYPE GetDesc( + D3D12_VIDEO_DECODER_HEAP_DESC * RetVal) = 0; +#endif + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoDecoderHeapVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoDecoderHeap * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoDecoderHeap * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoDecoderHeap * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoDecoderHeap * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoDecoderHeap * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoDecoderHeap * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoDecoderHeap * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoDecoderHeap * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12VideoDecoderHeap, GetDesc) +#if !defined(_WIN32) + D3D12_VIDEO_DECODER_HEAP_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoDecoderHeap * This); + +#else + D3D12_VIDEO_DECODER_HEAP_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoDecoderHeap * This, + D3D12_VIDEO_DECODER_HEAP_DESC * RetVal); + +#endif + + END_INTERFACE + } ID3D12VideoDecoderHeapVtbl; + + interface ID3D12VideoDecoderHeap + { + CONST_VTBL struct ID3D12VideoDecoderHeapVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoDecoderHeap_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoDecoderHeap_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoDecoderHeap_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoDecoderHeap_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoDecoderHeap_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoDecoderHeap_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoDecoderHeap_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoDecoderHeap_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#if !defined(_WIN32) + +#define ID3D12VideoDecoderHeap_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12VideoDecoderHeap_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoDecoderHeap_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoDevice_INTERFACE_DEFINED__ +#define __ID3D12VideoDevice_INTERFACE_DEFINED__ + +/* interface ID3D12VideoDevice */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoDevice; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("1F052807-0B46-4ACC-8A89-364F793718A4") + ID3D12VideoDevice : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE CheckFeatureSupport( + D3D12_FEATURE_VIDEO FeatureVideo, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateVideoDecoder( + _In_ const D3D12_VIDEO_DECODER_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoder) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateVideoDecoderHeap( + _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoderHeap) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateVideoProcessor( + UINT NodeMask, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc, + UINT NumInputStreamDescs, + _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoProcessor) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoDeviceVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoDevice * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoDevice * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoDevice * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12VideoDevice * This, + D3D12_FEATURE_VIDEO FeatureVideo, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoDecoder) + HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoder )( + ID3D12VideoDevice * This, + _In_ const D3D12_VIDEO_DECODER_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoder); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoDecoderHeap) + HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoderHeap )( + ID3D12VideoDevice * This, + _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoderHeap); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoProcessor) + HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessor )( + ID3D12VideoDevice * This, + UINT NodeMask, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc, + UINT NumInputStreamDescs, + _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoProcessor); + + END_INTERFACE + } ID3D12VideoDeviceVtbl; + + interface ID3D12VideoDevice + { + CONST_VTBL struct ID3D12VideoDeviceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoDevice_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoDevice_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoDevice_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoDevice_CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12VideoDevice_CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) \ + ( (This)->lpVtbl -> CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) ) + +#define ID3D12VideoDevice_CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) \ + ( (This)->lpVtbl -> CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) ) + +#define ID3D12VideoDevice_CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) \ + ( (This)->lpVtbl -> CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoDevice_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoDecoder_INTERFACE_DEFINED__ +#define __ID3D12VideoDecoder_INTERFACE_DEFINED__ + +/* interface ID3D12VideoDecoder */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoDecoder; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C59B6BDC-7720-4074-A136-17A156037470") + ID3D12VideoDecoder : public ID3D12Pageable + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_VIDEO_DECODER_DESC STDMETHODCALLTYPE GetDesc( void) = 0; +#else + virtual D3D12_VIDEO_DECODER_DESC *STDMETHODCALLTYPE GetDesc( + D3D12_VIDEO_DECODER_DESC * RetVal) = 0; +#endif + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoDecoderVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoDecoder * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoDecoder * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoDecoder * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoDecoder * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoDecoder * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoDecoder * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoDecoder * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoDecoder * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12VideoDecoder, GetDesc) +#if !defined(_WIN32) + D3D12_VIDEO_DECODER_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoDecoder * This); + +#else + D3D12_VIDEO_DECODER_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoDecoder * This, + D3D12_VIDEO_DECODER_DESC * RetVal); + +#endif + + END_INTERFACE + } ID3D12VideoDecoderVtbl; + + interface ID3D12VideoDecoder + { + CONST_VTBL struct ID3D12VideoDecoderVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoDecoder_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoDecoder_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoDecoder_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoDecoder_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoDecoder_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoDecoder_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoDecoder_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoDecoder_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#if !defined(_WIN32) + +#define ID3D12VideoDecoder_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12VideoDecoder_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoDecoder_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12video_0000_0003 */ +/* [local] */ + +typedef +enum D3D12_VIDEO_DECODE_TIER + { + D3D12_VIDEO_DECODE_TIER_NOT_SUPPORTED = 0, + D3D12_VIDEO_DECODE_TIER_1 = 1, + D3D12_VIDEO_DECODE_TIER_2 = 2, + D3D12_VIDEO_DECODE_TIER_3 = 3 + } D3D12_VIDEO_DECODE_TIER; + +typedef +enum D3D12_VIDEO_DECODE_SUPPORT_FLAGS + { + D3D12_VIDEO_DECODE_SUPPORT_FLAG_NONE = 0, + D3D12_VIDEO_DECODE_SUPPORT_FLAG_SUPPORTED = 0x1 + } D3D12_VIDEO_DECODE_SUPPORT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_SUPPORT_FLAGS ); +typedef +enum D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS + { + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_NONE = 0, + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_HEIGHT_ALIGNMENT_MULTIPLE_32_REQUIRED = 0x1, + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_POST_PROCESSING_SUPPORTED = 0x2, + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_REFERENCE_ONLY_ALLOCATIONS_REQUIRED = 0x4, + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_ALLOW_RESOLUTION_CHANGE_ON_NON_KEY_FRAME = 0x8 + } D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS ); +typedef +enum D3D12_VIDEO_DECODE_STATUS + { + D3D12_VIDEO_DECODE_STATUS_OK = 0, + D3D12_VIDEO_DECODE_STATUS_CONTINUE = 1, + D3D12_VIDEO_DECODE_STATUS_CONTINUE_SKIP_DISPLAY = 2, + D3D12_VIDEO_DECODE_STATUS_RESTART = 3, + D3D12_VIDEO_DECODE_STATUS_RATE_EXCEEDED = 4 + } D3D12_VIDEO_DECODE_STATUS; + +typedef +enum D3D12_VIDEO_DECODE_ARGUMENT_TYPE + { + D3D12_VIDEO_DECODE_ARGUMENT_TYPE_PICTURE_PARAMETERS = 0, + D3D12_VIDEO_DECODE_ARGUMENT_TYPE_INVERSE_QUANTIZATION_MATRIX = 1, + D3D12_VIDEO_DECODE_ARGUMENT_TYPE_SLICE_CONTROL = 2, + D3D12_VIDEO_DECODE_ARGUMENT_TYPE_MAX_VALID = 3 + } D3D12_VIDEO_DECODE_ARGUMENT_TYPE; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_SUPPORT + { + UINT NodeIndex; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; + UINT Width; + UINT Height; + DXGI_FORMAT DecodeFormat; + DXGI_RATIONAL FrameRate; + UINT BitRate; + D3D12_VIDEO_DECODE_SUPPORT_FLAGS SupportFlags; + D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS ConfigurationFlags; + D3D12_VIDEO_DECODE_TIER DecodeTier; + } D3D12_FEATURE_DATA_VIDEO_DECODE_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILE_COUNT + { + UINT NodeIndex; + UINT ProfileCount; + } D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILE_COUNT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILES + { + UINT NodeIndex; + UINT ProfileCount; + _Field_size_full_(ProfileCount) GUID *pProfiles; + } D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILES; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_FORMAT_COUNT + { + UINT NodeIndex; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; + UINT FormatCount; + } D3D12_FEATURE_DATA_VIDEO_DECODE_FORMAT_COUNT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_FORMATS + { + UINT NodeIndex; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; + UINT FormatCount; + _Field_size_full_(FormatCount) DXGI_FORMAT *pOutputFormats; + } D3D12_FEATURE_DATA_VIDEO_DECODE_FORMATS; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ARCHITECTURE + { + BOOL IOCoherent; + } D3D12_FEATURE_DATA_VIDEO_ARCHITECTURE; + +typedef +enum D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT + { + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_Y = 0, + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_U = 1, + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_V = 2, + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_R = 0, + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_G = 1, + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_B = 2, + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_A = 3 + } D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT; + +typedef +enum D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS + { + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_NONE = 0, + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_Y = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_Y ) , + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_U = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_U ) , + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_V = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_V ) , + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_R = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_R ) , + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_G = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_G ) , + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_B = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_B ) , + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_A = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_A ) + } D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS ); +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM + { + UINT NodeIndex; + GUID DecodeProfile; + UINT Width; + UINT Height; + DXGI_FORMAT DecodeFormat; + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS Components; + UINT BinCount; + UINT CounterBitDepth; + } D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM; + +typedef +enum D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS + { + D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAG_NONE = 0, + D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAG_SUPPORTED = 0x1 + } D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS ); +typedef +enum D3D12_VIDEO_SCALE_SUPPORT_FLAGS + { + D3D12_VIDEO_SCALE_SUPPORT_FLAG_NONE = 0, + D3D12_VIDEO_SCALE_SUPPORT_FLAG_POW2_ONLY = 0x1, + D3D12_VIDEO_SCALE_SUPPORT_FLAG_EVEN_DIMENSIONS_ONLY = 0x2 + } D3D12_VIDEO_SCALE_SUPPORT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_SCALE_SUPPORT_FLAGS ); +typedef struct D3D12_VIDEO_SCALE_SUPPORT + { + D3D12_VIDEO_SIZE_RANGE OutputSizeRange; + D3D12_VIDEO_SCALE_SUPPORT_FLAGS Flags; + } D3D12_VIDEO_SCALE_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT + { + UINT NodeIndex; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; + D3D12_VIDEO_SAMPLE DecodeSample; + D3D12_VIDEO_FORMAT OutputFormat; + DXGI_RATIONAL FrameRate; + UINT BitRate; + D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS SupportFlags; + D3D12_VIDEO_SCALE_SUPPORT ScaleSupport; + } D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODER_HEAP_SIZE + { + D3D12_VIDEO_DECODER_HEAP_DESC VideoDecoderHeapDesc; + UINT64 MemoryPoolL0Size; + UINT64 MemoryPoolL1Size; + } D3D12_FEATURE_DATA_VIDEO_DECODER_HEAP_SIZE; + +typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESSOR_SIZE + { + UINT NodeMask; + const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc; + UINT NumInputStreamDescs; + const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs; + UINT64 MemoryPoolL0Size; + UINT64 MemoryPoolL1Size; + } D3D12_FEATURE_DATA_VIDEO_PROCESSOR_SIZE; + +typedef struct D3D12_QUERY_DATA_VIDEO_DECODE_STATISTICS + { + UINT64 Status; + UINT64 NumMacroblocksAffected; + DXGI_RATIONAL FrameRate; + UINT BitRate; + } D3D12_QUERY_DATA_VIDEO_DECODE_STATISTICS; + +typedef struct D3D12_VIDEO_DECODE_FRAME_ARGUMENT + { + D3D12_VIDEO_DECODE_ARGUMENT_TYPE Type; + UINT Size; + _Field_size_bytes_full_(Size) void *pData; + } D3D12_VIDEO_DECODE_FRAME_ARGUMENT; + +typedef struct D3D12_VIDEO_DECODE_REFERENCE_FRAMES + { + UINT NumTexture2Ds; + _Field_size_full_(NumTexture2Ds) ID3D12Resource **ppTexture2Ds; + _Field_size_full_(NumTexture2Ds) UINT *pSubresources; + _Field_size_full_opt_(NumTexture2Ds) ID3D12VideoDecoderHeap **ppHeaps; + } D3D12_VIDEO_DECODE_REFERENCE_FRAMES; + +typedef struct D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM + { + ID3D12Resource *pBuffer; + UINT64 Offset; + UINT64 Size; + } D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM; + +typedef struct D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS + { + BOOL Enable; + ID3D12Resource *pReferenceTexture2D; + UINT ReferenceSubresource; + DXGI_COLOR_SPACE_TYPE OutputColorSpace; + DXGI_COLOR_SPACE_TYPE DecodeColorSpace; + } D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS; + +typedef struct D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS + { + UINT NumFrameArguments; + D3D12_VIDEO_DECODE_FRAME_ARGUMENT FrameArguments[ 10 ]; + D3D12_VIDEO_DECODE_REFERENCE_FRAMES ReferenceFrames; + D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM CompressedBitstream; + ID3D12VideoDecoderHeap *pHeap; + } D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS; + +typedef struct D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS + { + ID3D12Resource *pOutputTexture2D; + UINT OutputSubresource; + D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS ConversionArguments; + } D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0003_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0003_v0_0_s_ifspec; + +#ifndef __ID3D12VideoProcessor_INTERFACE_DEFINED__ +#define __ID3D12VideoProcessor_INTERFACE_DEFINED__ + +/* interface ID3D12VideoProcessor */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoProcessor; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("304FDB32-BEDE-410A-8545-943AC6A46138") + ID3D12VideoProcessor : public ID3D12Pageable + { + public: + virtual UINT STDMETHODCALLTYPE GetNodeMask( void) = 0; + + virtual UINT STDMETHODCALLTYPE GetNumInputStreamDescs( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetInputStreamDescs( + UINT NumInputStreamDescs, + _Out_writes_(NumInputStreamDescs) D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs) = 0; + +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC STDMETHODCALLTYPE GetOutputStreamDesc( void) = 0; +#else + virtual D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *STDMETHODCALLTYPE GetOutputStreamDesc( + D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC * RetVal) = 0; +#endif + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoProcessorVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoProcessor * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoProcessor * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoProcessor * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoProcessor * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoProcessor * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoProcessor * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoProcessor * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoProcessor * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessor, GetNodeMask) + UINT ( STDMETHODCALLTYPE *GetNodeMask )( + ID3D12VideoProcessor * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessor, GetNumInputStreamDescs) + UINT ( STDMETHODCALLTYPE *GetNumInputStreamDescs )( + ID3D12VideoProcessor * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessor, GetInputStreamDescs) + HRESULT ( STDMETHODCALLTYPE *GetInputStreamDescs )( + ID3D12VideoProcessor * This, + UINT NumInputStreamDescs, + _Out_writes_(NumInputStreamDescs) D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessor, GetOutputStreamDesc) +#if !defined(_WIN32) + D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC ( STDMETHODCALLTYPE *GetOutputStreamDesc )( + ID3D12VideoProcessor * This); + +#else + D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *( STDMETHODCALLTYPE *GetOutputStreamDesc )( + ID3D12VideoProcessor * This, + D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC * RetVal); + +#endif + + END_INTERFACE + } ID3D12VideoProcessorVtbl; + + interface ID3D12VideoProcessor + { + CONST_VTBL struct ID3D12VideoProcessorVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoProcessor_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoProcessor_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoProcessor_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoProcessor_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoProcessor_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoProcessor_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoProcessor_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoProcessor_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#define ID3D12VideoProcessor_GetNodeMask(This) \ + ( (This)->lpVtbl -> GetNodeMask(This) ) + +#define ID3D12VideoProcessor_GetNumInputStreamDescs(This) \ + ( (This)->lpVtbl -> GetNumInputStreamDescs(This) ) + +#define ID3D12VideoProcessor_GetInputStreamDescs(This,NumInputStreamDescs,pInputStreamDescs) \ + ( (This)->lpVtbl -> GetInputStreamDescs(This,NumInputStreamDescs,pInputStreamDescs) ) +#if !defined(_WIN32) + +#define ID3D12VideoProcessor_GetOutputStreamDesc(This) \ + ( (This)->lpVtbl -> GetOutputStreamDesc(This) ) +#else +#define ID3D12VideoProcessor_GetOutputStreamDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetOutputStreamDesc(This,RetVal) ) +#endif + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoProcessor_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12video_0000_0004 */ +/* [local] */ + +typedef +enum D3D12_VIDEO_PROCESS_FEATURE_FLAGS + { + D3D12_VIDEO_PROCESS_FEATURE_FLAG_NONE = 0, + D3D12_VIDEO_PROCESS_FEATURE_FLAG_ALPHA_FILL = 0x1, + D3D12_VIDEO_PROCESS_FEATURE_FLAG_LUMA_KEY = 0x2, + D3D12_VIDEO_PROCESS_FEATURE_FLAG_STEREO = 0x4, + D3D12_VIDEO_PROCESS_FEATURE_FLAG_ROTATION = 0x8, + D3D12_VIDEO_PROCESS_FEATURE_FLAG_FLIP = 0x10, + D3D12_VIDEO_PROCESS_FEATURE_FLAG_ALPHA_BLENDING = 0x20, + D3D12_VIDEO_PROCESS_FEATURE_FLAG_PIXEL_ASPECT_RATIO = 0x40 + } D3D12_VIDEO_PROCESS_FEATURE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_FEATURE_FLAGS ); +typedef +enum D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS + { + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_NONE = 0, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_DENOISE = 0x1, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_DERINGING = 0x2, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_EDGE_ENHANCEMENT = 0x4, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_COLOR_CORRECTION = 0x8, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_FLESH_TONE_MAPPING = 0x10, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_IMAGE_STABILIZATION = 0x20, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_SUPER_RESOLUTION = 0x40, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_ANAMORPHIC_SCALING = 0x80, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_CUSTOM = 0x80000000 + } D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS ); +typedef +enum D3D12_VIDEO_PROCESS_ORIENTATION + { + D3D12_VIDEO_PROCESS_ORIENTATION_DEFAULT = 0, + D3D12_VIDEO_PROCESS_ORIENTATION_FLIP_HORIZONTAL = 1, + D3D12_VIDEO_PROCESS_ORIENTATION_CLOCKWISE_90 = 2, + D3D12_VIDEO_PROCESS_ORIENTATION_CLOCKWISE_90_FLIP_HORIZONTAL = 3, + D3D12_VIDEO_PROCESS_ORIENTATION_CLOCKWISE_180 = 4, + D3D12_VIDEO_PROCESS_ORIENTATION_FLIP_VERTICAL = 5, + D3D12_VIDEO_PROCESS_ORIENTATION_CLOCKWISE_270 = 6, + D3D12_VIDEO_PROCESS_ORIENTATION_CLOCKWISE_270_FLIP_HORIZONTAL = 7 + } D3D12_VIDEO_PROCESS_ORIENTATION; + +typedef +enum D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS + { + D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAG_NONE = 0, + D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAG_FRAME_DISCONTINUITY = 0x1, + D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAG_FRAME_REPEAT = 0x2 + } D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS ); +typedef struct D3D12_VIDEO_PROCESS_FILTER_RANGE + { + INT Minimum; + INT Maximum; + INT Default; + FLOAT Multiplier; + } D3D12_VIDEO_PROCESS_FILTER_RANGE; + +typedef +enum D3D12_VIDEO_PROCESS_SUPPORT_FLAGS + { + D3D12_VIDEO_PROCESS_SUPPORT_FLAG_NONE = 0, + D3D12_VIDEO_PROCESS_SUPPORT_FLAG_SUPPORTED = 0x1 + } D3D12_VIDEO_PROCESS_SUPPORT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_SUPPORT_FLAGS ); +typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESS_SUPPORT + { + UINT NodeIndex; + D3D12_VIDEO_SAMPLE InputSample; + D3D12_VIDEO_FIELD_TYPE InputFieldType; + D3D12_VIDEO_FRAME_STEREO_FORMAT InputStereoFormat; + DXGI_RATIONAL InputFrameRate; + D3D12_VIDEO_FORMAT OutputFormat; + D3D12_VIDEO_FRAME_STEREO_FORMAT OutputStereoFormat; + DXGI_RATIONAL OutputFrameRate; + D3D12_VIDEO_PROCESS_SUPPORT_FLAGS SupportFlags; + D3D12_VIDEO_SCALE_SUPPORT ScaleSupport; + D3D12_VIDEO_PROCESS_FEATURE_FLAGS FeatureSupport; + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS DeinterlaceSupport; + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS AutoProcessingSupport; + D3D12_VIDEO_PROCESS_FILTER_FLAGS FilterSupport; + D3D12_VIDEO_PROCESS_FILTER_RANGE FilterRangeSupport[ 32 ]; + } D3D12_FEATURE_DATA_VIDEO_PROCESS_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESS_MAX_INPUT_STREAMS + { + UINT NodeIndex; + UINT MaxInputStreams; + } D3D12_FEATURE_DATA_VIDEO_PROCESS_MAX_INPUT_STREAMS; + +typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESS_REFERENCE_INFO + { + UINT NodeIndex; + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS DeinterlaceMode; + D3D12_VIDEO_PROCESS_FILTER_FLAGS Filters; + D3D12_VIDEO_PROCESS_FEATURE_FLAGS FeatureSupport; + DXGI_RATIONAL InputFrameRate; + DXGI_RATIONAL OutputFrameRate; + BOOL EnableAutoProcessing; + UINT PastFrames; + UINT FutureFrames; + } D3D12_FEATURE_DATA_VIDEO_PROCESS_REFERENCE_INFO; + +typedef struct D3D12_VIDEO_PROCESS_REFERENCE_SET + { + UINT NumPastFrames; + ID3D12Resource **ppPastFrames; + UINT *pPastSubresources; + UINT NumFutureFrames; + ID3D12Resource **ppFutureFrames; + UINT *pFutureSubresources; + } D3D12_VIDEO_PROCESS_REFERENCE_SET; + +typedef struct D3D12_VIDEO_PROCESS_TRANSFORM + { + D3D12_RECT SourceRectangle; + D3D12_RECT DestinationRectangle; + D3D12_VIDEO_PROCESS_ORIENTATION Orientation; + } D3D12_VIDEO_PROCESS_TRANSFORM; + +typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM_RATE + { + UINT OutputIndex; + UINT InputFrameOrField; + } D3D12_VIDEO_PROCESS_INPUT_STREAM_RATE; + +typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM + { + ID3D12Resource *pTexture2D; + UINT Subresource; + D3D12_VIDEO_PROCESS_REFERENCE_SET ReferenceSet; + } D3D12_VIDEO_PROCESS_INPUT_STREAM; + +typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS + { + D3D12_VIDEO_PROCESS_INPUT_STREAM InputStream[ 2 ]; + D3D12_VIDEO_PROCESS_TRANSFORM Transform; + D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS Flags; + D3D12_VIDEO_PROCESS_INPUT_STREAM_RATE RateInfo; + INT FilterLevels[ 32 ]; + D3D12_VIDEO_PROCESS_ALPHA_BLENDING AlphaBlending; + } D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS; + +typedef struct D3D12_VIDEO_PROCESS_OUTPUT_STREAM + { + ID3D12Resource *pTexture2D; + UINT Subresource; + } D3D12_VIDEO_PROCESS_OUTPUT_STREAM; + +typedef struct D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS + { + D3D12_VIDEO_PROCESS_OUTPUT_STREAM OutputStream[ 2 ]; + D3D12_RECT TargetRectangle; + } D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0004_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0004_v0_0_s_ifspec; + +#ifndef __ID3D12VideoDecodeCommandList_INTERFACE_DEFINED__ +#define __ID3D12VideoDecodeCommandList_INTERFACE_DEFINED__ + +/* interface ID3D12VideoDecodeCommandList */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoDecodeCommandList; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3B60536E-AD29-4E64-A269-F853837E5E53") + ID3D12VideoDecodeCommandList : public ID3D12CommandList + { + public: + virtual HRESULT STDMETHODCALLTYPE Close( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Reset( + _In_ ID3D12CommandAllocator *pAllocator) = 0; + + virtual void STDMETHODCALLTYPE ClearState( void) = 0; + + virtual void STDMETHODCALLTYPE ResourceBarrier( + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers) = 0; + + virtual void STDMETHODCALLTYPE DiscardResource( + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion) = 0; + + virtual void STDMETHODCALLTYPE BeginQuery( + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index) = 0; + + virtual void STDMETHODCALLTYPE EndQuery( + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index) = 0; + + virtual void STDMETHODCALLTYPE ResolveQueryData( + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset) = 0; + + virtual void STDMETHODCALLTYPE SetPredication( + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation) = 0; + + virtual void STDMETHODCALLTYPE SetMarker( + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size) = 0; + + virtual void STDMETHODCALLTYPE BeginEvent( + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size) = 0; + + virtual void STDMETHODCALLTYPE EndEvent( void) = 0; + + virtual void STDMETHODCALLTYPE DecodeFrame( + _In_ ID3D12VideoDecoder *pDecoder, + _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments) = 0; + + virtual void STDMETHODCALLTYPE WriteBufferImmediate( + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoDecodeCommandListVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoDecodeCommandList * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoDecodeCommandList * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoDecodeCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoDecodeCommandList * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoDecodeCommandList * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoDecodeCommandList * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoDecodeCommandList * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoDecodeCommandList * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12VideoDecodeCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12VideoDecodeCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12VideoDecodeCommandList * This, + _In_ ID3D12CommandAllocator *pAllocator); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12VideoDecodeCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12VideoDecodeCommandList * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12VideoDecodeCommandList * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12VideoDecodeCommandList * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12VideoDecodeCommandList * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12VideoDecodeCommandList * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12VideoDecodeCommandList * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12VideoDecodeCommandList * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12VideoDecodeCommandList * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12VideoDecodeCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, DecodeFrame) + void ( STDMETHODCALLTYPE *DecodeFrame )( + ID3D12VideoDecodeCommandList * This, + _In_ ID3D12VideoDecoder *pDecoder, + _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12VideoDecodeCommandList * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + END_INTERFACE + } ID3D12VideoDecodeCommandListVtbl; + + interface ID3D12VideoDecodeCommandList + { + CONST_VTBL struct ID3D12VideoDecodeCommandListVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoDecodeCommandList_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoDecodeCommandList_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoDecodeCommandList_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoDecodeCommandList_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoDecodeCommandList_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoDecodeCommandList_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoDecodeCommandList_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoDecodeCommandList_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12VideoDecodeCommandList_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12VideoDecodeCommandList_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12VideoDecodeCommandList_Reset(This,pAllocator) \ + ( (This)->lpVtbl -> Reset(This,pAllocator) ) + +#define ID3D12VideoDecodeCommandList_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D12VideoDecodeCommandList_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12VideoDecodeCommandList_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12VideoDecodeCommandList_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoDecodeCommandList_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoDecodeCommandList_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12VideoDecodeCommandList_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12VideoDecodeCommandList_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12VideoDecodeCommandList_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12VideoDecodeCommandList_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12VideoDecodeCommandList_DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) ) + +#define ID3D12VideoDecodeCommandList_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoDecodeCommandList_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoProcessCommandList_INTERFACE_DEFINED__ +#define __ID3D12VideoProcessCommandList_INTERFACE_DEFINED__ + +/* interface ID3D12VideoProcessCommandList */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoProcessCommandList; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("AEB2543A-167F-4682-ACC8-D159ED4A6209") + ID3D12VideoProcessCommandList : public ID3D12CommandList + { + public: + virtual HRESULT STDMETHODCALLTYPE Close( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Reset( + _In_ ID3D12CommandAllocator *pAllocator) = 0; + + virtual void STDMETHODCALLTYPE ClearState( void) = 0; + + virtual void STDMETHODCALLTYPE ResourceBarrier( + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers) = 0; + + virtual void STDMETHODCALLTYPE DiscardResource( + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion) = 0; + + virtual void STDMETHODCALLTYPE BeginQuery( + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index) = 0; + + virtual void STDMETHODCALLTYPE EndQuery( + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index) = 0; + + virtual void STDMETHODCALLTYPE ResolveQueryData( + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset) = 0; + + virtual void STDMETHODCALLTYPE SetPredication( + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation) = 0; + + virtual void STDMETHODCALLTYPE SetMarker( + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size) = 0; + + virtual void STDMETHODCALLTYPE BeginEvent( + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size) = 0; + + virtual void STDMETHODCALLTYPE EndEvent( void) = 0; + + virtual void STDMETHODCALLTYPE ProcessFrames( + _In_ ID3D12VideoProcessor *pVideoProcessor, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + UINT NumInputStreams, + _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS *pInputArguments) = 0; + + virtual void STDMETHODCALLTYPE WriteBufferImmediate( + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoProcessCommandListVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoProcessCommandList * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoProcessCommandList * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoProcessCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoProcessCommandList * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoProcessCommandList * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoProcessCommandList * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoProcessCommandList * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoProcessCommandList * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12VideoProcessCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12VideoProcessCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12VideoProcessCommandList * This, + _In_ ID3D12CommandAllocator *pAllocator); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12VideoProcessCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12VideoProcessCommandList * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12VideoProcessCommandList * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12VideoProcessCommandList * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12VideoProcessCommandList * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12VideoProcessCommandList * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12VideoProcessCommandList * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12VideoProcessCommandList * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12VideoProcessCommandList * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12VideoProcessCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ProcessFrames) + void ( STDMETHODCALLTYPE *ProcessFrames )( + ID3D12VideoProcessCommandList * This, + _In_ ID3D12VideoProcessor *pVideoProcessor, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + UINT NumInputStreams, + _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12VideoProcessCommandList * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + END_INTERFACE + } ID3D12VideoProcessCommandListVtbl; + + interface ID3D12VideoProcessCommandList + { + CONST_VTBL struct ID3D12VideoProcessCommandListVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoProcessCommandList_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoProcessCommandList_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoProcessCommandList_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoProcessCommandList_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoProcessCommandList_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoProcessCommandList_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoProcessCommandList_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoProcessCommandList_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12VideoProcessCommandList_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12VideoProcessCommandList_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12VideoProcessCommandList_Reset(This,pAllocator) \ + ( (This)->lpVtbl -> Reset(This,pAllocator) ) + +#define ID3D12VideoProcessCommandList_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D12VideoProcessCommandList_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12VideoProcessCommandList_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12VideoProcessCommandList_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoProcessCommandList_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoProcessCommandList_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12VideoProcessCommandList_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12VideoProcessCommandList_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12VideoProcessCommandList_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12VideoProcessCommandList_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12VideoProcessCommandList_ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) \ + ( (This)->lpVtbl -> ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) ) + +#define ID3D12VideoProcessCommandList_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoProcessCommandList_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12video_0000_0006 */ +/* [local] */ + +typedef struct D3D12_VIDEO_DECODE_OUTPUT_HISTOGRAM + { + UINT64 Offset; + ID3D12Resource *pBuffer; + } D3D12_VIDEO_DECODE_OUTPUT_HISTOGRAM; + +typedef struct D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1 + { + BOOL Enable; + ID3D12Resource *pReferenceTexture2D; + UINT ReferenceSubresource; + DXGI_COLOR_SPACE_TYPE OutputColorSpace; + DXGI_COLOR_SPACE_TYPE DecodeColorSpace; + UINT OutputWidth; + UINT OutputHeight; + } D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1; + +typedef struct D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1 + { + ID3D12Resource *pOutputTexture2D; + UINT OutputSubresource; + D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1 ConversionArguments; + D3D12_VIDEO_DECODE_OUTPUT_HISTOGRAM Histograms[ 4 ]; + } D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0006_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0006_v0_0_s_ifspec; + +#ifndef __ID3D12VideoDecodeCommandList1_INTERFACE_DEFINED__ +#define __ID3D12VideoDecodeCommandList1_INTERFACE_DEFINED__ + +/* interface ID3D12VideoDecodeCommandList1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoDecodeCommandList1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("D52F011B-B56E-453C-A05A-A7F311C8F472") + ID3D12VideoDecodeCommandList1 : public ID3D12VideoDecodeCommandList + { + public: + virtual void STDMETHODCALLTYPE DecodeFrame1( + _In_ ID3D12VideoDecoder *pDecoder, + _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1 *pOutputArguments, + _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoDecodeCommandList1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoDecodeCommandList1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoDecodeCommandList1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoDecodeCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoDecodeCommandList1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoDecodeCommandList1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoDecodeCommandList1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoDecodeCommandList1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoDecodeCommandList1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12VideoDecodeCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12VideoDecodeCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12VideoDecodeCommandList1 * This, + _In_ ID3D12CommandAllocator *pAllocator); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12VideoDecodeCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12VideoDecodeCommandList1 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12VideoDecodeCommandList1 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12VideoDecodeCommandList1 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12VideoDecodeCommandList1 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12VideoDecodeCommandList1 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12VideoDecodeCommandList1 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12VideoDecodeCommandList1 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12VideoDecodeCommandList1 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12VideoDecodeCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, DecodeFrame) + void ( STDMETHODCALLTYPE *DecodeFrame )( + ID3D12VideoDecodeCommandList1 * This, + _In_ ID3D12VideoDecoder *pDecoder, + _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12VideoDecodeCommandList1 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList1, DecodeFrame1) + void ( STDMETHODCALLTYPE *DecodeFrame1 )( + ID3D12VideoDecodeCommandList1 * This, + _In_ ID3D12VideoDecoder *pDecoder, + _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1 *pOutputArguments, + _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments); + + END_INTERFACE + } ID3D12VideoDecodeCommandList1Vtbl; + + interface ID3D12VideoDecodeCommandList1 + { + CONST_VTBL struct ID3D12VideoDecodeCommandList1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoDecodeCommandList1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoDecodeCommandList1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoDecodeCommandList1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoDecodeCommandList1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoDecodeCommandList1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoDecodeCommandList1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoDecodeCommandList1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoDecodeCommandList1_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12VideoDecodeCommandList1_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12VideoDecodeCommandList1_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12VideoDecodeCommandList1_Reset(This,pAllocator) \ + ( (This)->lpVtbl -> Reset(This,pAllocator) ) + +#define ID3D12VideoDecodeCommandList1_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D12VideoDecodeCommandList1_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12VideoDecodeCommandList1_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12VideoDecodeCommandList1_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoDecodeCommandList1_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoDecodeCommandList1_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12VideoDecodeCommandList1_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12VideoDecodeCommandList1_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12VideoDecodeCommandList1_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12VideoDecodeCommandList1_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12VideoDecodeCommandList1_DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) ) + +#define ID3D12VideoDecodeCommandList1_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + + +#define ID3D12VideoDecodeCommandList1_DecodeFrame1(This,pDecoder,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> DecodeFrame1(This,pDecoder,pOutputArguments,pInputArguments) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoDecodeCommandList1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12video_0000_0007 */ +/* [local] */ + +typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS1 + { + D3D12_VIDEO_PROCESS_INPUT_STREAM InputStream[ 2 ]; + D3D12_VIDEO_PROCESS_TRANSFORM Transform; + D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS Flags; + D3D12_VIDEO_PROCESS_INPUT_STREAM_RATE RateInfo; + INT FilterLevels[ 32 ]; + D3D12_VIDEO_PROCESS_ALPHA_BLENDING AlphaBlending; + D3D12_VIDEO_FIELD_TYPE FieldType; + } D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS1; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0007_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0007_v0_0_s_ifspec; + +#ifndef __ID3D12VideoProcessCommandList1_INTERFACE_DEFINED__ +#define __ID3D12VideoProcessCommandList1_INTERFACE_DEFINED__ + +/* interface ID3D12VideoProcessCommandList1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoProcessCommandList1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("542C5C4D-7596-434F-8C93-4EFA6766F267") + ID3D12VideoProcessCommandList1 : public ID3D12VideoProcessCommandList + { + public: + virtual void STDMETHODCALLTYPE ProcessFrames1( + _In_ ID3D12VideoProcessor *pVideoProcessor, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + UINT NumInputStreams, + _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS1 *pInputArguments) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoProcessCommandList1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoProcessCommandList1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoProcessCommandList1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoProcessCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoProcessCommandList1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoProcessCommandList1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoProcessCommandList1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoProcessCommandList1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoProcessCommandList1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12VideoProcessCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12VideoProcessCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12VideoProcessCommandList1 * This, + _In_ ID3D12CommandAllocator *pAllocator); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12VideoProcessCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12VideoProcessCommandList1 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12VideoProcessCommandList1 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12VideoProcessCommandList1 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12VideoProcessCommandList1 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12VideoProcessCommandList1 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12VideoProcessCommandList1 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12VideoProcessCommandList1 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12VideoProcessCommandList1 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12VideoProcessCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ProcessFrames) + void ( STDMETHODCALLTYPE *ProcessFrames )( + ID3D12VideoProcessCommandList1 * This, + _In_ ID3D12VideoProcessor *pVideoProcessor, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + UINT NumInputStreams, + _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12VideoProcessCommandList1 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList1, ProcessFrames1) + void ( STDMETHODCALLTYPE *ProcessFrames1 )( + ID3D12VideoProcessCommandList1 * This, + _In_ ID3D12VideoProcessor *pVideoProcessor, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + UINT NumInputStreams, + _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS1 *pInputArguments); + + END_INTERFACE + } ID3D12VideoProcessCommandList1Vtbl; + + interface ID3D12VideoProcessCommandList1 + { + CONST_VTBL struct ID3D12VideoProcessCommandList1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoProcessCommandList1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoProcessCommandList1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoProcessCommandList1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoProcessCommandList1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoProcessCommandList1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoProcessCommandList1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoProcessCommandList1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoProcessCommandList1_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12VideoProcessCommandList1_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12VideoProcessCommandList1_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12VideoProcessCommandList1_Reset(This,pAllocator) \ + ( (This)->lpVtbl -> Reset(This,pAllocator) ) + +#define ID3D12VideoProcessCommandList1_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D12VideoProcessCommandList1_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12VideoProcessCommandList1_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12VideoProcessCommandList1_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoProcessCommandList1_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoProcessCommandList1_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12VideoProcessCommandList1_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12VideoProcessCommandList1_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12VideoProcessCommandList1_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12VideoProcessCommandList1_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12VideoProcessCommandList1_ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) \ + ( (This)->lpVtbl -> ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) ) + +#define ID3D12VideoProcessCommandList1_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + + +#define ID3D12VideoProcessCommandList1_ProcessFrames1(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) \ + ( (This)->lpVtbl -> ProcessFrames1(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoProcessCommandList1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12video_0000_0008 */ +/* [local] */ + +typedef +enum D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE + { + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_8X8 = 0, + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_16X16 = 1 + } D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE; + +typedef +enum D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS + { + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAG_NONE = 0, + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAG_8X8 = ( 1 << D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_8X8 ) , + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAG_16X16 = ( 1 << D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_16X16 ) + } D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS ); +typedef +enum D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION + { + D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_QUARTER_PEL = 0 + } D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION; + +typedef +enum D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS + { + D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAG_NONE = 0, + D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAG_QUARTER_PEL = ( 1 << D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_QUARTER_PEL ) + } D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS ); +typedef struct D3D12_FEATURE_DATA_VIDEO_FEATURE_AREA_SUPPORT + { + UINT NodeIndex; + BOOL VideoDecodeSupport; + BOOL VideoProcessSupport; + BOOL VideoEncodeSupport; + } D3D12_FEATURE_DATA_VIDEO_FEATURE_AREA_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR + { + UINT NodeIndex; + DXGI_FORMAT InputFormat; + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS BlockSizeFlags; + D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS PrecisionFlags; + D3D12_VIDEO_SIZE_RANGE SizeRange; + } D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR; + +typedef struct D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR_SIZE + { + UINT NodeIndex; + DXGI_FORMAT InputFormat; + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE BlockSize; + D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION Precision; + D3D12_VIDEO_SIZE_RANGE SizeRange; + BOOL Protected; + UINT64 MotionVectorHeapMemoryPoolL0Size; + UINT64 MotionVectorHeapMemoryPoolL1Size; + UINT64 MotionEstimatorMemoryPoolL0Size; + UINT64 MotionEstimatorMemoryPoolL1Size; + } D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR_SIZE; + +typedef struct D3D12_VIDEO_MOTION_ESTIMATOR_DESC + { + UINT NodeMask; + DXGI_FORMAT InputFormat; + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE BlockSize; + D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION Precision; + D3D12_VIDEO_SIZE_RANGE SizeRange; + } D3D12_VIDEO_MOTION_ESTIMATOR_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0008_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0008_v0_0_s_ifspec; + +#ifndef __ID3D12VideoMotionEstimator_INTERFACE_DEFINED__ +#define __ID3D12VideoMotionEstimator_INTERFACE_DEFINED__ + +/* interface ID3D12VideoMotionEstimator */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoMotionEstimator; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("33FDAE0E-098B-428F-87BB-34B695DE08F8") + ID3D12VideoMotionEstimator : public ID3D12Pageable + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_VIDEO_MOTION_ESTIMATOR_DESC STDMETHODCALLTYPE GetDesc( void) = 0; +#else + virtual D3D12_VIDEO_MOTION_ESTIMATOR_DESC *STDMETHODCALLTYPE GetDesc( + D3D12_VIDEO_MOTION_ESTIMATOR_DESC * RetVal) = 0; +#endif + + virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession( + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoMotionEstimatorVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoMotionEstimator * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoMotionEstimator * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoMotionEstimator * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoMotionEstimator * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoMotionEstimator * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoMotionEstimator * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoMotionEstimator * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoMotionEstimator * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12VideoMotionEstimator, GetDesc) +#if !defined(_WIN32) + D3D12_VIDEO_MOTION_ESTIMATOR_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoMotionEstimator * This); + +#else + D3D12_VIDEO_MOTION_ESTIMATOR_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoMotionEstimator * This, + D3D12_VIDEO_MOTION_ESTIMATOR_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12VideoMotionEstimator, GetProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )( + ID3D12VideoMotionEstimator * This, + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession); + + END_INTERFACE + } ID3D12VideoMotionEstimatorVtbl; + + interface ID3D12VideoMotionEstimator + { + CONST_VTBL struct ID3D12VideoMotionEstimatorVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoMotionEstimator_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoMotionEstimator_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoMotionEstimator_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoMotionEstimator_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoMotionEstimator_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoMotionEstimator_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoMotionEstimator_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoMotionEstimator_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#if !defined(_WIN32) + +#define ID3D12VideoMotionEstimator_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12VideoMotionEstimator_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#define ID3D12VideoMotionEstimator_GetProtectedResourceSession(This,riid,ppProtectedSession) \ + ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoMotionEstimator_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12video_0000_0009 */ +/* [local] */ + +typedef struct D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC + { + UINT NodeMask; + DXGI_FORMAT InputFormat; + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE BlockSize; + D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION Precision; + D3D12_VIDEO_SIZE_RANGE SizeRange; + } D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0009_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0009_v0_0_s_ifspec; + +#ifndef __ID3D12VideoMotionVectorHeap_INTERFACE_DEFINED__ +#define __ID3D12VideoMotionVectorHeap_INTERFACE_DEFINED__ + +/* interface ID3D12VideoMotionVectorHeap */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoMotionVectorHeap; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("5BE17987-743A-4061-834B-23D22DAEA505") + ID3D12VideoMotionVectorHeap : public ID3D12Pageable + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC STDMETHODCALLTYPE GetDesc( void) = 0; +#else + virtual D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC *STDMETHODCALLTYPE GetDesc( + D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC * RetVal) = 0; +#endif + + virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession( + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoMotionVectorHeapVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoMotionVectorHeap * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoMotionVectorHeap * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoMotionVectorHeap * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoMotionVectorHeap * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoMotionVectorHeap * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoMotionVectorHeap * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoMotionVectorHeap * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoMotionVectorHeap * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12VideoMotionVectorHeap, GetDesc) +#if !defined(_WIN32) + D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoMotionVectorHeap * This); + +#else + D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoMotionVectorHeap * This, + D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12VideoMotionVectorHeap, GetProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )( + ID3D12VideoMotionVectorHeap * This, + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession); + + END_INTERFACE + } ID3D12VideoMotionVectorHeapVtbl; + + interface ID3D12VideoMotionVectorHeap + { + CONST_VTBL struct ID3D12VideoMotionVectorHeapVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoMotionVectorHeap_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoMotionVectorHeap_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoMotionVectorHeap_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoMotionVectorHeap_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoMotionVectorHeap_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoMotionVectorHeap_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoMotionVectorHeap_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoMotionVectorHeap_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#if !defined(_WIN32) + +#define ID3D12VideoMotionVectorHeap_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12VideoMotionVectorHeap_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#define ID3D12VideoMotionVectorHeap_GetProtectedResourceSession(This,riid,ppProtectedSession) \ + ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoMotionVectorHeap_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoDevice1_INTERFACE_DEFINED__ +#define __ID3D12VideoDevice1_INTERFACE_DEFINED__ + +/* interface ID3D12VideoDevice1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoDevice1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("981611AD-A144-4C83-9890-F30E26D658AB") + ID3D12VideoDevice1 : public ID3D12VideoDevice + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateVideoMotionEstimator( + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoMotionEstimator) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateVideoMotionVectorHeap( + _In_ const D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoMotionVectorHeap) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoDevice1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoDevice1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoDevice1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoDevice1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12VideoDevice1 * This, + D3D12_FEATURE_VIDEO FeatureVideo, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoDecoder) + HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoder )( + ID3D12VideoDevice1 * This, + _In_ const D3D12_VIDEO_DECODER_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoder); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoDecoderHeap) + HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoderHeap )( + ID3D12VideoDevice1 * This, + _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoderHeap); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoProcessor) + HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessor )( + ID3D12VideoDevice1 * This, + UINT NodeMask, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc, + UINT NumInputStreamDescs, + _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoProcessor); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice1, CreateVideoMotionEstimator) + HRESULT ( STDMETHODCALLTYPE *CreateVideoMotionEstimator )( + ID3D12VideoDevice1 * This, + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoMotionEstimator); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice1, CreateVideoMotionVectorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateVideoMotionVectorHeap )( + ID3D12VideoDevice1 * This, + _In_ const D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoMotionVectorHeap); + + END_INTERFACE + } ID3D12VideoDevice1Vtbl; + + interface ID3D12VideoDevice1 + { + CONST_VTBL struct ID3D12VideoDevice1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoDevice1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoDevice1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoDevice1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoDevice1_CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12VideoDevice1_CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) \ + ( (This)->lpVtbl -> CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) ) + +#define ID3D12VideoDevice1_CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) \ + ( (This)->lpVtbl -> CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) ) + +#define ID3D12VideoDevice1_CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) \ + ( (This)->lpVtbl -> CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) ) + + +#define ID3D12VideoDevice1_CreateVideoMotionEstimator(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionEstimator) \ + ( (This)->lpVtbl -> CreateVideoMotionEstimator(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionEstimator) ) + +#define ID3D12VideoDevice1_CreateVideoMotionVectorHeap(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionVectorHeap) \ + ( (This)->lpVtbl -> CreateVideoMotionVectorHeap(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionVectorHeap) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoDevice1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12video_0000_0011 */ +/* [local] */ + +typedef struct D3D12_RESOURCE_COORDINATE + { + UINT64 X; + UINT Y; + UINT Z; + UINT SubresourceIndex; + } D3D12_RESOURCE_COORDINATE; + +typedef struct D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT + { + ID3D12VideoMotionVectorHeap *pMotionVectorHeap; + } D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT; + +typedef struct D3D12_VIDEO_MOTION_ESTIMATOR_INPUT + { + ID3D12Resource *pInputTexture2D; + UINT InputSubresourceIndex; + ID3D12Resource *pReferenceTexture2D; + UINT ReferenceSubresourceIndex; + ID3D12VideoMotionVectorHeap *pHintMotionVectorHeap; + } D3D12_VIDEO_MOTION_ESTIMATOR_INPUT; + +typedef struct D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT + { + ID3D12Resource *pMotionVectorTexture2D; + D3D12_RESOURCE_COORDINATE MotionVectorCoordinate; + } D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT; + +typedef struct D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT + { + ID3D12VideoMotionVectorHeap *pMotionVectorHeap; + UINT PixelWidth; + UINT PixelHeight; + } D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0011_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0011_v0_0_s_ifspec; + +#ifndef __ID3D12VideoEncodeCommandList_INTERFACE_DEFINED__ +#define __ID3D12VideoEncodeCommandList_INTERFACE_DEFINED__ + +/* interface ID3D12VideoEncodeCommandList */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoEncodeCommandList; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("8455293A-0CBD-4831-9B39-FBDBAB724723") + ID3D12VideoEncodeCommandList : public ID3D12CommandList + { + public: + virtual HRESULT STDMETHODCALLTYPE Close( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Reset( + _In_ ID3D12CommandAllocator *pAllocator) = 0; + + virtual void STDMETHODCALLTYPE ClearState( void) = 0; + + virtual void STDMETHODCALLTYPE ResourceBarrier( + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers) = 0; + + virtual void STDMETHODCALLTYPE DiscardResource( + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion) = 0; + + virtual void STDMETHODCALLTYPE BeginQuery( + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index) = 0; + + virtual void STDMETHODCALLTYPE EndQuery( + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index) = 0; + + virtual void STDMETHODCALLTYPE ResolveQueryData( + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset) = 0; + + virtual void STDMETHODCALLTYPE SetPredication( + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation) = 0; + + virtual void STDMETHODCALLTYPE SetMarker( + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size) = 0; + + virtual void STDMETHODCALLTYPE BeginEvent( + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size) = 0; + + virtual void STDMETHODCALLTYPE EndEvent( void) = 0; + + virtual void STDMETHODCALLTYPE EstimateMotion( + _In_ ID3D12VideoMotionEstimator *pMotionEstimator, + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT *pOutputArguments, + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_INPUT *pInputArguments) = 0; + + virtual void STDMETHODCALLTYPE ResolveMotionVectorHeap( + const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT *pOutputArguments, + const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT *pInputArguments) = 0; + + virtual void STDMETHODCALLTYPE WriteBufferImmediate( + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes) = 0; + + virtual void STDMETHODCALLTYPE SetProtectedResourceSession( + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoEncodeCommandListVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoEncodeCommandList * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoEncodeCommandList * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoEncodeCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoEncodeCommandList * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoEncodeCommandList * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoEncodeCommandList * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoEncodeCommandList * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoEncodeCommandList * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12VideoEncodeCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12VideoEncodeCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12VideoEncodeCommandList * This, + _In_ ID3D12CommandAllocator *pAllocator); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12VideoEncodeCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12VideoEncodeCommandList * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12VideoEncodeCommandList * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12VideoEncodeCommandList * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12VideoEncodeCommandList * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12VideoEncodeCommandList * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12VideoEncodeCommandList * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12VideoEncodeCommandList * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12VideoEncodeCommandList * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12VideoEncodeCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EstimateMotion) + void ( STDMETHODCALLTYPE *EstimateMotion )( + ID3D12VideoEncodeCommandList * This, + _In_ ID3D12VideoMotionEstimator *pMotionEstimator, + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT *pOutputArguments, + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_INPUT *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResolveMotionVectorHeap) + void ( STDMETHODCALLTYPE *ResolveMotionVectorHeap )( + ID3D12VideoEncodeCommandList * This, + const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT *pOutputArguments, + const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12VideoEncodeCommandList * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12VideoEncodeCommandList * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + END_INTERFACE + } ID3D12VideoEncodeCommandListVtbl; + + interface ID3D12VideoEncodeCommandList + { + CONST_VTBL struct ID3D12VideoEncodeCommandListVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoEncodeCommandList_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoEncodeCommandList_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoEncodeCommandList_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoEncodeCommandList_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoEncodeCommandList_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoEncodeCommandList_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoEncodeCommandList_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoEncodeCommandList_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12VideoEncodeCommandList_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12VideoEncodeCommandList_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12VideoEncodeCommandList_Reset(This,pAllocator) \ + ( (This)->lpVtbl -> Reset(This,pAllocator) ) + +#define ID3D12VideoEncodeCommandList_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D12VideoEncodeCommandList_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12VideoEncodeCommandList_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12VideoEncodeCommandList_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoEncodeCommandList_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoEncodeCommandList_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12VideoEncodeCommandList_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12VideoEncodeCommandList_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12VideoEncodeCommandList_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12VideoEncodeCommandList_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12VideoEncodeCommandList_EstimateMotion(This,pMotionEstimator,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> EstimateMotion(This,pMotionEstimator,pOutputArguments,pInputArguments) ) + +#define ID3D12VideoEncodeCommandList_ResolveMotionVectorHeap(This,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> ResolveMotionVectorHeap(This,pOutputArguments,pInputArguments) ) + +#define ID3D12VideoEncodeCommandList_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + +#define ID3D12VideoEncodeCommandList_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoEncodeCommandList_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12video_0000_0012 */ +/* [local] */ + +typedef +enum D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS + { + D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAG_NONE = 0, + D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAG_SUPPORTED = 0x1 + } D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS ); +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_PROTECTED_RESOURCES + { + UINT NodeIndex; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; + D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS SupportFlags; + } D3D12_FEATURE_DATA_VIDEO_DECODE_PROTECTED_RESOURCES; + +typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESS_PROTECTED_RESOURCES + { + UINT NodeIndex; + D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS SupportFlags; + } D3D12_FEATURE_DATA_VIDEO_PROCESS_PROTECTED_RESOURCES; + +typedef struct D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR_PROTECTED_RESOURCES + { + UINT NodeIndex; + D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS SupportFlags; + } D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR_PROTECTED_RESOURCES; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODER_HEAP_SIZE1 + { + D3D12_VIDEO_DECODER_HEAP_DESC VideoDecoderHeapDesc; + BOOL Protected; + UINT64 MemoryPoolL0Size; + UINT64 MemoryPoolL1Size; + } D3D12_FEATURE_DATA_VIDEO_DECODER_HEAP_SIZE1; + +typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESSOR_SIZE1 + { + UINT NodeMask; + const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc; + UINT NumInputStreamDescs; + const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs; + BOOL Protected; + UINT64 MemoryPoolL0Size; + UINT64 MemoryPoolL1Size; + } D3D12_FEATURE_DATA_VIDEO_PROCESSOR_SIZE1; + +typedef +enum D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE + { + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_CREATION = 0, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_INITIALIZATION = 1, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_EXECUTION = 2, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_CAPS_INPUT = 3, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_CAPS_OUTPUT = 4, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_DEVICE_EXECUTE_INPUT = 5, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_DEVICE_EXECUTE_OUTPUT = 6 + } D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE; + +typedef +enum D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE + { + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_UINT8 = 0, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_UINT16 = 1, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_UINT32 = 2, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_UINT64 = 3, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_SINT8 = 4, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_SINT16 = 5, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_SINT32 = 6, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_SINT64 = 7, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_FLOAT = 8, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_DOUBLE = 9, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_RESOURCE = 10 + } D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE; + +typedef +enum D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAGS + { + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAG_NONE = 0, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAG_READ = 0x1, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAG_WRITE = 0x2 + } D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAGS ); +typedef struct D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_COUNT + { + UINT NodeIndex; + UINT CommandCount; + } D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_COUNT; + +typedef struct D3D12_VIDEO_EXTENSION_COMMAND_INFO + { + GUID CommandId; + LPCWSTR Name; + D3D12_COMMAND_LIST_SUPPORT_FLAGS CommandListSupportFlags; + } D3D12_VIDEO_EXTENSION_COMMAND_INFO; + +typedef struct D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMANDS + { + UINT NodeIndex; + UINT CommandCount; + _Field_size_full_(CommandCount) D3D12_VIDEO_EXTENSION_COMMAND_INFO *pCommandInfos; + } D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMANDS; + +typedef struct D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_PARAMETER_COUNT + { + GUID CommandId; + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE Stage; + UINT ParameterCount; + UINT ParameterPacking; + } D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_PARAMETER_COUNT; + +typedef struct D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_INFO + { + LPCWSTR Name; + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE Type; + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAGS Flags; + } D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_INFO; + +typedef struct D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_PARAMETERS + { + GUID CommandId; + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE Stage; + UINT ParameterCount; + _Field_size_full_(ParameterCount) D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_INFO *pParameterInfos; + } D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_PARAMETERS; + +typedef struct D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_SUPPORT + { + UINT NodeIndex; + GUID CommandId; + _Field_size_bytes_full_opt_(InputDataSizeInBytes) const void *pInputData; + SIZE_T InputDataSizeInBytes; + _Field_size_bytes_full_opt_(OutputDataSizeInBytes) void *pOutputData; + SIZE_T OutputDataSizeInBytes; + } D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_SIZE + { + UINT NodeIndex; + GUID CommandId; + _Field_size_bytes_full_(CreationParametersDataSizeInBytes) const void *pCreationParameters; + SIZE_T CreationParametersSizeInBytes; + UINT64 MemoryPoolL0Size; + UINT64 MemoryPoolL1Size; + } D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_SIZE; + +typedef struct D3D12_VIDEO_EXTENSION_COMMAND_DESC + { + UINT NodeMask; + GUID CommandId; + } D3D12_VIDEO_EXTENSION_COMMAND_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0012_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0012_v0_0_s_ifspec; + +#ifndef __ID3D12VideoDecoder1_INTERFACE_DEFINED__ +#define __ID3D12VideoDecoder1_INTERFACE_DEFINED__ + +/* interface ID3D12VideoDecoder1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoDecoder1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("79A2E5FB-CCD2-469A-9FDE-195D10951F7E") + ID3D12VideoDecoder1 : public ID3D12VideoDecoder + { + public: + virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession( + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoDecoder1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoDecoder1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoDecoder1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoDecoder1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoDecoder1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoDecoder1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoDecoder1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoDecoder1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoDecoder1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12VideoDecoder, GetDesc) +#if !defined(_WIN32) + D3D12_VIDEO_DECODER_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoDecoder1 * This); + +#else + D3D12_VIDEO_DECODER_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoDecoder1 * This, + D3D12_VIDEO_DECODER_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12VideoDecoder1, GetProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )( + ID3D12VideoDecoder1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession); + + END_INTERFACE + } ID3D12VideoDecoder1Vtbl; + + interface ID3D12VideoDecoder1 + { + CONST_VTBL struct ID3D12VideoDecoder1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoDecoder1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoDecoder1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoDecoder1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoDecoder1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoDecoder1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoDecoder1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoDecoder1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoDecoder1_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#if !defined(_WIN32) + +#define ID3D12VideoDecoder1_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12VideoDecoder1_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + + +#define ID3D12VideoDecoder1_GetProtectedResourceSession(This,riid,ppProtectedSession) \ + ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoDecoder1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoDecoderHeap1_INTERFACE_DEFINED__ +#define __ID3D12VideoDecoderHeap1_INTERFACE_DEFINED__ + +/* interface ID3D12VideoDecoderHeap1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoDecoderHeap1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("DA1D98C5-539F-41B2-BF6B-1198A03B6D26") + ID3D12VideoDecoderHeap1 : public ID3D12VideoDecoderHeap + { + public: + virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession( + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoDecoderHeap1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoDecoderHeap1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoDecoderHeap1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoDecoderHeap1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoDecoderHeap1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoDecoderHeap1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoDecoderHeap1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoDecoderHeap1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoDecoderHeap1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12VideoDecoderHeap, GetDesc) +#if !defined(_WIN32) + D3D12_VIDEO_DECODER_HEAP_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoDecoderHeap1 * This); + +#else + D3D12_VIDEO_DECODER_HEAP_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoDecoderHeap1 * This, + D3D12_VIDEO_DECODER_HEAP_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12VideoDecoderHeap1, GetProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )( + ID3D12VideoDecoderHeap1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession); + + END_INTERFACE + } ID3D12VideoDecoderHeap1Vtbl; + + interface ID3D12VideoDecoderHeap1 + { + CONST_VTBL struct ID3D12VideoDecoderHeap1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoDecoderHeap1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoDecoderHeap1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoDecoderHeap1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoDecoderHeap1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoDecoderHeap1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoDecoderHeap1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoDecoderHeap1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoDecoderHeap1_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#if !defined(_WIN32) + +#define ID3D12VideoDecoderHeap1_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12VideoDecoderHeap1_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + + +#define ID3D12VideoDecoderHeap1_GetProtectedResourceSession(This,riid,ppProtectedSession) \ + ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoDecoderHeap1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoProcessor1_INTERFACE_DEFINED__ +#define __ID3D12VideoProcessor1_INTERFACE_DEFINED__ + +/* interface ID3D12VideoProcessor1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoProcessor1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("F3CFE615-553F-425C-86D8-EE8C1B1FB01C") + ID3D12VideoProcessor1 : public ID3D12VideoProcessor + { + public: + virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession( + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoProcessor1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoProcessor1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoProcessor1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoProcessor1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoProcessor1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoProcessor1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoProcessor1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoProcessor1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoProcessor1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessor, GetNodeMask) + UINT ( STDMETHODCALLTYPE *GetNodeMask )( + ID3D12VideoProcessor1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessor, GetNumInputStreamDescs) + UINT ( STDMETHODCALLTYPE *GetNumInputStreamDescs )( + ID3D12VideoProcessor1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessor, GetInputStreamDescs) + HRESULT ( STDMETHODCALLTYPE *GetInputStreamDescs )( + ID3D12VideoProcessor1 * This, + UINT NumInputStreamDescs, + _Out_writes_(NumInputStreamDescs) D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessor, GetOutputStreamDesc) +#if !defined(_WIN32) + D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC ( STDMETHODCALLTYPE *GetOutputStreamDesc )( + ID3D12VideoProcessor1 * This); + +#else + D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *( STDMETHODCALLTYPE *GetOutputStreamDesc )( + ID3D12VideoProcessor1 * This, + D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12VideoProcessor1, GetProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )( + ID3D12VideoProcessor1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession); + + END_INTERFACE + } ID3D12VideoProcessor1Vtbl; + + interface ID3D12VideoProcessor1 + { + CONST_VTBL struct ID3D12VideoProcessor1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoProcessor1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoProcessor1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoProcessor1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoProcessor1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoProcessor1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoProcessor1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoProcessor1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoProcessor1_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#define ID3D12VideoProcessor1_GetNodeMask(This) \ + ( (This)->lpVtbl -> GetNodeMask(This) ) + +#define ID3D12VideoProcessor1_GetNumInputStreamDescs(This) \ + ( (This)->lpVtbl -> GetNumInputStreamDescs(This) ) + +#define ID3D12VideoProcessor1_GetInputStreamDescs(This,NumInputStreamDescs,pInputStreamDescs) \ + ( (This)->lpVtbl -> GetInputStreamDescs(This,NumInputStreamDescs,pInputStreamDescs) ) +#if !defined(_WIN32) + +#define ID3D12VideoProcessor1_GetOutputStreamDesc(This) \ + ( (This)->lpVtbl -> GetOutputStreamDesc(This) ) +#else +#define ID3D12VideoProcessor1_GetOutputStreamDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetOutputStreamDesc(This,RetVal) ) +#endif + + +#define ID3D12VideoProcessor1_GetProtectedResourceSession(This,riid,ppProtectedSession) \ + ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoProcessor1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoExtensionCommand_INTERFACE_DEFINED__ +#define __ID3D12VideoExtensionCommand_INTERFACE_DEFINED__ + +/* interface ID3D12VideoExtensionCommand */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoExtensionCommand; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("554E41E8-AE8E-4A8C-B7D2-5B4F274A30E4") + ID3D12VideoExtensionCommand : public ID3D12Pageable + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_VIDEO_EXTENSION_COMMAND_DESC STDMETHODCALLTYPE GetDesc( void) = 0; +#else + virtual D3D12_VIDEO_EXTENSION_COMMAND_DESC *STDMETHODCALLTYPE GetDesc( + D3D12_VIDEO_EXTENSION_COMMAND_DESC * RetVal) = 0; +#endif + + virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession( + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoExtensionCommandVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoExtensionCommand * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoExtensionCommand * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoExtensionCommand * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoExtensionCommand * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoExtensionCommand * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoExtensionCommand * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoExtensionCommand * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoExtensionCommand * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12VideoExtensionCommand, GetDesc) +#if !defined(_WIN32) + D3D12_VIDEO_EXTENSION_COMMAND_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoExtensionCommand * This); + +#else + D3D12_VIDEO_EXTENSION_COMMAND_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoExtensionCommand * This, + D3D12_VIDEO_EXTENSION_COMMAND_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12VideoExtensionCommand, GetProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )( + ID3D12VideoExtensionCommand * This, + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession); + + END_INTERFACE + } ID3D12VideoExtensionCommandVtbl; + + interface ID3D12VideoExtensionCommand + { + CONST_VTBL struct ID3D12VideoExtensionCommandVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoExtensionCommand_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoExtensionCommand_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoExtensionCommand_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoExtensionCommand_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoExtensionCommand_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoExtensionCommand_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoExtensionCommand_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoExtensionCommand_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#if !defined(_WIN32) + +#define ID3D12VideoExtensionCommand_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12VideoExtensionCommand_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#define ID3D12VideoExtensionCommand_GetProtectedResourceSession(This,riid,ppProtectedSession) \ + ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoExtensionCommand_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoDevice2_INTERFACE_DEFINED__ +#define __ID3D12VideoDevice2_INTERFACE_DEFINED__ + +/* interface ID3D12VideoDevice2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoDevice2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("F019AC49-F838-4A95-9B17-579437C8F513") + ID3D12VideoDevice2 : public ID3D12VideoDevice1 + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateVideoDecoder1( + _In_ const D3D12_VIDEO_DECODER_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoder) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateVideoDecoderHeap1( + _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoderHeap) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateVideoProcessor1( + UINT NodeMask, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc, + UINT NumInputStreamDescs, + _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoProcessor) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateVideoExtensionCommand( + _In_ const D3D12_VIDEO_EXTENSION_COMMAND_DESC *pDesc, + _In_reads_bytes_(CreationParametersDataSizeInBytes) const void *pCreationParameters, + SIZE_T CreationParametersDataSizeInBytes, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoExtensionCommand) = 0; + + virtual HRESULT STDMETHODCALLTYPE ExecuteExtensionCommand( + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes, + _Out_writes_bytes_(OutputDataSizeInBytes) void *pOutputData, + SIZE_T OutputDataSizeInBytes) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoDevice2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoDevice2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoDevice2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoDevice2 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12VideoDevice2 * This, + D3D12_FEATURE_VIDEO FeatureVideo, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoDecoder) + HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoder )( + ID3D12VideoDevice2 * This, + _In_ const D3D12_VIDEO_DECODER_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoder); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoDecoderHeap) + HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoderHeap )( + ID3D12VideoDevice2 * This, + _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoderHeap); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoProcessor) + HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessor )( + ID3D12VideoDevice2 * This, + UINT NodeMask, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc, + UINT NumInputStreamDescs, + _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoProcessor); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice1, CreateVideoMotionEstimator) + HRESULT ( STDMETHODCALLTYPE *CreateVideoMotionEstimator )( + ID3D12VideoDevice2 * This, + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoMotionEstimator); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice1, CreateVideoMotionVectorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateVideoMotionVectorHeap )( + ID3D12VideoDevice2 * This, + _In_ const D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoMotionVectorHeap); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice2, CreateVideoDecoder1) + HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoder1 )( + ID3D12VideoDevice2 * This, + _In_ const D3D12_VIDEO_DECODER_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoder); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice2, CreateVideoDecoderHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoderHeap1 )( + ID3D12VideoDevice2 * This, + _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoderHeap); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice2, CreateVideoProcessor1) + HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessor1 )( + ID3D12VideoDevice2 * This, + UINT NodeMask, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc, + UINT NumInputStreamDescs, + _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoProcessor); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice2, CreateVideoExtensionCommand) + HRESULT ( STDMETHODCALLTYPE *CreateVideoExtensionCommand )( + ID3D12VideoDevice2 * This, + _In_ const D3D12_VIDEO_EXTENSION_COMMAND_DESC *pDesc, + _In_reads_bytes_(CreationParametersDataSizeInBytes) const void *pCreationParameters, + SIZE_T CreationParametersDataSizeInBytes, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoExtensionCommand); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice2, ExecuteExtensionCommand) + HRESULT ( STDMETHODCALLTYPE *ExecuteExtensionCommand )( + ID3D12VideoDevice2 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes, + _Out_writes_bytes_(OutputDataSizeInBytes) void *pOutputData, + SIZE_T OutputDataSizeInBytes); + + END_INTERFACE + } ID3D12VideoDevice2Vtbl; + + interface ID3D12VideoDevice2 + { + CONST_VTBL struct ID3D12VideoDevice2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoDevice2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoDevice2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoDevice2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoDevice2_CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12VideoDevice2_CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) \ + ( (This)->lpVtbl -> CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) ) + +#define ID3D12VideoDevice2_CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) \ + ( (This)->lpVtbl -> CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) ) + +#define ID3D12VideoDevice2_CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) \ + ( (This)->lpVtbl -> CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) ) + + +#define ID3D12VideoDevice2_CreateVideoMotionEstimator(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionEstimator) \ + ( (This)->lpVtbl -> CreateVideoMotionEstimator(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionEstimator) ) + +#define ID3D12VideoDevice2_CreateVideoMotionVectorHeap(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionVectorHeap) \ + ( (This)->lpVtbl -> CreateVideoMotionVectorHeap(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionVectorHeap) ) + + +#define ID3D12VideoDevice2_CreateVideoDecoder1(This,pDesc,pProtectedResourceSession,riid,ppVideoDecoder) \ + ( (This)->lpVtbl -> CreateVideoDecoder1(This,pDesc,pProtectedResourceSession,riid,ppVideoDecoder) ) + +#define ID3D12VideoDevice2_CreateVideoDecoderHeap1(This,pVideoDecoderHeapDesc,pProtectedResourceSession,riid,ppVideoDecoderHeap) \ + ( (This)->lpVtbl -> CreateVideoDecoderHeap1(This,pVideoDecoderHeapDesc,pProtectedResourceSession,riid,ppVideoDecoderHeap) ) + +#define ID3D12VideoDevice2_CreateVideoProcessor1(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,pProtectedResourceSession,riid,ppVideoProcessor) \ + ( (This)->lpVtbl -> CreateVideoProcessor1(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,pProtectedResourceSession,riid,ppVideoProcessor) ) + +#define ID3D12VideoDevice2_CreateVideoExtensionCommand(This,pDesc,pCreationParameters,CreationParametersDataSizeInBytes,pProtectedResourceSession,riid,ppVideoExtensionCommand) \ + ( (This)->lpVtbl -> CreateVideoExtensionCommand(This,pDesc,pCreationParameters,CreationParametersDataSizeInBytes,pProtectedResourceSession,riid,ppVideoExtensionCommand) ) + +#define ID3D12VideoDevice2_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes,pOutputData,OutputDataSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes,pOutputData,OutputDataSizeInBytes) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoDevice2_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoDecodeCommandList2_INTERFACE_DEFINED__ +#define __ID3D12VideoDecodeCommandList2_INTERFACE_DEFINED__ + +/* interface ID3D12VideoDecodeCommandList2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoDecodeCommandList2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6e120880-c114-4153-8036-d247051e1729") + ID3D12VideoDecodeCommandList2 : public ID3D12VideoDecodeCommandList1 + { + public: + virtual void STDMETHODCALLTYPE SetProtectedResourceSession( + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession) = 0; + + virtual void STDMETHODCALLTYPE InitializeExtensionCommand( + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters, + SIZE_T InitializationParametersSizeInBytes) = 0; + + virtual void STDMETHODCALLTYPE ExecuteExtensionCommand( + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoDecodeCommandList2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoDecodeCommandList2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoDecodeCommandList2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoDecodeCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoDecodeCommandList2 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoDecodeCommandList2 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoDecodeCommandList2 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoDecodeCommandList2 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoDecodeCommandList2 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12VideoDecodeCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12VideoDecodeCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12VideoDecodeCommandList2 * This, + _In_ ID3D12CommandAllocator *pAllocator); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12VideoDecodeCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12VideoDecodeCommandList2 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12VideoDecodeCommandList2 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12VideoDecodeCommandList2 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12VideoDecodeCommandList2 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12VideoDecodeCommandList2 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12VideoDecodeCommandList2 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12VideoDecodeCommandList2 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12VideoDecodeCommandList2 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12VideoDecodeCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, DecodeFrame) + void ( STDMETHODCALLTYPE *DecodeFrame )( + ID3D12VideoDecodeCommandList2 * This, + _In_ ID3D12VideoDecoder *pDecoder, + _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12VideoDecodeCommandList2 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList1, DecodeFrame1) + void ( STDMETHODCALLTYPE *DecodeFrame1 )( + ID3D12VideoDecodeCommandList2 * This, + _In_ ID3D12VideoDecoder *pDecoder, + _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1 *pOutputArguments, + _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList2, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12VideoDecodeCommandList2 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList2, InitializeExtensionCommand) + void ( STDMETHODCALLTYPE *InitializeExtensionCommand )( + ID3D12VideoDecodeCommandList2 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters, + SIZE_T InitializationParametersSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList2, ExecuteExtensionCommand) + void ( STDMETHODCALLTYPE *ExecuteExtensionCommand )( + ID3D12VideoDecodeCommandList2 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes); + + END_INTERFACE + } ID3D12VideoDecodeCommandList2Vtbl; + + interface ID3D12VideoDecodeCommandList2 + { + CONST_VTBL struct ID3D12VideoDecodeCommandList2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoDecodeCommandList2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoDecodeCommandList2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoDecodeCommandList2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoDecodeCommandList2_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoDecodeCommandList2_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoDecodeCommandList2_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoDecodeCommandList2_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoDecodeCommandList2_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12VideoDecodeCommandList2_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12VideoDecodeCommandList2_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12VideoDecodeCommandList2_Reset(This,pAllocator) \ + ( (This)->lpVtbl -> Reset(This,pAllocator) ) + +#define ID3D12VideoDecodeCommandList2_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D12VideoDecodeCommandList2_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12VideoDecodeCommandList2_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12VideoDecodeCommandList2_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoDecodeCommandList2_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoDecodeCommandList2_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12VideoDecodeCommandList2_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12VideoDecodeCommandList2_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12VideoDecodeCommandList2_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12VideoDecodeCommandList2_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12VideoDecodeCommandList2_DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) ) + +#define ID3D12VideoDecodeCommandList2_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + + +#define ID3D12VideoDecodeCommandList2_DecodeFrame1(This,pDecoder,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> DecodeFrame1(This,pDecoder,pOutputArguments,pInputArguments) ) + + +#define ID3D12VideoDecodeCommandList2_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + +#define ID3D12VideoDecodeCommandList2_InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) \ + ( (This)->lpVtbl -> InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) ) + +#define ID3D12VideoDecodeCommandList2_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoDecodeCommandList2_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoDecodeCommandList3_INTERFACE_DEFINED__ +#define __ID3D12VideoDecodeCommandList3_INTERFACE_DEFINED__ + +/* interface ID3D12VideoDecodeCommandList3 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoDecodeCommandList3; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2aee8c37-9562-42da-8abf-61efeb2e4513") + ID3D12VideoDecodeCommandList3 : public ID3D12VideoDecodeCommandList2 + { + public: + virtual void STDMETHODCALLTYPE Barrier( + UINT32 NumBarrierGroups, + _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoDecodeCommandList3Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoDecodeCommandList3 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoDecodeCommandList3 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoDecodeCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoDecodeCommandList3 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoDecodeCommandList3 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoDecodeCommandList3 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoDecodeCommandList3 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoDecodeCommandList3 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12VideoDecodeCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12VideoDecodeCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12VideoDecodeCommandList3 * This, + _In_ ID3D12CommandAllocator *pAllocator); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12VideoDecodeCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12VideoDecodeCommandList3 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12VideoDecodeCommandList3 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12VideoDecodeCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12VideoDecodeCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12VideoDecodeCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12VideoDecodeCommandList3 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12VideoDecodeCommandList3 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12VideoDecodeCommandList3 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12VideoDecodeCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, DecodeFrame) + void ( STDMETHODCALLTYPE *DecodeFrame )( + ID3D12VideoDecodeCommandList3 * This, + _In_ ID3D12VideoDecoder *pDecoder, + _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12VideoDecodeCommandList3 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList1, DecodeFrame1) + void ( STDMETHODCALLTYPE *DecodeFrame1 )( + ID3D12VideoDecodeCommandList3 * This, + _In_ ID3D12VideoDecoder *pDecoder, + _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1 *pOutputArguments, + _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList2, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12VideoDecodeCommandList3 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList2, InitializeExtensionCommand) + void ( STDMETHODCALLTYPE *InitializeExtensionCommand )( + ID3D12VideoDecodeCommandList3 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters, + SIZE_T InitializationParametersSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList2, ExecuteExtensionCommand) + void ( STDMETHODCALLTYPE *ExecuteExtensionCommand )( + ID3D12VideoDecodeCommandList3 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList3, Barrier) + void ( STDMETHODCALLTYPE *Barrier )( + ID3D12VideoDecodeCommandList3 * This, + UINT32 NumBarrierGroups, + _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups); + + END_INTERFACE + } ID3D12VideoDecodeCommandList3Vtbl; + + interface ID3D12VideoDecodeCommandList3 + { + CONST_VTBL struct ID3D12VideoDecodeCommandList3Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoDecodeCommandList3_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoDecodeCommandList3_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoDecodeCommandList3_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoDecodeCommandList3_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoDecodeCommandList3_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoDecodeCommandList3_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoDecodeCommandList3_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoDecodeCommandList3_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12VideoDecodeCommandList3_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12VideoDecodeCommandList3_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12VideoDecodeCommandList3_Reset(This,pAllocator) \ + ( (This)->lpVtbl -> Reset(This,pAllocator) ) + +#define ID3D12VideoDecodeCommandList3_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D12VideoDecodeCommandList3_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12VideoDecodeCommandList3_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12VideoDecodeCommandList3_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoDecodeCommandList3_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoDecodeCommandList3_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12VideoDecodeCommandList3_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12VideoDecodeCommandList3_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12VideoDecodeCommandList3_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12VideoDecodeCommandList3_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12VideoDecodeCommandList3_DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) ) + +#define ID3D12VideoDecodeCommandList3_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + + +#define ID3D12VideoDecodeCommandList3_DecodeFrame1(This,pDecoder,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> DecodeFrame1(This,pDecoder,pOutputArguments,pInputArguments) ) + + +#define ID3D12VideoDecodeCommandList3_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + +#define ID3D12VideoDecodeCommandList3_InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) \ + ( (This)->lpVtbl -> InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) ) + +#define ID3D12VideoDecodeCommandList3_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) ) + + +#define ID3D12VideoDecodeCommandList3_Barrier(This,NumBarrierGroups,pBarrierGroups) \ + ( (This)->lpVtbl -> Barrier(This,NumBarrierGroups,pBarrierGroups) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoDecodeCommandList3_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoProcessCommandList2_INTERFACE_DEFINED__ +#define __ID3D12VideoProcessCommandList2_INTERFACE_DEFINED__ + +/* interface ID3D12VideoProcessCommandList2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoProcessCommandList2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("db525ae4-6ad6-473c-baa7-59b2e37082e4") + ID3D12VideoProcessCommandList2 : public ID3D12VideoProcessCommandList1 + { + public: + virtual void STDMETHODCALLTYPE SetProtectedResourceSession( + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession) = 0; + + virtual void STDMETHODCALLTYPE InitializeExtensionCommand( + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters, + SIZE_T InitializationParametersSizeInBytes) = 0; + + virtual void STDMETHODCALLTYPE ExecuteExtensionCommand( + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoProcessCommandList2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoProcessCommandList2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoProcessCommandList2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoProcessCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoProcessCommandList2 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoProcessCommandList2 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoProcessCommandList2 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoProcessCommandList2 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoProcessCommandList2 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12VideoProcessCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12VideoProcessCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12VideoProcessCommandList2 * This, + _In_ ID3D12CommandAllocator *pAllocator); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12VideoProcessCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12VideoProcessCommandList2 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12VideoProcessCommandList2 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12VideoProcessCommandList2 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12VideoProcessCommandList2 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12VideoProcessCommandList2 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12VideoProcessCommandList2 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12VideoProcessCommandList2 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12VideoProcessCommandList2 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12VideoProcessCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ProcessFrames) + void ( STDMETHODCALLTYPE *ProcessFrames )( + ID3D12VideoProcessCommandList2 * This, + _In_ ID3D12VideoProcessor *pVideoProcessor, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + UINT NumInputStreams, + _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12VideoProcessCommandList2 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList1, ProcessFrames1) + void ( STDMETHODCALLTYPE *ProcessFrames1 )( + ID3D12VideoProcessCommandList2 * This, + _In_ ID3D12VideoProcessor *pVideoProcessor, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + UINT NumInputStreams, + _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS1 *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList2, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12VideoProcessCommandList2 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList2, InitializeExtensionCommand) + void ( STDMETHODCALLTYPE *InitializeExtensionCommand )( + ID3D12VideoProcessCommandList2 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters, + SIZE_T InitializationParametersSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList2, ExecuteExtensionCommand) + void ( STDMETHODCALLTYPE *ExecuteExtensionCommand )( + ID3D12VideoProcessCommandList2 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes); + + END_INTERFACE + } ID3D12VideoProcessCommandList2Vtbl; + + interface ID3D12VideoProcessCommandList2 + { + CONST_VTBL struct ID3D12VideoProcessCommandList2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoProcessCommandList2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoProcessCommandList2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoProcessCommandList2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoProcessCommandList2_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoProcessCommandList2_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoProcessCommandList2_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoProcessCommandList2_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoProcessCommandList2_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12VideoProcessCommandList2_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12VideoProcessCommandList2_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12VideoProcessCommandList2_Reset(This,pAllocator) \ + ( (This)->lpVtbl -> Reset(This,pAllocator) ) + +#define ID3D12VideoProcessCommandList2_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D12VideoProcessCommandList2_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12VideoProcessCommandList2_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12VideoProcessCommandList2_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoProcessCommandList2_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoProcessCommandList2_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12VideoProcessCommandList2_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12VideoProcessCommandList2_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12VideoProcessCommandList2_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12VideoProcessCommandList2_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12VideoProcessCommandList2_ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) \ + ( (This)->lpVtbl -> ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) ) + +#define ID3D12VideoProcessCommandList2_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + + +#define ID3D12VideoProcessCommandList2_ProcessFrames1(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) \ + ( (This)->lpVtbl -> ProcessFrames1(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) ) + + +#define ID3D12VideoProcessCommandList2_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + +#define ID3D12VideoProcessCommandList2_InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) \ + ( (This)->lpVtbl -> InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) ) + +#define ID3D12VideoProcessCommandList2_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoProcessCommandList2_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoProcessCommandList3_INTERFACE_DEFINED__ +#define __ID3D12VideoProcessCommandList3_INTERFACE_DEFINED__ + +/* interface ID3D12VideoProcessCommandList3 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoProcessCommandList3; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("1a0a4ca4-9f08-40ce-9558-b411fd2666ff") + ID3D12VideoProcessCommandList3 : public ID3D12VideoProcessCommandList2 + { + public: + virtual void STDMETHODCALLTYPE Barrier( + UINT32 NumBarrierGroups, + _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoProcessCommandList3Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoProcessCommandList3 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoProcessCommandList3 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoProcessCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoProcessCommandList3 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoProcessCommandList3 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoProcessCommandList3 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoProcessCommandList3 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoProcessCommandList3 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12VideoProcessCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12VideoProcessCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12VideoProcessCommandList3 * This, + _In_ ID3D12CommandAllocator *pAllocator); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12VideoProcessCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12VideoProcessCommandList3 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12VideoProcessCommandList3 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12VideoProcessCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12VideoProcessCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12VideoProcessCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12VideoProcessCommandList3 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12VideoProcessCommandList3 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12VideoProcessCommandList3 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12VideoProcessCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ProcessFrames) + void ( STDMETHODCALLTYPE *ProcessFrames )( + ID3D12VideoProcessCommandList3 * This, + _In_ ID3D12VideoProcessor *pVideoProcessor, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + UINT NumInputStreams, + _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12VideoProcessCommandList3 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList1, ProcessFrames1) + void ( STDMETHODCALLTYPE *ProcessFrames1 )( + ID3D12VideoProcessCommandList3 * This, + _In_ ID3D12VideoProcessor *pVideoProcessor, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + UINT NumInputStreams, + _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS1 *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList2, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12VideoProcessCommandList3 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList2, InitializeExtensionCommand) + void ( STDMETHODCALLTYPE *InitializeExtensionCommand )( + ID3D12VideoProcessCommandList3 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters, + SIZE_T InitializationParametersSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList2, ExecuteExtensionCommand) + void ( STDMETHODCALLTYPE *ExecuteExtensionCommand )( + ID3D12VideoProcessCommandList3 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList3, Barrier) + void ( STDMETHODCALLTYPE *Barrier )( + ID3D12VideoProcessCommandList3 * This, + UINT32 NumBarrierGroups, + _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups); + + END_INTERFACE + } ID3D12VideoProcessCommandList3Vtbl; + + interface ID3D12VideoProcessCommandList3 + { + CONST_VTBL struct ID3D12VideoProcessCommandList3Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoProcessCommandList3_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoProcessCommandList3_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoProcessCommandList3_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoProcessCommandList3_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoProcessCommandList3_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoProcessCommandList3_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoProcessCommandList3_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoProcessCommandList3_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12VideoProcessCommandList3_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12VideoProcessCommandList3_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12VideoProcessCommandList3_Reset(This,pAllocator) \ + ( (This)->lpVtbl -> Reset(This,pAllocator) ) + +#define ID3D12VideoProcessCommandList3_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D12VideoProcessCommandList3_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12VideoProcessCommandList3_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12VideoProcessCommandList3_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoProcessCommandList3_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoProcessCommandList3_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12VideoProcessCommandList3_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12VideoProcessCommandList3_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12VideoProcessCommandList3_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12VideoProcessCommandList3_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12VideoProcessCommandList3_ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) \ + ( (This)->lpVtbl -> ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) ) + +#define ID3D12VideoProcessCommandList3_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + + +#define ID3D12VideoProcessCommandList3_ProcessFrames1(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) \ + ( (This)->lpVtbl -> ProcessFrames1(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) ) + + +#define ID3D12VideoProcessCommandList3_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + +#define ID3D12VideoProcessCommandList3_InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) \ + ( (This)->lpVtbl -> InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) ) + +#define ID3D12VideoProcessCommandList3_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) ) + + +#define ID3D12VideoProcessCommandList3_Barrier(This,NumBarrierGroups,pBarrierGroups) \ + ( (This)->lpVtbl -> Barrier(This,NumBarrierGroups,pBarrierGroups) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoProcessCommandList3_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoEncodeCommandList1_INTERFACE_DEFINED__ +#define __ID3D12VideoEncodeCommandList1_INTERFACE_DEFINED__ + +/* interface ID3D12VideoEncodeCommandList1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoEncodeCommandList1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("94971eca-2bdb-4769-88cf-3675ea757ebc") + ID3D12VideoEncodeCommandList1 : public ID3D12VideoEncodeCommandList + { + public: + virtual void STDMETHODCALLTYPE InitializeExtensionCommand( + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters, + SIZE_T InitializationParametersSizeInBytes) = 0; + + virtual void STDMETHODCALLTYPE ExecuteExtensionCommand( + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoEncodeCommandList1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoEncodeCommandList1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoEncodeCommandList1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoEncodeCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoEncodeCommandList1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoEncodeCommandList1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoEncodeCommandList1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoEncodeCommandList1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoEncodeCommandList1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12VideoEncodeCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12VideoEncodeCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12VideoEncodeCommandList1 * This, + _In_ ID3D12CommandAllocator *pAllocator); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12VideoEncodeCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12VideoEncodeCommandList1 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12VideoEncodeCommandList1 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12VideoEncodeCommandList1 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12VideoEncodeCommandList1 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12VideoEncodeCommandList1 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12VideoEncodeCommandList1 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12VideoEncodeCommandList1 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12VideoEncodeCommandList1 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12VideoEncodeCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EstimateMotion) + void ( STDMETHODCALLTYPE *EstimateMotion )( + ID3D12VideoEncodeCommandList1 * This, + _In_ ID3D12VideoMotionEstimator *pMotionEstimator, + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT *pOutputArguments, + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_INPUT *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResolveMotionVectorHeap) + void ( STDMETHODCALLTYPE *ResolveMotionVectorHeap )( + ID3D12VideoEncodeCommandList1 * This, + const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT *pOutputArguments, + const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12VideoEncodeCommandList1 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12VideoEncodeCommandList1 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList1, InitializeExtensionCommand) + void ( STDMETHODCALLTYPE *InitializeExtensionCommand )( + ID3D12VideoEncodeCommandList1 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters, + SIZE_T InitializationParametersSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList1, ExecuteExtensionCommand) + void ( STDMETHODCALLTYPE *ExecuteExtensionCommand )( + ID3D12VideoEncodeCommandList1 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes); + + END_INTERFACE + } ID3D12VideoEncodeCommandList1Vtbl; + + interface ID3D12VideoEncodeCommandList1 + { + CONST_VTBL struct ID3D12VideoEncodeCommandList1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoEncodeCommandList1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoEncodeCommandList1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoEncodeCommandList1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoEncodeCommandList1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoEncodeCommandList1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoEncodeCommandList1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoEncodeCommandList1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoEncodeCommandList1_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12VideoEncodeCommandList1_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12VideoEncodeCommandList1_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12VideoEncodeCommandList1_Reset(This,pAllocator) \ + ( (This)->lpVtbl -> Reset(This,pAllocator) ) + +#define ID3D12VideoEncodeCommandList1_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D12VideoEncodeCommandList1_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12VideoEncodeCommandList1_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12VideoEncodeCommandList1_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoEncodeCommandList1_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoEncodeCommandList1_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12VideoEncodeCommandList1_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12VideoEncodeCommandList1_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12VideoEncodeCommandList1_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12VideoEncodeCommandList1_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12VideoEncodeCommandList1_EstimateMotion(This,pMotionEstimator,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> EstimateMotion(This,pMotionEstimator,pOutputArguments,pInputArguments) ) + +#define ID3D12VideoEncodeCommandList1_ResolveMotionVectorHeap(This,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> ResolveMotionVectorHeap(This,pOutputArguments,pInputArguments) ) + +#define ID3D12VideoEncodeCommandList1_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + +#define ID3D12VideoEncodeCommandList1_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + + +#define ID3D12VideoEncodeCommandList1_InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) \ + ( (This)->lpVtbl -> InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) ) + +#define ID3D12VideoEncodeCommandList1_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoEncodeCommandList1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12video_0000_0022 */ +/* [local] */ + +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG2, 0xee27417f, 0x5e28, 0x4e65, 0xbe, 0xea, 0x1d, 0x26, 0xb5, 0x08, 0xad, 0xc9); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG1_AND_MPEG2, 0x86695f12, 0x340e, 0x4f04, 0x9f, 0xd3, 0x92, 0x53, 0xdd, 0x32, 0x74, 0x60); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264, 0x1b81be68, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264_STEREO_PROGRESSIVE, 0xd79be8da, 0x0cf1, 0x4c81, 0xb8, 0x2a, 0x69, 0xa4, 0xe2, 0x36, 0xf4, 0x3d); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264_STEREO, 0xf9aaccbb, 0xc2b6, 0x4cfc, 0x87, 0x79, 0x57, 0x07, 0xb1, 0x76, 0x05, 0x52); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264_MULTIVIEW, 0x705b9d82, 0x76cf, 0x49d6, 0xb7, 0xe6, 0xac, 0x88, 0x72, 0xdb, 0x01, 0x3c); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VC1, 0x1b81beA3, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VC1_D2010, 0x1b81beA4, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG4PT2_SIMPLE, 0xefd64d74, 0xc9e8,0x41d7,0xa5,0xe9,0xe9,0xb0,0xe3,0x9f,0xa3,0x19); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG4PT2_ADVSIMPLE_NOGMC, 0xed418a9f, 0x010d, 0x4eda, 0x9a, 0xe3, 0x9a, 0x65, 0x35, 0x8d, 0x8d, 0x2e); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN, 0x5b11d51b, 0x2f4c, 0x4452, 0xbc, 0xc3, 0x09, 0xf2, 0xa1, 0x16, 0x0c, 0xc0); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN10, 0x107af0e0, 0xef1a, 0x4d19, 0xab, 0xa8, 0x67, 0xa1, 0x63, 0x07, 0x3d, 0x13); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP9, 0x463707f8, 0xa1d0, 0x4585, 0x87, 0x6d, 0x83, 0xaa, 0x6d, 0x60, 0xb8, 0x9e); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP9_10BIT_PROFILE2, 0xa4c749ef, 0x6ecf, 0x48aa, 0x84, 0x48, 0x50, 0xa7, 0xa1, 0x16, 0x5f, 0xf7); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP8, 0x90b899ea, 0x3a62, 0x4705, 0x88, 0xb3, 0x8d, 0xf0, 0x4b, 0x27, 0x44, 0xe7); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE0, 0xb8be4ccb, 0xcf53, 0x46ba, 0x8d, 0x59, 0xd6, 0xb8, 0xa6, 0xda, 0x5d, 0x2a); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE1, 0x6936ff0f, 0x45b1, 0x4163, 0x9c, 0xc1, 0x64, 0x6e, 0xf6, 0x94, 0x61, 0x08); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE2, 0x0c5f2aa1, 0xe541, 0x4089, 0xbb, 0x7b, 0x98, 0x11, 0x0a, 0x19, 0xd7, 0xc8); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_12BIT_PROFILE2, 0x17127009, 0xa00f, 0x4ce1, 0x99, 0x4e, 0xbf, 0x40, 0x81, 0xf6, 0xf3, 0xf0); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_12BIT_PROFILE2_420, 0x2d80bed6, 0x9cac, 0x4835, 0x9e, 0x91, 0x32, 0x7b, 0xbc, 0x4f, 0x9e, 0xe8); +typedef +enum D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE + { + D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE_ABSOLUTE_QP_MAP = 0, + D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE_CQP = 1, + D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE_CBR = 2, + D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE_VBR = 3, + D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE_QVBR = 4 + } D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE; + +typedef +enum D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS + { + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_DELTA_QP = 0x1, + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_FRAME_ANALYSIS = 0x2, + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_QP_RANGE = 0x4, + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_INITIAL_QP = 0x8, + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_MAX_FRAME_SIZE = 0x10, + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_VBV_SIZES = 0x20 + } D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS); +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP + { + UINT ConstantQP_FullIntracodedFrame; + UINT ConstantQP_InterPredictedFrame_PrevRefOnly; + UINT ConstantQP_InterPredictedFrame_BiDirectionalRef; + } D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP; + +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR + { + UINT InitialQP; + UINT MinQP; + UINT MaxQP; + UINT64 MaxFrameBitSize; + UINT64 TargetBitRate; + UINT64 VBVCapacity; + UINT64 InitialVBVFullness; + } D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR; + +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR + { + UINT InitialQP; + UINT MinQP; + UINT MaxQP; + UINT64 MaxFrameBitSize; + UINT64 TargetAvgBitRate; + UINT64 PeakBitRate; + UINT64 VBVCapacity; + UINT64 InitialVBVFullness; + } D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR; + +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR + { + UINT InitialQP; + UINT MinQP; + UINT MaxQP; + UINT64 MaxFrameBitSize; + UINT64 TargetAvgBitRate; + UINT64 PeakBitRate; + UINT ConstantQualityTarget; + } D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR; + +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS + { + UINT DataSize; + union + { + const D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP *pConfiguration_CQP; + const D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR *pConfiguration_CBR; + const D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR *pConfiguration_VBR; + const D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR *pConfiguration_QVBR; + } ; + } D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS; + +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL + { + D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE Mode; + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS Flags; + D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS ConfigParams; + DXGI_RATIONAL TargetFrameRate; + } D3D12_VIDEO_ENCODER_RATE_CONTROL; + +typedef +enum D3D12_VIDEO_ENCODER_CODEC + { + D3D12_VIDEO_ENCODER_CODEC_H264 = 0, + D3D12_VIDEO_ENCODER_CODEC_HEVC = 1 + } D3D12_VIDEO_ENCODER_CODEC; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC + { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + BOOL IsSupported; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC; + +typedef +enum D3D12_VIDEO_ENCODER_PROFILE_H264 + { + D3D12_VIDEO_ENCODER_PROFILE_H264_MAIN = 0, + D3D12_VIDEO_ENCODER_PROFILE_H264_HIGH = 1, + D3D12_VIDEO_ENCODER_PROFILE_H264_HIGH_10 = 2 + } D3D12_VIDEO_ENCODER_PROFILE_H264; + +typedef +enum D3D12_VIDEO_ENCODER_PROFILE_HEVC + { + D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN = 0, + D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN10 = 1 + } D3D12_VIDEO_ENCODER_PROFILE_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_PROFILE_DESC + { + UINT DataSize; + union + { + D3D12_VIDEO_ENCODER_PROFILE_H264 *pH264Profile; + D3D12_VIDEO_ENCODER_PROFILE_HEVC *pHEVCProfile; + } ; + } D3D12_VIDEO_ENCODER_PROFILE_DESC; + +typedef +enum D3D12_VIDEO_ENCODER_LEVELS_H264 + { + D3D12_VIDEO_ENCODER_LEVELS_H264_1 = 0, + D3D12_VIDEO_ENCODER_LEVELS_H264_1b = 1, + D3D12_VIDEO_ENCODER_LEVELS_H264_11 = 2, + D3D12_VIDEO_ENCODER_LEVELS_H264_12 = 3, + D3D12_VIDEO_ENCODER_LEVELS_H264_13 = 4, + D3D12_VIDEO_ENCODER_LEVELS_H264_2 = 5, + D3D12_VIDEO_ENCODER_LEVELS_H264_21 = 6, + D3D12_VIDEO_ENCODER_LEVELS_H264_22 = 7, + D3D12_VIDEO_ENCODER_LEVELS_H264_3 = 8, + D3D12_VIDEO_ENCODER_LEVELS_H264_31 = 9, + D3D12_VIDEO_ENCODER_LEVELS_H264_32 = 10, + D3D12_VIDEO_ENCODER_LEVELS_H264_4 = 11, + D3D12_VIDEO_ENCODER_LEVELS_H264_41 = 12, + D3D12_VIDEO_ENCODER_LEVELS_H264_42 = 13, + D3D12_VIDEO_ENCODER_LEVELS_H264_5 = 14, + D3D12_VIDEO_ENCODER_LEVELS_H264_51 = 15, + D3D12_VIDEO_ENCODER_LEVELS_H264_52 = 16, + D3D12_VIDEO_ENCODER_LEVELS_H264_6 = 17, + D3D12_VIDEO_ENCODER_LEVELS_H264_61 = 18, + D3D12_VIDEO_ENCODER_LEVELS_H264_62 = 19 + } D3D12_VIDEO_ENCODER_LEVELS_H264; + +typedef +enum D3D12_VIDEO_ENCODER_TIER_HEVC + { + D3D12_VIDEO_ENCODER_TIER_HEVC_MAIN = 0, + D3D12_VIDEO_ENCODER_TIER_HEVC_HIGH = 1 + } D3D12_VIDEO_ENCODER_TIER_HEVC; + +typedef +enum D3D12_VIDEO_ENCODER_LEVELS_HEVC + { + D3D12_VIDEO_ENCODER_LEVELS_HEVC_1 = 0, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_2 = 1, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_21 = 2, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_3 = 3, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_31 = 4, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_4 = 5, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_41 = 6, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_5 = 7, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_51 = 8, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_52 = 9, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_6 = 10, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_61 = 11, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_62 = 12 + } D3D12_VIDEO_ENCODER_LEVELS_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_LEVEL_TIER_CONSTRAINTS_HEVC + { + D3D12_VIDEO_ENCODER_LEVELS_HEVC Level; + D3D12_VIDEO_ENCODER_TIER_HEVC Tier; + } D3D12_VIDEO_ENCODER_LEVEL_TIER_CONSTRAINTS_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_LEVEL_SETTING + { + UINT DataSize; + union + { + D3D12_VIDEO_ENCODER_LEVELS_H264 *pH264LevelSetting; + D3D12_VIDEO_ENCODER_LEVEL_TIER_CONSTRAINTS_HEVC *pHEVCLevelSetting; + } ; + } D3D12_VIDEO_ENCODER_LEVEL_SETTING; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_PROFILE_LEVEL + { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + D3D12_VIDEO_ENCODER_PROFILE_DESC Profile; + BOOL IsSupported; + D3D12_VIDEO_ENCODER_LEVEL_SETTING MinSupportedLevel; + D3D12_VIDEO_ENCODER_LEVEL_SETTING MaxSupportedLevel; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_PROFILE_LEVEL; + +typedef struct D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC + { + UINT Width; + UINT Height; + } D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC; + +typedef struct D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_RATIO_DESC + { + UINT WidthRatio; + UINT HeightRatio; + } D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_RATIO_DESC; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION_RATIOS_COUNT + { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + UINT ResolutionRatiosCount; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION_RATIOS_COUNT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION + { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + UINT ResolutionRatiosCount; + BOOL IsSupported; + D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC MinResolutionSupported; + D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC MaxResolutionSupported; + UINT ResolutionWidthMultipleRequirement; + UINT ResolutionHeightMultipleRequirement; + _Field_size_full_(ResolutionRatiosCount) D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_RATIO_DESC *pResolutionRatios; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_INPUT_FORMAT + { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + D3D12_VIDEO_ENCODER_PROFILE_DESC Profile; + DXGI_FORMAT Format; + BOOL IsSupported; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_INPUT_FORMAT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_RATE_CONTROL_MODE + { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE RateControlMode; + BOOL IsSupported; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_RATE_CONTROL_MODE; + +typedef +enum D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE + { + D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE_NONE = 0, + D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE_ROW_BASED = 1 + } D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_INTRA_REFRESH_MODE + { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + D3D12_VIDEO_ENCODER_PROFILE_DESC Profile; + D3D12_VIDEO_ENCODER_LEVEL_SETTING Level; + D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE IntraRefreshMode; + BOOL IsSupported; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_INTRA_REFRESH_MODE; + +typedef +enum D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE + { + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_FULL_FRAME = 0, + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_BYTES_PER_SUBREGION = 1, + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_SQUARE_UNITS_PER_SUBREGION_ROW_UNALIGNED = 2, + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_PARTITIONING_ROWS_PER_SUBREGION = 3, + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_PARTITIONING_SUBREGIONS_PER_FRAME = 4 + } D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE + { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + D3D12_VIDEO_ENCODER_PROFILE_DESC Profile; + D3D12_VIDEO_ENCODER_LEVEL_SETTING Level; + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE SubregionMode; + BOOL IsSupported; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE; + +typedef +enum D3D12_VIDEO_ENCODER_HEAP_FLAGS + { + D3D12_VIDEO_ENCODER_HEAP_FLAG_NONE = 0 + } D3D12_VIDEO_ENCODER_HEAP_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_HEAP_FLAGS); +typedef struct D3D12_VIDEO_ENCODER_HEAP_DESC + { + UINT NodeMask; + D3D12_VIDEO_ENCODER_HEAP_FLAGS Flags; + D3D12_VIDEO_ENCODER_CODEC EncodeCodec; + D3D12_VIDEO_ENCODER_PROFILE_DESC EncodeProfile; + D3D12_VIDEO_ENCODER_LEVEL_SETTING EncodeLevel; + UINT ResolutionsListCount; + _Field_size_full_(ResolutionsListCount) const D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC *pResolutionList; + } D3D12_VIDEO_ENCODER_HEAP_DESC; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_HEAP_SIZE + { + D3D12_VIDEO_ENCODER_HEAP_DESC HeapDesc; + BOOL IsSupported; + UINT64 MemoryPoolL0Size; + UINT64 MemoryPoolL1Size; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_HEAP_SIZE; + +typedef +enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAGS + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_CABAC_ENCODING_SUPPORT = 0x1, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_INTRA_SLICE_CONSTRAINED_ENCODING_SUPPORT = 0x2, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_BFRAME_LTR_COMBINED_SUPPORT = 0x4, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_ADAPTIVE_8x8_TRANSFORM_ENCODING_SUPPORT = 0x8, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_DIRECT_SPATIAL_ENCODING_SUPPORT = 0x10, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_DIRECT_TEMPORAL_ENCODING_SUPPORT = 0x20, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_CONSTRAINED_INTRAPREDICTION_SUPPORT = 0x40 + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAGS); +typedef +enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODES + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_0_ALL_LUMA_CHROMA_SLICE_BLOCK_EDGES_ALWAYS_FILTERED = 0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_1_DISABLE_ALL_SLICE_BLOCK_EDGES = 1, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_2_DISABLE_SLICE_BOUNDARIES_BLOCKS = 2, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_3_USE_TWO_STAGE_DEBLOCKING = 3, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_4_DISABLE_CHROMA_BLOCK_EDGES = 4, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_5_DISABLE_CHROMA_BLOCK_EDGES_AND_LUMA_BOUNDARIES = 5, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_6_DISABLE_CHROMA_BLOCK_EDGES_AND_USE_LUMA_TWO_STAGE_DEBLOCKING = 6 + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODES; + +typedef +enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAGS + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_0_ALL_LUMA_CHROMA_SLICE_BLOCK_EDGES_ALWAYS_FILTERED = ( 1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_0_ALL_LUMA_CHROMA_SLICE_BLOCK_EDGES_ALWAYS_FILTERED ) , + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_1_DISABLE_ALL_SLICE_BLOCK_EDGES = ( 1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_1_DISABLE_ALL_SLICE_BLOCK_EDGES ) , + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_2_DISABLE_SLICE_BOUNDARIES_BLOCKS = ( 1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_2_DISABLE_SLICE_BOUNDARIES_BLOCKS ) , + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_3_USE_TWO_STAGE_DEBLOCKING = ( 1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_3_USE_TWO_STAGE_DEBLOCKING ) , + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_4_DISABLE_CHROMA_BLOCK_EDGES = ( 1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_4_DISABLE_CHROMA_BLOCK_EDGES ) , + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_5_DISABLE_CHROMA_BLOCK_EDGES_AND_LUMA_BOUNDARIES = ( 1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_5_DISABLE_CHROMA_BLOCK_EDGES_AND_LUMA_BOUNDARIES ) , + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_6_DISABLE_CHROMA_BLOCK_EDGES_AND_USE_LUMA_TWO_STAGE_DEBLOCKING = ( 1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_6_DISABLE_CHROMA_BLOCK_EDGES_AND_USE_LUMA_TWO_STAGE_DEBLOCKING ) + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAGS); +typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264 + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAGS SupportFlags; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAGS DisableDeblockingFilterSupportedModes; + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264; + +typedef +enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_BFRAME_LTR_COMBINED_SUPPORT = 0x1, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_INTRA_SLICE_CONSTRAINED_ENCODING_SUPPORT = 0x2, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_CONSTRAINED_INTRAPREDICTION_SUPPORT = 0x4, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_SAO_FILTER_SUPPORT = 0x8, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_ASYMETRIC_MOTION_PARTITION_SUPPORT = 0x10, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_ASYMETRIC_MOTION_PARTITION_REQUIRED = 0x20, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_TRANSFORM_SKIP_SUPPORT = 0x40, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_DISABLING_LOOP_FILTER_ACROSS_SLICES_SUPPORT = 0x80, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_P_FRAMES_IMPLEMENTED_AS_LOW_DELAY_B_FRAMES = 0x100 + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS); +typedef +enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE_8x8 = 0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE_16x16 = 1, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE_32x32 = 2, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE_64x64 = 3 + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE; + +typedef +enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE_4x4 = 0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE_8x8 = 1, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE_16x16 = 2, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE_32x32 = 3 + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS SupportFlags; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE MinLumaCodingUnitSize; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE MaxLumaCodingUnitSize; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE MinLumaTransformUnitSize; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE MaxLumaTransformUnitSize; + UCHAR max_transform_hierarchy_depth_inter; + UCHAR max_transform_hierarchy_depth_intra; + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT + { + UINT DataSize; + union + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264 *pH264Support; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC *pHEVCSupport; + } ; + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT + { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + D3D12_VIDEO_ENCODER_PROFILE_DESC Profile; + BOOL IsSupported; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT CodecSupportLimits; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_H264 + { + UINT MaxL0ReferencesForP; + UINT MaxL0ReferencesForB; + UINT MaxL1ReferencesForB; + UINT MaxLongTermReferences; + UINT MaxDPBCapacity; + } D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_H264; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_HEVC + { + UINT MaxL0ReferencesForP; + UINT MaxL0ReferencesForB; + UINT MaxL1ReferencesForB; + UINT MaxLongTermReferences; + UINT MaxDPBCapacity; + } D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT + { + UINT DataSize; + union + { + D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_H264 *pH264Support; + D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_HEVC *pHEVCSupport; + } ; + } D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT + { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + D3D12_VIDEO_ENCODER_PROFILE_DESC Profile; + BOOL IsSupported; + D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT PictureSupport; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT; + +typedef +enum D3D12_VIDEO_ENCODER_SUPPORT_FLAGS + { + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_GENERAL_SUPPORT_OK = 0x1, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_RECONFIGURATION_AVAILABLE = 0x2, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RESOLUTION_RECONFIGURATION_AVAILABLE = 0x4, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_VBV_SIZE_CONFIG_AVAILABLE = 0x8, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_FRAME_ANALYSIS_AVAILABLE = 0x10, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RECONSTRUCTED_FRAMES_REQUIRE_TEXTURE_ARRAYS = 0x20, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_DELTA_QP_AVAILABLE = 0x40, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_SUBREGION_LAYOUT_RECONFIGURATION_AVAILABLE = 0x80, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_ADJUSTABLE_QP_RANGE_AVAILABLE = 0x100, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_INITIAL_QP_AVAILABLE = 0x200, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_MAX_FRAME_SIZE_AVAILABLE = 0x400, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_SEQUENCE_GOP_RECONFIGURATION_AVAILABLE = 0x800, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_MOTION_ESTIMATION_PRECISION_MODE_LIMIT_AVAILABLE = 0x1000 + } D3D12_VIDEO_ENCODER_SUPPORT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_SUPPORT_FLAGS); +typedef +enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAGS + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_USE_CONSTRAINED_INTRAPREDICTION = 0x1, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_USE_ADAPTIVE_8x8_TRANSFORM = 0x2, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_ENABLE_CABAC_ENCODING = 0x4, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_ALLOW_REQUEST_INTRA_CONSTRAINED_SLICES = 0x8 + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAGS); +typedef +enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES_DISABLED = 0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES_TEMPORAL = 1, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES_SPATIAL = 2 + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264 + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAGS ConfigurationFlags; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES DirectModeConfig; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODES DisableDeblockingFilterConfig; + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264; + +typedef +enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAGS + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_DISABLE_LOOP_FILTER_ACROSS_SLICES = 0x1, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_ALLOW_REQUEST_INTRA_CONSTRAINED_SLICES = 0x2, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_ENABLE_SAO_FILTER = 0x4, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_ENABLE_LONG_TERM_REFERENCES = 0x8, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_USE_ASYMETRIC_MOTION_PARTITION = 0x10, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_ENABLE_TRANSFORM_SKIPPING = 0x20, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_USE_CONSTRAINED_INTRAPREDICTION = 0x40 + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAGS); +typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAGS ConfigurationFlags; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE MinLumaCodingUnitSize; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE MaxLumaCodingUnitSize; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE MinLumaTransformUnitSize; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE MaxLumaTransformUnitSize; + UCHAR max_transform_hierarchy_depth_inter; + UCHAR max_transform_hierarchy_depth_intra; + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION + { + UINT DataSize; + union + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264 *pH264Config; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC *pHEVCConfig; + } ; + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION; + +typedef struct D3D12_VIDEO_ENCODER_INTRA_REFRESH + { + D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE Mode; + UINT IntraRefreshDuration; + } D3D12_VIDEO_ENCODER_INTRA_REFRESH; + +typedef +enum D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE + { + D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_MAXIMUM = 0, + D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_FULL_PIXEL = 1, + D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_HALF_PIXEL = 2, + D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_QUARTER_PIXEL = 3 + } D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS + { + UINT MaxSubregionsNumber; + UINT MaxIntraRefreshFrameDuration; + UINT SubregionBlockPixelsSize; + UINT QPMapRegionPixelsSize; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS; + +typedef +enum D3D12_VIDEO_ENCODER_VALIDATION_FLAGS + { + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_CODEC_NOT_SUPPORTED = 0x1, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_INPUT_FORMAT_NOT_SUPPORTED = 0x8, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_CODEC_CONFIGURATION_NOT_SUPPORTED = 0x10, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_RATE_CONTROL_MODE_NOT_SUPPORTED = 0x20, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_RATE_CONTROL_CONFIGURATION_NOT_SUPPORTED = 0x40, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_INTRA_REFRESH_MODE_NOT_SUPPORTED = 0x80, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_SUBREGION_LAYOUT_MODE_NOT_SUPPORTED = 0x100, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_RESOLUTION_NOT_SUPPORTED_IN_LIST = 0x200, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_GOP_STRUCTURE_NOT_SUPPORTED = 0x800 + } D3D12_VIDEO_ENCODER_VALIDATION_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_VALIDATION_FLAGS); +typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264 + { + UINT GOPLength; + UINT PPicturePeriod; + UCHAR pic_order_cnt_type; + UCHAR log2_max_frame_num_minus4; + UCHAR log2_max_pic_order_cnt_lsb_minus4; + } D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264; + +typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_HEVC + { + UINT GOPLength; + UINT PPicturePeriod; + UCHAR log2_max_pic_order_cnt_lsb_minus4; + } D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE + { + UINT DataSize; + union + { + D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264 *pH264GroupOfPictures; + D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_HEVC *pHEVCGroupOfPictures; + } ; + } D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT + { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + DXGI_FORMAT InputFormat; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION CodecConfiguration; + D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE CodecGopSequence; + D3D12_VIDEO_ENCODER_RATE_CONTROL RateControl; + D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE IntraRefresh; + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE SubregionFrameEncoding; + UINT ResolutionsListCount; + const D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC *pResolutionList; + UINT MaxReferenceFramesInDPB; + D3D12_VIDEO_ENCODER_VALIDATION_FLAGS ValidationFlags; + D3D12_VIDEO_ENCODER_SUPPORT_FLAGS SupportFlags; + D3D12_VIDEO_ENCODER_PROFILE_DESC SuggestedProfile; + D3D12_VIDEO_ENCODER_LEVEL_SETTING SuggestedLevel; + _Field_size_full_(ResolutionsListCount) D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS *pResolutionDependentSupport; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOURCE_REQUIREMENTS + { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + D3D12_VIDEO_ENCODER_PROFILE_DESC Profile; + DXGI_FORMAT InputFormat; + D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC PictureTargetResolution; + BOOL IsSupported; + UINT CompressedBitstreamBufferAccessAlignment; + UINT EncoderMetadataBufferAccessAlignment; + UINT MaxEncoderOutputMetadataBufferSize; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOURCE_REQUIREMENTS; + +typedef +enum D3D12_VIDEO_ENCODER_FLAGS + { + D3D12_VIDEO_ENCODER_FLAG_NONE = 0 + } D3D12_VIDEO_ENCODER_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_FLAGS); +typedef struct D3D12_VIDEO_ENCODER_DESC + { + UINT NodeMask; + D3D12_VIDEO_ENCODER_FLAGS Flags; + D3D12_VIDEO_ENCODER_CODEC EncodeCodec; + D3D12_VIDEO_ENCODER_PROFILE_DESC EncodeProfile; + DXGI_FORMAT InputFormat; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION CodecConfiguration; + D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE MaxMotionEstimationPrecision; + } D3D12_VIDEO_ENCODER_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0022_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0022_v0_0_s_ifspec; + +#ifndef __ID3D12VideoEncoder_INTERFACE_DEFINED__ +#define __ID3D12VideoEncoder_INTERFACE_DEFINED__ + +/* interface ID3D12VideoEncoder */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoEncoder; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2E0D212D-8DF9-44A6-A770-BB289B182737") + ID3D12VideoEncoder : public ID3D12Pageable + { + public: + virtual UINT STDMETHODCALLTYPE GetNodeMask( void) = 0; + + virtual D3D12_VIDEO_ENCODER_FLAGS STDMETHODCALLTYPE GetEncoderFlags( void) = 0; + + virtual D3D12_VIDEO_ENCODER_CODEC STDMETHODCALLTYPE GetCodec( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetCodecProfile( + _Inout_ D3D12_VIDEO_ENCODER_PROFILE_DESC dstProfile) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetCodecConfiguration( + _Inout_ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION dstCodecConfig) = 0; + + virtual DXGI_FORMAT STDMETHODCALLTYPE GetInputFormat( void) = 0; + + virtual D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE STDMETHODCALLTYPE GetMaxMotionEstimationPrecision( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoEncoderVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoEncoder * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoEncoder * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoEncoder * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoEncoder * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoEncoder * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoEncoder * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoEncoder * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoEncoder * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoder, GetNodeMask) + UINT ( STDMETHODCALLTYPE *GetNodeMask )( + ID3D12VideoEncoder * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoder, GetEncoderFlags) + D3D12_VIDEO_ENCODER_FLAGS ( STDMETHODCALLTYPE *GetEncoderFlags )( + ID3D12VideoEncoder * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoder, GetCodec) + D3D12_VIDEO_ENCODER_CODEC ( STDMETHODCALLTYPE *GetCodec )( + ID3D12VideoEncoder * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoder, GetCodecProfile) + HRESULT ( STDMETHODCALLTYPE *GetCodecProfile )( + ID3D12VideoEncoder * This, + _Inout_ D3D12_VIDEO_ENCODER_PROFILE_DESC dstProfile); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoder, GetCodecConfiguration) + HRESULT ( STDMETHODCALLTYPE *GetCodecConfiguration )( + ID3D12VideoEncoder * This, + _Inout_ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION dstCodecConfig); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoder, GetInputFormat) + DXGI_FORMAT ( STDMETHODCALLTYPE *GetInputFormat )( + ID3D12VideoEncoder * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoder, GetMaxMotionEstimationPrecision) + D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE ( STDMETHODCALLTYPE *GetMaxMotionEstimationPrecision )( + ID3D12VideoEncoder * This); + + END_INTERFACE + } ID3D12VideoEncoderVtbl; + + interface ID3D12VideoEncoder + { + CONST_VTBL struct ID3D12VideoEncoderVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoEncoder_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoEncoder_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoEncoder_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoEncoder_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoEncoder_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoEncoder_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoEncoder_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoEncoder_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#define ID3D12VideoEncoder_GetNodeMask(This) \ + ( (This)->lpVtbl -> GetNodeMask(This) ) + +#define ID3D12VideoEncoder_GetEncoderFlags(This) \ + ( (This)->lpVtbl -> GetEncoderFlags(This) ) + +#define ID3D12VideoEncoder_GetCodec(This) \ + ( (This)->lpVtbl -> GetCodec(This) ) + +#define ID3D12VideoEncoder_GetCodecProfile(This,dstProfile) \ + ( (This)->lpVtbl -> GetCodecProfile(This,dstProfile) ) + +#define ID3D12VideoEncoder_GetCodecConfiguration(This,dstCodecConfig) \ + ( (This)->lpVtbl -> GetCodecConfiguration(This,dstCodecConfig) ) + +#define ID3D12VideoEncoder_GetInputFormat(This) \ + ( (This)->lpVtbl -> GetInputFormat(This) ) + +#define ID3D12VideoEncoder_GetMaxMotionEstimationPrecision(This) \ + ( (This)->lpVtbl -> GetMaxMotionEstimationPrecision(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoEncoder_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoEncoderHeap_INTERFACE_DEFINED__ +#define __ID3D12VideoEncoderHeap_INTERFACE_DEFINED__ + +/* interface ID3D12VideoEncoderHeap */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoEncoderHeap; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("22B35D96-876A-44C0-B25E-FB8C9C7F1C4A") + ID3D12VideoEncoderHeap : public ID3D12Pageable + { + public: + virtual UINT STDMETHODCALLTYPE GetNodeMask( void) = 0; + + virtual D3D12_VIDEO_ENCODER_HEAP_FLAGS STDMETHODCALLTYPE GetEncoderHeapFlags( void) = 0; + + virtual D3D12_VIDEO_ENCODER_CODEC STDMETHODCALLTYPE GetCodec( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetCodecProfile( + _Inout_ D3D12_VIDEO_ENCODER_PROFILE_DESC dstProfile) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetCodecLevel( + _Inout_ D3D12_VIDEO_ENCODER_LEVEL_SETTING dstLevel) = 0; + + virtual UINT STDMETHODCALLTYPE GetResolutionListCount( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetResolutionList( + const UINT ResolutionsListCount, + _Out_writes_(ResolutionsListCount) D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC *pResolutionList) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoEncoderHeapVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoEncoderHeap * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoEncoderHeap * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoEncoderHeap * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoEncoderHeap * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoEncoderHeap * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoEncoderHeap * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoEncoderHeap * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoEncoderHeap * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoderHeap, GetNodeMask) + UINT ( STDMETHODCALLTYPE *GetNodeMask )( + ID3D12VideoEncoderHeap * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoderHeap, GetEncoderHeapFlags) + D3D12_VIDEO_ENCODER_HEAP_FLAGS ( STDMETHODCALLTYPE *GetEncoderHeapFlags )( + ID3D12VideoEncoderHeap * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoderHeap, GetCodec) + D3D12_VIDEO_ENCODER_CODEC ( STDMETHODCALLTYPE *GetCodec )( + ID3D12VideoEncoderHeap * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoderHeap, GetCodecProfile) + HRESULT ( STDMETHODCALLTYPE *GetCodecProfile )( + ID3D12VideoEncoderHeap * This, + _Inout_ D3D12_VIDEO_ENCODER_PROFILE_DESC dstProfile); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoderHeap, GetCodecLevel) + HRESULT ( STDMETHODCALLTYPE *GetCodecLevel )( + ID3D12VideoEncoderHeap * This, + _Inout_ D3D12_VIDEO_ENCODER_LEVEL_SETTING dstLevel); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoderHeap, GetResolutionListCount) + UINT ( STDMETHODCALLTYPE *GetResolutionListCount )( + ID3D12VideoEncoderHeap * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoderHeap, GetResolutionList) + HRESULT ( STDMETHODCALLTYPE *GetResolutionList )( + ID3D12VideoEncoderHeap * This, + const UINT ResolutionsListCount, + _Out_writes_(ResolutionsListCount) D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC *pResolutionList); + + END_INTERFACE + } ID3D12VideoEncoderHeapVtbl; + + interface ID3D12VideoEncoderHeap + { + CONST_VTBL struct ID3D12VideoEncoderHeapVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoEncoderHeap_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoEncoderHeap_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoEncoderHeap_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoEncoderHeap_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoEncoderHeap_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoEncoderHeap_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoEncoderHeap_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoEncoderHeap_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#define ID3D12VideoEncoderHeap_GetNodeMask(This) \ + ( (This)->lpVtbl -> GetNodeMask(This) ) + +#define ID3D12VideoEncoderHeap_GetEncoderHeapFlags(This) \ + ( (This)->lpVtbl -> GetEncoderHeapFlags(This) ) + +#define ID3D12VideoEncoderHeap_GetCodec(This) \ + ( (This)->lpVtbl -> GetCodec(This) ) + +#define ID3D12VideoEncoderHeap_GetCodecProfile(This,dstProfile) \ + ( (This)->lpVtbl -> GetCodecProfile(This,dstProfile) ) + +#define ID3D12VideoEncoderHeap_GetCodecLevel(This,dstLevel) \ + ( (This)->lpVtbl -> GetCodecLevel(This,dstLevel) ) + +#define ID3D12VideoEncoderHeap_GetResolutionListCount(This) \ + ( (This)->lpVtbl -> GetResolutionListCount(This) ) + +#define ID3D12VideoEncoderHeap_GetResolutionList(This,ResolutionsListCount,pResolutionList) \ + ( (This)->lpVtbl -> GetResolutionList(This,ResolutionsListCount,pResolutionList) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoEncoderHeap_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoDevice3_INTERFACE_DEFINED__ +#define __ID3D12VideoDevice3_INTERFACE_DEFINED__ + +/* interface ID3D12VideoDevice3 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoDevice3; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("4243ADB4-3A32-4666-973C-0CCC5625DC44") + ID3D12VideoDevice3 : public ID3D12VideoDevice2 + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateVideoEncoder( + _In_ const D3D12_VIDEO_ENCODER_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoEncoder) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateVideoEncoderHeap( + _In_ const D3D12_VIDEO_ENCODER_HEAP_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoEncoderHeap) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoDevice3Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoDevice3 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoDevice3 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoDevice3 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12VideoDevice3 * This, + D3D12_FEATURE_VIDEO FeatureVideo, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoDecoder) + HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoder )( + ID3D12VideoDevice3 * This, + _In_ const D3D12_VIDEO_DECODER_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoder); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoDecoderHeap) + HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoderHeap )( + ID3D12VideoDevice3 * This, + _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoderHeap); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoProcessor) + HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessor )( + ID3D12VideoDevice3 * This, + UINT NodeMask, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc, + UINT NumInputStreamDescs, + _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoProcessor); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice1, CreateVideoMotionEstimator) + HRESULT ( STDMETHODCALLTYPE *CreateVideoMotionEstimator )( + ID3D12VideoDevice3 * This, + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoMotionEstimator); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice1, CreateVideoMotionVectorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateVideoMotionVectorHeap )( + ID3D12VideoDevice3 * This, + _In_ const D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoMotionVectorHeap); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice2, CreateVideoDecoder1) + HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoder1 )( + ID3D12VideoDevice3 * This, + _In_ const D3D12_VIDEO_DECODER_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoder); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice2, CreateVideoDecoderHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoderHeap1 )( + ID3D12VideoDevice3 * This, + _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoderHeap); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice2, CreateVideoProcessor1) + HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessor1 )( + ID3D12VideoDevice3 * This, + UINT NodeMask, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc, + UINT NumInputStreamDescs, + _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoProcessor); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice2, CreateVideoExtensionCommand) + HRESULT ( STDMETHODCALLTYPE *CreateVideoExtensionCommand )( + ID3D12VideoDevice3 * This, + _In_ const D3D12_VIDEO_EXTENSION_COMMAND_DESC *pDesc, + _In_reads_bytes_(CreationParametersDataSizeInBytes) const void *pCreationParameters, + SIZE_T CreationParametersDataSizeInBytes, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoExtensionCommand); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice2, ExecuteExtensionCommand) + HRESULT ( STDMETHODCALLTYPE *ExecuteExtensionCommand )( + ID3D12VideoDevice3 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes, + _Out_writes_bytes_(OutputDataSizeInBytes) void *pOutputData, + SIZE_T OutputDataSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice3, CreateVideoEncoder) + HRESULT ( STDMETHODCALLTYPE *CreateVideoEncoder )( + ID3D12VideoDevice3 * This, + _In_ const D3D12_VIDEO_ENCODER_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoEncoder); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice3, CreateVideoEncoderHeap) + HRESULT ( STDMETHODCALLTYPE *CreateVideoEncoderHeap )( + ID3D12VideoDevice3 * This, + _In_ const D3D12_VIDEO_ENCODER_HEAP_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoEncoderHeap); + + END_INTERFACE + } ID3D12VideoDevice3Vtbl; + + interface ID3D12VideoDevice3 + { + CONST_VTBL struct ID3D12VideoDevice3Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoDevice3_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoDevice3_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoDevice3_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoDevice3_CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12VideoDevice3_CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) \ + ( (This)->lpVtbl -> CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) ) + +#define ID3D12VideoDevice3_CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) \ + ( (This)->lpVtbl -> CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) ) + +#define ID3D12VideoDevice3_CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) \ + ( (This)->lpVtbl -> CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) ) + + +#define ID3D12VideoDevice3_CreateVideoMotionEstimator(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionEstimator) \ + ( (This)->lpVtbl -> CreateVideoMotionEstimator(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionEstimator) ) + +#define ID3D12VideoDevice3_CreateVideoMotionVectorHeap(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionVectorHeap) \ + ( (This)->lpVtbl -> CreateVideoMotionVectorHeap(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionVectorHeap) ) + + +#define ID3D12VideoDevice3_CreateVideoDecoder1(This,pDesc,pProtectedResourceSession,riid,ppVideoDecoder) \ + ( (This)->lpVtbl -> CreateVideoDecoder1(This,pDesc,pProtectedResourceSession,riid,ppVideoDecoder) ) + +#define ID3D12VideoDevice3_CreateVideoDecoderHeap1(This,pVideoDecoderHeapDesc,pProtectedResourceSession,riid,ppVideoDecoderHeap) \ + ( (This)->lpVtbl -> CreateVideoDecoderHeap1(This,pVideoDecoderHeapDesc,pProtectedResourceSession,riid,ppVideoDecoderHeap) ) + +#define ID3D12VideoDevice3_CreateVideoProcessor1(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,pProtectedResourceSession,riid,ppVideoProcessor) \ + ( (This)->lpVtbl -> CreateVideoProcessor1(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,pProtectedResourceSession,riid,ppVideoProcessor) ) + +#define ID3D12VideoDevice3_CreateVideoExtensionCommand(This,pDesc,pCreationParameters,CreationParametersDataSizeInBytes,pProtectedResourceSession,riid,ppVideoExtensionCommand) \ + ( (This)->lpVtbl -> CreateVideoExtensionCommand(This,pDesc,pCreationParameters,CreationParametersDataSizeInBytes,pProtectedResourceSession,riid,ppVideoExtensionCommand) ) + +#define ID3D12VideoDevice3_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes,pOutputData,OutputDataSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes,pOutputData,OutputDataSizeInBytes) ) + + +#define ID3D12VideoDevice3_CreateVideoEncoder(This,pDesc,riid,ppVideoEncoder) \ + ( (This)->lpVtbl -> CreateVideoEncoder(This,pDesc,riid,ppVideoEncoder) ) + +#define ID3D12VideoDevice3_CreateVideoEncoderHeap(This,pDesc,riid,ppVideoEncoderHeap) \ + ( (This)->lpVtbl -> CreateVideoEncoderHeap(This,pDesc,riid,ppVideoEncoderHeap) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoDevice3_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12video_0000_0025 */ +/* [local] */ + +typedef +enum D3D12_VIDEO_ENCODER_FRAME_TYPE_H264 + { + D3D12_VIDEO_ENCODER_FRAME_TYPE_H264_I_FRAME = 0, + D3D12_VIDEO_ENCODER_FRAME_TYPE_H264_P_FRAME = 1, + D3D12_VIDEO_ENCODER_FRAME_TYPE_H264_B_FRAME = 2, + D3D12_VIDEO_ENCODER_FRAME_TYPE_H264_IDR_FRAME = 3 + } D3D12_VIDEO_ENCODER_FRAME_TYPE_H264; + +typedef struct D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_H264 + { + UINT ReconstructedPictureResourceIndex; + BOOL IsLongTermReference; + UINT LongTermPictureIdx; + UINT PictureOrderCountNumber; + UINT FrameDecodingOrderNumber; + UINT TemporalLayerIndex; + } D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_H264; + +typedef +enum D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS + { + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAG_REQUEST_INTRA_CONSTRAINED_SLICES = 0x1 + } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS); +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_MARKING_OPERATION + { + UCHAR memory_management_control_operation; + UINT difference_of_pic_nums_minus1; + UINT long_term_pic_num; + UINT long_term_frame_idx; + UINT max_long_term_frame_idx_plus1; + } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_MARKING_OPERATION; + +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_LIST_MODIFICATION_OPERATION + { + UCHAR modification_of_pic_nums_idc; + UINT abs_diff_pic_num_minus1; + UINT long_term_pic_num; + } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_LIST_MODIFICATION_OPERATION; + +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264 + { + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS Flags; + D3D12_VIDEO_ENCODER_FRAME_TYPE_H264 FrameType; + UINT pic_parameter_set_id; + UINT idr_pic_id; + UINT PictureOrderCountNumber; + UINT FrameDecodingOrderNumber; + UINT TemporalLayerIndex; + UINT List0ReferenceFramesCount; + _Field_size_full_(List0ReferenceFramesCount) UINT *pList0ReferenceFrames; + UINT List1ReferenceFramesCount; + _Field_size_full_(List1ReferenceFramesCount) UINT *pList1ReferenceFrames; + UINT ReferenceFramesReconPictureDescriptorsCount; + _Field_size_full_(ReferenceFramesReconPictureDescriptorsCount) D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_H264 *pReferenceFramesReconPictureDescriptors; + UCHAR adaptive_ref_pic_marking_mode_flag; + UINT RefPicMarkingOperationsCommandsCount; + _Field_size_full_(RefPicMarkingOperationsCommandsCount) D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_MARKING_OPERATION *pRefPicMarkingOperationsCommands; + UINT List0RefPicModificationsCount; + _Field_size_full_(List0RefPicModificationsCount) D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_LIST_MODIFICATION_OPERATION *pList0RefPicModifications; + UINT List1RefPicModificationsCount; + _Field_size_full_(List1RefPicModificationsCount) D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_LIST_MODIFICATION_OPERATION *pList1RefPicModifications; + UINT QPMapValuesCount; + _Field_size_full_(QPMapValuesCount) INT8 *pRateControlQPMap; + } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264; + +typedef +enum D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC + { + D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC_I_FRAME = 0, + D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC_P_FRAME = 1, + D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC_B_FRAME = 2, + D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC_IDR_FRAME = 3 + } D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_HEVC + { + UINT ReconstructedPictureResourceIndex; + BOOL IsRefUsedByCurrentPic; + BOOL IsLongTermReference; + UINT PictureOrderCountNumber; + UINT TemporalLayerIndex; + } D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_HEVC; + +typedef +enum D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS + { + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAG_REQUEST_INTRA_CONSTRAINED_SLICES = 0x1 + } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS); +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC + { + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS Flags; + D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC FrameType; + UINT slice_pic_parameter_set_id; + UINT PictureOrderCountNumber; + UINT TemporalLayerIndex; + UINT List0ReferenceFramesCount; + _Field_size_full_(List0ReferenceFramesCount) UINT *pList0ReferenceFrames; + UINT List1ReferenceFramesCount; + _Field_size_full_(List1ReferenceFramesCount) UINT *pList1ReferenceFrames; + UINT ReferenceFramesReconPictureDescriptorsCount; + _Field_size_full_(ReferenceFramesReconPictureDescriptorsCount) D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_HEVC *pReferenceFramesReconPictureDescriptors; + UINT List0RefPicModificationsCount; + _Field_size_full_(List0RefPicModificationsCount) UINT *pList0RefPicModifications; + UINT List1RefPicModificationsCount; + _Field_size_full_(List1RefPicModificationsCount) UINT *pList1RefPicModifications; + UINT QPMapValuesCount; + _Field_size_full_(QPMapValuesCount) INT8 *pRateControlQPMap; + } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA + { + UINT DataSize; + union + { + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264 *pH264PicData; + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC *pHEVCPicData; + } ; + } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA; + +typedef struct D3D12_VIDEO_ENCODE_REFERENCE_FRAMES + { + UINT NumTexture2Ds; + _Field_size_full_(NumTexture2Ds) ID3D12Resource **ppTexture2Ds; + _Field_size_full_(NumTexture2Ds) UINT *pSubresources; + } D3D12_VIDEO_ENCODE_REFERENCE_FRAMES; + +typedef +enum D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS + { + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAG_USED_AS_REFERENCE_PICTURE = 0x1 + } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS); +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC + { + UINT IntraRefreshFrameIndex; + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS Flags; + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA PictureControlCodecData; + D3D12_VIDEO_ENCODE_REFERENCE_FRAMES ReferenceFrames; + } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC; + +typedef +enum D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS + { + D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_RESOLUTION_CHANGE = 0x1, + D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_RATE_CONTROL_CHANGE = 0x2, + D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_SUBREGION_LAYOUT_CHANGE = 0x4, + D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_REQUEST_INTRA_REFRESH = 0x8, + D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_GOP_SEQUENCE_CHANGE = 0x10 + } D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS); +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES + { + union + { + UINT MaxBytesPerSlice; + UINT NumberOfCodingUnitsPerSlice; + UINT NumberOfRowsPerSlice; + UINT NumberOfSlicesPerFrame; + } ; + } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES; + +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA + { + UINT DataSize; + union + { + const D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES *pSlicesPartition_H264; + const D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES *pSlicesPartition_HEVC; + } ; + } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA; + +typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC + { + D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS Flags; + D3D12_VIDEO_ENCODER_INTRA_REFRESH IntraRefreshConfig; + D3D12_VIDEO_ENCODER_RATE_CONTROL RateControl; + D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC PictureTargetResolution; + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE SelectedLayoutMode; + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA FrameSubregionsLayoutData; + D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE CodecGopSequence; + } D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC; + +typedef struct D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS + { + D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC SequenceControlDesc; + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC PictureControlDesc; + ID3D12Resource *pInputFrame; + UINT InputFrameSubresource; + UINT CurrentFrameBitstreamMetadataSize; + } D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS; + +typedef struct D3D12_VIDEO_ENCODER_COMPRESSED_BITSTREAM + { + ID3D12Resource *pBuffer; + UINT64 FrameStartOffset; + } D3D12_VIDEO_ENCODER_COMPRESSED_BITSTREAM; + +typedef struct D3D12_VIDEO_ENCODER_RECONSTRUCTED_PICTURE + { + ID3D12Resource *pReconstructedPicture; + UINT ReconstructedPictureSubresource; + } D3D12_VIDEO_ENCODER_RECONSTRUCTED_PICTURE; + +typedef struct D3D12_VIDEO_ENCODER_FRAME_SUBREGION_METADATA + { + UINT64 bSize; + UINT64 bStartOffset; + UINT64 bHeaderSize; + } D3D12_VIDEO_ENCODER_FRAME_SUBREGION_METADATA; + +typedef +enum D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAGS + { + D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_NO_ERROR = 0, + D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_CODEC_PICTURE_CONTROL_NOT_SUPPORTED = 0x1, + D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_SUBREGION_LAYOUT_CONFIGURATION_NOT_SUPPORTED = 0x2, + D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_INVALID_REFERENCE_PICTURES = 0x4, + D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_RECONFIGURATION_REQUEST_NOT_SUPPORTED = 0x8, + D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_INVALID_METADATA_BUFFER_SOURCE = 0x10 + } D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAGS); +typedef struct D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS + { + UINT64 AverageQP; + UINT64 IntraCodingUnitsCount; + UINT64 InterCodingUnitsCount; + UINT64 SkipCodingUnitsCount; + UINT64 AverageMotionEstimationXDirection; + UINT64 AverageMotionEstimationYDirection; + } D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS; + +typedef struct D3D12_VIDEO_ENCODER_OUTPUT_METADATA + { + UINT64 EncodeErrorFlags; + D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS EncodeStats; + UINT64 EncodedBitstreamWrittenBytesCount; + UINT64 WrittenSubregionsCount; + } D3D12_VIDEO_ENCODER_OUTPUT_METADATA; + +typedef struct D3D12_VIDEO_ENCODER_ENCODE_OPERATION_METADATA_BUFFER + { + ID3D12Resource *pBuffer; + UINT64 Offset; + } D3D12_VIDEO_ENCODER_ENCODE_OPERATION_METADATA_BUFFER; + +typedef struct D3D12_VIDEO_ENCODER_RESOLVE_METADATA_INPUT_ARGUMENTS + { + D3D12_VIDEO_ENCODER_CODEC EncoderCodec; + D3D12_VIDEO_ENCODER_PROFILE_DESC EncoderProfile; + DXGI_FORMAT EncoderInputFormat; + D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC EncodedPictureEffectiveResolution; + D3D12_VIDEO_ENCODER_ENCODE_OPERATION_METADATA_BUFFER HWLayoutMetadata; + } D3D12_VIDEO_ENCODER_RESOLVE_METADATA_INPUT_ARGUMENTS; + +typedef struct D3D12_VIDEO_ENCODER_RESOLVE_METADATA_OUTPUT_ARGUMENTS + { + D3D12_VIDEO_ENCODER_ENCODE_OPERATION_METADATA_BUFFER ResolvedLayoutMetadata; + } D3D12_VIDEO_ENCODER_RESOLVE_METADATA_OUTPUT_ARGUMENTS; + +typedef struct D3D12_VIDEO_ENCODER_ENCODEFRAME_OUTPUT_ARGUMENTS + { + D3D12_VIDEO_ENCODER_COMPRESSED_BITSTREAM Bitstream; + D3D12_VIDEO_ENCODER_RECONSTRUCTED_PICTURE ReconstructedPicture; + D3D12_VIDEO_ENCODER_ENCODE_OPERATION_METADATA_BUFFER EncoderOutputMetadata; + } D3D12_VIDEO_ENCODER_ENCODEFRAME_OUTPUT_ARGUMENTS; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0025_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0025_v0_0_s_ifspec; + +#ifndef __ID3D12VideoEncodeCommandList2_INTERFACE_DEFINED__ +#define __ID3D12VideoEncodeCommandList2_INTERFACE_DEFINED__ + +/* interface ID3D12VideoEncodeCommandList2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoEncodeCommandList2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("895491e2-e701-46a9-9a1f-8d3480ed867a") + ID3D12VideoEncodeCommandList2 : public ID3D12VideoEncodeCommandList1 + { + public: + virtual void STDMETHODCALLTYPE EncodeFrame( + _In_ ID3D12VideoEncoder *pEncoder, + _In_ ID3D12VideoEncoderHeap *pHeap, + _In_ const D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS *pInputArguments, + _In_ const D3D12_VIDEO_ENCODER_ENCODEFRAME_OUTPUT_ARGUMENTS *pOutputArguments) = 0; + + virtual void STDMETHODCALLTYPE ResolveEncoderOutputMetadata( + _In_ const D3D12_VIDEO_ENCODER_RESOLVE_METADATA_INPUT_ARGUMENTS *pInputArguments, + _In_ const D3D12_VIDEO_ENCODER_RESOLVE_METADATA_OUTPUT_ARGUMENTS *pOutputArguments) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoEncodeCommandList2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoEncodeCommandList2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoEncodeCommandList2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoEncodeCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoEncodeCommandList2 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoEncodeCommandList2 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoEncodeCommandList2 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoEncodeCommandList2 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoEncodeCommandList2 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12VideoEncodeCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12VideoEncodeCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12VideoEncodeCommandList2 * This, + _In_ ID3D12CommandAllocator *pAllocator); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12VideoEncodeCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12VideoEncodeCommandList2 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12VideoEncodeCommandList2 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12VideoEncodeCommandList2 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12VideoEncodeCommandList2 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12VideoEncodeCommandList2 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12VideoEncodeCommandList2 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12VideoEncodeCommandList2 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12VideoEncodeCommandList2 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12VideoEncodeCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EstimateMotion) + void ( STDMETHODCALLTYPE *EstimateMotion )( + ID3D12VideoEncodeCommandList2 * This, + _In_ ID3D12VideoMotionEstimator *pMotionEstimator, + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT *pOutputArguments, + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_INPUT *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResolveMotionVectorHeap) + void ( STDMETHODCALLTYPE *ResolveMotionVectorHeap )( + ID3D12VideoEncodeCommandList2 * This, + const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT *pOutputArguments, + const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12VideoEncodeCommandList2 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12VideoEncodeCommandList2 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList1, InitializeExtensionCommand) + void ( STDMETHODCALLTYPE *InitializeExtensionCommand )( + ID3D12VideoEncodeCommandList2 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters, + SIZE_T InitializationParametersSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList1, ExecuteExtensionCommand) + void ( STDMETHODCALLTYPE *ExecuteExtensionCommand )( + ID3D12VideoEncodeCommandList2 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList2, EncodeFrame) + void ( STDMETHODCALLTYPE *EncodeFrame )( + ID3D12VideoEncodeCommandList2 * This, + _In_ ID3D12VideoEncoder *pEncoder, + _In_ ID3D12VideoEncoderHeap *pHeap, + _In_ const D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS *pInputArguments, + _In_ const D3D12_VIDEO_ENCODER_ENCODEFRAME_OUTPUT_ARGUMENTS *pOutputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList2, ResolveEncoderOutputMetadata) + void ( STDMETHODCALLTYPE *ResolveEncoderOutputMetadata )( + ID3D12VideoEncodeCommandList2 * This, + _In_ const D3D12_VIDEO_ENCODER_RESOLVE_METADATA_INPUT_ARGUMENTS *pInputArguments, + _In_ const D3D12_VIDEO_ENCODER_RESOLVE_METADATA_OUTPUT_ARGUMENTS *pOutputArguments); + + END_INTERFACE + } ID3D12VideoEncodeCommandList2Vtbl; + + interface ID3D12VideoEncodeCommandList2 + { + CONST_VTBL struct ID3D12VideoEncodeCommandList2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoEncodeCommandList2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoEncodeCommandList2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoEncodeCommandList2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoEncodeCommandList2_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoEncodeCommandList2_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoEncodeCommandList2_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoEncodeCommandList2_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoEncodeCommandList2_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12VideoEncodeCommandList2_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12VideoEncodeCommandList2_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12VideoEncodeCommandList2_Reset(This,pAllocator) \ + ( (This)->lpVtbl -> Reset(This,pAllocator) ) + +#define ID3D12VideoEncodeCommandList2_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D12VideoEncodeCommandList2_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12VideoEncodeCommandList2_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12VideoEncodeCommandList2_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoEncodeCommandList2_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoEncodeCommandList2_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12VideoEncodeCommandList2_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12VideoEncodeCommandList2_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12VideoEncodeCommandList2_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12VideoEncodeCommandList2_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12VideoEncodeCommandList2_EstimateMotion(This,pMotionEstimator,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> EstimateMotion(This,pMotionEstimator,pOutputArguments,pInputArguments) ) + +#define ID3D12VideoEncodeCommandList2_ResolveMotionVectorHeap(This,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> ResolveMotionVectorHeap(This,pOutputArguments,pInputArguments) ) + +#define ID3D12VideoEncodeCommandList2_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + +#define ID3D12VideoEncodeCommandList2_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + + +#define ID3D12VideoEncodeCommandList2_InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) \ + ( (This)->lpVtbl -> InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) ) + +#define ID3D12VideoEncodeCommandList2_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) ) + + +#define ID3D12VideoEncodeCommandList2_EncodeFrame(This,pEncoder,pHeap,pInputArguments,pOutputArguments) \ + ( (This)->lpVtbl -> EncodeFrame(This,pEncoder,pHeap,pInputArguments,pOutputArguments) ) + +#define ID3D12VideoEncodeCommandList2_ResolveEncoderOutputMetadata(This,pInputArguments,pOutputArguments) \ + ( (This)->lpVtbl -> ResolveEncoderOutputMetadata(This,pInputArguments,pOutputArguments) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoEncodeCommandList2_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoEncodeCommandList3_INTERFACE_DEFINED__ +#define __ID3D12VideoEncodeCommandList3_INTERFACE_DEFINED__ + +/* interface ID3D12VideoEncodeCommandList3 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoEncodeCommandList3; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("7f027b22-1515-4e85-aa0d-026486580576") + ID3D12VideoEncodeCommandList3 : public ID3D12VideoEncodeCommandList2 + { + public: + virtual void STDMETHODCALLTYPE Barrier( + UINT32 NumBarrierGroups, + _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoEncodeCommandList3Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoEncodeCommandList3 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoEncodeCommandList3 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoEncodeCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoEncodeCommandList3 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoEncodeCommandList3 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoEncodeCommandList3 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoEncodeCommandList3 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoEncodeCommandList3 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12VideoEncodeCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12VideoEncodeCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12VideoEncodeCommandList3 * This, + _In_ ID3D12CommandAllocator *pAllocator); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12VideoEncodeCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12VideoEncodeCommandList3 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12VideoEncodeCommandList3 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12VideoEncodeCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12VideoEncodeCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12VideoEncodeCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12VideoEncodeCommandList3 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12VideoEncodeCommandList3 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12VideoEncodeCommandList3 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12VideoEncodeCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EstimateMotion) + void ( STDMETHODCALLTYPE *EstimateMotion )( + ID3D12VideoEncodeCommandList3 * This, + _In_ ID3D12VideoMotionEstimator *pMotionEstimator, + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT *pOutputArguments, + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_INPUT *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResolveMotionVectorHeap) + void ( STDMETHODCALLTYPE *ResolveMotionVectorHeap )( + ID3D12VideoEncodeCommandList3 * This, + const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT *pOutputArguments, + const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12VideoEncodeCommandList3 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12VideoEncodeCommandList3 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList1, InitializeExtensionCommand) + void ( STDMETHODCALLTYPE *InitializeExtensionCommand )( + ID3D12VideoEncodeCommandList3 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters, + SIZE_T InitializationParametersSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList1, ExecuteExtensionCommand) + void ( STDMETHODCALLTYPE *ExecuteExtensionCommand )( + ID3D12VideoEncodeCommandList3 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList2, EncodeFrame) + void ( STDMETHODCALLTYPE *EncodeFrame )( + ID3D12VideoEncodeCommandList3 * This, + _In_ ID3D12VideoEncoder *pEncoder, + _In_ ID3D12VideoEncoderHeap *pHeap, + _In_ const D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS *pInputArguments, + _In_ const D3D12_VIDEO_ENCODER_ENCODEFRAME_OUTPUT_ARGUMENTS *pOutputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList2, ResolveEncoderOutputMetadata) + void ( STDMETHODCALLTYPE *ResolveEncoderOutputMetadata )( + ID3D12VideoEncodeCommandList3 * This, + _In_ const D3D12_VIDEO_ENCODER_RESOLVE_METADATA_INPUT_ARGUMENTS *pInputArguments, + _In_ const D3D12_VIDEO_ENCODER_RESOLVE_METADATA_OUTPUT_ARGUMENTS *pOutputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList3, Barrier) + void ( STDMETHODCALLTYPE *Barrier )( + ID3D12VideoEncodeCommandList3 * This, + UINT32 NumBarrierGroups, + _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups); + + END_INTERFACE + } ID3D12VideoEncodeCommandList3Vtbl; + + interface ID3D12VideoEncodeCommandList3 + { + CONST_VTBL struct ID3D12VideoEncodeCommandList3Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoEncodeCommandList3_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoEncodeCommandList3_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoEncodeCommandList3_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoEncodeCommandList3_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoEncodeCommandList3_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoEncodeCommandList3_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoEncodeCommandList3_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoEncodeCommandList3_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12VideoEncodeCommandList3_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12VideoEncodeCommandList3_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12VideoEncodeCommandList3_Reset(This,pAllocator) \ + ( (This)->lpVtbl -> Reset(This,pAllocator) ) + +#define ID3D12VideoEncodeCommandList3_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D12VideoEncodeCommandList3_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12VideoEncodeCommandList3_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12VideoEncodeCommandList3_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoEncodeCommandList3_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoEncodeCommandList3_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12VideoEncodeCommandList3_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12VideoEncodeCommandList3_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12VideoEncodeCommandList3_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12VideoEncodeCommandList3_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12VideoEncodeCommandList3_EstimateMotion(This,pMotionEstimator,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> EstimateMotion(This,pMotionEstimator,pOutputArguments,pInputArguments) ) + +#define ID3D12VideoEncodeCommandList3_ResolveMotionVectorHeap(This,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> ResolveMotionVectorHeap(This,pOutputArguments,pInputArguments) ) + +#define ID3D12VideoEncodeCommandList3_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + +#define ID3D12VideoEncodeCommandList3_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + + +#define ID3D12VideoEncodeCommandList3_InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) \ + ( (This)->lpVtbl -> InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) ) + +#define ID3D12VideoEncodeCommandList3_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) ) + + +#define ID3D12VideoEncodeCommandList3_EncodeFrame(This,pEncoder,pHeap,pInputArguments,pOutputArguments) \ + ( (This)->lpVtbl -> EncodeFrame(This,pEncoder,pHeap,pInputArguments,pOutputArguments) ) + +#define ID3D12VideoEncodeCommandList3_ResolveEncoderOutputMetadata(This,pInputArguments,pOutputArguments) \ + ( (This)->lpVtbl -> ResolveEncoderOutputMetadata(This,pInputArguments,pOutputArguments) ) + + +#define ID3D12VideoEncodeCommandList3_Barrier(This,NumBarrierGroups,pBarrierGroups) \ + ( (This)->lpVtbl -> Barrier(This,NumBarrierGroups,pBarrierGroups) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoEncodeCommandList3_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12video_0000_0027 */ +/* [local] */ + +#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */ +#pragma endregion +DEFINE_GUID(IID_ID3D12VideoDecoderHeap,0x0946B7C9,0xEBF6,0x4047,0xBB,0x73,0x86,0x83,0xE2,0x7D,0xBB,0x1F); +DEFINE_GUID(IID_ID3D12VideoDevice,0x1F052807,0x0B46,0x4ACC,0x8A,0x89,0x36,0x4F,0x79,0x37,0x18,0xA4); +DEFINE_GUID(IID_ID3D12VideoDecoder,0xC59B6BDC,0x7720,0x4074,0xA1,0x36,0x17,0xA1,0x56,0x03,0x74,0x70); +DEFINE_GUID(IID_ID3D12VideoProcessor,0x304FDB32,0xBEDE,0x410A,0x85,0x45,0x94,0x3A,0xC6,0xA4,0x61,0x38); +DEFINE_GUID(IID_ID3D12VideoDecodeCommandList,0x3B60536E,0xAD29,0x4E64,0xA2,0x69,0xF8,0x53,0x83,0x7E,0x5E,0x53); +DEFINE_GUID(IID_ID3D12VideoProcessCommandList,0xAEB2543A,0x167F,0x4682,0xAC,0xC8,0xD1,0x59,0xED,0x4A,0x62,0x09); +DEFINE_GUID(IID_ID3D12VideoDecodeCommandList1,0xD52F011B,0xB56E,0x453C,0xA0,0x5A,0xA7,0xF3,0x11,0xC8,0xF4,0x72); +DEFINE_GUID(IID_ID3D12VideoProcessCommandList1,0x542C5C4D,0x7596,0x434F,0x8C,0x93,0x4E,0xFA,0x67,0x66,0xF2,0x67); +DEFINE_GUID(IID_ID3D12VideoMotionEstimator,0x33FDAE0E,0x098B,0x428F,0x87,0xBB,0x34,0xB6,0x95,0xDE,0x08,0xF8); +DEFINE_GUID(IID_ID3D12VideoMotionVectorHeap,0x5BE17987,0x743A,0x4061,0x83,0x4B,0x23,0xD2,0x2D,0xAE,0xA5,0x05); +DEFINE_GUID(IID_ID3D12VideoDevice1,0x981611AD,0xA144,0x4C83,0x98,0x90,0xF3,0x0E,0x26,0xD6,0x58,0xAB); +DEFINE_GUID(IID_ID3D12VideoEncodeCommandList,0x8455293A,0x0CBD,0x4831,0x9B,0x39,0xFB,0xDB,0xAB,0x72,0x47,0x23); +DEFINE_GUID(IID_ID3D12VideoDecoder1,0x79A2E5FB,0xCCD2,0x469A,0x9F,0xDE,0x19,0x5D,0x10,0x95,0x1F,0x7E); +DEFINE_GUID(IID_ID3D12VideoDecoderHeap1,0xDA1D98C5,0x539F,0x41B2,0xBF,0x6B,0x11,0x98,0xA0,0x3B,0x6D,0x26); +DEFINE_GUID(IID_ID3D12VideoProcessor1,0xF3CFE615,0x553F,0x425C,0x86,0xD8,0xEE,0x8C,0x1B,0x1F,0xB0,0x1C); +DEFINE_GUID(IID_ID3D12VideoExtensionCommand,0x554E41E8,0xAE8E,0x4A8C,0xB7,0xD2,0x5B,0x4F,0x27,0x4A,0x30,0xE4); +DEFINE_GUID(IID_ID3D12VideoDevice2,0xF019AC49,0xF838,0x4A95,0x9B,0x17,0x57,0x94,0x37,0xC8,0xF5,0x13); +DEFINE_GUID(IID_ID3D12VideoDecodeCommandList2,0x6e120880,0xc114,0x4153,0x80,0x36,0xd2,0x47,0x05,0x1e,0x17,0x29); +DEFINE_GUID(IID_ID3D12VideoDecodeCommandList3,0x2aee8c37,0x9562,0x42da,0x8a,0xbf,0x61,0xef,0xeb,0x2e,0x45,0x13); +DEFINE_GUID(IID_ID3D12VideoProcessCommandList2,0xdb525ae4,0x6ad6,0x473c,0xba,0xa7,0x59,0xb2,0xe3,0x70,0x82,0xe4); +DEFINE_GUID(IID_ID3D12VideoProcessCommandList3,0x1a0a4ca4,0x9f08,0x40ce,0x95,0x58,0xb4,0x11,0xfd,0x26,0x66,0xff); +DEFINE_GUID(IID_ID3D12VideoEncodeCommandList1,0x94971eca,0x2bdb,0x4769,0x88,0xcf,0x36,0x75,0xea,0x75,0x7e,0xbc); +DEFINE_GUID(IID_ID3D12VideoEncoder,0x2E0D212D,0x8DF9,0x44A6,0xA7,0x70,0xBB,0x28,0x9B,0x18,0x27,0x37); +DEFINE_GUID(IID_ID3D12VideoEncoderHeap,0x22B35D96,0x876A,0x44C0,0xB2,0x5E,0xFB,0x8C,0x9C,0x7F,0x1C,0x4A); +DEFINE_GUID(IID_ID3D12VideoDevice3,0x4243ADB4,0x3A32,0x4666,0x97,0x3C,0x0C,0xCC,0x56,0x25,0xDC,0x44); +DEFINE_GUID(IID_ID3D12VideoEncodeCommandList2,0x895491e2,0xe701,0x46a9,0x9a,0x1f,0x8d,0x34,0x80,0xed,0x86,0x7a); +DEFINE_GUID(IID_ID3D12VideoEncodeCommandList3,0x7f027b22,0x1515,0x4e85,0xaa,0x0d,0x02,0x64,0x86,0x58,0x05,0x76); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0027_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0027_v0_0_s_ifspec; + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12video.idl b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12video.idl new file mode 100644 index 0000000..d2f9a62 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3d12video.idl @@ -0,0 +1,2486 @@ +/*------------------------------------------------------------------------------------- + * + * Copyright (c) Microsoft Corporation + * Licensed under the MIT license + * + *-------------------------------------------------------------------------------------*/ +import "oaidl.idl"; +import "ocidl.idl"; + +import "dxgicommon.idl"; +import "d3d12.idl"; + +cpp_quote("#include ") + +#pragma region App Family +cpp_quote("#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES)") + +typedef enum D3D12_VIDEO_FIELD_TYPE +{ + D3D12_VIDEO_FIELD_TYPE_NONE = 0, + D3D12_VIDEO_FIELD_TYPE_INTERLACED_TOP_FIELD_FIRST = 1, + D3D12_VIDEO_FIELD_TYPE_INTERLACED_BOTTOM_FIELD_FIRST = 2, +} D3D12_VIDEO_FIELD_TYPE; + +typedef enum D3D12_VIDEO_FRAME_STEREO_FORMAT +{ + D3D12_VIDEO_FRAME_STEREO_FORMAT_NONE = 0, + D3D12_VIDEO_FRAME_STEREO_FORMAT_MONO = 1, + D3D12_VIDEO_FRAME_STEREO_FORMAT_HORIZONTAL = 2, + D3D12_VIDEO_FRAME_STEREO_FORMAT_VERTICAL = 3, + D3D12_VIDEO_FRAME_STEREO_FORMAT_SEPARATE = 4, +} D3D12_VIDEO_FRAME_STEREO_FORMAT; + +typedef struct D3D12_VIDEO_FORMAT +{ + DXGI_FORMAT Format; + DXGI_COLOR_SPACE_TYPE ColorSpace; +} D3D12_VIDEO_FORMAT; + +typedef struct D3D12_VIDEO_SAMPLE +{ + UINT Width; + UINT Height; + D3D12_VIDEO_FORMAT Format; +} D3D12_VIDEO_SAMPLE; + +typedef enum D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE +{ + D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE_NONE = 0, + D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE_FIELD_BASED = 1, +} D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE; + +typedef enum D3D12_FEATURE_VIDEO +{ + D3D12_FEATURE_VIDEO_DECODE_SUPPORT = 0, + D3D12_FEATURE_VIDEO_DECODE_PROFILES = 1, + D3D12_FEATURE_VIDEO_DECODE_FORMATS = 2, + D3D12_FEATURE_VIDEO_DECODE_CONVERSION_SUPPORT = 3, + D3D12_FEATURE_VIDEO_PROCESS_SUPPORT = 5, + D3D12_FEATURE_VIDEO_PROCESS_MAX_INPUT_STREAMS = 6, + D3D12_FEATURE_VIDEO_PROCESS_REFERENCE_INFO = 7, + D3D12_FEATURE_VIDEO_DECODER_HEAP_SIZE = 8, + D3D12_FEATURE_VIDEO_PROCESSOR_SIZE = 9, + D3D12_FEATURE_VIDEO_DECODE_PROFILE_COUNT = 10, + D3D12_FEATURE_VIDEO_DECODE_FORMAT_COUNT = 11, + D3D12_FEATURE_VIDEO_ARCHITECTURE = 17, + D3D12_FEATURE_VIDEO_DECODE_HISTOGRAM = 18, + D3D12_FEATURE_VIDEO_FEATURE_AREA_SUPPORT = 19, + D3D12_FEATURE_VIDEO_MOTION_ESTIMATOR = 20, + D3D12_FEATURE_VIDEO_MOTION_ESTIMATOR_SIZE = 21, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_COUNT = 22, + D3D12_FEATURE_VIDEO_EXTENSION_COMMANDS = 23, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_PARAMETER_COUNT = 24, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_PARAMETERS = 25, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_SUPPORT = 26, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_SIZE = 27, + D3D12_FEATURE_VIDEO_DECODE_PROTECTED_RESOURCES = 28, + D3D12_FEATURE_VIDEO_PROCESS_PROTECTED_RESOURCES = 29, + D3D12_FEATURE_VIDEO_MOTION_ESTIMATOR_PROTECTED_RESOURCES = 30, + D3D12_FEATURE_VIDEO_DECODER_HEAP_SIZE1 = 31, + D3D12_FEATURE_VIDEO_PROCESSOR_SIZE1 = 32, + D3D12_FEATURE_VIDEO_ENCODER_CODEC = 33, + D3D12_FEATURE_VIDEO_ENCODER_PROFILE_LEVEL = 34, + D3D12_FEATURE_VIDEO_ENCODER_OUTPUT_RESOLUTION_RATIOS_COUNT = 35, + D3D12_FEATURE_VIDEO_ENCODER_OUTPUT_RESOLUTION = 36, + D3D12_FEATURE_VIDEO_ENCODER_INPUT_FORMAT = 37, + D3D12_FEATURE_VIDEO_ENCODER_RATE_CONTROL_MODE = 38, + D3D12_FEATURE_VIDEO_ENCODER_INTRA_REFRESH_MODE = 39, + D3D12_FEATURE_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE = 40, + D3D12_FEATURE_VIDEO_ENCODER_HEAP_SIZE = 41, + D3D12_FEATURE_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT = 42, + D3D12_FEATURE_VIDEO_ENCODER_SUPPORT = 43, + D3D12_FEATURE_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT = 44, + D3D12_FEATURE_VIDEO_ENCODER_RESOURCE_REQUIREMENTS = 45, + + +} D3D12_FEATURE_VIDEO; + +typedef enum D3D12_BITSTREAM_ENCRYPTION_TYPE +{ + D3D12_BITSTREAM_ENCRYPTION_TYPE_NONE = 0, +} D3D12_BITSTREAM_ENCRYPTION_TYPE; + +typedef struct D3D12_VIDEO_DECODE_CONFIGURATION +{ + GUID DecodeProfile; + D3D12_BITSTREAM_ENCRYPTION_TYPE BitstreamEncryption; + D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE InterlaceType; +} D3D12_VIDEO_DECODE_CONFIGURATION; + +typedef struct D3D12_VIDEO_DECODER_DESC +{ + UINT NodeMask; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; +} D3D12_VIDEO_DECODER_DESC; + +typedef struct D3D12_VIDEO_DECODER_HEAP_DESC +{ + UINT NodeMask; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; + UINT DecodeWidth; + UINT DecodeHeight; + DXGI_FORMAT Format; + DXGI_RATIONAL FrameRate; + UINT BitRate; + UINT MaxDecodePictureBufferCount; +} D3D12_VIDEO_DECODER_HEAP_DESC; + +typedef struct D3D12_VIDEO_SIZE_RANGE +{ + UINT MaxWidth; + UINT MaxHeight; + UINT MinWidth; + UINT MinHeight; +} D3D12_VIDEO_SIZE_RANGE; + +typedef enum D3D12_VIDEO_PROCESS_FILTER +{ + D3D12_VIDEO_PROCESS_FILTER_BRIGHTNESS = 0, + D3D12_VIDEO_PROCESS_FILTER_CONTRAST = 1, + D3D12_VIDEO_PROCESS_FILTER_HUE = 2, + D3D12_VIDEO_PROCESS_FILTER_SATURATION = 3, + D3D12_VIDEO_PROCESS_FILTER_NOISE_REDUCTION = 4, + D3D12_VIDEO_PROCESS_FILTER_EDGE_ENHANCEMENT = 5, + D3D12_VIDEO_PROCESS_FILTER_ANAMORPHIC_SCALING = 6, + D3D12_VIDEO_PROCESS_FILTER_STEREO_ADJUSTMENT = 7, +} D3D12_VIDEO_PROCESS_FILTER; + +typedef enum D3D12_VIDEO_PROCESS_FILTER_FLAGS +{ + D3D12_VIDEO_PROCESS_FILTER_FLAG_NONE = 0x0, + D3D12_VIDEO_PROCESS_FILTER_FLAG_BRIGHTNESS = (1 << D3D12_VIDEO_PROCESS_FILTER_BRIGHTNESS), + D3D12_VIDEO_PROCESS_FILTER_FLAG_CONTRAST = (1 << D3D12_VIDEO_PROCESS_FILTER_CONTRAST), + D3D12_VIDEO_PROCESS_FILTER_FLAG_HUE = (1 << D3D12_VIDEO_PROCESS_FILTER_HUE), + D3D12_VIDEO_PROCESS_FILTER_FLAG_SATURATION = (1 << D3D12_VIDEO_PROCESS_FILTER_SATURATION), + D3D12_VIDEO_PROCESS_FILTER_FLAG_NOISE_REDUCTION = (1 << D3D12_VIDEO_PROCESS_FILTER_NOISE_REDUCTION), + D3D12_VIDEO_PROCESS_FILTER_FLAG_EDGE_ENHANCEMENT = (1 << D3D12_VIDEO_PROCESS_FILTER_EDGE_ENHANCEMENT), + D3D12_VIDEO_PROCESS_FILTER_FLAG_ANAMORPHIC_SCALING = (1 << D3D12_VIDEO_PROCESS_FILTER_ANAMORPHIC_SCALING), + D3D12_VIDEO_PROCESS_FILTER_FLAG_STEREO_ADJUSTMENT = (1 << D3D12_VIDEO_PROCESS_FILTER_STEREO_ADJUSTMENT), + +} D3D12_VIDEO_PROCESS_FILTER_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_FILTER_FLAGS );") + +typedef enum D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS +{ + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG_NONE = 0x0, + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG_BOB = 0x1, + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG_CUSTOM = 0x80000000, + +} D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS );") + +typedef struct D3D12_VIDEO_PROCESS_ALPHA_BLENDING +{ + BOOL Enable; + FLOAT Alpha; +} D3D12_VIDEO_PROCESS_ALPHA_BLENDING; + +typedef struct D3D12_VIDEO_PROCESS_LUMA_KEY +{ + BOOL Enable; + FLOAT Lower; + FLOAT Upper; +} D3D12_VIDEO_PROCESS_LUMA_KEY; + +typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC +{ + DXGI_FORMAT Format; + DXGI_COLOR_SPACE_TYPE ColorSpace; + DXGI_RATIONAL SourceAspectRatio; + DXGI_RATIONAL DestinationAspectRatio; + DXGI_RATIONAL FrameRate; + D3D12_VIDEO_SIZE_RANGE SourceSizeRange; + D3D12_VIDEO_SIZE_RANGE DestinationSizeRange; + BOOL EnableOrientation; + D3D12_VIDEO_PROCESS_FILTER_FLAGS FilterFlags; + D3D12_VIDEO_FRAME_STEREO_FORMAT StereoFormat; + D3D12_VIDEO_FIELD_TYPE FieldType; + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS DeinterlaceMode; + BOOL EnableAlphaBlending; + D3D12_VIDEO_PROCESS_LUMA_KEY LumaKey; + UINT NumPastFrames; + UINT NumFutureFrames; + BOOL EnableAutoProcessing; +} D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC; + +typedef enum D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE +{ + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_OPAQUE = 0, + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_BACKGROUND = 1, + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_DESTINATION = 2, + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_SOURCE_STREAM = 3, +} D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE; + +typedef struct D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC +{ + DXGI_FORMAT Format; + DXGI_COLOR_SPACE_TYPE ColorSpace; + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE AlphaFillMode; + UINT AlphaFillModeSourceStreamIndex; + FLOAT BackgroundColor[4]; + DXGI_RATIONAL FrameRate; + BOOL EnableStereo; +} D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC; + +[uuid(0946B7C9-EBF6-4047-BB73-8683E27DBB1F), object, local, pointer_default(unique)] +interface ID3D12VideoDecoderHeap + : ID3D12Pageable +{ + D3D12_VIDEO_DECODER_HEAP_DESC GetDesc(); +} + +[uuid(1F052807-0B46-4ACC-8A89-364F793718A4), object, local, pointer_default(unique)] +interface ID3D12VideoDevice + : IUnknown +{ + HRESULT CheckFeatureSupport( + D3D12_FEATURE_VIDEO FeatureVideo, + [annotation("_Inout_updates_bytes_(FeatureSupportDataSize)")] void* pFeatureSupportData, + UINT FeatureSupportDataSize + ); + + HRESULT CreateVideoDecoder( + [annotation("_In_")] const D3D12_VIDEO_DECODER_DESC* pDesc, + [annotation("_In_")] REFIID riid, // Expected: IID_ID3D12VideoDecoder, + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppVideoDecoder + ); + + HRESULT CreateVideoDecoderHeap( + [annotation("_In_")]const D3D12_VIDEO_DECODER_HEAP_DESC* pVideoDecoderHeapDesc, + [annotation("_In_")] REFIID riid, // Expected: IID_ID3D12VideoDecoderHeap, + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppVideoDecoderHeap + ); + + HRESULT CreateVideoProcessor( + UINT NodeMask, + [annotation("_In_")] const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC* pOutputStreamDesc, + UINT NumInputStreamDescs, + [annotation("_In_reads_(NumInputStreamDescs)")]const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs, + [annotation("_In_")] REFIID riid, // Expected: IID_ID3D12VideoProcessor, + [out, iid_is(riid), annotation("_COM_Outptr_")] void **ppVideoProcessor + ); +} + +[uuid(C59B6BDC-7720-4074-A136-17A156037470), object, local, pointer_default(unique)] +interface ID3D12VideoDecoder + : ID3D12Pageable +{ + D3D12_VIDEO_DECODER_DESC GetDesc(); +} + +typedef enum D3D12_VIDEO_DECODE_TIER +{ + D3D12_VIDEO_DECODE_TIER_NOT_SUPPORTED = 0, + D3D12_VIDEO_DECODE_TIER_1 = 1, + D3D12_VIDEO_DECODE_TIER_2 = 2, + D3D12_VIDEO_DECODE_TIER_3 = 3, +} D3D12_VIDEO_DECODE_TIER; + +typedef enum D3D12_VIDEO_DECODE_SUPPORT_FLAGS +{ + D3D12_VIDEO_DECODE_SUPPORT_FLAG_NONE = 0x0, + D3D12_VIDEO_DECODE_SUPPORT_FLAG_SUPPORTED = 0x1, + +} D3D12_VIDEO_DECODE_SUPPORT_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_SUPPORT_FLAGS );") + +typedef enum D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS +{ + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_NONE = 0x0, + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_HEIGHT_ALIGNMENT_MULTIPLE_32_REQUIRED = 0x1, + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_POST_PROCESSING_SUPPORTED = 0x2, + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_REFERENCE_ONLY_ALLOCATIONS_REQUIRED = 0x4, + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_ALLOW_RESOLUTION_CHANGE_ON_NON_KEY_FRAME = 0x8, + +} D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS );") + +typedef enum D3D12_VIDEO_DECODE_STATUS +{ + D3D12_VIDEO_DECODE_STATUS_OK = 0, + D3D12_VIDEO_DECODE_STATUS_CONTINUE = 1, + D3D12_VIDEO_DECODE_STATUS_CONTINUE_SKIP_DISPLAY = 2, + D3D12_VIDEO_DECODE_STATUS_RESTART = 3, + D3D12_VIDEO_DECODE_STATUS_RATE_EXCEEDED = 4, +} D3D12_VIDEO_DECODE_STATUS; + +typedef enum D3D12_VIDEO_DECODE_ARGUMENT_TYPE +{ + D3D12_VIDEO_DECODE_ARGUMENT_TYPE_PICTURE_PARAMETERS = 0, + D3D12_VIDEO_DECODE_ARGUMENT_TYPE_INVERSE_QUANTIZATION_MATRIX = 1, + D3D12_VIDEO_DECODE_ARGUMENT_TYPE_SLICE_CONTROL = 2, + D3D12_VIDEO_DECODE_ARGUMENT_TYPE_MAX_VALID = 3 +} D3D12_VIDEO_DECODE_ARGUMENT_TYPE; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_SUPPORT +{ + UINT NodeIndex; // input + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; // input + UINT Width; // input + UINT Height; // input + DXGI_FORMAT DecodeFormat; // input + DXGI_RATIONAL FrameRate; // input + UINT BitRate; // input + D3D12_VIDEO_DECODE_SUPPORT_FLAGS SupportFlags; // output + D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS ConfigurationFlags; // output + D3D12_VIDEO_DECODE_TIER DecodeTier; // output +} D3D12_FEATURE_DATA_VIDEO_DECODE_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILE_COUNT +{ + UINT NodeIndex; // input + UINT ProfileCount; // output +} D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILE_COUNT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILES +{ + UINT NodeIndex; // input + UINT ProfileCount; // input + [annotation("_Field_size_full_(ProfileCount)")] GUID *pProfiles; // output. The list of supported profiles. The caller allocates storage for the profile list before calling CheckFeatureSupport. +} D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILES; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_FORMAT_COUNT +{ + UINT NodeIndex; // input + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; // input + UINT FormatCount; // output +} D3D12_FEATURE_DATA_VIDEO_DECODE_FORMAT_COUNT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_FORMATS +{ + UINT NodeIndex; // input + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; // input + UINT FormatCount; // input + [annotation("_Field_size_full_(FormatCount)")] DXGI_FORMAT *pOutputFormats; // output. The list of supported video formats. The caller allocates storage for the format list before calling CheckFeatureSupport. +} D3D12_FEATURE_DATA_VIDEO_DECODE_FORMATS; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ARCHITECTURE +{ + BOOL IOCoherent; +} D3D12_FEATURE_DATA_VIDEO_ARCHITECTURE; + +typedef enum D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT +{ + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_Y = 0, + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_U = 1, + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_V = 2, + + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_R = 0, + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_G = 1, + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_B = 2, + + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_A = 3, +} D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT; + +typedef enum D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS +{ + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_NONE = 0x0, + + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_Y = (1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_Y), + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_U = (1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_U), + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_V = (1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_V), + + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_R = (1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_R), + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_G = (1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_G), + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_B = (1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_B), + + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_A = (1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_A), +} D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS );") + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM +{ + UINT NodeIndex; // in + GUID DecodeProfile; // in + UINT Width; // in + UINT Height; // in + DXGI_FORMAT DecodeFormat; // in + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS Components; // out + UINT BinCount; // out + UINT CounterBitDepth; // out +} D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM; + +typedef enum D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS +{ + D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAG_NONE = 0x0, + D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAG_SUPPORTED = 0x1, + +} D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS );") + +typedef enum D3D12_VIDEO_SCALE_SUPPORT_FLAGS +{ + D3D12_VIDEO_SCALE_SUPPORT_FLAG_NONE = 0x0, + D3D12_VIDEO_SCALE_SUPPORT_FLAG_POW2_ONLY = 0x1, + D3D12_VIDEO_SCALE_SUPPORT_FLAG_EVEN_DIMENSIONS_ONLY = 0x2, + +} D3D12_VIDEO_SCALE_SUPPORT_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_SCALE_SUPPORT_FLAGS );") + +typedef struct D3D12_VIDEO_SCALE_SUPPORT +{ + D3D12_VIDEO_SIZE_RANGE OutputSizeRange; + D3D12_VIDEO_SCALE_SUPPORT_FLAGS Flags; +} D3D12_VIDEO_SCALE_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT +{ + UINT NodeIndex; // input + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; // input + D3D12_VIDEO_SAMPLE DecodeSample; // input + D3D12_VIDEO_FORMAT OutputFormat; // input + DXGI_RATIONAL FrameRate; // input + UINT BitRate; // input + D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS SupportFlags; // output + D3D12_VIDEO_SCALE_SUPPORT ScaleSupport; // output +} D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODER_HEAP_SIZE +{ + D3D12_VIDEO_DECODER_HEAP_DESC VideoDecoderHeapDesc; // input + UINT64 MemoryPoolL0Size; // output + UINT64 MemoryPoolL1Size; // output +} D3D12_FEATURE_DATA_VIDEO_DECODER_HEAP_SIZE; + +typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESSOR_SIZE +{ + UINT NodeMask; + const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC* pOutputStreamDesc; // input + UINT NumInputStreamDescs; // input + const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs; // input + UINT64 MemoryPoolL0Size; // output + UINT64 MemoryPoolL1Size; // output +} D3D12_FEATURE_DATA_VIDEO_PROCESSOR_SIZE; + +typedef struct D3D12_QUERY_DATA_VIDEO_DECODE_STATISTICS +{ + UINT64 Status; // see D3D12_VIDEO_DECODE_STATUS + UINT64 NumMacroblocksAffected; + DXGI_RATIONAL FrameRate; + UINT BitRate; +} D3D12_QUERY_DATA_VIDEO_DECODE_STATISTICS; + +typedef struct D3D12_VIDEO_DECODE_FRAME_ARGUMENT +{ + D3D12_VIDEO_DECODE_ARGUMENT_TYPE Type; + UINT Size; + [annotation("_Field_size_bytes_full_(Size)")] void *pData; +} D3D12_VIDEO_DECODE_FRAME_ARGUMENT; + +typedef struct D3D12_VIDEO_DECODE_REFERENCE_FRAMES +{ + UINT NumTexture2Ds; + [annotation("_Field_size_full_(NumTexture2Ds)")] ID3D12Resource** ppTexture2Ds; + [annotation("_Field_size_full_(NumTexture2Ds)")] UINT* pSubresources; + [annotation("_Field_size_full_opt_(NumTexture2Ds)")] ID3D12VideoDecoderHeap** ppHeaps; // If null, assume single decoder heap from input args. +} D3D12_VIDEO_DECODE_REFERENCE_FRAMES; + +typedef struct D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM +{ + ID3D12Resource* pBuffer; + UINT64 Offset; + UINT64 Size; +} D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM; + +typedef struct D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS +{ + BOOL Enable; + ID3D12Resource* pReferenceTexture2D; + UINT ReferenceSubresource; + DXGI_COLOR_SPACE_TYPE OutputColorSpace; + DXGI_COLOR_SPACE_TYPE DecodeColorSpace; +} D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS; + +typedef struct D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS +{ + UINT NumFrameArguments; + D3D12_VIDEO_DECODE_FRAME_ARGUMENT FrameArguments[D3D12_VIDEO_DECODE_MAX_ARGUMENTS]; + D3D12_VIDEO_DECODE_REFERENCE_FRAMES ReferenceFrames; + D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM CompressedBitstream; + ID3D12VideoDecoderHeap *pHeap; +} D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS; + +typedef struct D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS +{ + ID3D12Resource* pOutputTexture2D; + UINT OutputSubresource; + D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS ConversionArguments; +} D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS; + +[uuid(304FDB32-BEDE-410A-8545-943AC6A46138), object, local, pointer_default(unique)] +interface ID3D12VideoProcessor + : ID3D12Pageable +{ + UINT GetNodeMask(); + UINT GetNumInputStreamDescs(); + HRESULT GetInputStreamDescs(UINT NumInputStreamDescs, [annotation("_Out_writes_(NumInputStreamDescs)")] D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs); + D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC GetOutputStreamDesc(); +} + +typedef enum D3D12_VIDEO_PROCESS_FEATURE_FLAGS +{ + D3D12_VIDEO_PROCESS_FEATURE_FLAG_NONE = 0x0, + D3D12_VIDEO_PROCESS_FEATURE_FLAG_ALPHA_FILL = 0x1, + D3D12_VIDEO_PROCESS_FEATURE_FLAG_LUMA_KEY = 0x2, + D3D12_VIDEO_PROCESS_FEATURE_FLAG_STEREO = 0x4, + D3D12_VIDEO_PROCESS_FEATURE_FLAG_ROTATION = 0x8, + D3D12_VIDEO_PROCESS_FEATURE_FLAG_FLIP = 0x10, + D3D12_VIDEO_PROCESS_FEATURE_FLAG_ALPHA_BLENDING = 0x20, + D3D12_VIDEO_PROCESS_FEATURE_FLAG_PIXEL_ASPECT_RATIO = 0x40, + +} D3D12_VIDEO_PROCESS_FEATURE_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_FEATURE_FLAGS );") + +typedef enum D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS +{ + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_NONE = 0x0, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_DENOISE = 0x01, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_DERINGING = 0x02, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_EDGE_ENHANCEMENT = 0x04, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_COLOR_CORRECTION = 0x08, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_FLESH_TONE_MAPPING = 0x10, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_IMAGE_STABILIZATION = 0x20, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_SUPER_RESOLUTION = 0x40, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_ANAMORPHIC_SCALING = 0x80, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_CUSTOM = 0x80000000, + +} D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS );") + +typedef enum D3D12_VIDEO_PROCESS_ORIENTATION +{ + D3D12_VIDEO_PROCESS_ORIENTATION_DEFAULT = 0, + D3D12_VIDEO_PROCESS_ORIENTATION_FLIP_HORIZONTAL = 1, + D3D12_VIDEO_PROCESS_ORIENTATION_CLOCKWISE_90 = 2, + D3D12_VIDEO_PROCESS_ORIENTATION_CLOCKWISE_90_FLIP_HORIZONTAL = 3, + D3D12_VIDEO_PROCESS_ORIENTATION_CLOCKWISE_180 = 4, + D3D12_VIDEO_PROCESS_ORIENTATION_FLIP_VERTICAL = 5, + D3D12_VIDEO_PROCESS_ORIENTATION_CLOCKWISE_270 = 6, + D3D12_VIDEO_PROCESS_ORIENTATION_CLOCKWISE_270_FLIP_HORIZONTAL = 7, +} D3D12_VIDEO_PROCESS_ORIENTATION; + +typedef enum D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS +{ + D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAG_NONE = 0x0, + D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAG_FRAME_DISCONTINUITY = 0x1, + D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAG_FRAME_REPEAT = 0x2, + +} D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS );") + +typedef struct D3D12_VIDEO_PROCESS_FILTER_RANGE +{ + INT Minimum; + INT Maximum; + INT Default; + FLOAT Multiplier; +} D3D12_VIDEO_PROCESS_FILTER_RANGE; + +typedef enum D3D12_VIDEO_PROCESS_SUPPORT_FLAGS +{ + D3D12_VIDEO_PROCESS_SUPPORT_FLAG_NONE = 0x0, + D3D12_VIDEO_PROCESS_SUPPORT_FLAG_SUPPORTED = 0x1, + +} D3D12_VIDEO_PROCESS_SUPPORT_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_SUPPORT_FLAGS );") + +typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESS_SUPPORT +{ + UINT NodeIndex; // input + D3D12_VIDEO_SAMPLE InputSample; // input + D3D12_VIDEO_FIELD_TYPE InputFieldType; // input + D3D12_VIDEO_FRAME_STEREO_FORMAT InputStereoFormat; // input + DXGI_RATIONAL InputFrameRate; // input + D3D12_VIDEO_FORMAT OutputFormat; // input + D3D12_VIDEO_FRAME_STEREO_FORMAT OutputStereoFormat; // input + DXGI_RATIONAL OutputFrameRate; // input + D3D12_VIDEO_PROCESS_SUPPORT_FLAGS SupportFlags; // output + D3D12_VIDEO_SCALE_SUPPORT ScaleSupport; // output + D3D12_VIDEO_PROCESS_FEATURE_FLAGS FeatureSupport; // output + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS DeinterlaceSupport; // output + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS AutoProcessingSupport; // output + D3D12_VIDEO_PROCESS_FILTER_FLAGS FilterSupport; // output + D3D12_VIDEO_PROCESS_FILTER_RANGE FilterRangeSupport[D3D12_VIDEO_PROCESS_MAX_FILTERS]; // output +} D3D12_FEATURE_DATA_VIDEO_PROCESS_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESS_MAX_INPUT_STREAMS +{ + UINT NodeIndex; // input + UINT MaxInputStreams; // output +} D3D12_FEATURE_DATA_VIDEO_PROCESS_MAX_INPUT_STREAMS; + +typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESS_REFERENCE_INFO +{ + UINT NodeIndex; // input + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS DeinterlaceMode; // input + D3D12_VIDEO_PROCESS_FILTER_FLAGS Filters; // input + D3D12_VIDEO_PROCESS_FEATURE_FLAGS FeatureSupport; // input + DXGI_RATIONAL InputFrameRate; // input + DXGI_RATIONAL OutputFrameRate; // input + BOOL EnableAutoProcessing; // input + UINT PastFrames; // output + UINT FutureFrames; // output +} D3D12_FEATURE_DATA_VIDEO_PROCESS_REFERENCE_INFO; + +typedef struct D3D12_VIDEO_PROCESS_REFERENCE_SET +{ + UINT NumPastFrames; + ID3D12Resource **ppPastFrames; + UINT *pPastSubresources; + UINT NumFutureFrames; + ID3D12Resource **ppFutureFrames; + UINT *pFutureSubresources; +} D3D12_VIDEO_PROCESS_REFERENCE_SET; + +typedef struct D3D12_VIDEO_PROCESS_TRANSFORM +{ + D3D12_RECT SourceRectangle; + D3D12_RECT DestinationRectangle; + D3D12_VIDEO_PROCESS_ORIENTATION Orientation; +} D3D12_VIDEO_PROCESS_TRANSFORM; + +typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM_RATE +{ + UINT OutputIndex; + UINT InputFrameOrField; +} D3D12_VIDEO_PROCESS_INPUT_STREAM_RATE; + +typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM +{ + ID3D12Resource *pTexture2D; + UINT Subresource; + D3D12_VIDEO_PROCESS_REFERENCE_SET ReferenceSet; +} D3D12_VIDEO_PROCESS_INPUT_STREAM; + +typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS +{ + D3D12_VIDEO_PROCESS_INPUT_STREAM InputStream[D3D12_VIDEO_PROCESS_STEREO_VIEWS]; + D3D12_VIDEO_PROCESS_TRANSFORM Transform; + D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS Flags; + D3D12_VIDEO_PROCESS_INPUT_STREAM_RATE RateInfo; + INT FilterLevels[D3D12_VIDEO_PROCESS_MAX_FILTERS]; + D3D12_VIDEO_PROCESS_ALPHA_BLENDING AlphaBlending; +} D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS; + +typedef struct D3D12_VIDEO_PROCESS_OUTPUT_STREAM +{ + ID3D12Resource* pTexture2D; + UINT Subresource; +} D3D12_VIDEO_PROCESS_OUTPUT_STREAM; + +typedef struct D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS +{ + D3D12_VIDEO_PROCESS_OUTPUT_STREAM OutputStream[D3D12_VIDEO_PROCESS_STEREO_VIEWS]; + D3D12_RECT TargetRectangle; +} D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS; + +[uuid(3B60536E-AD29-4E64-A269-F853837E5E53), object, local, pointer_default(unique)] +interface ID3D12VideoDecodeCommandList + : ID3D12CommandList +{ + HRESULT Close(); + + HRESULT Reset( + [annotation("_In_")] ID3D12CommandAllocator* pAllocator + ); + + void ClearState(); + + void ResourceBarrier( + [annotation("_In_")] UINT NumBarriers, + [annotation("_In_reads_(NumBarriers)")] const D3D12_RESOURCE_BARRIER* pBarriers + ); + + void DiscardResource( + [annotation("_In_")] ID3D12Resource* pResource, + [annotation("_In_opt_")] const D3D12_DISCARD_REGION* pRegion + ); + + void BeginQuery( + [annotation("_In_")] ID3D12QueryHeap* pQueryHeap, + [annotation("_In_")] D3D12_QUERY_TYPE Type, + [annotation("_In_")] UINT Index + ); + + void EndQuery( + [annotation("_In_")] ID3D12QueryHeap* pQueryHeap, + [annotation("_In_")] D3D12_QUERY_TYPE Type, + [annotation("_In_")] UINT Index + ); + + void ResolveQueryData( + [annotation("_In_")] ID3D12QueryHeap* pQueryHeap, + [annotation("_In_")] D3D12_QUERY_TYPE Type, + [annotation("_In_")] UINT StartIndex, + [annotation("_In_")] UINT NumQueries, + [annotation("_In_")] ID3D12Resource* pDestinationBuffer, + [annotation("_In_")] UINT64 AlignedDestinationBufferOffset + ); + + void SetPredication( + [annotation("_In_opt_")] ID3D12Resource* pBuffer, + [annotation("_In_")] UINT64 AlignedBufferOffset, + [annotation("_In_")] D3D12_PREDICATION_OP Operation + ); + + void SetMarker( + UINT Metadata, + [annotation("_In_reads_bytes_opt_(Size)")] const void* pData, + UINT Size); + + void BeginEvent( + UINT Metadata, + [annotation("_In_reads_bytes_opt_(Size)")] const void* pData, + UINT Size); + + void EndEvent(); + + void DecodeFrame( + [annotation("_In_")] ID3D12VideoDecoder* pDecoder, + [annotation("_In_")] const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + [annotation("_In_")] const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments + ); + + void WriteBufferImmediate( + UINT Count, + [annotation("_In_reads_(Count)")] const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + [annotation("_In_reads_opt_(Count)")] const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes + ); +} + +[uuid(AEB2543A-167F-4682-ACC8-D159ED4A6209), object, local, pointer_default(unique)] +interface ID3D12VideoProcessCommandList + : ID3D12CommandList +{ + HRESULT Close(); + + HRESULT Reset( + [annotation("_In_")] ID3D12CommandAllocator* pAllocator + ); + + void ClearState(); + + void ResourceBarrier( + [annotation("_In_")] UINT NumBarriers, + [annotation("_In_reads_(NumBarriers)")] const D3D12_RESOURCE_BARRIER* pBarriers + ); + + void DiscardResource( + [annotation("_In_")] ID3D12Resource* pResource, + [annotation("_In_opt_")] const D3D12_DISCARD_REGION* pRegion + ); + + void BeginQuery( + [annotation("_In_")] ID3D12QueryHeap* pQueryHeap, + [annotation("_In_")] D3D12_QUERY_TYPE Type, + [annotation("_In_")] UINT Index + ); + + void EndQuery( + [annotation("_In_")] ID3D12QueryHeap* pQueryHeap, + [annotation("_In_")] D3D12_QUERY_TYPE Type, + [annotation("_In_")] UINT Index + ); + + void ResolveQueryData( + [annotation("_In_")] ID3D12QueryHeap* pQueryHeap, + [annotation("_In_")] D3D12_QUERY_TYPE Type, + [annotation("_In_")] UINT StartIndex, + [annotation("_In_")] UINT NumQueries, + [annotation("_In_")] ID3D12Resource* pDestinationBuffer, + [annotation("_In_")] UINT64 AlignedDestinationBufferOffset + ); + + void SetPredication( + [annotation("_In_opt_")] ID3D12Resource* pBuffer, + [annotation("_In_")] UINT64 AlignedBufferOffset, + [annotation("_In_")] D3D12_PREDICATION_OP Operation + ); + + void SetMarker( + UINT Metadata, + [annotation("_In_reads_bytes_opt_(Size)")] const void* pData, + UINT Size); + + void BeginEvent( + UINT Metadata, + [annotation("_In_reads_bytes_opt_(Size)")] const void* pData, + UINT Size); + + void EndEvent(); + + void ProcessFrames( + [annotation("_In_")] ID3D12VideoProcessor* pVideoProcessor, + [annotation("_In_")] const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + UINT NumInputStreams, + [annotation("_In_reads_(NumInputStreams)")] const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS *pInputArguments + ); + + void WriteBufferImmediate( + UINT Count, + [annotation("_In_reads_(Count)")] const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + [annotation("_In_reads_opt_(Count)")] const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes + ); +} + +typedef struct D3D12_VIDEO_DECODE_OUTPUT_HISTOGRAM +{ + UINT64 Offset; + ID3D12Resource* pBuffer; +} D3D12_VIDEO_DECODE_OUTPUT_HISTOGRAM; + +typedef struct D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1 +{ + BOOL Enable; + ID3D12Resource* pReferenceTexture2D; + UINT ReferenceSubresource; + DXGI_COLOR_SPACE_TYPE OutputColorSpace; + DXGI_COLOR_SPACE_TYPE DecodeColorSpace; + UINT OutputWidth; + UINT OutputHeight; +} D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1; + +typedef struct D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1 +{ + ID3D12Resource* pOutputTexture2D; + UINT OutputSubresource; + D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1 ConversionArguments; + D3D12_VIDEO_DECODE_OUTPUT_HISTOGRAM Histograms[D3D12_VIDEO_DECODE_MAX_HISTOGRAM_COMPONENTS]; +} D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1; + +[uuid(D52F011B-B56E-453C-A05A-A7F311C8F472), object, local, pointer_default(unique)] +interface ID3D12VideoDecodeCommandList1 + : ID3D12VideoDecodeCommandList +{ + void DecodeFrame1( + [annotation("_In_")] ID3D12VideoDecoder* pDecoder, + [annotation("_In_")] const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1 *pOutputArguments, + [annotation("_In_")] const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments + ); +} + +typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS1 +{ + D3D12_VIDEO_PROCESS_INPUT_STREAM InputStream[D3D12_VIDEO_PROCESS_STEREO_VIEWS]; + D3D12_VIDEO_PROCESS_TRANSFORM Transform; + D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS Flags; + D3D12_VIDEO_PROCESS_INPUT_STREAM_RATE RateInfo; + INT FilterLevels[D3D12_VIDEO_PROCESS_MAX_FILTERS]; + D3D12_VIDEO_PROCESS_ALPHA_BLENDING AlphaBlending; + D3D12_VIDEO_FIELD_TYPE FieldType; +} D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS1; + +[uuid(542C5C4D-7596-434F-8C93-4EFA6766F267), object, local, pointer_default(unique)] +interface ID3D12VideoProcessCommandList1 : ID3D12VideoProcessCommandList +{ + void ProcessFrames1( + [annotation("_In_")] ID3D12VideoProcessor* pVideoProcessor, + [annotation("_In_")] const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + UINT NumInputStreams, + [annotation("_In_reads_(NumInputStreams)")] const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS1 *pInputArguments + ); +} + +typedef enum D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE +{ + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_8X8 = 0, + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_16X16 = 1, +} D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE; + +typedef enum D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS +{ + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAG_NONE = 0, + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAG_8X8 = (1 << D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_8X8), + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAG_16X16 = (1 << D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_16X16), + +} D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS );" ) + +typedef enum D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION +{ + D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_QUARTER_PEL = 0, +} D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION; + +typedef enum D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS +{ + D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAG_NONE = 0, + D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAG_QUARTER_PEL = (1 << D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_QUARTER_PEL), + +} D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS );" ) + +// D3D12_FEATURE_VIDEO_FEATURE_AREA_SUPPORT +typedef struct D3D12_FEATURE_DATA_VIDEO_FEATURE_AREA_SUPPORT +{ + UINT NodeIndex; // input + BOOL VideoDecodeSupport; // output + BOOL VideoProcessSupport; // output + BOOL VideoEncodeSupport; // output +} D3D12_FEATURE_DATA_VIDEO_FEATURE_AREA_SUPPORT; + +// D3D12_FEATURE_VIDEO_MOTION_ESTIMATOR +typedef struct D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR +{ + UINT NodeIndex; // input + DXGI_FORMAT InputFormat; // input + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS BlockSizeFlags; // output + D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS PrecisionFlags; // output + D3D12_VIDEO_SIZE_RANGE SizeRange; // output +} D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR; + +// D3D12_FEATURE_VIDEO_MOTION_ESTIMATOR_SIZE +typedef struct D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR_SIZE +{ + UINT NodeIndex; // input + DXGI_FORMAT InputFormat; // input + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE BlockSize; // input + D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION Precision; // input + D3D12_VIDEO_SIZE_RANGE SizeRange; // input + BOOL Protected; // input + UINT64 MotionVectorHeapMemoryPoolL0Size; // output + UINT64 MotionVectorHeapMemoryPoolL1Size; // output + UINT64 MotionEstimatorMemoryPoolL0Size; // output + UINT64 MotionEstimatorMemoryPoolL1Size; // output +} D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR_SIZE; + +typedef struct D3D12_VIDEO_MOTION_ESTIMATOR_DESC +{ + UINT NodeMask; + DXGI_FORMAT InputFormat; + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE BlockSize; + D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION Precision; + D3D12_VIDEO_SIZE_RANGE SizeRange; + +} D3D12_VIDEO_MOTION_ESTIMATOR_DESC; + +[uuid(33FDAE0E-098B-428F-87BB-34B695DE08F8), object, local, pointer_default(unique)] +interface ID3D12VideoMotionEstimator + : ID3D12Pageable +{ + D3D12_VIDEO_MOTION_ESTIMATOR_DESC GetDesc(); + + HRESULT GetProtectedResourceSession( + [in] REFIID riid, // Expected: ID3D12ProtectedResourceSession + [out, iid_is(riid), annotation("_COM_Outptr_opt_")] void** ppProtectedSession); +} + +typedef struct D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC +{ + UINT NodeMask; + DXGI_FORMAT InputFormat; + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE BlockSize; + D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION Precision; + D3D12_VIDEO_SIZE_RANGE SizeRange; + +} D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC; + +[uuid(5BE17987-743A-4061-834B-23D22DAEA505), object, local, pointer_default(unique)] +interface ID3D12VideoMotionVectorHeap + : ID3D12Pageable +{ + D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC GetDesc(); + + HRESULT GetProtectedResourceSession( + [in] REFIID riid, // Expected: ID3D12ProtectedResourceSession + [out, iid_is(riid), annotation("_COM_Outptr_opt_")] void** ppProtectedSession); +} + +[uuid(981611AD-A144-4C83-9890-F30E26D658AB), object, local, pointer_default(unique)] +interface ID3D12VideoDevice1 + : ID3D12VideoDevice +{ + HRESULT CreateVideoMotionEstimator( + [annotation("_In_")] const D3D12_VIDEO_MOTION_ESTIMATOR_DESC* pDesc, + [annotation("_In_opt_")] ID3D12ProtectedResourceSession *pProtectedResourceSession, + [annotation("_In_")] REFIID riid, // Expected: IID_ID3D12VideoMotionEstimator, + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppVideoMotionEstimator + ); + + HRESULT CreateVideoMotionVectorHeap( + [annotation("_In_")] const D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC* pDesc, + [annotation("_In_opt_")] ID3D12ProtectedResourceSession *pProtectedResourceSession, + [annotation("_In_")] REFIID riid, // Expected: IID_ID3D12VideoMotionVectorHeap, + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppVideoMotionVectorHeap + ); +} + +typedef struct D3D12_RESOURCE_COORDINATE +{ + // Coordinate values below index pixels. + UINT64 X; // Used for buffer, 1D, 2D, 3D + UINT Y; // Used for 2D, 3D + UINT Z; // Used for 3D + UINT SubresourceIndex; // indexes into mips, arrays, and planes. Used for 1D, 2D, 3D +} D3D12_RESOURCE_COORDINATE; + +typedef struct D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT +{ + ID3D12VideoMotionVectorHeap* pMotionVectorHeap; +} D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT; + +typedef struct D3D12_VIDEO_MOTION_ESTIMATOR_INPUT +{ + ID3D12Resource* pInputTexture2D; + UINT InputSubresourceIndex; + ID3D12Resource* pReferenceTexture2D; + UINT ReferenceSubresourceIndex; + ID3D12VideoMotionVectorHeap* pHintMotionVectorHeap; +} D3D12_VIDEO_MOTION_ESTIMATOR_INPUT; + +typedef struct D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT +{ + ID3D12Resource* pMotionVectorTexture2D; + D3D12_RESOURCE_COORDINATE MotionVectorCoordinate; +} D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT; + +typedef struct D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT +{ + ID3D12VideoMotionVectorHeap* pMotionVectorHeap; + UINT PixelWidth; + UINT PixelHeight; +} D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT; + +[uuid(8455293A-0CBD-4831-9B39-FBDBAB724723), object, local, pointer_default(unique)] +interface ID3D12VideoEncodeCommandList + : ID3D12CommandList +{ + HRESULT Close(); + + HRESULT Reset( + [annotation("_In_")] ID3D12CommandAllocator* pAllocator + ); + + void ClearState(); + + void ResourceBarrier( + [annotation("_In_")] UINT NumBarriers, + [annotation("_In_reads_(NumBarriers)")] const D3D12_RESOURCE_BARRIER* pBarriers + ); + + void DiscardResource( + [annotation("_In_")] ID3D12Resource* pResource, + [annotation("_In_opt_")] const D3D12_DISCARD_REGION* pRegion + ); + + void BeginQuery( + [annotation("_In_")] ID3D12QueryHeap* pQueryHeap, + [annotation("_In_")] D3D12_QUERY_TYPE Type, + [annotation("_In_")] UINT Index + ); + + void EndQuery( + [annotation("_In_")] ID3D12QueryHeap* pQueryHeap, + [annotation("_In_")] D3D12_QUERY_TYPE Type, + [annotation("_In_")] UINT Index + ); + + void ResolveQueryData( + [annotation("_In_")] ID3D12QueryHeap* pQueryHeap, + [annotation("_In_")] D3D12_QUERY_TYPE Type, + [annotation("_In_")] UINT StartIndex, + [annotation("_In_")] UINT NumQueries, + [annotation("_In_")] ID3D12Resource* pDestinationBuffer, + [annotation("_In_")] UINT64 AlignedDestinationBufferOffset + ); + + void SetPredication( + [annotation("_In_opt_")] ID3D12Resource* pBuffer, + [annotation("_In_")] UINT64 AlignedBufferOffset, + [annotation("_In_")] D3D12_PREDICATION_OP Operation + ); + + void SetMarker( + UINT Metadata, + [annotation("_In_reads_bytes_opt_(Size)")] const void* pData, + UINT Size); + + void BeginEvent( + UINT Metadata, + [annotation("_In_reads_bytes_opt_(Size)")] const void* pData, + UINT Size); + + void EndEvent(); + + void EstimateMotion( + [annotation("_In_")] ID3D12VideoMotionEstimator* pMotionEstimator, + [annotation("_In_")] const D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT* pOutputArguments, + [annotation("_In_")] const D3D12_VIDEO_MOTION_ESTIMATOR_INPUT* pInputArguments + ); + + void ResolveMotionVectorHeap( + const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT* pOutputArguments, + const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT* pInputArguments + ); + + void WriteBufferImmediate( + UINT Count, + [annotation("_In_reads_(Count)")] const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + [annotation("_In_reads_opt_(Count)")] const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes + ); + + void SetProtectedResourceSession( + [annotation("_In_opt_")]ID3D12ProtectedResourceSession *pProtectedResourceSession + ); +} + +typedef enum D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS +{ + D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAG_NONE = 0x0, + D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAG_SUPPORTED = 0x1, + +} D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS );") + +// D3D12_FEATURE_VIDEO_DECODE_PROTECTED_RESOURCES +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_PROTECTED_RESOURCES +{ + UINT NodeIndex; // input + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; // input + D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS SupportFlags; // output +} D3D12_FEATURE_DATA_VIDEO_DECODE_PROTECTED_RESOURCES; + +// D3D12_FEATURE_VIDEO_PROCESS_PROTECTED_RESOURCES +typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESS_PROTECTED_RESOURCES +{ + UINT NodeIndex; // input + D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS SupportFlags; // output +} D3D12_FEATURE_DATA_VIDEO_PROCESS_PROTECTED_RESOURCES; + +// D3D12_FEATURE_VIDEO_MOTION_ESTIMATOR_PROTECTED_RESOURCES +typedef struct D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR_PROTECTED_RESOURCES +{ + UINT NodeIndex; // input + D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS SupportFlags; // output +} D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR_PROTECTED_RESOURCES; + +//D3D12_FEATURE_VIDEO_DECODER_HEAP_SIZE1 +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODER_HEAP_SIZE1 +{ + D3D12_VIDEO_DECODER_HEAP_DESC VideoDecoderHeapDesc; // input + BOOL Protected; // input + UINT64 MemoryPoolL0Size; // output + UINT64 MemoryPoolL1Size; // output +} D3D12_FEATURE_DATA_VIDEO_DECODER_HEAP_SIZE1; + +// D3D12_FEATURE_VIDEO_PROCESSOR_SIZE1 +typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESSOR_SIZE1 +{ + UINT NodeMask; + const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC* pOutputStreamDesc; // input + UINT NumInputStreamDescs; // input + const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs; // input + BOOL Protected; // input + UINT64 MemoryPoolL0Size; // output + UINT64 MemoryPoolL1Size; // output +} D3D12_FEATURE_DATA_VIDEO_PROCESSOR_SIZE1; + +typedef enum D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE +{ + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_CREATION = 0, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_INITIALIZATION = 1, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_EXECUTION = 2, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_CAPS_INPUT = 3, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_CAPS_OUTPUT = 4, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_DEVICE_EXECUTE_INPUT = 5, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_DEVICE_EXECUTE_OUTPUT = 6, +} D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE; + +typedef enum D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE +{ + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_UINT8 = 0, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_UINT16 = 1, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_UINT32 = 2, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_UINT64 = 3, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_SINT8 = 4, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_SINT16 = 5, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_SINT32 = 6, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_SINT64 = 7, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_FLOAT = 8, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_DOUBLE = 9, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_RESOURCE = 10, +} D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE; + +typedef enum D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAGS +{ + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAG_NONE = 0x00000000, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAG_READ = 0x00000001, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAG_WRITE = 0x00000002 +} D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAGS; + +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAGS );") + +typedef struct D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_COUNT +{ + UINT NodeIndex; // in + UINT CommandCount; // out +} D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_COUNT; + +typedef struct D3D12_VIDEO_EXTENSION_COMMAND_INFO +{ + GUID CommandId; + LPCWSTR Name; + D3D12_COMMAND_LIST_SUPPORT_FLAGS CommandListSupportFlags; +} D3D12_VIDEO_EXTENSION_COMMAND_INFO; + +typedef struct D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMANDS +{ + UINT NodeIndex; + UINT CommandCount; + [annotation("_Field_size_full_(CommandCount)")] D3D12_VIDEO_EXTENSION_COMMAND_INFO* pCommandInfos; +} D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMANDS; + +typedef struct D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_PARAMETER_COUNT +{ + GUID CommandId; // in + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE Stage; // in + UINT ParameterCount; // out + UINT ParameterPacking; // out +} D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_PARAMETER_COUNT; + +typedef struct D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_INFO +{ + LPCWSTR Name; + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE Type; + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAGS Flags; +} D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_INFO; + +typedef struct D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_PARAMETERS +{ + GUID CommandId; // in + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE Stage; // in + UINT ParameterCount; // in + [annotation("_Field_size_full_(ParameterCount)")] D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_INFO* pParameterInfos; // out +} D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_PARAMETERS; + +typedef struct D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_SUPPORT +{ + UINT NodeIndex; + GUID CommandId; + [annotation("_Field_size_bytes_full_opt_(InputDataSizeInBytes)")] const void *pInputData; + SIZE_T InputDataSizeInBytes; + [annotation("_Field_size_bytes_full_opt_(OutputDataSizeInBytes)")] void *pOutputData; + SIZE_T OutputDataSizeInBytes; +} D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_SIZE +{ + UINT NodeIndex; + GUID CommandId; + [annotation("_Field_size_bytes_full_(CreationParametersDataSizeInBytes)")] const void* pCreationParameters; + SIZE_T CreationParametersSizeInBytes; + UINT64 MemoryPoolL0Size; // output + UINT64 MemoryPoolL1Size; // output +} D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_SIZE; + +typedef struct D3D12_VIDEO_EXTENSION_COMMAND_DESC +{ + UINT NodeMask; + GUID CommandId; +} D3D12_VIDEO_EXTENSION_COMMAND_DESC; + +[uuid(79A2E5FB-CCD2-469A-9FDE-195D10951F7E), object, local, pointer_default(unique)] +interface ID3D12VideoDecoder1 + : ID3D12VideoDecoder +{ + HRESULT GetProtectedResourceSession( + [in] REFIID riid, // Expected: ID3D12ProtectedResourceSession + [out, iid_is(riid), annotation("_COM_Outptr_opt_")] void** ppProtectedSession); +} + +[uuid(DA1D98C5-539F-41B2-BF6B-1198A03B6D26), object, local, pointer_default(unique)] +interface ID3D12VideoDecoderHeap1 + : ID3D12VideoDecoderHeap +{ + HRESULT GetProtectedResourceSession( + [in] REFIID riid, // Expected: ID3D12ProtectedResourceSession + [out, iid_is(riid), annotation("_COM_Outptr_opt_")] void** ppProtectedSession); +} + +[uuid(F3CFE615-553F-425C-86D8-EE8C1B1FB01C), object, local, pointer_default(unique)] +interface ID3D12VideoProcessor1 + : ID3D12VideoProcessor +{ + HRESULT GetProtectedResourceSession( + [in] REFIID riid, // Expected: ID3D12ProtectedResourceSession + [out, iid_is(riid), annotation("_COM_Outptr_opt_")] void** ppProtectedSession); +} + +[uuid(554E41E8-AE8E-4A8C-B7D2-5B4F274A30E4), object, local, pointer_default(unique)] +interface ID3D12VideoExtensionCommand + : ID3D12Pageable +{ + D3D12_VIDEO_EXTENSION_COMMAND_DESC GetDesc(); + + HRESULT GetProtectedResourceSession( + [in] REFIID riid, // Expected: ID3D12ProtectedResourceSession + [out, iid_is(riid), annotation("_COM_Outptr_opt_")] void** ppProtectedSession); +} + +[uuid(F019AC49-F838-4A95-9B17-579437C8F513), object, local, pointer_default(unique)] +interface ID3D12VideoDevice2 + : ID3D12VideoDevice1 +{ + HRESULT CreateVideoDecoder1( + [annotation("_In_")] const D3D12_VIDEO_DECODER_DESC* pDesc, + [annotation("_In_opt_")] ID3D12ProtectedResourceSession *pProtectedResourceSession, + [annotation("_In_")] REFIID riid, // Expected: IID_ID3D12VideoDecoder1, + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppVideoDecoder + ); + + HRESULT CreateVideoDecoderHeap1( + [annotation("_In_")] const D3D12_VIDEO_DECODER_HEAP_DESC* pVideoDecoderHeapDesc, + [annotation("_In_opt_")] ID3D12ProtectedResourceSession *pProtectedResourceSession, + [annotation("_In_")] REFIID riid, // Expected: IID_ID3D12VideoDecoderHeap1, + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppVideoDecoderHeap + ); + + HRESULT CreateVideoProcessor1( + UINT NodeMask, + [annotation("_In_")] const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC* pOutputStreamDesc, + UINT NumInputStreamDescs, + [annotation("_In_reads_(NumInputStreamDescs)")]const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs, + [annotation("_In_opt_")] ID3D12ProtectedResourceSession *pProtectedResourceSession, + [annotation("_In_")] REFIID riid, // Expected: IID_ID3D12VideoProcessor1, + [out, iid_is(riid), annotation("_COM_Outptr_")] void **ppVideoProcessor + ); + + HRESULT CreateVideoExtensionCommand( + [annotation("_In_")] const D3D12_VIDEO_EXTENSION_COMMAND_DESC* pDesc, + [annotation("_In_reads_bytes_(CreationParametersDataSizeInBytes)")] const void* pCreationParameters, + SIZE_T CreationParametersDataSizeInBytes, + [annotation("_In_opt_")] ID3D12ProtectedResourceSession* pProtectedResourceSession, + [annotation("_In_")] REFIID riid, // Expected: IID_ID3D12VideoExtensionCommand, + [annotation("_COM_Outptr_")] void** ppVideoExtensionCommand); + + HRESULT ExecuteExtensionCommand( + [annotation("_In_")] ID3D12VideoExtensionCommand* pExtensionCommand, + [annotation("_In_reads_bytes_(ExecutionParametersSizeInBytes)")] const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes, + [annotation("_Out_writes_bytes_(OutputDataSizeInBytes)")] void *pOutputData, + SIZE_T OutputDataSizeInBytes + ); +} + +[uuid(6e120880-c114-4153-8036-d247051e1729), object, local, pointer_default(unique)] +interface ID3D12VideoDecodeCommandList2 + : ID3D12VideoDecodeCommandList1 +{ + void SetProtectedResourceSession( + [annotation("_In_opt_")]ID3D12ProtectedResourceSession *pProtectedResourceSession + ); + + void InitializeExtensionCommand( + [annotation("_In_")] ID3D12VideoExtensionCommand* pExtensionCommand, + [annotation("_In_reads_bytes_(InitializationParametersSizeInBytes)")] const void *pInitializationParameters, + SIZE_T InitializationParametersSizeInBytes); + + void ExecuteExtensionCommand( + [annotation("_In_")] ID3D12VideoExtensionCommand* pExtensionCommand, + [annotation("_In_reads_bytes_(ExecutionParametersSizeInBytes)")] const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes); +} + +[uuid(2aee8c37-9562-42da-8abf-61efeb2e4513), object, local, pointer_default(unique)] +interface ID3D12VideoDecodeCommandList3 + : ID3D12VideoDecodeCommandList2 +{ + void Barrier( + UINT32 NumBarrierGroups, + [annotation("_In_reads_(NumBarrierGroups)")] const D3D12_BARRIER_GROUP *pBarrierGroups + ); +} + +[uuid(db525ae4-6ad6-473c-baa7-59b2e37082e4), object, local, pointer_default(unique)] +interface ID3D12VideoProcessCommandList2 + : ID3D12VideoProcessCommandList1 +{ + + void SetProtectedResourceSession( + [annotation("_In_opt_")]ID3D12ProtectedResourceSession *pProtectedResourceSession + ); + + void InitializeExtensionCommand( + [annotation("_In_")] ID3D12VideoExtensionCommand* pExtensionCommand, + [annotation("_In_reads_bytes_(InitializationParametersSizeInBytes)")] const void *pInitializationParameters, + SIZE_T InitializationParametersSizeInBytes); + + void ExecuteExtensionCommand( + [annotation("_In_")] ID3D12VideoExtensionCommand* pExtensionCommand, + [annotation("_In_reads_bytes_(ExecutionParametersSizeInBytes)")] const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes); +} + +[uuid(1a0a4ca4-9f08-40ce-9558-b411fd2666ff), object, local, pointer_default(unique)] +interface ID3D12VideoProcessCommandList3 + : ID3D12VideoProcessCommandList2 +{ + void Barrier( + UINT32 NumBarrierGroups, + [annotation("_In_reads_(NumBarrierGroups)")] const D3D12_BARRIER_GROUP *pBarrierGroups + ); +} + +[uuid(94971eca-2bdb-4769-88cf-3675ea757ebc), object, local, pointer_default(unique)] +interface ID3D12VideoEncodeCommandList1 + : ID3D12VideoEncodeCommandList +{ + void InitializeExtensionCommand( + [annotation("_In_")] ID3D12VideoExtensionCommand* pExtensionCommand, + [annotation("_In_reads_bytes_(InitializationParametersSizeInBytes)")] const void *pInitializationParameters, + SIZE_T InitializationParametersSizeInBytes); + + void ExecuteExtensionCommand( + [annotation("_In_")] ID3D12VideoExtensionCommand* pExtensionCommand, + [annotation("_In_reads_bytes_(ExecutionParametersSizeInBytes)")] const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes); +} + +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG2, 0xee27417f, 0x5e28, 0x4e65, 0xbe, 0xea, 0x1d, 0x26, 0xb5, 0x08, 0xad, 0xc9); ") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG1_AND_MPEG2, 0x86695f12, 0x340e, 0x4f04, 0x9f, 0xd3, 0x92, 0x53, 0xdd, 0x32, 0x74, 0x60); ") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264, 0x1b81be68, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264_STEREO_PROGRESSIVE, 0xd79be8da, 0x0cf1, 0x4c81, 0xb8, 0x2a, 0x69, 0xa4, 0xe2, 0x36, 0xf4, 0x3d);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264_STEREO, 0xf9aaccbb, 0xc2b6, 0x4cfc, 0x87, 0x79, 0x57, 0x07, 0xb1, 0x76, 0x05, 0x52);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264_MULTIVIEW, 0x705b9d82, 0x76cf, 0x49d6, 0xb7, 0xe6, 0xac, 0x88, 0x72, 0xdb, 0x01, 0x3c);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VC1, 0x1b81beA3, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VC1_D2010, 0x1b81beA4, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG4PT2_SIMPLE, 0xefd64d74, 0xc9e8,0x41d7,0xa5,0xe9,0xe9,0xb0,0xe3,0x9f,0xa3,0x19);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG4PT2_ADVSIMPLE_NOGMC, 0xed418a9f, 0x010d, 0x4eda, 0x9a, 0xe3, 0x9a, 0x65, 0x35, 0x8d, 0x8d, 0x2e);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN, 0x5b11d51b, 0x2f4c, 0x4452, 0xbc, 0xc3, 0x09, 0xf2, 0xa1, 0x16, 0x0c, 0xc0);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN10, 0x107af0e0, 0xef1a, 0x4d19, 0xab, 0xa8, 0x67, 0xa1, 0x63, 0x07, 0x3d, 0x13);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP9, 0x463707f8, 0xa1d0, 0x4585, 0x87, 0x6d, 0x83, 0xaa, 0x6d, 0x60, 0xb8, 0x9e);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP9_10BIT_PROFILE2, 0xa4c749ef, 0x6ecf, 0x48aa, 0x84, 0x48, 0x50, 0xa7, 0xa1, 0x16, 0x5f, 0xf7);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP8, 0x90b899ea, 0x3a62, 0x4705, 0x88, 0xb3, 0x8d, 0xf0, 0x4b, 0x27, 0x44, 0xe7);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE0, 0xb8be4ccb, 0xcf53, 0x46ba, 0x8d, 0x59, 0xd6, 0xb8, 0xa6, 0xda, 0x5d, 0x2a);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE1, 0x6936ff0f, 0x45b1, 0x4163, 0x9c, 0xc1, 0x64, 0x6e, 0xf6, 0x94, 0x61, 0x08);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE2, 0x0c5f2aa1, 0xe541, 0x4089, 0xbb, 0x7b, 0x98, 0x11, 0x0a, 0x19, 0xd7, 0xc8);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_12BIT_PROFILE2, 0x17127009, 0xa00f, 0x4ce1, 0x99, 0x4e, 0xbf, 0x40, 0x81, 0xf6, 0xf3, 0xf0);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_12BIT_PROFILE2_420, 0x2d80bed6, 0x9cac, 0x4835, 0x9e, 0x91, 0x32, 0x7b, 0xbc, 0x4f, 0x9e, 0xe8);") + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Video Encoder +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// +// Rate control API +// + +typedef enum D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE +{ + D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE_ABSOLUTE_QP_MAP = 0, + D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE_CQP = 1, + D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE_CBR = 2, + D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE_VBR = 3, + D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE_QVBR = 4, +} D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE; + +typedef enum D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS +{ + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_NONE = 0x0, + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_DELTA_QP = 0x1, + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_FRAME_ANALYSIS = 0x2, + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_QP_RANGE = 0x4, + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_INITIAL_QP = 0x8, + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_MAX_FRAME_SIZE = 0x10, + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_VBV_SIZES = 0x20, +} D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS);") + +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP { + UINT ConstantQP_FullIntracodedFrame; + UINT ConstantQP_InterPredictedFrame_PrevRefOnly; + UINT ConstantQP_InterPredictedFrame_BiDirectionalRef; +} D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP; + +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR { + UINT InitialQP; + UINT MinQP; + UINT MaxQP; + UINT64 MaxFrameBitSize; + UINT64 TargetBitRate; + UINT64 VBVCapacity; + UINT64 InitialVBVFullness; +} D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR; + +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR { + UINT InitialQP; + UINT MinQP; + UINT MaxQP; + UINT64 MaxFrameBitSize; + UINT64 TargetAvgBitRate; + UINT64 PeakBitRate; + UINT64 VBVCapacity; + UINT64 InitialVBVFullness; +} D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR; + +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR { + UINT InitialQP; + UINT MinQP; + UINT MaxQP; + UINT64 MaxFrameBitSize; + UINT64 TargetAvgBitRate; + UINT64 PeakBitRate; + UINT ConstantQualityTarget; +} D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR; + +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS +{ + UINT DataSize; + union + { + const D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP* pConfiguration_CQP; + const D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR* pConfiguration_CBR; + const D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR* pConfiguration_VBR; + const D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR* pConfiguration_QVBR; + }; +} D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS; + +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL { + D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE Mode; + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS Flags; + D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS ConfigParams; + DXGI_RATIONAL TargetFrameRate; +} D3D12_VIDEO_ENCODER_RATE_CONTROL; + +// +// Video Encoder support API +// + +typedef enum D3D12_VIDEO_ENCODER_CODEC +{ + D3D12_VIDEO_ENCODER_CODEC_H264 = 0, + D3D12_VIDEO_ENCODER_CODEC_HEVC = 1, +} D3D12_VIDEO_ENCODER_CODEC; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC +{ + UINT NodeIndex; // input + D3D12_VIDEO_ENCODER_CODEC Codec; // input + BOOL IsSupported; // output +} D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC; + +typedef enum D3D12_VIDEO_ENCODER_PROFILE_H264 +{ + D3D12_VIDEO_ENCODER_PROFILE_H264_MAIN = 0, + D3D12_VIDEO_ENCODER_PROFILE_H264_HIGH = 1, + D3D12_VIDEO_ENCODER_PROFILE_H264_HIGH_10 = 2, +} D3D12_VIDEO_ENCODER_PROFILE_H264; + +typedef enum D3D12_VIDEO_ENCODER_PROFILE_HEVC +{ + D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN = 0, + D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN10 = 1, +} D3D12_VIDEO_ENCODER_PROFILE_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_PROFILE_DESC +{ + UINT DataSize; + union + { + D3D12_VIDEO_ENCODER_PROFILE_H264* pH264Profile; + D3D12_VIDEO_ENCODER_PROFILE_HEVC* pHEVCProfile; + }; +} D3D12_VIDEO_ENCODER_PROFILE_DESC; + +typedef enum D3D12_VIDEO_ENCODER_LEVELS_H264 +{ + D3D12_VIDEO_ENCODER_LEVELS_H264_1 = 0, + D3D12_VIDEO_ENCODER_LEVELS_H264_1b = 1, + D3D12_VIDEO_ENCODER_LEVELS_H264_11 = 2, + D3D12_VIDEO_ENCODER_LEVELS_H264_12 = 3, + D3D12_VIDEO_ENCODER_LEVELS_H264_13 = 4, + D3D12_VIDEO_ENCODER_LEVELS_H264_2 = 5, + D3D12_VIDEO_ENCODER_LEVELS_H264_21 = 6, + D3D12_VIDEO_ENCODER_LEVELS_H264_22 = 7, + D3D12_VIDEO_ENCODER_LEVELS_H264_3 = 8, + D3D12_VIDEO_ENCODER_LEVELS_H264_31 = 9, + D3D12_VIDEO_ENCODER_LEVELS_H264_32 = 10, + D3D12_VIDEO_ENCODER_LEVELS_H264_4 = 11, + D3D12_VIDEO_ENCODER_LEVELS_H264_41 = 12, + D3D12_VIDEO_ENCODER_LEVELS_H264_42 = 13, + D3D12_VIDEO_ENCODER_LEVELS_H264_5 = 14, + D3D12_VIDEO_ENCODER_LEVELS_H264_51 = 15, + D3D12_VIDEO_ENCODER_LEVELS_H264_52 = 16, + D3D12_VIDEO_ENCODER_LEVELS_H264_6 = 17, + D3D12_VIDEO_ENCODER_LEVELS_H264_61 = 18, + D3D12_VIDEO_ENCODER_LEVELS_H264_62 = 19, +} D3D12_VIDEO_ENCODER_LEVELS_H264; + +typedef enum D3D12_VIDEO_ENCODER_TIER_HEVC +{ + D3D12_VIDEO_ENCODER_TIER_HEVC_MAIN = 0, + D3D12_VIDEO_ENCODER_TIER_HEVC_HIGH = 1, +} D3D12_VIDEO_ENCODER_TIER_HEVC; + +typedef enum D3D12_VIDEO_ENCODER_LEVELS_HEVC +{ + D3D12_VIDEO_ENCODER_LEVELS_HEVC_1 = 0, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_2 = 1, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_21 = 2, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_3 = 3, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_31 = 4, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_4 = 5, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_41 = 6, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_5 = 7, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_51 = 8, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_52 = 9, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_6 = 10, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_61 = 11, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_62 = 12, +} D3D12_VIDEO_ENCODER_LEVELS_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_LEVEL_TIER_CONSTRAINTS_HEVC +{ + D3D12_VIDEO_ENCODER_LEVELS_HEVC Level; + D3D12_VIDEO_ENCODER_TIER_HEVC Tier; +} D3D12_VIDEO_ENCODER_LEVEL_TIER_CONSTRAINTS_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_LEVEL_SETTING +{ + UINT DataSize; + union + { + D3D12_VIDEO_ENCODER_LEVELS_H264* pH264LevelSetting; + D3D12_VIDEO_ENCODER_LEVEL_TIER_CONSTRAINTS_HEVC* pHEVCLevelSetting; + }; +} D3D12_VIDEO_ENCODER_LEVEL_SETTING; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_PROFILE_LEVEL +{ + UINT NodeIndex; // input + D3D12_VIDEO_ENCODER_CODEC Codec; // input + D3D12_VIDEO_ENCODER_PROFILE_DESC Profile; // input + BOOL IsSupported; // output + D3D12_VIDEO_ENCODER_LEVEL_SETTING MinSupportedLevel; // output + D3D12_VIDEO_ENCODER_LEVEL_SETTING MaxSupportedLevel; // output +} D3D12_FEATURE_DATA_VIDEO_ENCODER_PROFILE_LEVEL; + +typedef struct D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC +{ + UINT Width; + UINT Height; +} D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC; + +typedef struct D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_RATIO_DESC +{ + UINT WidthRatio; + UINT HeightRatio; +} D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_RATIO_DESC; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION_RATIOS_COUNT +{ + UINT NodeIndex; // input + D3D12_VIDEO_ENCODER_CODEC Codec; // input + UINT ResolutionRatiosCount; // output +} D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION_RATIOS_COUNT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION +{ + UINT NodeIndex; // input + D3D12_VIDEO_ENCODER_CODEC Codec; // input + UINT ResolutionRatiosCount; // input + BOOL IsSupported; // output + D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC MinResolutionSupported; // output + D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC MaxResolutionSupported; // output + UINT ResolutionWidthMultipleRequirement; // output + UINT ResolutionHeightMultipleRequirement; // output + [annotation("_Field_size_full_(ResolutionRatiosCount)")] D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_RATIO_DESC* pResolutionRatios; +} D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_INPUT_FORMAT +{ + UINT NodeIndex; // input + D3D12_VIDEO_ENCODER_CODEC Codec; // input + D3D12_VIDEO_ENCODER_PROFILE_DESC Profile; // input + DXGI_FORMAT Format; // input + BOOL IsSupported; // output +} D3D12_FEATURE_DATA_VIDEO_ENCODER_INPUT_FORMAT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_RATE_CONTROL_MODE +{ + UINT NodeIndex; // input + D3D12_VIDEO_ENCODER_CODEC Codec; // input + D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE RateControlMode; // input + BOOL IsSupported; // output +} D3D12_FEATURE_DATA_VIDEO_ENCODER_RATE_CONTROL_MODE; + +typedef enum D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE +{ + D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE_NONE = 0, + D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE_ROW_BASED = 1, +} D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_INTRA_REFRESH_MODE { + UINT NodeIndex; // input + D3D12_VIDEO_ENCODER_CODEC Codec; // input + D3D12_VIDEO_ENCODER_PROFILE_DESC Profile; // input + D3D12_VIDEO_ENCODER_LEVEL_SETTING Level; // input + D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE IntraRefreshMode; // input + BOOL IsSupported; // output +} D3D12_FEATURE_DATA_VIDEO_ENCODER_INTRA_REFRESH_MODE; + +typedef enum D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE +{ + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_FULL_FRAME = 0, + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_BYTES_PER_SUBREGION = 1, + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_SQUARE_UNITS_PER_SUBREGION_ROW_UNALIGNED = 2, + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_PARTITIONING_ROWS_PER_SUBREGION = 3, + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_PARTITIONING_SUBREGIONS_PER_FRAME = 4, +} D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE +{ + UINT NodeIndex; // input + D3D12_VIDEO_ENCODER_CODEC Codec; // input + D3D12_VIDEO_ENCODER_PROFILE_DESC Profile; // input + D3D12_VIDEO_ENCODER_LEVEL_SETTING Level; // input + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE SubregionMode; // input + BOOL IsSupported; // output +} D3D12_FEATURE_DATA_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE; + +typedef enum D3D12_VIDEO_ENCODER_HEAP_FLAGS +{ + D3D12_VIDEO_ENCODER_HEAP_FLAG_NONE = 0x0, +} D3D12_VIDEO_ENCODER_HEAP_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_HEAP_FLAGS);") + +typedef struct D3D12_VIDEO_ENCODER_HEAP_DESC +{ + UINT NodeMask; + D3D12_VIDEO_ENCODER_HEAP_FLAGS Flags; + D3D12_VIDEO_ENCODER_CODEC EncodeCodec; + D3D12_VIDEO_ENCODER_PROFILE_DESC EncodeProfile; + D3D12_VIDEO_ENCODER_LEVEL_SETTING EncodeLevel; + UINT ResolutionsListCount; + [annotation("_Field_size_full_(ResolutionsListCount)")] const D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC* pResolutionList; +} D3D12_VIDEO_ENCODER_HEAP_DESC; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_HEAP_SIZE { + D3D12_VIDEO_ENCODER_HEAP_DESC HeapDesc; // input + BOOL IsSupported; // output + UINT64 MemoryPoolL0Size; // output + UINT64 MemoryPoolL1Size; // output +} D3D12_FEATURE_DATA_VIDEO_ENCODER_HEAP_SIZE; + +typedef enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAGS +{ + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_NONE = 0x0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_CABAC_ENCODING_SUPPORT = 0x1, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_INTRA_SLICE_CONSTRAINED_ENCODING_SUPPORT = 0x2, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_BFRAME_LTR_COMBINED_SUPPORT = 0x4, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_ADAPTIVE_8x8_TRANSFORM_ENCODING_SUPPORT = 0x8, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_DIRECT_SPATIAL_ENCODING_SUPPORT = 0x10, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_DIRECT_TEMPORAL_ENCODING_SUPPORT = 0x20, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_CONSTRAINED_INTRAPREDICTION_SUPPORT = 0x40, +} D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAGS);") + +typedef enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODES { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_0_ALL_LUMA_CHROMA_SLICE_BLOCK_EDGES_ALWAYS_FILTERED = 0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_1_DISABLE_ALL_SLICE_BLOCK_EDGES = 1, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_2_DISABLE_SLICE_BOUNDARIES_BLOCKS = 2, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_3_USE_TWO_STAGE_DEBLOCKING = 3, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_4_DISABLE_CHROMA_BLOCK_EDGES = 4, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_5_DISABLE_CHROMA_BLOCK_EDGES_AND_LUMA_BOUNDARIES = 5, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_6_DISABLE_CHROMA_BLOCK_EDGES_AND_USE_LUMA_TWO_STAGE_DEBLOCKING = 6, +} D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODES; + +typedef enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAGS { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_NONE = 0x0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_0_ALL_LUMA_CHROMA_SLICE_BLOCK_EDGES_ALWAYS_FILTERED = (1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_0_ALL_LUMA_CHROMA_SLICE_BLOCK_EDGES_ALWAYS_FILTERED), + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_1_DISABLE_ALL_SLICE_BLOCK_EDGES = (1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_1_DISABLE_ALL_SLICE_BLOCK_EDGES), + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_2_DISABLE_SLICE_BOUNDARIES_BLOCKS = (1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_2_DISABLE_SLICE_BOUNDARIES_BLOCKS), + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_3_USE_TWO_STAGE_DEBLOCKING = (1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_3_USE_TWO_STAGE_DEBLOCKING), + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_4_DISABLE_CHROMA_BLOCK_EDGES = (1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_4_DISABLE_CHROMA_BLOCK_EDGES), + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_5_DISABLE_CHROMA_BLOCK_EDGES_AND_LUMA_BOUNDARIES = (1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_5_DISABLE_CHROMA_BLOCK_EDGES_AND_LUMA_BOUNDARIES), + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_6_DISABLE_CHROMA_BLOCK_EDGES_AND_USE_LUMA_TWO_STAGE_DEBLOCKING = (1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_6_DISABLE_CHROMA_BLOCK_EDGES_AND_USE_LUMA_TWO_STAGE_DEBLOCKING), +} D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAGS);") + +typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264 { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAGS SupportFlags; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAGS DisableDeblockingFilterSupportedModes; +} D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264; + +typedef enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS +{ + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_NONE = 0x0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_BFRAME_LTR_COMBINED_SUPPORT = 0x1, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_INTRA_SLICE_CONSTRAINED_ENCODING_SUPPORT = 0x2, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_CONSTRAINED_INTRAPREDICTION_SUPPORT = 0x4, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_SAO_FILTER_SUPPORT = 0x8, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_ASYMETRIC_MOTION_PARTITION_SUPPORT = 0x10, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_ASYMETRIC_MOTION_PARTITION_REQUIRED = 0x20, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_TRANSFORM_SKIP_SUPPORT = 0x40, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_DISABLING_LOOP_FILTER_ACROSS_SLICES_SUPPORT = 0x80, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_P_FRAMES_IMPLEMENTED_AS_LOW_DELAY_B_FRAMES = 0x100, +} D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS);") + +typedef enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE_8x8 = 0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE_16x16 = 1, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE_32x32 = 2, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE_64x64 = 3, +} D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE; + +typedef enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE_4x4 = 0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE_8x8 = 1, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE_16x16 = 2, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE_32x32 = 3, +} D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS SupportFlags; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE MinLumaCodingUnitSize; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE MaxLumaCodingUnitSize; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE MinLumaTransformUnitSize; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE MaxLumaTransformUnitSize; + UCHAR max_transform_hierarchy_depth_inter; + UCHAR max_transform_hierarchy_depth_intra; +} D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT { + UINT DataSize; + union + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264* pH264Support; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC* pHEVCSupport; + }; +} D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT { + UINT NodeIndex; // input + D3D12_VIDEO_ENCODER_CODEC Codec; // input + D3D12_VIDEO_ENCODER_PROFILE_DESC Profile; // input + BOOL IsSupported; // output + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT CodecSupportLimits; // input/output +} D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_H264 { + UINT MaxL0ReferencesForP; + UINT MaxL0ReferencesForB; + UINT MaxL1ReferencesForB; + UINT MaxLongTermReferences; + UINT MaxDPBCapacity; +} D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_H264; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_HEVC { + UINT MaxL0ReferencesForP; + UINT MaxL0ReferencesForB; + UINT MaxL1ReferencesForB; + UINT MaxLongTermReferences; + UINT MaxDPBCapacity; +} D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT { + UINT DataSize; + union + { + D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_H264* pH264Support; + D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_HEVC* pHEVCSupport; + }; +} D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT { + UINT NodeIndex; // input + D3D12_VIDEO_ENCODER_CODEC Codec; // input + D3D12_VIDEO_ENCODER_PROFILE_DESC Profile; // input + BOOL IsSupported; // output + D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT PictureSupport; // output +} D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT; + +typedef enum D3D12_VIDEO_ENCODER_SUPPORT_FLAGS +{ + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_NONE = 0x0, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_GENERAL_SUPPORT_OK = 0x1, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_RECONFIGURATION_AVAILABLE = 0x2, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RESOLUTION_RECONFIGURATION_AVAILABLE = 0x4, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_VBV_SIZE_CONFIG_AVAILABLE = 0x8, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_FRAME_ANALYSIS_AVAILABLE = 0x10, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RECONSTRUCTED_FRAMES_REQUIRE_TEXTURE_ARRAYS = 0x20, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_DELTA_QP_AVAILABLE = 0x40, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_SUBREGION_LAYOUT_RECONFIGURATION_AVAILABLE = 0x80, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_ADJUSTABLE_QP_RANGE_AVAILABLE = 0x100, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_INITIAL_QP_AVAILABLE = 0x200, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_MAX_FRAME_SIZE_AVAILABLE = 0x400, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_SEQUENCE_GOP_RECONFIGURATION_AVAILABLE = 0x800, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_MOTION_ESTIMATION_PRECISION_MODE_LIMIT_AVAILABLE = 0x1000, +} D3D12_VIDEO_ENCODER_SUPPORT_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_SUPPORT_FLAGS);") + +typedef enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAGS +{ + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_NONE = 0x0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_USE_CONSTRAINED_INTRAPREDICTION = 0x1, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_USE_ADAPTIVE_8x8_TRANSFORM = 0x2, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_ENABLE_CABAC_ENCODING = 0x4, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_ALLOW_REQUEST_INTRA_CONSTRAINED_SLICES = 0x8, +} D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAGS);") + +typedef enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES_DISABLED = 0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES_TEMPORAL = 1, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES_SPATIAL = 2, +} D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264 +{ + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAGS ConfigurationFlags; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES DirectModeConfig; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODES DisableDeblockingFilterConfig; +} D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264; + +typedef enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAGS +{ + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_NONE = 0x0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_DISABLE_LOOP_FILTER_ACROSS_SLICES = 0x1, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_ALLOW_REQUEST_INTRA_CONSTRAINED_SLICES = 0x2, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_ENABLE_SAO_FILTER = 0x4, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_ENABLE_LONG_TERM_REFERENCES = 0x8, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_USE_ASYMETRIC_MOTION_PARTITION = 0x10, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_ENABLE_TRANSFORM_SKIPPING = 0x20, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_USE_CONSTRAINED_INTRAPREDICTION = 0x40, +} D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAGS);") + +typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAGS ConfigurationFlags; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE MinLumaCodingUnitSize; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE MaxLumaCodingUnitSize; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE MinLumaTransformUnitSize; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE MaxLumaTransformUnitSize; + UCHAR max_transform_hierarchy_depth_inter; + UCHAR max_transform_hierarchy_depth_intra; +} D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION +{ + UINT DataSize; + union + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264* pH264Config; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC* pHEVCConfig; + }; +} D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION; + +typedef struct D3D12_VIDEO_ENCODER_INTRA_REFRESH +{ + D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE Mode; + UINT IntraRefreshDuration; +} D3D12_VIDEO_ENCODER_INTRA_REFRESH; + + +typedef enum D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE +{ + D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_MAXIMUM = 0, + D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_FULL_PIXEL = 1, + D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_HALF_PIXEL = 2, + D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_QUARTER_PIXEL = 3, +} D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS +{ + UINT MaxSubregionsNumber; + UINT MaxIntraRefreshFrameDuration; + UINT SubregionBlockPixelsSize; + UINT QPMapRegionPixelsSize; +} D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS; + +typedef enum D3D12_VIDEO_ENCODER_VALIDATION_FLAGS +{ + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_NONE = 0x0, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_CODEC_NOT_SUPPORTED = 0x1, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_INPUT_FORMAT_NOT_SUPPORTED = 0x8, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_CODEC_CONFIGURATION_NOT_SUPPORTED = 0x10, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_RATE_CONTROL_MODE_NOT_SUPPORTED = 0x20, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_RATE_CONTROL_CONFIGURATION_NOT_SUPPORTED = 0x40, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_INTRA_REFRESH_MODE_NOT_SUPPORTED = 0x80, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_SUBREGION_LAYOUT_MODE_NOT_SUPPORTED = 0x100, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_RESOLUTION_NOT_SUPPORTED_IN_LIST = 0x200, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_GOP_STRUCTURE_NOT_SUPPORTED = 0x800, +} D3D12_VIDEO_ENCODER_VALIDATION_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_VALIDATION_FLAGS);") + +typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264 +{ + UINT GOPLength; + UINT PPicturePeriod; + UCHAR pic_order_cnt_type; + UCHAR log2_max_frame_num_minus4; + UCHAR log2_max_pic_order_cnt_lsb_minus4; +} D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264; + +typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_HEVC +{ + UINT GOPLength; + UINT PPicturePeriod; + UCHAR log2_max_pic_order_cnt_lsb_minus4; +} D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE +{ + UINT DataSize; + union + { + D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264* pH264GroupOfPictures; + D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_HEVC* pHEVCGroupOfPictures; + }; +} D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT +{ + // input + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + DXGI_FORMAT InputFormat; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION CodecConfiguration; + D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE CodecGopSequence; + D3D12_VIDEO_ENCODER_RATE_CONTROL RateControl; + D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE IntraRefresh; + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE SubregionFrameEncoding; + UINT ResolutionsListCount; + const D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC* pResolutionList; + UINT MaxReferenceFramesInDPB; + + // single value output + D3D12_VIDEO_ENCODER_VALIDATION_FLAGS ValidationFlags; + D3D12_VIDEO_ENCODER_SUPPORT_FLAGS SupportFlags; + D3D12_VIDEO_ENCODER_PROFILE_DESC SuggestedProfile; + D3D12_VIDEO_ENCODER_LEVEL_SETTING SuggestedLevel; // assuming max resolution from input list + + // resolution dependent output + [annotation("_Field_size_full_(ResolutionsListCount)")] D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS* pResolutionDependentSupport; +} D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT; + + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOURCE_REQUIREMENTS +{ + UINT NodeIndex; // input + D3D12_VIDEO_ENCODER_CODEC Codec; // input + D3D12_VIDEO_ENCODER_PROFILE_DESC Profile; // input + DXGI_FORMAT InputFormat; // input + D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC PictureTargetResolution; // input + + BOOL IsSupported; // output + UINT CompressedBitstreamBufferAccessAlignment; // output + UINT EncoderMetadataBufferAccessAlignment; // output + UINT MaxEncoderOutputMetadataBufferSize; // output +} D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOURCE_REQUIREMENTS; + +// +// Video Encoder creation API +// + +typedef enum D3D12_VIDEO_ENCODER_FLAGS +{ + D3D12_VIDEO_ENCODER_FLAG_NONE = 0x0, +} D3D12_VIDEO_ENCODER_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_FLAGS);") + +typedef struct D3D12_VIDEO_ENCODER_DESC +{ + UINT NodeMask; + D3D12_VIDEO_ENCODER_FLAGS Flags; + D3D12_VIDEO_ENCODER_CODEC EncodeCodec; + D3D12_VIDEO_ENCODER_PROFILE_DESC EncodeProfile; + DXGI_FORMAT InputFormat; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION CodecConfiguration; + D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE MaxMotionEstimationPrecision; +} D3D12_VIDEO_ENCODER_DESC; + +[uuid(2E0D212D-8DF9-44A6-A770-BB289B182737), object, local, pointer_default(unique)] +interface ID3D12VideoEncoder + : ID3D12Pageable +{ + UINT GetNodeMask(); + D3D12_VIDEO_ENCODER_FLAGS GetEncoderFlags(); + D3D12_VIDEO_ENCODER_CODEC GetCodec(); + HRESULT GetCodecProfile([annotation("_Inout_")] D3D12_VIDEO_ENCODER_PROFILE_DESC dstProfile); + HRESULT GetCodecConfiguration([annotation("_Inout_")] D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION dstCodecConfig); + DXGI_FORMAT GetInputFormat(); + D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE GetMaxMotionEstimationPrecision(); +} + +[uuid(22B35D96-876A-44C0-B25E-FB8C9C7F1C4A), object, local, pointer_default(unique)] +interface ID3D12VideoEncoderHeap + : ID3D12Pageable +{ + UINT GetNodeMask(); + D3D12_VIDEO_ENCODER_HEAP_FLAGS GetEncoderHeapFlags(); + D3D12_VIDEO_ENCODER_CODEC GetCodec(); + HRESULT GetCodecProfile([annotation("_Inout_")] D3D12_VIDEO_ENCODER_PROFILE_DESC dstProfile); + HRESULT GetCodecLevel([annotation("_Inout_")] D3D12_VIDEO_ENCODER_LEVEL_SETTING dstLevel); + UINT GetResolutionListCount(); + HRESULT GetResolutionList( + const UINT ResolutionsListCount, + [annotation("_Out_writes_(ResolutionsListCount)")] D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC* pResolutionList); +} + +[uuid(4243ADB4-3A32-4666-973C-0CCC5625DC44), object, local, pointer_default(unique)] +interface ID3D12VideoDevice3 + : ID3D12VideoDevice2 +{ + + HRESULT CreateVideoEncoder( + [annotation("_In_")] const D3D12_VIDEO_ENCODER_DESC* pDesc, + [annotation("_In_")] REFIID riid, // Expected: IID_ID3D12VideoEncoder, + [annotation("_COM_Outptr_")] void** ppVideoEncoder); + + HRESULT CreateVideoEncoderHeap( + [annotation("_In_")] const D3D12_VIDEO_ENCODER_HEAP_DESC* pDesc, + [annotation("_In_")] REFIID riid, // Expected: IID_ID3D12VideoEncoderHeap, + [annotation("_COM_Outptr_")] void** ppVideoEncoderHeap); + +} + +// +// Video Encoder operation API +// + + +typedef enum D3D12_VIDEO_ENCODER_FRAME_TYPE_H264 +{ + D3D12_VIDEO_ENCODER_FRAME_TYPE_H264_I_FRAME = 0, + D3D12_VIDEO_ENCODER_FRAME_TYPE_H264_P_FRAME = 1, + D3D12_VIDEO_ENCODER_FRAME_TYPE_H264_B_FRAME = 2, + D3D12_VIDEO_ENCODER_FRAME_TYPE_H264_IDR_FRAME = 3, +} D3D12_VIDEO_ENCODER_FRAME_TYPE_H264; + + +typedef struct D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_H264 +{ + UINT ReconstructedPictureResourceIndex; + BOOL IsLongTermReference; + UINT LongTermPictureIdx; + UINT PictureOrderCountNumber; + UINT FrameDecodingOrderNumber; + UINT TemporalLayerIndex; +} D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_H264; + +typedef enum D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS +{ + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAG_NONE = 0x0, + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAG_REQUEST_INTRA_CONSTRAINED_SLICES = 0x1, +} D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS);") + +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_MARKING_OPERATION +{ + UCHAR memory_management_control_operation; + UINT difference_of_pic_nums_minus1; + UINT long_term_pic_num; + UINT long_term_frame_idx; + UINT max_long_term_frame_idx_plus1; +} D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_MARKING_OPERATION; + +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_LIST_MODIFICATION_OPERATION +{ + UCHAR modification_of_pic_nums_idc; + UINT abs_diff_pic_num_minus1; + UINT long_term_pic_num; +} D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_LIST_MODIFICATION_OPERATION; + +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264 +{ + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS Flags; + D3D12_VIDEO_ENCODER_FRAME_TYPE_H264 FrameType; + UINT pic_parameter_set_id; + UINT idr_pic_id; + UINT PictureOrderCountNumber; + UINT FrameDecodingOrderNumber; + UINT TemporalLayerIndex; + UINT List0ReferenceFramesCount; + [annotation("_Field_size_full_(List0ReferenceFramesCount)")] UINT* pList0ReferenceFrames; + UINT List1ReferenceFramesCount; + [annotation("_Field_size_full_(List1ReferenceFramesCount)")] UINT* pList1ReferenceFrames; + UINT ReferenceFramesReconPictureDescriptorsCount; + [annotation("_Field_size_full_(ReferenceFramesReconPictureDescriptorsCount)")] D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_H264* pReferenceFramesReconPictureDescriptors; + UCHAR adaptive_ref_pic_marking_mode_flag; + UINT RefPicMarkingOperationsCommandsCount; + [annotation("_Field_size_full_(RefPicMarkingOperationsCommandsCount)")] D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_MARKING_OPERATION* pRefPicMarkingOperationsCommands; + UINT List0RefPicModificationsCount; + [annotation("_Field_size_full_(List0RefPicModificationsCount)")] D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_LIST_MODIFICATION_OPERATION* pList0RefPicModifications; + UINT List1RefPicModificationsCount; + [annotation("_Field_size_full_(List1RefPicModificationsCount)")] D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_LIST_MODIFICATION_OPERATION* pList1RefPicModifications; + UINT QPMapValuesCount; + [annotation("_Field_size_full_(QPMapValuesCount)")] INT8 *pRateControlQPMap; +} D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264; + +typedef enum D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC +{ + D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC_I_FRAME = 0, + D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC_P_FRAME = 1, + D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC_B_FRAME = 2, + D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC_IDR_FRAME = 3, +} D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_HEVC +{ + UINT ReconstructedPictureResourceIndex; + BOOL IsRefUsedByCurrentPic; + BOOL IsLongTermReference; + UINT PictureOrderCountNumber; + UINT TemporalLayerIndex; +} D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_HEVC; + +typedef enum D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS +{ + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAG_NONE = 0x0, + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAG_REQUEST_INTRA_CONSTRAINED_SLICES = 0x1, +} D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS);") + +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC +{ + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS Flags; + D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC FrameType; + UINT slice_pic_parameter_set_id; + UINT PictureOrderCountNumber; + UINT TemporalLayerIndex; + UINT List0ReferenceFramesCount; + [annotation("_Field_size_full_(List0ReferenceFramesCount)")] UINT* pList0ReferenceFrames; + UINT List1ReferenceFramesCount; + [annotation("_Field_size_full_(List1ReferenceFramesCount)")] UINT* pList1ReferenceFrames; + UINT ReferenceFramesReconPictureDescriptorsCount; + [annotation("_Field_size_full_(ReferenceFramesReconPictureDescriptorsCount)")] D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_HEVC* pReferenceFramesReconPictureDescriptors; + UINT List0RefPicModificationsCount; + [annotation("_Field_size_full_(List0RefPicModificationsCount)")] UINT* pList0RefPicModifications; + UINT List1RefPicModificationsCount; + [annotation("_Field_size_full_(List1RefPicModificationsCount)")] UINT* pList1RefPicModifications; + UINT QPMapValuesCount; + [annotation("_Field_size_full_(QPMapValuesCount)")] INT8 *pRateControlQPMap; +} D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA +{ + UINT DataSize; + union + { + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264* pH264PicData; + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC* pHEVCPicData; + }; +} D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA; + +typedef struct D3D12_VIDEO_ENCODE_REFERENCE_FRAMES +{ + UINT NumTexture2Ds; + [annotation("_Field_size_full_(NumTexture2Ds)")] ID3D12Resource** ppTexture2Ds; + [annotation("_Field_size_full_(NumTexture2Ds)")] UINT* pSubresources; +} D3D12_VIDEO_ENCODE_REFERENCE_FRAMES; + +typedef enum D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS +{ + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAG_NONE = 0x0, + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAG_USED_AS_REFERENCE_PICTURE = 0x1, +} D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS);") + +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC +{ + UINT IntraRefreshFrameIndex; + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS Flags; + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA PictureControlCodecData; + D3D12_VIDEO_ENCODE_REFERENCE_FRAMES ReferenceFrames; +} D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC; + +typedef enum D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS +{ + D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_NONE = 0x0, + D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_RESOLUTION_CHANGE = 0x1, + D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_RATE_CONTROL_CHANGE = 0x2, + D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_SUBREGION_LAYOUT_CHANGE = 0x4, + D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_REQUEST_INTRA_REFRESH = 0x8, + D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_GOP_SEQUENCE_CHANGE = 0x10, +} D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS);") + +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES +{ + // Mutually exclusive options according to selected mode + union + { + // Use with mode: D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_BYTES_PER_SUBREGION + UINT MaxBytesPerSlice; + + // Use with mode: D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_SQUARE_UNITS_PER_SUBREGION_ROW_UNALIGNED + UINT NumberOfCodingUnitsPerSlice; + + // Use with mode: D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_PARTITIONING_ROWS_PER_SUBREGION + UINT NumberOfRowsPerSlice; + + // Use with mode: D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_PARTITIONING_SUBREGIONS_PER_FRAME + UINT NumberOfSlicesPerFrame; + }; +} D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES; + +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA +{ + UINT DataSize; + union + { + const D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES* pSlicesPartition_H264; + const D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES* pSlicesPartition_HEVC; + }; + +} D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA; + +typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC +{ + D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS Flags; + D3D12_VIDEO_ENCODER_INTRA_REFRESH IntraRefreshConfig; + D3D12_VIDEO_ENCODER_RATE_CONTROL RateControl; + D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC PictureTargetResolution; + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE SelectedLayoutMode; + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA FrameSubregionsLayoutData; + D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE CodecGopSequence; +} D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC; + +// +// Video Encoder operation commands API +// + +typedef struct D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS +{ + D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC SequenceControlDesc; + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC PictureControlDesc; + ID3D12Resource *pInputFrame; + UINT InputFrameSubresource; + UINT CurrentFrameBitstreamMetadataSize; +} D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS; + +typedef struct D3D12_VIDEO_ENCODER_COMPRESSED_BITSTREAM +{ + ID3D12Resource* pBuffer; + UINT64 FrameStartOffset; +} D3D12_VIDEO_ENCODER_COMPRESSED_BITSTREAM; + +typedef struct D3D12_VIDEO_ENCODER_RECONSTRUCTED_PICTURE +{ + ID3D12Resource *pReconstructedPicture; + UINT ReconstructedPictureSubresource; +} D3D12_VIDEO_ENCODER_RECONSTRUCTED_PICTURE; + +typedef struct D3D12_VIDEO_ENCODER_FRAME_SUBREGION_METADATA +{ + UINT64 bSize; + UINT64 bStartOffset; + UINT64 bHeaderSize; +} D3D12_VIDEO_ENCODER_FRAME_SUBREGION_METADATA; + +typedef enum D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAGS +{ + D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_NO_ERROR = 0x0, + D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_CODEC_PICTURE_CONTROL_NOT_SUPPORTED = 0x1, + D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_SUBREGION_LAYOUT_CONFIGURATION_NOT_SUPPORTED = 0x2, + D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_INVALID_REFERENCE_PICTURES = 0x4, + D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_RECONFIGURATION_REQUEST_NOT_SUPPORTED = 0x8, + D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_INVALID_METADATA_BUFFER_SOURCE = 0x10, +} D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAGS);") + +typedef struct D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS +{ + UINT64 AverageQP; + UINT64 IntraCodingUnitsCount; + UINT64 InterCodingUnitsCount; + UINT64 SkipCodingUnitsCount; + UINT64 AverageMotionEstimationXDirection; + UINT64 AverageMotionEstimationYDirection; +} D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS; + +typedef struct D3D12_VIDEO_ENCODER_OUTPUT_METADATA +{ + UINT64 EncodeErrorFlags; // D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAGS + D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS EncodeStats; + UINT64 EncodedBitstreamWrittenBytesCount; + UINT64 WrittenSubregionsCount; +} D3D12_VIDEO_ENCODER_OUTPUT_METADATA; + +typedef struct D3D12_VIDEO_ENCODER_ENCODE_OPERATION_METADATA_BUFFER +{ + ID3D12Resource* pBuffer; + UINT64 Offset; +} D3D12_VIDEO_ENCODER_ENCODE_OPERATION_METADATA_BUFFER; + +typedef struct D3D12_VIDEO_ENCODER_RESOLVE_METADATA_INPUT_ARGUMENTS +{ + D3D12_VIDEO_ENCODER_CODEC EncoderCodec; + D3D12_VIDEO_ENCODER_PROFILE_DESC EncoderProfile; + DXGI_FORMAT EncoderInputFormat; + D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC EncodedPictureEffectiveResolution; + D3D12_VIDEO_ENCODER_ENCODE_OPERATION_METADATA_BUFFER HWLayoutMetadata; +} D3D12_VIDEO_ENCODER_RESOLVE_METADATA_INPUT_ARGUMENTS; + +typedef struct D3D12_VIDEO_ENCODER_RESOLVE_METADATA_OUTPUT_ARGUMENTS +{ + D3D12_VIDEO_ENCODER_ENCODE_OPERATION_METADATA_BUFFER ResolvedLayoutMetadata; +} D3D12_VIDEO_ENCODER_RESOLVE_METADATA_OUTPUT_ARGUMENTS; + +typedef struct D3D12_VIDEO_ENCODER_ENCODEFRAME_OUTPUT_ARGUMENTS +{ + D3D12_VIDEO_ENCODER_COMPRESSED_BITSTREAM Bitstream; + D3D12_VIDEO_ENCODER_RECONSTRUCTED_PICTURE ReconstructedPicture; + D3D12_VIDEO_ENCODER_ENCODE_OPERATION_METADATA_BUFFER EncoderOutputMetadata; +} D3D12_VIDEO_ENCODER_ENCODEFRAME_OUTPUT_ARGUMENTS; + +[uuid(895491e2-e701-46a9-9a1f-8d3480ed867a), object, local, pointer_default(unique)] +interface ID3D12VideoEncodeCommandList2 + : ID3D12VideoEncodeCommandList1 +{ + void EncodeFrame( + [annotation("_In_")] ID3D12VideoEncoder* pEncoder, + [annotation("_In_")] ID3D12VideoEncoderHeap *pHeap, + [annotation("_In_")] const D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS *pInputArguments, + [annotation("_In_")] const D3D12_VIDEO_ENCODER_ENCODEFRAME_OUTPUT_ARGUMENTS *pOutputArguments); + + void ResolveEncoderOutputMetadata( + [annotation("_In_")] const D3D12_VIDEO_ENCODER_RESOLVE_METADATA_INPUT_ARGUMENTS* pInputArguments, + [annotation("_In_")] const D3D12_VIDEO_ENCODER_RESOLVE_METADATA_OUTPUT_ARGUMENTS* pOutputArguments); +} + + +[uuid(7f027b22-1515-4e85-aa0d-026486580576), object, local, pointer_default(unique)] +interface ID3D12VideoEncodeCommandList3 + : ID3D12VideoEncodeCommandList2 +{ + + void Barrier( + UINT32 NumBarrierGroups, + [annotation("_In_reads_(NumBarrierGroups)")] const D3D12_BARRIER_GROUP *pBarrierGroups + ); +} + +cpp_quote("#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */") +#pragma endregion + +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoDecoderHeap,0x0946B7C9,0xEBF6,0x4047,0xBB,0x73,0x86,0x83,0xE2,0x7D,0xBB,0x1F);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoDevice,0x1F052807,0x0B46,0x4ACC,0x8A,0x89,0x36,0x4F,0x79,0x37,0x18,0xA4);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoDecoder,0xC59B6BDC,0x7720,0x4074,0xA1,0x36,0x17,0xA1,0x56,0x03,0x74,0x70);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoProcessor,0x304FDB32,0xBEDE,0x410A,0x85,0x45,0x94,0x3A,0xC6,0xA4,0x61,0x38);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoDecodeCommandList,0x3B60536E,0xAD29,0x4E64,0xA2,0x69,0xF8,0x53,0x83,0x7E,0x5E,0x53);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoProcessCommandList,0xAEB2543A,0x167F,0x4682,0xAC,0xC8,0xD1,0x59,0xED,0x4A,0x62,0x09);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoDecodeCommandList1,0xD52F011B,0xB56E,0x453C,0xA0,0x5A,0xA7,0xF3,0x11,0xC8,0xF4,0x72);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoProcessCommandList1,0x542C5C4D,0x7596,0x434F,0x8C,0x93,0x4E,0xFA,0x67,0x66,0xF2,0x67);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoMotionEstimator,0x33FDAE0E,0x098B,0x428F,0x87,0xBB,0x34,0xB6,0x95,0xDE,0x08,0xF8);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoMotionVectorHeap,0x5BE17987,0x743A,0x4061,0x83,0x4B,0x23,0xD2,0x2D,0xAE,0xA5,0x05);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoDevice1,0x981611AD,0xA144,0x4C83,0x98,0x90,0xF3,0x0E,0x26,0xD6,0x58,0xAB);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoEncodeCommandList,0x8455293A,0x0CBD,0x4831,0x9B,0x39,0xFB,0xDB,0xAB,0x72,0x47,0x23);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoDecoder1,0x79A2E5FB,0xCCD2,0x469A,0x9F,0xDE,0x19,0x5D,0x10,0x95,0x1F,0x7E);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoDecoderHeap1,0xDA1D98C5,0x539F,0x41B2,0xBF,0x6B,0x11,0x98,0xA0,0x3B,0x6D,0x26);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoProcessor1,0xF3CFE615,0x553F,0x425C,0x86,0xD8,0xEE,0x8C,0x1B,0x1F,0xB0,0x1C);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoExtensionCommand,0x554E41E8,0xAE8E,0x4A8C,0xB7,0xD2,0x5B,0x4F,0x27,0x4A,0x30,0xE4);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoDevice2,0xF019AC49,0xF838,0x4A95,0x9B,0x17,0x57,0x94,0x37,0xC8,0xF5,0x13);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoDecodeCommandList2,0x6e120880,0xc114,0x4153,0x80,0x36,0xd2,0x47,0x05,0x1e,0x17,0x29);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoDecodeCommandList3,0x2aee8c37,0x9562,0x42da,0x8a,0xbf,0x61,0xef,0xeb,0x2e,0x45,0x13);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoProcessCommandList2,0xdb525ae4,0x6ad6,0x473c,0xba,0xa7,0x59,0xb2,0xe3,0x70,0x82,0xe4);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoProcessCommandList3,0x1a0a4ca4,0x9f08,0x40ce,0x95,0x58,0xb4,0x11,0xfd,0x26,0x66,0xff);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoEncodeCommandList1,0x94971eca,0x2bdb,0x4769,0x88,0xcf,0x36,0x75,0xea,0x75,0x7e,0xbc);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoEncoder,0x2E0D212D,0x8DF9,0x44A6,0xA7,0x70,0xBB,0x28,0x9B,0x18,0x27,0x37);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoEncoderHeap,0x22B35D96,0x876A,0x44C0,0xB2,0x5E,0xFB,0x8C,0x9C,0x7F,0x1C,0x4A);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoDevice3,0x4243ADB4,0x3A32,0x4666,0x97,0x3C,0x0C,0xCC,0x56,0x25,0xDC,0x44);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoEncodeCommandList2,0x895491e2,0xe701,0x46a9,0x9a,0x1f,0x8d,0x34,0x80,0xed,0x86,0x7a);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12VideoEncodeCommandList3,0x7f027b22,0x1515,0x4e85,0xaa,0x0d,0x02,0x64,0x86,0x58,0x05,0x76);" ) diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3dcommon.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3dcommon.h new file mode 100644 index 0000000..33e7762 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3dcommon.h @@ -0,0 +1,1116 @@ +/*------------------------------------------------------------------------------------- + * + * Copyright (c) Microsoft Corporation + * Licensed under the MIT license + * + *-------------------------------------------------------------------------------------*/ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 8.01.0628 */ +/* @@MIDL_FILE_HEADING( ) */ + + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 500 +#endif + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif /* __RPCNDR_H_VERSION__ */ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __d3dcommon_h__ +#define __d3dcommon_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +#ifndef DECLSPEC_XFGVIRT +#if defined(_CONTROL_FLOW_GUARD_XFG) +#define DECLSPEC_XFGVIRT(base, func) __declspec(xfg_virtual(base, func)) +#else +#define DECLSPEC_XFGVIRT(base, func) +#endif +#endif + +/* Forward Declarations */ + +#ifndef __ID3D10Blob_FWD_DEFINED__ +#define __ID3D10Blob_FWD_DEFINED__ +typedef interface ID3D10Blob ID3D10Blob; + +#endif /* __ID3D10Blob_FWD_DEFINED__ */ + + +#ifndef __ID3DDestructionNotifier_FWD_DEFINED__ +#define __ID3DDestructionNotifier_FWD_DEFINED__ +typedef interface ID3DDestructionNotifier ID3DDestructionNotifier; + +#endif /* __ID3DDestructionNotifier_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_d3dcommon_0000_0000 */ +/* [local] */ + +typedef +enum D3D_DRIVER_TYPE + { + D3D_DRIVER_TYPE_UNKNOWN = 0, + D3D_DRIVER_TYPE_HARDWARE = ( D3D_DRIVER_TYPE_UNKNOWN + 1 ) , + D3D_DRIVER_TYPE_REFERENCE = ( D3D_DRIVER_TYPE_HARDWARE + 1 ) , + D3D_DRIVER_TYPE_NULL = ( D3D_DRIVER_TYPE_REFERENCE + 1 ) , + D3D_DRIVER_TYPE_SOFTWARE = ( D3D_DRIVER_TYPE_NULL + 1 ) , + D3D_DRIVER_TYPE_WARP = ( D3D_DRIVER_TYPE_SOFTWARE + 1 ) + } D3D_DRIVER_TYPE; + +typedef +enum D3D_FEATURE_LEVEL + { + D3D_FEATURE_LEVEL_1_0_CORE = 0x1000, + D3D_FEATURE_LEVEL_9_1 = 0x9100, + D3D_FEATURE_LEVEL_9_2 = 0x9200, + D3D_FEATURE_LEVEL_9_3 = 0x9300, + D3D_FEATURE_LEVEL_10_0 = 0xa000, + D3D_FEATURE_LEVEL_10_1 = 0xa100, + D3D_FEATURE_LEVEL_11_0 = 0xb000, + D3D_FEATURE_LEVEL_11_1 = 0xb100, + D3D_FEATURE_LEVEL_12_0 = 0xc000, + D3D_FEATURE_LEVEL_12_1 = 0xc100, + D3D_FEATURE_LEVEL_12_2 = 0xc200 + } D3D_FEATURE_LEVEL; + +#define D3D_FL9_1_REQ_TEXTURE1D_U_DIMENSION 2048 +#define D3D_FL9_3_REQ_TEXTURE1D_U_DIMENSION 4096 +#define D3D_FL9_1_REQ_TEXTURE2D_U_OR_V_DIMENSION 2048 +#define D3D_FL9_3_REQ_TEXTURE2D_U_OR_V_DIMENSION 4096 +#define D3D_FL9_1_REQ_TEXTURECUBE_DIMENSION 512 +#define D3D_FL9_3_REQ_TEXTURECUBE_DIMENSION 4096 +#define D3D_FL9_1_REQ_TEXTURE3D_U_V_OR_W_DIMENSION 256 +#define D3D_FL9_1_DEFAULT_MAX_ANISOTROPY 2 +#define D3D_FL9_1_IA_PRIMITIVE_MAX_COUNT 65535 +#define D3D_FL9_2_IA_PRIMITIVE_MAX_COUNT 1048575 +#define D3D_FL9_1_SIMULTANEOUS_RENDER_TARGET_COUNT 1 +#define D3D_FL9_3_SIMULTANEOUS_RENDER_TARGET_COUNT 4 +#define D3D_FL9_1_MAX_TEXTURE_REPEAT 128 +#define D3D_FL9_2_MAX_TEXTURE_REPEAT 2048 +#define D3D_FL9_3_MAX_TEXTURE_REPEAT 8192 +typedef +enum D3D_PRIMITIVE_TOPOLOGY + { + D3D_PRIMITIVE_TOPOLOGY_UNDEFINED = 0, + D3D_PRIMITIVE_TOPOLOGY_POINTLIST = 1, + D3D_PRIMITIVE_TOPOLOGY_LINELIST = 2, + D3D_PRIMITIVE_TOPOLOGY_LINESTRIP = 3, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST = 4, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = 5, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLEFAN = 6, + D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = 10, + D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = 11, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = 12, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = 13, + D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST = 33, + D3D_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST = 34, + D3D_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST = 35, + D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST = 36, + D3D_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST = 37, + D3D_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST = 38, + D3D_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST = 39, + D3D_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST = 40, + D3D_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST = 41, + D3D_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST = 42, + D3D_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST = 43, + D3D_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST = 44, + D3D_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST = 45, + D3D_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST = 46, + D3D_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST = 47, + D3D_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST = 48, + D3D_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST = 49, + D3D_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST = 50, + D3D_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST = 51, + D3D_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST = 52, + D3D_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST = 53, + D3D_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST = 54, + D3D_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST = 55, + D3D_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST = 56, + D3D_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST = 57, + D3D_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST = 58, + D3D_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST = 59, + D3D_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST = 60, + D3D_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST = 61, + D3D_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST = 62, + D3D_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST = 63, + D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST = 64, + D3D10_PRIMITIVE_TOPOLOGY_UNDEFINED = D3D_PRIMITIVE_TOPOLOGY_UNDEFINED, + D3D10_PRIMITIVE_TOPOLOGY_POINTLIST = D3D_PRIMITIVE_TOPOLOGY_POINTLIST, + D3D10_PRIMITIVE_TOPOLOGY_LINELIST = D3D_PRIMITIVE_TOPOLOGY_LINELIST, + D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP, + D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST, + D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP, + D3D10_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ, + D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ, + D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ, + D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ, + D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED = D3D_PRIMITIVE_TOPOLOGY_UNDEFINED, + D3D11_PRIMITIVE_TOPOLOGY_POINTLIST = D3D_PRIMITIVE_TOPOLOGY_POINTLIST, + D3D11_PRIMITIVE_TOPOLOGY_LINELIST = D3D_PRIMITIVE_TOPOLOGY_LINELIST, + D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP, + D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST, + D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP, + D3D11_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ, + D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ, + D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ, + D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ, + D3D11_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST + } D3D_PRIMITIVE_TOPOLOGY; + +typedef +enum D3D_PRIMITIVE + { + D3D_PRIMITIVE_UNDEFINED = 0, + D3D_PRIMITIVE_POINT = 1, + D3D_PRIMITIVE_LINE = 2, + D3D_PRIMITIVE_TRIANGLE = 3, + D3D_PRIMITIVE_LINE_ADJ = 6, + D3D_PRIMITIVE_TRIANGLE_ADJ = 7, + D3D_PRIMITIVE_1_CONTROL_POINT_PATCH = 8, + D3D_PRIMITIVE_2_CONTROL_POINT_PATCH = 9, + D3D_PRIMITIVE_3_CONTROL_POINT_PATCH = 10, + D3D_PRIMITIVE_4_CONTROL_POINT_PATCH = 11, + D3D_PRIMITIVE_5_CONTROL_POINT_PATCH = 12, + D3D_PRIMITIVE_6_CONTROL_POINT_PATCH = 13, + D3D_PRIMITIVE_7_CONTROL_POINT_PATCH = 14, + D3D_PRIMITIVE_8_CONTROL_POINT_PATCH = 15, + D3D_PRIMITIVE_9_CONTROL_POINT_PATCH = 16, + D3D_PRIMITIVE_10_CONTROL_POINT_PATCH = 17, + D3D_PRIMITIVE_11_CONTROL_POINT_PATCH = 18, + D3D_PRIMITIVE_12_CONTROL_POINT_PATCH = 19, + D3D_PRIMITIVE_13_CONTROL_POINT_PATCH = 20, + D3D_PRIMITIVE_14_CONTROL_POINT_PATCH = 21, + D3D_PRIMITIVE_15_CONTROL_POINT_PATCH = 22, + D3D_PRIMITIVE_16_CONTROL_POINT_PATCH = 23, + D3D_PRIMITIVE_17_CONTROL_POINT_PATCH = 24, + D3D_PRIMITIVE_18_CONTROL_POINT_PATCH = 25, + D3D_PRIMITIVE_19_CONTROL_POINT_PATCH = 26, + D3D_PRIMITIVE_20_CONTROL_POINT_PATCH = 27, + D3D_PRIMITIVE_21_CONTROL_POINT_PATCH = 28, + D3D_PRIMITIVE_22_CONTROL_POINT_PATCH = 29, + D3D_PRIMITIVE_23_CONTROL_POINT_PATCH = 30, + D3D_PRIMITIVE_24_CONTROL_POINT_PATCH = 31, + D3D_PRIMITIVE_25_CONTROL_POINT_PATCH = 32, + D3D_PRIMITIVE_26_CONTROL_POINT_PATCH = 33, + D3D_PRIMITIVE_27_CONTROL_POINT_PATCH = 34, + D3D_PRIMITIVE_28_CONTROL_POINT_PATCH = 35, + D3D_PRIMITIVE_29_CONTROL_POINT_PATCH = 36, + D3D_PRIMITIVE_30_CONTROL_POINT_PATCH = 37, + D3D_PRIMITIVE_31_CONTROL_POINT_PATCH = 38, + D3D_PRIMITIVE_32_CONTROL_POINT_PATCH = 39, + D3D10_PRIMITIVE_UNDEFINED = D3D_PRIMITIVE_UNDEFINED, + D3D10_PRIMITIVE_POINT = D3D_PRIMITIVE_POINT, + D3D10_PRIMITIVE_LINE = D3D_PRIMITIVE_LINE, + D3D10_PRIMITIVE_TRIANGLE = D3D_PRIMITIVE_TRIANGLE, + D3D10_PRIMITIVE_LINE_ADJ = D3D_PRIMITIVE_LINE_ADJ, + D3D10_PRIMITIVE_TRIANGLE_ADJ = D3D_PRIMITIVE_TRIANGLE_ADJ, + D3D11_PRIMITIVE_UNDEFINED = D3D_PRIMITIVE_UNDEFINED, + D3D11_PRIMITIVE_POINT = D3D_PRIMITIVE_POINT, + D3D11_PRIMITIVE_LINE = D3D_PRIMITIVE_LINE, + D3D11_PRIMITIVE_TRIANGLE = D3D_PRIMITIVE_TRIANGLE, + D3D11_PRIMITIVE_LINE_ADJ = D3D_PRIMITIVE_LINE_ADJ, + D3D11_PRIMITIVE_TRIANGLE_ADJ = D3D_PRIMITIVE_TRIANGLE_ADJ, + D3D11_PRIMITIVE_1_CONTROL_POINT_PATCH = D3D_PRIMITIVE_1_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_2_CONTROL_POINT_PATCH = D3D_PRIMITIVE_2_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_3_CONTROL_POINT_PATCH = D3D_PRIMITIVE_3_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_4_CONTROL_POINT_PATCH = D3D_PRIMITIVE_4_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_5_CONTROL_POINT_PATCH = D3D_PRIMITIVE_5_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_6_CONTROL_POINT_PATCH = D3D_PRIMITIVE_6_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_7_CONTROL_POINT_PATCH = D3D_PRIMITIVE_7_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_8_CONTROL_POINT_PATCH = D3D_PRIMITIVE_8_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_9_CONTROL_POINT_PATCH = D3D_PRIMITIVE_9_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_10_CONTROL_POINT_PATCH = D3D_PRIMITIVE_10_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_11_CONTROL_POINT_PATCH = D3D_PRIMITIVE_11_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_12_CONTROL_POINT_PATCH = D3D_PRIMITIVE_12_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_13_CONTROL_POINT_PATCH = D3D_PRIMITIVE_13_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_14_CONTROL_POINT_PATCH = D3D_PRIMITIVE_14_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_15_CONTROL_POINT_PATCH = D3D_PRIMITIVE_15_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_16_CONTROL_POINT_PATCH = D3D_PRIMITIVE_16_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_17_CONTROL_POINT_PATCH = D3D_PRIMITIVE_17_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_18_CONTROL_POINT_PATCH = D3D_PRIMITIVE_18_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_19_CONTROL_POINT_PATCH = D3D_PRIMITIVE_19_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_20_CONTROL_POINT_PATCH = D3D_PRIMITIVE_20_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_21_CONTROL_POINT_PATCH = D3D_PRIMITIVE_21_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_22_CONTROL_POINT_PATCH = D3D_PRIMITIVE_22_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_23_CONTROL_POINT_PATCH = D3D_PRIMITIVE_23_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_24_CONTROL_POINT_PATCH = D3D_PRIMITIVE_24_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_25_CONTROL_POINT_PATCH = D3D_PRIMITIVE_25_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_26_CONTROL_POINT_PATCH = D3D_PRIMITIVE_26_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_27_CONTROL_POINT_PATCH = D3D_PRIMITIVE_27_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_28_CONTROL_POINT_PATCH = D3D_PRIMITIVE_28_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_29_CONTROL_POINT_PATCH = D3D_PRIMITIVE_29_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_30_CONTROL_POINT_PATCH = D3D_PRIMITIVE_30_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_31_CONTROL_POINT_PATCH = D3D_PRIMITIVE_31_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_32_CONTROL_POINT_PATCH = D3D_PRIMITIVE_32_CONTROL_POINT_PATCH + } D3D_PRIMITIVE; + +typedef +enum D3D_SRV_DIMENSION + { + D3D_SRV_DIMENSION_UNKNOWN = 0, + D3D_SRV_DIMENSION_BUFFER = 1, + D3D_SRV_DIMENSION_TEXTURE1D = 2, + D3D_SRV_DIMENSION_TEXTURE1DARRAY = 3, + D3D_SRV_DIMENSION_TEXTURE2D = 4, + D3D_SRV_DIMENSION_TEXTURE2DARRAY = 5, + D3D_SRV_DIMENSION_TEXTURE2DMS = 6, + D3D_SRV_DIMENSION_TEXTURE2DMSARRAY = 7, + D3D_SRV_DIMENSION_TEXTURE3D = 8, + D3D_SRV_DIMENSION_TEXTURECUBE = 9, + D3D_SRV_DIMENSION_TEXTURECUBEARRAY = 10, + D3D_SRV_DIMENSION_BUFFEREX = 11, + D3D10_SRV_DIMENSION_UNKNOWN = D3D_SRV_DIMENSION_UNKNOWN, + D3D10_SRV_DIMENSION_BUFFER = D3D_SRV_DIMENSION_BUFFER, + D3D10_SRV_DIMENSION_TEXTURE1D = D3D_SRV_DIMENSION_TEXTURE1D, + D3D10_SRV_DIMENSION_TEXTURE1DARRAY = D3D_SRV_DIMENSION_TEXTURE1DARRAY, + D3D10_SRV_DIMENSION_TEXTURE2D = D3D_SRV_DIMENSION_TEXTURE2D, + D3D10_SRV_DIMENSION_TEXTURE2DARRAY = D3D_SRV_DIMENSION_TEXTURE2DARRAY, + D3D10_SRV_DIMENSION_TEXTURE2DMS = D3D_SRV_DIMENSION_TEXTURE2DMS, + D3D10_SRV_DIMENSION_TEXTURE2DMSARRAY = D3D_SRV_DIMENSION_TEXTURE2DMSARRAY, + D3D10_SRV_DIMENSION_TEXTURE3D = D3D_SRV_DIMENSION_TEXTURE3D, + D3D10_SRV_DIMENSION_TEXTURECUBE = D3D_SRV_DIMENSION_TEXTURECUBE, + D3D10_1_SRV_DIMENSION_UNKNOWN = D3D_SRV_DIMENSION_UNKNOWN, + D3D10_1_SRV_DIMENSION_BUFFER = D3D_SRV_DIMENSION_BUFFER, + D3D10_1_SRV_DIMENSION_TEXTURE1D = D3D_SRV_DIMENSION_TEXTURE1D, + D3D10_1_SRV_DIMENSION_TEXTURE1DARRAY = D3D_SRV_DIMENSION_TEXTURE1DARRAY, + D3D10_1_SRV_DIMENSION_TEXTURE2D = D3D_SRV_DIMENSION_TEXTURE2D, + D3D10_1_SRV_DIMENSION_TEXTURE2DARRAY = D3D_SRV_DIMENSION_TEXTURE2DARRAY, + D3D10_1_SRV_DIMENSION_TEXTURE2DMS = D3D_SRV_DIMENSION_TEXTURE2DMS, + D3D10_1_SRV_DIMENSION_TEXTURE2DMSARRAY = D3D_SRV_DIMENSION_TEXTURE2DMSARRAY, + D3D10_1_SRV_DIMENSION_TEXTURE3D = D3D_SRV_DIMENSION_TEXTURE3D, + D3D10_1_SRV_DIMENSION_TEXTURECUBE = D3D_SRV_DIMENSION_TEXTURECUBE, + D3D10_1_SRV_DIMENSION_TEXTURECUBEARRAY = D3D_SRV_DIMENSION_TEXTURECUBEARRAY, + D3D11_SRV_DIMENSION_UNKNOWN = D3D_SRV_DIMENSION_UNKNOWN, + D3D11_SRV_DIMENSION_BUFFER = D3D_SRV_DIMENSION_BUFFER, + D3D11_SRV_DIMENSION_TEXTURE1D = D3D_SRV_DIMENSION_TEXTURE1D, + D3D11_SRV_DIMENSION_TEXTURE1DARRAY = D3D_SRV_DIMENSION_TEXTURE1DARRAY, + D3D11_SRV_DIMENSION_TEXTURE2D = D3D_SRV_DIMENSION_TEXTURE2D, + D3D11_SRV_DIMENSION_TEXTURE2DARRAY = D3D_SRV_DIMENSION_TEXTURE2DARRAY, + D3D11_SRV_DIMENSION_TEXTURE2DMS = D3D_SRV_DIMENSION_TEXTURE2DMS, + D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY = D3D_SRV_DIMENSION_TEXTURE2DMSARRAY, + D3D11_SRV_DIMENSION_TEXTURE3D = D3D_SRV_DIMENSION_TEXTURE3D, + D3D11_SRV_DIMENSION_TEXTURECUBE = D3D_SRV_DIMENSION_TEXTURECUBE, + D3D11_SRV_DIMENSION_TEXTURECUBEARRAY = D3D_SRV_DIMENSION_TEXTURECUBEARRAY, + D3D11_SRV_DIMENSION_BUFFEREX = D3D_SRV_DIMENSION_BUFFEREX + } D3D_SRV_DIMENSION; + +#define D3D_SHADER_FEATURE_DOUBLES 0x00001 +#define D3D_SHADER_FEATURE_COMPUTE_SHADERS_PLUS_RAW_AND_STRUCTURED_BUFFERS_VIA_SHADER_4_X 0x00002 +#define D3D_SHADER_FEATURE_UAVS_AT_EVERY_STAGE 0x00004 +#define D3D_SHADER_FEATURE_64_UAVS 0x00008 +#define D3D_SHADER_FEATURE_MINIMUM_PRECISION 0x00010 +#define D3D_SHADER_FEATURE_11_1_DOUBLE_EXTENSIONS 0x00020 +#define D3D_SHADER_FEATURE_11_1_SHADER_EXTENSIONS 0x00040 +#define D3D_SHADER_FEATURE_LEVEL_9_COMPARISON_FILTERING 0x00080 +#define D3D_SHADER_FEATURE_TILED_RESOURCES 0x00100 +#define D3D_SHADER_FEATURE_STENCIL_REF 0x00200 +#define D3D_SHADER_FEATURE_INNER_COVERAGE 0x00400 +#define D3D_SHADER_FEATURE_TYPED_UAV_LOAD_ADDITIONAL_FORMATS 0x00800 +#define D3D_SHADER_FEATURE_ROVS 0x01000 +#define D3D_SHADER_FEATURE_VIEWPORT_AND_RT_ARRAY_INDEX_FROM_ANY_SHADER_FEEDING_RASTERIZER 0x02000 +#define D3D_SHADER_FEATURE_WAVE_OPS 0x04000 +#define D3D_SHADER_FEATURE_INT64_OPS 0x08000 +#define D3D_SHADER_FEATURE_VIEW_ID 0x10000 +#define D3D_SHADER_FEATURE_BARYCENTRICS 0x20000 +#define D3D_SHADER_FEATURE_NATIVE_16BIT_OPS 0x40000 +#define D3D_SHADER_FEATURE_SHADING_RATE 0x80000 +#define D3D_SHADER_FEATURE_RAYTRACING_TIER_1_1 0x100000 +#define D3D_SHADER_FEATURE_SAMPLER_FEEDBACK 0x200000 +#define D3D_SHADER_FEATURE_ATOMIC_INT64_ON_TYPED_RESOURCE 0x400000 +#define D3D_SHADER_FEATURE_ATOMIC_INT64_ON_GROUP_SHARED 0x800000 +#define D3D_SHADER_FEATURE_DERIVATIVES_IN_MESH_AND_AMPLIFICATION_SHADERS 0x1000000 +#define D3D_SHADER_FEATURE_RESOURCE_DESCRIPTOR_HEAP_INDEXING 0x2000000 +#define D3D_SHADER_FEATURE_SAMPLER_DESCRIPTOR_HEAP_INDEXING 0x4000000 +#define D3D_SHADER_FEATURE_WAVE_MMA 0x8000000 +#define D3D_SHADER_FEATURE_ATOMIC_INT64_ON_DESCRIPTOR_HEAP_RESOURCE 0x10000000 +#define D3D_SHADER_FEATURE_ADVANCED_TEXTURE_OPS 0x20000000 +#define D3D_SHADER_FEATURE_WRITEABLE_MSAA_TEXTURES 0x40000000 +typedef struct _D3D_SHADER_MACRO + { + LPCSTR Name; + LPCSTR Definition; + } D3D_SHADER_MACRO; + +typedef struct _D3D_SHADER_MACRO *LPD3D_SHADER_MACRO; + +DEFINE_GUID(IID_ID3D10Blob, 0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0xd, 0x98, 0x9c, 0x3a, 0x1, 0x2); + + +extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0000_v0_0_s_ifspec; + +#ifndef __ID3D10Blob_INTERFACE_DEFINED__ +#define __ID3D10Blob_INTERFACE_DEFINED__ + +/* interface ID3D10Blob */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Blob; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("8BA5FB08-5195-40e2-AC58-0D989C3A0102") + ID3D10Blob : public IUnknown + { + public: + virtual LPVOID STDMETHODCALLTYPE GetBufferPointer( void) = 0; + + virtual SIZE_T STDMETHODCALLTYPE GetBufferSize( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D10BlobVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Blob * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Blob * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Blob * This); + + DECLSPEC_XFGVIRT(ID3D10Blob, GetBufferPointer) + LPVOID ( STDMETHODCALLTYPE *GetBufferPointer )( + ID3D10Blob * This); + + DECLSPEC_XFGVIRT(ID3D10Blob, GetBufferSize) + SIZE_T ( STDMETHODCALLTYPE *GetBufferSize )( + ID3D10Blob * This); + + END_INTERFACE + } ID3D10BlobVtbl; + + interface ID3D10Blob + { + CONST_VTBL struct ID3D10BlobVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Blob_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Blob_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Blob_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Blob_GetBufferPointer(This) \ + ( (This)->lpVtbl -> GetBufferPointer(This) ) + +#define ID3D10Blob_GetBufferSize(This) \ + ( (This)->lpVtbl -> GetBufferSize(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Blob_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3dcommon_0000_0001 */ +/* [local] */ + +typedef interface ID3D10Blob* LPD3D10BLOB; +typedef ID3D10Blob ID3DBlob; + +typedef ID3DBlob* LPD3DBLOB; +#define IID_ID3DBlob IID_ID3D10Blob +typedef void ( __stdcall *PFN_DESTRUCTION_CALLBACK )( + void *pData); + + + +extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0001_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0001_v0_0_s_ifspec; + +#ifndef __ID3DDestructionNotifier_INTERFACE_DEFINED__ +#define __ID3DDestructionNotifier_INTERFACE_DEFINED__ + +/* interface ID3DDestructionNotifier */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3DDestructionNotifier; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("a06eb39a-50da-425b-8c31-4eecd6c270f3") + ID3DDestructionNotifier : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE RegisterDestructionCallback( + /* [annotation] */ + _In_ PFN_DESTRUCTION_CALLBACK callbackFn, + /* [annotation] */ + _In_ void *pData, + /* [annotation] */ + _Out_ UINT *pCallbackID) = 0; + + virtual HRESULT STDMETHODCALLTYPE UnregisterDestructionCallback( + /* [annotation] */ + _In_ UINT callbackID) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3DDestructionNotifierVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3DDestructionNotifier * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3DDestructionNotifier * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3DDestructionNotifier * This); + + DECLSPEC_XFGVIRT(ID3DDestructionNotifier, RegisterDestructionCallback) + HRESULT ( STDMETHODCALLTYPE *RegisterDestructionCallback )( + ID3DDestructionNotifier * This, + /* [annotation] */ + _In_ PFN_DESTRUCTION_CALLBACK callbackFn, + /* [annotation] */ + _In_ void *pData, + /* [annotation] */ + _Out_ UINT *pCallbackID); + + DECLSPEC_XFGVIRT(ID3DDestructionNotifier, UnregisterDestructionCallback) + HRESULT ( STDMETHODCALLTYPE *UnregisterDestructionCallback )( + ID3DDestructionNotifier * This, + /* [annotation] */ + _In_ UINT callbackID); + + END_INTERFACE + } ID3DDestructionNotifierVtbl; + + interface ID3DDestructionNotifier + { + CONST_VTBL struct ID3DDestructionNotifierVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3DDestructionNotifier_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3DDestructionNotifier_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3DDestructionNotifier_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3DDestructionNotifier_RegisterDestructionCallback(This,callbackFn,pData,pCallbackID) \ + ( (This)->lpVtbl -> RegisterDestructionCallback(This,callbackFn,pData,pCallbackID) ) + +#define ID3DDestructionNotifier_UnregisterDestructionCallback(This,callbackID) \ + ( (This)->lpVtbl -> UnregisterDestructionCallback(This,callbackID) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3DDestructionNotifier_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3dcommon_0000_0002 */ +/* [local] */ + +typedef +enum _D3D_INCLUDE_TYPE + { + D3D_INCLUDE_LOCAL = 0, + D3D_INCLUDE_SYSTEM = ( D3D_INCLUDE_LOCAL + 1 ) , + D3D10_INCLUDE_LOCAL = D3D_INCLUDE_LOCAL, + D3D10_INCLUDE_SYSTEM = D3D_INCLUDE_SYSTEM, + D3D_INCLUDE_FORCE_DWORD = 0x7fffffff + } D3D_INCLUDE_TYPE; + +typedef interface ID3DInclude ID3DInclude; +#undef INTERFACE +#define INTERFACE ID3DInclude +DECLARE_INTERFACE(ID3DInclude) +{ + STDMETHOD(Open)(THIS_ D3D_INCLUDE_TYPE IncludeType, LPCSTR pFileName, LPCVOID pParentData, LPCVOID *ppData, UINT *pBytes) PURE; + STDMETHOD(Close)(THIS_ LPCVOID pData) PURE; +}; +typedef ID3DInclude* LPD3DINCLUDE; +typedef +enum _D3D_SHADER_VARIABLE_CLASS + { + D3D_SVC_SCALAR = 0, + D3D_SVC_VECTOR = ( D3D_SVC_SCALAR + 1 ) , + D3D_SVC_MATRIX_ROWS = ( D3D_SVC_VECTOR + 1 ) , + D3D_SVC_MATRIX_COLUMNS = ( D3D_SVC_MATRIX_ROWS + 1 ) , + D3D_SVC_OBJECT = ( D3D_SVC_MATRIX_COLUMNS + 1 ) , + D3D_SVC_STRUCT = ( D3D_SVC_OBJECT + 1 ) , + D3D_SVC_INTERFACE_CLASS = ( D3D_SVC_STRUCT + 1 ) , + D3D_SVC_INTERFACE_POINTER = ( D3D_SVC_INTERFACE_CLASS + 1 ) , + D3D10_SVC_SCALAR = D3D_SVC_SCALAR, + D3D10_SVC_VECTOR = D3D_SVC_VECTOR, + D3D10_SVC_MATRIX_ROWS = D3D_SVC_MATRIX_ROWS, + D3D10_SVC_MATRIX_COLUMNS = D3D_SVC_MATRIX_COLUMNS, + D3D10_SVC_OBJECT = D3D_SVC_OBJECT, + D3D10_SVC_STRUCT = D3D_SVC_STRUCT, + D3D11_SVC_INTERFACE_CLASS = D3D_SVC_INTERFACE_CLASS, + D3D11_SVC_INTERFACE_POINTER = D3D_SVC_INTERFACE_POINTER, + D3D_SVC_FORCE_DWORD = 0x7fffffff + } D3D_SHADER_VARIABLE_CLASS; + +typedef +enum _D3D_SHADER_VARIABLE_FLAGS + { + D3D_SVF_USERPACKED = 1, + D3D_SVF_USED = 2, + D3D_SVF_INTERFACE_POINTER = 4, + D3D_SVF_INTERFACE_PARAMETER = 8, + D3D10_SVF_USERPACKED = D3D_SVF_USERPACKED, + D3D10_SVF_USED = D3D_SVF_USED, + D3D11_SVF_INTERFACE_POINTER = D3D_SVF_INTERFACE_POINTER, + D3D11_SVF_INTERFACE_PARAMETER = D3D_SVF_INTERFACE_PARAMETER, + D3D_SVF_FORCE_DWORD = 0x7fffffff + } D3D_SHADER_VARIABLE_FLAGS; + +typedef +enum _D3D_SHADER_VARIABLE_TYPE + { + D3D_SVT_VOID = 0, + D3D_SVT_BOOL = 1, + D3D_SVT_INT = 2, + D3D_SVT_FLOAT = 3, + D3D_SVT_STRING = 4, + D3D_SVT_TEXTURE = 5, + D3D_SVT_TEXTURE1D = 6, + D3D_SVT_TEXTURE2D = 7, + D3D_SVT_TEXTURE3D = 8, + D3D_SVT_TEXTURECUBE = 9, + D3D_SVT_SAMPLER = 10, + D3D_SVT_SAMPLER1D = 11, + D3D_SVT_SAMPLER2D = 12, + D3D_SVT_SAMPLER3D = 13, + D3D_SVT_SAMPLERCUBE = 14, + D3D_SVT_PIXELSHADER = 15, + D3D_SVT_VERTEXSHADER = 16, + D3D_SVT_PIXELFRAGMENT = 17, + D3D_SVT_VERTEXFRAGMENT = 18, + D3D_SVT_UINT = 19, + D3D_SVT_UINT8 = 20, + D3D_SVT_GEOMETRYSHADER = 21, + D3D_SVT_RASTERIZER = 22, + D3D_SVT_DEPTHSTENCIL = 23, + D3D_SVT_BLEND = 24, + D3D_SVT_BUFFER = 25, + D3D_SVT_CBUFFER = 26, + D3D_SVT_TBUFFER = 27, + D3D_SVT_TEXTURE1DARRAY = 28, + D3D_SVT_TEXTURE2DARRAY = 29, + D3D_SVT_RENDERTARGETVIEW = 30, + D3D_SVT_DEPTHSTENCILVIEW = 31, + D3D_SVT_TEXTURE2DMS = 32, + D3D_SVT_TEXTURE2DMSARRAY = 33, + D3D_SVT_TEXTURECUBEARRAY = 34, + D3D_SVT_HULLSHADER = 35, + D3D_SVT_DOMAINSHADER = 36, + D3D_SVT_INTERFACE_POINTER = 37, + D3D_SVT_COMPUTESHADER = 38, + D3D_SVT_DOUBLE = 39, + D3D_SVT_RWTEXTURE1D = 40, + D3D_SVT_RWTEXTURE1DARRAY = 41, + D3D_SVT_RWTEXTURE2D = 42, + D3D_SVT_RWTEXTURE2DARRAY = 43, + D3D_SVT_RWTEXTURE3D = 44, + D3D_SVT_RWBUFFER = 45, + D3D_SVT_BYTEADDRESS_BUFFER = 46, + D3D_SVT_RWBYTEADDRESS_BUFFER = 47, + D3D_SVT_STRUCTURED_BUFFER = 48, + D3D_SVT_RWSTRUCTURED_BUFFER = 49, + D3D_SVT_APPEND_STRUCTURED_BUFFER = 50, + D3D_SVT_CONSUME_STRUCTURED_BUFFER = 51, + D3D_SVT_MIN8FLOAT = 52, + D3D_SVT_MIN10FLOAT = 53, + D3D_SVT_MIN16FLOAT = 54, + D3D_SVT_MIN12INT = 55, + D3D_SVT_MIN16INT = 56, + D3D_SVT_MIN16UINT = 57, + D3D_SVT_INT16 = 58, + D3D_SVT_UINT16 = 59, + D3D_SVT_FLOAT16 = 60, + D3D_SVT_INT64 = 61, + D3D_SVT_UINT64 = 62, + D3D10_SVT_VOID = D3D_SVT_VOID, + D3D10_SVT_BOOL = D3D_SVT_BOOL, + D3D10_SVT_INT = D3D_SVT_INT, + D3D10_SVT_FLOAT = D3D_SVT_FLOAT, + D3D10_SVT_STRING = D3D_SVT_STRING, + D3D10_SVT_TEXTURE = D3D_SVT_TEXTURE, + D3D10_SVT_TEXTURE1D = D3D_SVT_TEXTURE1D, + D3D10_SVT_TEXTURE2D = D3D_SVT_TEXTURE2D, + D3D10_SVT_TEXTURE3D = D3D_SVT_TEXTURE3D, + D3D10_SVT_TEXTURECUBE = D3D_SVT_TEXTURECUBE, + D3D10_SVT_SAMPLER = D3D_SVT_SAMPLER, + D3D10_SVT_SAMPLER1D = D3D_SVT_SAMPLER1D, + D3D10_SVT_SAMPLER2D = D3D_SVT_SAMPLER2D, + D3D10_SVT_SAMPLER3D = D3D_SVT_SAMPLER3D, + D3D10_SVT_SAMPLERCUBE = D3D_SVT_SAMPLERCUBE, + D3D10_SVT_PIXELSHADER = D3D_SVT_PIXELSHADER, + D3D10_SVT_VERTEXSHADER = D3D_SVT_VERTEXSHADER, + D3D10_SVT_PIXELFRAGMENT = D3D_SVT_PIXELFRAGMENT, + D3D10_SVT_VERTEXFRAGMENT = D3D_SVT_VERTEXFRAGMENT, + D3D10_SVT_UINT = D3D_SVT_UINT, + D3D10_SVT_UINT8 = D3D_SVT_UINT8, + D3D10_SVT_GEOMETRYSHADER = D3D_SVT_GEOMETRYSHADER, + D3D10_SVT_RASTERIZER = D3D_SVT_RASTERIZER, + D3D10_SVT_DEPTHSTENCIL = D3D_SVT_DEPTHSTENCIL, + D3D10_SVT_BLEND = D3D_SVT_BLEND, + D3D10_SVT_BUFFER = D3D_SVT_BUFFER, + D3D10_SVT_CBUFFER = D3D_SVT_CBUFFER, + D3D10_SVT_TBUFFER = D3D_SVT_TBUFFER, + D3D10_SVT_TEXTURE1DARRAY = D3D_SVT_TEXTURE1DARRAY, + D3D10_SVT_TEXTURE2DARRAY = D3D_SVT_TEXTURE2DARRAY, + D3D10_SVT_RENDERTARGETVIEW = D3D_SVT_RENDERTARGETVIEW, + D3D10_SVT_DEPTHSTENCILVIEW = D3D_SVT_DEPTHSTENCILVIEW, + D3D10_SVT_TEXTURE2DMS = D3D_SVT_TEXTURE2DMS, + D3D10_SVT_TEXTURE2DMSARRAY = D3D_SVT_TEXTURE2DMSARRAY, + D3D10_SVT_TEXTURECUBEARRAY = D3D_SVT_TEXTURECUBEARRAY, + D3D11_SVT_HULLSHADER = D3D_SVT_HULLSHADER, + D3D11_SVT_DOMAINSHADER = D3D_SVT_DOMAINSHADER, + D3D11_SVT_INTERFACE_POINTER = D3D_SVT_INTERFACE_POINTER, + D3D11_SVT_COMPUTESHADER = D3D_SVT_COMPUTESHADER, + D3D11_SVT_DOUBLE = D3D_SVT_DOUBLE, + D3D11_SVT_RWTEXTURE1D = D3D_SVT_RWTEXTURE1D, + D3D11_SVT_RWTEXTURE1DARRAY = D3D_SVT_RWTEXTURE1DARRAY, + D3D11_SVT_RWTEXTURE2D = D3D_SVT_RWTEXTURE2D, + D3D11_SVT_RWTEXTURE2DARRAY = D3D_SVT_RWTEXTURE2DARRAY, + D3D11_SVT_RWTEXTURE3D = D3D_SVT_RWTEXTURE3D, + D3D11_SVT_RWBUFFER = D3D_SVT_RWBUFFER, + D3D11_SVT_BYTEADDRESS_BUFFER = D3D_SVT_BYTEADDRESS_BUFFER, + D3D11_SVT_RWBYTEADDRESS_BUFFER = D3D_SVT_RWBYTEADDRESS_BUFFER, + D3D11_SVT_STRUCTURED_BUFFER = D3D_SVT_STRUCTURED_BUFFER, + D3D11_SVT_RWSTRUCTURED_BUFFER = D3D_SVT_RWSTRUCTURED_BUFFER, + D3D11_SVT_APPEND_STRUCTURED_BUFFER = D3D_SVT_APPEND_STRUCTURED_BUFFER, + D3D11_SVT_CONSUME_STRUCTURED_BUFFER = D3D_SVT_CONSUME_STRUCTURED_BUFFER, + D3D_SVT_FORCE_DWORD = 0x7fffffff + } D3D_SHADER_VARIABLE_TYPE; + +typedef +enum _D3D_SHADER_INPUT_FLAGS + { + D3D_SIF_USERPACKED = 0x1, + D3D_SIF_COMPARISON_SAMPLER = 0x2, + D3D_SIF_TEXTURE_COMPONENT_0 = 0x4, + D3D_SIF_TEXTURE_COMPONENT_1 = 0x8, + D3D_SIF_TEXTURE_COMPONENTS = 0xc, + D3D_SIF_UNUSED = 0x10, + D3D10_SIF_USERPACKED = D3D_SIF_USERPACKED, + D3D10_SIF_COMPARISON_SAMPLER = D3D_SIF_COMPARISON_SAMPLER, + D3D10_SIF_TEXTURE_COMPONENT_0 = D3D_SIF_TEXTURE_COMPONENT_0, + D3D10_SIF_TEXTURE_COMPONENT_1 = D3D_SIF_TEXTURE_COMPONENT_1, + D3D10_SIF_TEXTURE_COMPONENTS = D3D_SIF_TEXTURE_COMPONENTS, + D3D_SIF_FORCE_DWORD = 0x7fffffff + } D3D_SHADER_INPUT_FLAGS; + +typedef +enum _D3D_SHADER_INPUT_TYPE + { + D3D_SIT_CBUFFER = 0, + D3D_SIT_TBUFFER = ( D3D_SIT_CBUFFER + 1 ) , + D3D_SIT_TEXTURE = ( D3D_SIT_TBUFFER + 1 ) , + D3D_SIT_SAMPLER = ( D3D_SIT_TEXTURE + 1 ) , + D3D_SIT_UAV_RWTYPED = ( D3D_SIT_SAMPLER + 1 ) , + D3D_SIT_STRUCTURED = ( D3D_SIT_UAV_RWTYPED + 1 ) , + D3D_SIT_UAV_RWSTRUCTURED = ( D3D_SIT_STRUCTURED + 1 ) , + D3D_SIT_BYTEADDRESS = ( D3D_SIT_UAV_RWSTRUCTURED + 1 ) , + D3D_SIT_UAV_RWBYTEADDRESS = ( D3D_SIT_BYTEADDRESS + 1 ) , + D3D_SIT_UAV_APPEND_STRUCTURED = ( D3D_SIT_UAV_RWBYTEADDRESS + 1 ) , + D3D_SIT_UAV_CONSUME_STRUCTURED = ( D3D_SIT_UAV_APPEND_STRUCTURED + 1 ) , + D3D_SIT_UAV_RWSTRUCTURED_WITH_COUNTER = ( D3D_SIT_UAV_CONSUME_STRUCTURED + 1 ) , + D3D_SIT_RTACCELERATIONSTRUCTURE = ( D3D_SIT_UAV_RWSTRUCTURED_WITH_COUNTER + 1 ) , + D3D_SIT_UAV_FEEDBACKTEXTURE = ( D3D_SIT_RTACCELERATIONSTRUCTURE + 1 ) , + D3D10_SIT_CBUFFER = D3D_SIT_CBUFFER, + D3D10_SIT_TBUFFER = D3D_SIT_TBUFFER, + D3D10_SIT_TEXTURE = D3D_SIT_TEXTURE, + D3D10_SIT_SAMPLER = D3D_SIT_SAMPLER, + D3D11_SIT_UAV_RWTYPED = D3D_SIT_UAV_RWTYPED, + D3D11_SIT_STRUCTURED = D3D_SIT_STRUCTURED, + D3D11_SIT_UAV_RWSTRUCTURED = D3D_SIT_UAV_RWSTRUCTURED, + D3D11_SIT_BYTEADDRESS = D3D_SIT_BYTEADDRESS, + D3D11_SIT_UAV_RWBYTEADDRESS = D3D_SIT_UAV_RWBYTEADDRESS, + D3D11_SIT_UAV_APPEND_STRUCTURED = D3D_SIT_UAV_APPEND_STRUCTURED, + D3D11_SIT_UAV_CONSUME_STRUCTURED = D3D_SIT_UAV_CONSUME_STRUCTURED, + D3D11_SIT_UAV_RWSTRUCTURED_WITH_COUNTER = D3D_SIT_UAV_RWSTRUCTURED_WITH_COUNTER + } D3D_SHADER_INPUT_TYPE; + +typedef +enum _D3D_SHADER_CBUFFER_FLAGS + { + D3D_CBF_USERPACKED = 1, + D3D10_CBF_USERPACKED = D3D_CBF_USERPACKED, + D3D_CBF_FORCE_DWORD = 0x7fffffff + } D3D_SHADER_CBUFFER_FLAGS; + +typedef +enum _D3D_CBUFFER_TYPE + { + D3D_CT_CBUFFER = 0, + D3D_CT_TBUFFER = ( D3D_CT_CBUFFER + 1 ) , + D3D_CT_INTERFACE_POINTERS = ( D3D_CT_TBUFFER + 1 ) , + D3D_CT_RESOURCE_BIND_INFO = ( D3D_CT_INTERFACE_POINTERS + 1 ) , + D3D10_CT_CBUFFER = D3D_CT_CBUFFER, + D3D10_CT_TBUFFER = D3D_CT_TBUFFER, + D3D11_CT_CBUFFER = D3D_CT_CBUFFER, + D3D11_CT_TBUFFER = D3D_CT_TBUFFER, + D3D11_CT_INTERFACE_POINTERS = D3D_CT_INTERFACE_POINTERS, + D3D11_CT_RESOURCE_BIND_INFO = D3D_CT_RESOURCE_BIND_INFO + } D3D_CBUFFER_TYPE; + +typedef +enum D3D_NAME + { + D3D_NAME_UNDEFINED = 0, + D3D_NAME_POSITION = 1, + D3D_NAME_CLIP_DISTANCE = 2, + D3D_NAME_CULL_DISTANCE = 3, + D3D_NAME_RENDER_TARGET_ARRAY_INDEX = 4, + D3D_NAME_VIEWPORT_ARRAY_INDEX = 5, + D3D_NAME_VERTEX_ID = 6, + D3D_NAME_PRIMITIVE_ID = 7, + D3D_NAME_INSTANCE_ID = 8, + D3D_NAME_IS_FRONT_FACE = 9, + D3D_NAME_SAMPLE_INDEX = 10, + D3D_NAME_FINAL_QUAD_EDGE_TESSFACTOR = 11, + D3D_NAME_FINAL_QUAD_INSIDE_TESSFACTOR = 12, + D3D_NAME_FINAL_TRI_EDGE_TESSFACTOR = 13, + D3D_NAME_FINAL_TRI_INSIDE_TESSFACTOR = 14, + D3D_NAME_FINAL_LINE_DETAIL_TESSFACTOR = 15, + D3D_NAME_FINAL_LINE_DENSITY_TESSFACTOR = 16, + D3D_NAME_BARYCENTRICS = 23, + D3D_NAME_SHADINGRATE = 24, + D3D_NAME_CULLPRIMITIVE = 25, + D3D_NAME_TARGET = 64, + D3D_NAME_DEPTH = 65, + D3D_NAME_COVERAGE = 66, + D3D_NAME_DEPTH_GREATER_EQUAL = 67, + D3D_NAME_DEPTH_LESS_EQUAL = 68, + D3D_NAME_STENCIL_REF = 69, + D3D_NAME_INNER_COVERAGE = 70, + D3D10_NAME_UNDEFINED = D3D_NAME_UNDEFINED, + D3D10_NAME_POSITION = D3D_NAME_POSITION, + D3D10_NAME_CLIP_DISTANCE = D3D_NAME_CLIP_DISTANCE, + D3D10_NAME_CULL_DISTANCE = D3D_NAME_CULL_DISTANCE, + D3D10_NAME_RENDER_TARGET_ARRAY_INDEX = D3D_NAME_RENDER_TARGET_ARRAY_INDEX, + D3D10_NAME_VIEWPORT_ARRAY_INDEX = D3D_NAME_VIEWPORT_ARRAY_INDEX, + D3D10_NAME_VERTEX_ID = D3D_NAME_VERTEX_ID, + D3D10_NAME_PRIMITIVE_ID = D3D_NAME_PRIMITIVE_ID, + D3D10_NAME_INSTANCE_ID = D3D_NAME_INSTANCE_ID, + D3D10_NAME_IS_FRONT_FACE = D3D_NAME_IS_FRONT_FACE, + D3D10_NAME_SAMPLE_INDEX = D3D_NAME_SAMPLE_INDEX, + D3D10_NAME_TARGET = D3D_NAME_TARGET, + D3D10_NAME_DEPTH = D3D_NAME_DEPTH, + D3D10_NAME_COVERAGE = D3D_NAME_COVERAGE, + D3D11_NAME_FINAL_QUAD_EDGE_TESSFACTOR = D3D_NAME_FINAL_QUAD_EDGE_TESSFACTOR, + D3D11_NAME_FINAL_QUAD_INSIDE_TESSFACTOR = D3D_NAME_FINAL_QUAD_INSIDE_TESSFACTOR, + D3D11_NAME_FINAL_TRI_EDGE_TESSFACTOR = D3D_NAME_FINAL_TRI_EDGE_TESSFACTOR, + D3D11_NAME_FINAL_TRI_INSIDE_TESSFACTOR = D3D_NAME_FINAL_TRI_INSIDE_TESSFACTOR, + D3D11_NAME_FINAL_LINE_DETAIL_TESSFACTOR = D3D_NAME_FINAL_LINE_DETAIL_TESSFACTOR, + D3D11_NAME_FINAL_LINE_DENSITY_TESSFACTOR = D3D_NAME_FINAL_LINE_DENSITY_TESSFACTOR, + D3D11_NAME_DEPTH_GREATER_EQUAL = D3D_NAME_DEPTH_GREATER_EQUAL, + D3D11_NAME_DEPTH_LESS_EQUAL = D3D_NAME_DEPTH_LESS_EQUAL, + D3D11_NAME_STENCIL_REF = D3D_NAME_STENCIL_REF, + D3D11_NAME_INNER_COVERAGE = D3D_NAME_INNER_COVERAGE, + D3D12_NAME_BARYCENTRICS = D3D_NAME_BARYCENTRICS, + D3D12_NAME_SHADINGRATE = D3D_NAME_SHADINGRATE, + D3D12_NAME_CULLPRIMITIVE = D3D_NAME_CULLPRIMITIVE + } D3D_NAME; + +typedef +enum D3D_RESOURCE_RETURN_TYPE + { + D3D_RETURN_TYPE_UNORM = 1, + D3D_RETURN_TYPE_SNORM = 2, + D3D_RETURN_TYPE_SINT = 3, + D3D_RETURN_TYPE_UINT = 4, + D3D_RETURN_TYPE_FLOAT = 5, + D3D_RETURN_TYPE_MIXED = 6, + D3D_RETURN_TYPE_DOUBLE = 7, + D3D_RETURN_TYPE_CONTINUED = 8, + D3D10_RETURN_TYPE_UNORM = D3D_RETURN_TYPE_UNORM, + D3D10_RETURN_TYPE_SNORM = D3D_RETURN_TYPE_SNORM, + D3D10_RETURN_TYPE_SINT = D3D_RETURN_TYPE_SINT, + D3D10_RETURN_TYPE_UINT = D3D_RETURN_TYPE_UINT, + D3D10_RETURN_TYPE_FLOAT = D3D_RETURN_TYPE_FLOAT, + D3D10_RETURN_TYPE_MIXED = D3D_RETURN_TYPE_MIXED, + D3D11_RETURN_TYPE_UNORM = D3D_RETURN_TYPE_UNORM, + D3D11_RETURN_TYPE_SNORM = D3D_RETURN_TYPE_SNORM, + D3D11_RETURN_TYPE_SINT = D3D_RETURN_TYPE_SINT, + D3D11_RETURN_TYPE_UINT = D3D_RETURN_TYPE_UINT, + D3D11_RETURN_TYPE_FLOAT = D3D_RETURN_TYPE_FLOAT, + D3D11_RETURN_TYPE_MIXED = D3D_RETURN_TYPE_MIXED, + D3D11_RETURN_TYPE_DOUBLE = D3D_RETURN_TYPE_DOUBLE, + D3D11_RETURN_TYPE_CONTINUED = D3D_RETURN_TYPE_CONTINUED + } D3D_RESOURCE_RETURN_TYPE; + +typedef +enum D3D_REGISTER_COMPONENT_TYPE + { + D3D_REGISTER_COMPONENT_UNKNOWN = 0, + D3D_REGISTER_COMPONENT_UINT32 = 1, + D3D_REGISTER_COMPONENT_SINT32 = 2, + D3D_REGISTER_COMPONENT_FLOAT32 = 3, + D3D10_REGISTER_COMPONENT_UNKNOWN = D3D_REGISTER_COMPONENT_UNKNOWN, + D3D10_REGISTER_COMPONENT_UINT32 = D3D_REGISTER_COMPONENT_UINT32, + D3D10_REGISTER_COMPONENT_SINT32 = D3D_REGISTER_COMPONENT_SINT32, + D3D10_REGISTER_COMPONENT_FLOAT32 = D3D_REGISTER_COMPONENT_FLOAT32 + } D3D_REGISTER_COMPONENT_TYPE; + +typedef +enum D3D_TESSELLATOR_DOMAIN + { + D3D_TESSELLATOR_DOMAIN_UNDEFINED = 0, + D3D_TESSELLATOR_DOMAIN_ISOLINE = 1, + D3D_TESSELLATOR_DOMAIN_TRI = 2, + D3D_TESSELLATOR_DOMAIN_QUAD = 3, + D3D11_TESSELLATOR_DOMAIN_UNDEFINED = D3D_TESSELLATOR_DOMAIN_UNDEFINED, + D3D11_TESSELLATOR_DOMAIN_ISOLINE = D3D_TESSELLATOR_DOMAIN_ISOLINE, + D3D11_TESSELLATOR_DOMAIN_TRI = D3D_TESSELLATOR_DOMAIN_TRI, + D3D11_TESSELLATOR_DOMAIN_QUAD = D3D_TESSELLATOR_DOMAIN_QUAD + } D3D_TESSELLATOR_DOMAIN; + +typedef +enum D3D_TESSELLATOR_PARTITIONING + { + D3D_TESSELLATOR_PARTITIONING_UNDEFINED = 0, + D3D_TESSELLATOR_PARTITIONING_INTEGER = 1, + D3D_TESSELLATOR_PARTITIONING_POW2 = 2, + D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD = 3, + D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN = 4, + D3D11_TESSELLATOR_PARTITIONING_UNDEFINED = D3D_TESSELLATOR_PARTITIONING_UNDEFINED, + D3D11_TESSELLATOR_PARTITIONING_INTEGER = D3D_TESSELLATOR_PARTITIONING_INTEGER, + D3D11_TESSELLATOR_PARTITIONING_POW2 = D3D_TESSELLATOR_PARTITIONING_POW2, + D3D11_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD = D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD, + D3D11_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN = D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN + } D3D_TESSELLATOR_PARTITIONING; + +typedef +enum D3D_TESSELLATOR_OUTPUT_PRIMITIVE + { + D3D_TESSELLATOR_OUTPUT_UNDEFINED = 0, + D3D_TESSELLATOR_OUTPUT_POINT = 1, + D3D_TESSELLATOR_OUTPUT_LINE = 2, + D3D_TESSELLATOR_OUTPUT_TRIANGLE_CW = 3, + D3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW = 4, + D3D11_TESSELLATOR_OUTPUT_UNDEFINED = D3D_TESSELLATOR_OUTPUT_UNDEFINED, + D3D11_TESSELLATOR_OUTPUT_POINT = D3D_TESSELLATOR_OUTPUT_POINT, + D3D11_TESSELLATOR_OUTPUT_LINE = D3D_TESSELLATOR_OUTPUT_LINE, + D3D11_TESSELLATOR_OUTPUT_TRIANGLE_CW = D3D_TESSELLATOR_OUTPUT_TRIANGLE_CW, + D3D11_TESSELLATOR_OUTPUT_TRIANGLE_CCW = D3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW + } D3D_TESSELLATOR_OUTPUT_PRIMITIVE; + +typedef +enum D3D_MIN_PRECISION + { + D3D_MIN_PRECISION_DEFAULT = 0, + D3D_MIN_PRECISION_FLOAT_16 = 1, + D3D_MIN_PRECISION_FLOAT_2_8 = 2, + D3D_MIN_PRECISION_RESERVED = 3, + D3D_MIN_PRECISION_SINT_16 = 4, + D3D_MIN_PRECISION_UINT_16 = 5, + D3D_MIN_PRECISION_ANY_16 = 0xf0, + D3D_MIN_PRECISION_ANY_10 = 0xf1 + } D3D_MIN_PRECISION; + +typedef +enum D3D_INTERPOLATION_MODE + { + D3D_INTERPOLATION_UNDEFINED = 0, + D3D_INTERPOLATION_CONSTANT = 1, + D3D_INTERPOLATION_LINEAR = 2, + D3D_INTERPOLATION_LINEAR_CENTROID = 3, + D3D_INTERPOLATION_LINEAR_NOPERSPECTIVE = 4, + D3D_INTERPOLATION_LINEAR_NOPERSPECTIVE_CENTROID = 5, + D3D_INTERPOLATION_LINEAR_SAMPLE = 6, + D3D_INTERPOLATION_LINEAR_NOPERSPECTIVE_SAMPLE = 7 + } D3D_INTERPOLATION_MODE; + +typedef +enum _D3D_PARAMETER_FLAGS + { + D3D_PF_NONE = 0, + D3D_PF_IN = 0x1, + D3D_PF_OUT = 0x2, + D3D_PF_FORCE_DWORD = 0x7fffffff + } D3D_PARAMETER_FLAGS; + +typedef +enum D3D_FORMAT_LAYOUT + { + D3DFL_STANDARD = 0, + D3DFL_CUSTOM = -1 + } D3D_FORMAT_LAYOUT; + +typedef +enum D3D_FORMAT_TYPE_LEVEL + { + D3DFTL_NO_TYPE = 0, + D3DFTL_PARTIAL_TYPE = -2, + D3DFTL_FULL_TYPE = -1 + } D3D_FORMAT_TYPE_LEVEL; + +typedef +enum D3D_FORMAT_COMPONENT_NAME + { + D3DFCN_R = -4, + D3DFCN_G = -3, + D3DFCN_B = -2, + D3DFCN_A = -1, + D3DFCN_D = 0, + D3DFCN_S = 1, + D3DFCN_X = 2 + } D3D_FORMAT_COMPONENT_NAME; + +typedef +enum D3D_FORMAT_COMPONENT_INTERPRETATION + { + D3DFCI_TYPELESS = 0, + D3DFCI_FLOAT = -4, + D3DFCI_SNORM = -3, + D3DFCI_UNORM = -2, + D3DFCI_SINT = -1, + D3DFCI_UINT = 1, + D3DFCI_UNORM_SRGB = 2, + D3DFCI_BIASED_FIXED_2_8 = 3 + } D3D_FORMAT_COMPONENT_INTERPRETATION; + +DEFINE_GUID(WKPDID_D3DDebugObjectName,0x429b8c22,0x9188,0x4b0c,0x87,0x42,0xac,0xb0,0xbf,0x85,0xc2,0x00); +DEFINE_GUID(WKPDID_D3DDebugObjectNameW,0x4cca5fd8,0x921f,0x42c8,0x85,0x66,0x70,0xca,0xf2,0xa9,0xb7,0x41); +DEFINE_GUID(WKPDID_CommentStringW,0xd0149dc0,0x90e8,0x4ec8,0x81, 0x44, 0xe9, 0x00, 0xad, 0x26, 0x6b, 0xb2); +DEFINE_GUID(WKPDID_D3D12UniqueObjectId, 0x1b39de15, 0xec04, 0x4bae, 0xba, 0x4d, 0x8c, 0xef, 0x79, 0xfc, 0x04, 0xc1); +#define D3D_SET_OBJECT_NAME_N_A(pObject, Chars, pName) (pObject)->SetPrivateData(WKPDID_D3DDebugObjectName, Chars, pName) +#define D3D_SET_OBJECT_NAME_A(pObject, pName) D3D_SET_OBJECT_NAME_N_A(pObject, lstrlenA(pName), pName) +#define D3D_SET_OBJECT_NAME_N_W(pObject, Chars, pName) (pObject)->SetPrivateData(WKPDID_D3DDebugObjectNameW, Chars*2, pName) +#define D3D_SET_OBJECT_NAME_W(pObject, pName) D3D_SET_OBJECT_NAME_N_W(pObject, wcslen(pName), pName) +#define D3D_COMPONENT_MASK_X 1 +#define D3D_COMPONENT_MASK_Y 2 +#define D3D_COMPONENT_MASK_Z 4 +#define D3D_COMPONENT_MASK_W 8 +DEFINE_GUID(D3D_TEXTURE_LAYOUT_ROW_MAJOR,0xb5dc234f,0x72bb,0x4bec,0x97,0x05,0x8c,0xf2,0x58,0xdf,0x6b,0x6c); +DEFINE_GUID(D3D_TEXTURE_LAYOUT_64KB_STANDARD_SWIZZLE,0x4c0f29e3,0x3f5f,0x4d35,0x84,0xc9,0xbc,0x09,0x83,0xb6,0x2c,0x28); + + +extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0002_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0002_v0_0_s_ifspec; + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3dcommon.idl b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3dcommon.idl new file mode 100644 index 0000000..3f2b76b --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3dcommon.idl @@ -0,0 +1,964 @@ +/*------------------------------------------------------------------------------------- + * + * Copyright (c) Microsoft Corporation + * Licensed under the MIT license + * + *-------------------------------------------------------------------------------------*/ +import "oaidl.idl"; +import "ocidl.idl"; + +//---------------------------------------------------------------------------- +// +// D3D-version-neutral runtime information. +// +//---------------------------------------------------------------------------- + +typedef enum D3D_DRIVER_TYPE +{ + D3D_DRIVER_TYPE_UNKNOWN, + D3D_DRIVER_TYPE_HARDWARE, + D3D_DRIVER_TYPE_REFERENCE, + D3D_DRIVER_TYPE_NULL, + D3D_DRIVER_TYPE_SOFTWARE, + D3D_DRIVER_TYPE_WARP, +} D3D_DRIVER_TYPE; + +typedef enum D3D_FEATURE_LEVEL +{ + D3D_FEATURE_LEVEL_1_0_CORE = 0x1000, + D3D_FEATURE_LEVEL_9_1 = 0x9100, + D3D_FEATURE_LEVEL_9_2 = 0x9200, + D3D_FEATURE_LEVEL_9_3 = 0x9300, + D3D_FEATURE_LEVEL_10_0 = 0xa000, + D3D_FEATURE_LEVEL_10_1 = 0xa100, + D3D_FEATURE_LEVEL_11_0 = 0xb000, + D3D_FEATURE_LEVEL_11_1 = 0xb100, + D3D_FEATURE_LEVEL_12_0 = 0xc000, + D3D_FEATURE_LEVEL_12_1 = 0xc100, + D3D_FEATURE_LEVEL_12_2 = 0xc200 +} D3D_FEATURE_LEVEL; + +cpp_quote("#define D3D_FL9_1_REQ_TEXTURE1D_U_DIMENSION 2048") +cpp_quote("#define D3D_FL9_3_REQ_TEXTURE1D_U_DIMENSION 4096") +cpp_quote("#define D3D_FL9_1_REQ_TEXTURE2D_U_OR_V_DIMENSION 2048") +cpp_quote("#define D3D_FL9_3_REQ_TEXTURE2D_U_OR_V_DIMENSION 4096") +cpp_quote("#define D3D_FL9_1_REQ_TEXTURECUBE_DIMENSION 512") +cpp_quote("#define D3D_FL9_3_REQ_TEXTURECUBE_DIMENSION 4096") +cpp_quote("#define D3D_FL9_1_REQ_TEXTURE3D_U_V_OR_W_DIMENSION 256") +cpp_quote("#define D3D_FL9_1_DEFAULT_MAX_ANISOTROPY 2") +cpp_quote("#define D3D_FL9_1_IA_PRIMITIVE_MAX_COUNT 65535") +cpp_quote("#define D3D_FL9_2_IA_PRIMITIVE_MAX_COUNT 1048575") +cpp_quote("#define D3D_FL9_1_SIMULTANEOUS_RENDER_TARGET_COUNT 1") +cpp_quote("#define D3D_FL9_3_SIMULTANEOUS_RENDER_TARGET_COUNT 4") +cpp_quote("#define D3D_FL9_1_MAX_TEXTURE_REPEAT 128") +cpp_quote("#define D3D_FL9_2_MAX_TEXTURE_REPEAT 2048") +cpp_quote("#define D3D_FL9_3_MAX_TEXTURE_REPEAT 8192") + +typedef enum D3D_PRIMITIVE_TOPOLOGY +{ + D3D_PRIMITIVE_TOPOLOGY_UNDEFINED = 0, + D3D_PRIMITIVE_TOPOLOGY_POINTLIST = 1, + D3D_PRIMITIVE_TOPOLOGY_LINELIST = 2, + D3D_PRIMITIVE_TOPOLOGY_LINESTRIP = 3, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST = 4, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = 5, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLEFAN = 6, + // Adjacency values should be equal to (0x8 & non-adjacency): + D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = 10, + D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = 11, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = 12, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = 13, + D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST = 33, + D3D_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST = 34, + D3D_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST = 35, + D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST = 36, + D3D_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST = 37, + D3D_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST = 38, + D3D_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST = 39, + D3D_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST = 40, + D3D_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST = 41, + D3D_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST = 42, + D3D_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST = 43, + D3D_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST = 44, + D3D_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST = 45, + D3D_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST = 46, + D3D_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST = 47, + D3D_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST = 48, + D3D_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST = 49, + D3D_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST = 50, + D3D_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST = 51, + D3D_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST = 52, + D3D_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST = 53, + D3D_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST = 54, + D3D_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST = 55, + D3D_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST = 56, + D3D_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST = 57, + D3D_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST = 58, + D3D_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST = 59, + D3D_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST = 60, + D3D_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST = 61, + D3D_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST = 62, + D3D_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST = 63, + D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST = 64, + + D3D10_PRIMITIVE_TOPOLOGY_UNDEFINED = D3D_PRIMITIVE_TOPOLOGY_UNDEFINED, + D3D10_PRIMITIVE_TOPOLOGY_POINTLIST = D3D_PRIMITIVE_TOPOLOGY_POINTLIST, + D3D10_PRIMITIVE_TOPOLOGY_LINELIST = D3D_PRIMITIVE_TOPOLOGY_LINELIST, + D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP, + D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST, + D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP, + D3D10_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ, + D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ, + D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ, + D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ, + + D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED = D3D_PRIMITIVE_TOPOLOGY_UNDEFINED, + D3D11_PRIMITIVE_TOPOLOGY_POINTLIST = D3D_PRIMITIVE_TOPOLOGY_POINTLIST, + D3D11_PRIMITIVE_TOPOLOGY_LINELIST = D3D_PRIMITIVE_TOPOLOGY_LINELIST, + D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP, + D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST, + D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP, + D3D11_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ, + D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ, + D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ, + D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ, + D3D11_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST +} D3D_PRIMITIVE_TOPOLOGY; + +typedef enum D3D_PRIMITIVE +{ + D3D_PRIMITIVE_UNDEFINED = 0, + D3D_PRIMITIVE_POINT = 1, + D3D_PRIMITIVE_LINE = 2, + D3D_PRIMITIVE_TRIANGLE = 3, + // Adjacency values should be equal to (0x4 & non-adjacency): + D3D_PRIMITIVE_LINE_ADJ = 6, + D3D_PRIMITIVE_TRIANGLE_ADJ = 7, + D3D_PRIMITIVE_1_CONTROL_POINT_PATCH = 8, + D3D_PRIMITIVE_2_CONTROL_POINT_PATCH = 9, + D3D_PRIMITIVE_3_CONTROL_POINT_PATCH = 10, + D3D_PRIMITIVE_4_CONTROL_POINT_PATCH = 11, + D3D_PRIMITIVE_5_CONTROL_POINT_PATCH = 12, + D3D_PRIMITIVE_6_CONTROL_POINT_PATCH = 13, + D3D_PRIMITIVE_7_CONTROL_POINT_PATCH = 14, + D3D_PRIMITIVE_8_CONTROL_POINT_PATCH = 15, + D3D_PRIMITIVE_9_CONTROL_POINT_PATCH = 16, + D3D_PRIMITIVE_10_CONTROL_POINT_PATCH = 17, + D3D_PRIMITIVE_11_CONTROL_POINT_PATCH = 18, + D3D_PRIMITIVE_12_CONTROL_POINT_PATCH = 19, + D3D_PRIMITIVE_13_CONTROL_POINT_PATCH = 20, + D3D_PRIMITIVE_14_CONTROL_POINT_PATCH = 21, + D3D_PRIMITIVE_15_CONTROL_POINT_PATCH = 22, + D3D_PRIMITIVE_16_CONTROL_POINT_PATCH = 23, + D3D_PRIMITIVE_17_CONTROL_POINT_PATCH = 24, + D3D_PRIMITIVE_18_CONTROL_POINT_PATCH = 25, + D3D_PRIMITIVE_19_CONTROL_POINT_PATCH = 26, + D3D_PRIMITIVE_20_CONTROL_POINT_PATCH = 27, + D3D_PRIMITIVE_21_CONTROL_POINT_PATCH = 28, + D3D_PRIMITIVE_22_CONTROL_POINT_PATCH = 29, + D3D_PRIMITIVE_23_CONTROL_POINT_PATCH = 30, + D3D_PRIMITIVE_24_CONTROL_POINT_PATCH = 31, + D3D_PRIMITIVE_25_CONTROL_POINT_PATCH = 32, + D3D_PRIMITIVE_26_CONTROL_POINT_PATCH = 33, + D3D_PRIMITIVE_27_CONTROL_POINT_PATCH = 34, + D3D_PRIMITIVE_28_CONTROL_POINT_PATCH = 35, + D3D_PRIMITIVE_29_CONTROL_POINT_PATCH = 36, + D3D_PRIMITIVE_30_CONTROL_POINT_PATCH = 37, + D3D_PRIMITIVE_31_CONTROL_POINT_PATCH = 38, + D3D_PRIMITIVE_32_CONTROL_POINT_PATCH = 39, + + D3D10_PRIMITIVE_UNDEFINED = D3D_PRIMITIVE_UNDEFINED, + D3D10_PRIMITIVE_POINT = D3D_PRIMITIVE_POINT, + D3D10_PRIMITIVE_LINE = D3D_PRIMITIVE_LINE, + D3D10_PRIMITIVE_TRIANGLE = D3D_PRIMITIVE_TRIANGLE, + D3D10_PRIMITIVE_LINE_ADJ = D3D_PRIMITIVE_LINE_ADJ, + D3D10_PRIMITIVE_TRIANGLE_ADJ = D3D_PRIMITIVE_TRIANGLE_ADJ, + + D3D11_PRIMITIVE_UNDEFINED = D3D_PRIMITIVE_UNDEFINED, + D3D11_PRIMITIVE_POINT = D3D_PRIMITIVE_POINT, + D3D11_PRIMITIVE_LINE = D3D_PRIMITIVE_LINE, + D3D11_PRIMITIVE_TRIANGLE = D3D_PRIMITIVE_TRIANGLE, + D3D11_PRIMITIVE_LINE_ADJ = D3D_PRIMITIVE_LINE_ADJ, + D3D11_PRIMITIVE_TRIANGLE_ADJ = D3D_PRIMITIVE_TRIANGLE_ADJ, + D3D11_PRIMITIVE_1_CONTROL_POINT_PATCH = D3D_PRIMITIVE_1_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_2_CONTROL_POINT_PATCH = D3D_PRIMITIVE_2_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_3_CONTROL_POINT_PATCH = D3D_PRIMITIVE_3_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_4_CONTROL_POINT_PATCH = D3D_PRIMITIVE_4_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_5_CONTROL_POINT_PATCH = D3D_PRIMITIVE_5_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_6_CONTROL_POINT_PATCH = D3D_PRIMITIVE_6_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_7_CONTROL_POINT_PATCH = D3D_PRIMITIVE_7_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_8_CONTROL_POINT_PATCH = D3D_PRIMITIVE_8_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_9_CONTROL_POINT_PATCH = D3D_PRIMITIVE_9_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_10_CONTROL_POINT_PATCH = D3D_PRIMITIVE_10_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_11_CONTROL_POINT_PATCH = D3D_PRIMITIVE_11_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_12_CONTROL_POINT_PATCH = D3D_PRIMITIVE_12_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_13_CONTROL_POINT_PATCH = D3D_PRIMITIVE_13_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_14_CONTROL_POINT_PATCH = D3D_PRIMITIVE_14_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_15_CONTROL_POINT_PATCH = D3D_PRIMITIVE_15_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_16_CONTROL_POINT_PATCH = D3D_PRIMITIVE_16_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_17_CONTROL_POINT_PATCH = D3D_PRIMITIVE_17_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_18_CONTROL_POINT_PATCH = D3D_PRIMITIVE_18_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_19_CONTROL_POINT_PATCH = D3D_PRIMITIVE_19_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_20_CONTROL_POINT_PATCH = D3D_PRIMITIVE_20_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_21_CONTROL_POINT_PATCH = D3D_PRIMITIVE_21_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_22_CONTROL_POINT_PATCH = D3D_PRIMITIVE_22_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_23_CONTROL_POINT_PATCH = D3D_PRIMITIVE_23_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_24_CONTROL_POINT_PATCH = D3D_PRIMITIVE_24_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_25_CONTROL_POINT_PATCH = D3D_PRIMITIVE_25_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_26_CONTROL_POINT_PATCH = D3D_PRIMITIVE_26_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_27_CONTROL_POINT_PATCH = D3D_PRIMITIVE_27_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_28_CONTROL_POINT_PATCH = D3D_PRIMITIVE_28_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_29_CONTROL_POINT_PATCH = D3D_PRIMITIVE_29_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_30_CONTROL_POINT_PATCH = D3D_PRIMITIVE_30_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_31_CONTROL_POINT_PATCH = D3D_PRIMITIVE_31_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_32_CONTROL_POINT_PATCH = D3D_PRIMITIVE_32_CONTROL_POINT_PATCH, +} D3D_PRIMITIVE; + +typedef enum D3D_SRV_DIMENSION +{ + D3D_SRV_DIMENSION_UNKNOWN = 0, + D3D_SRV_DIMENSION_BUFFER = 1, + D3D_SRV_DIMENSION_TEXTURE1D = 2, + D3D_SRV_DIMENSION_TEXTURE1DARRAY = 3, + D3D_SRV_DIMENSION_TEXTURE2D = 4, + D3D_SRV_DIMENSION_TEXTURE2DARRAY = 5, + D3D_SRV_DIMENSION_TEXTURE2DMS = 6, + D3D_SRV_DIMENSION_TEXTURE2DMSARRAY = 7, + D3D_SRV_DIMENSION_TEXTURE3D = 8, + D3D_SRV_DIMENSION_TEXTURECUBE = 9, + D3D_SRV_DIMENSION_TEXTURECUBEARRAY = 10, + D3D_SRV_DIMENSION_BUFFEREX = 11, + + D3D10_SRV_DIMENSION_UNKNOWN = D3D_SRV_DIMENSION_UNKNOWN, + D3D10_SRV_DIMENSION_BUFFER = D3D_SRV_DIMENSION_BUFFER, + D3D10_SRV_DIMENSION_TEXTURE1D = D3D_SRV_DIMENSION_TEXTURE1D, + D3D10_SRV_DIMENSION_TEXTURE1DARRAY = D3D_SRV_DIMENSION_TEXTURE1DARRAY, + D3D10_SRV_DIMENSION_TEXTURE2D = D3D_SRV_DIMENSION_TEXTURE2D, + D3D10_SRV_DIMENSION_TEXTURE2DARRAY = D3D_SRV_DIMENSION_TEXTURE2DARRAY, + D3D10_SRV_DIMENSION_TEXTURE2DMS = D3D_SRV_DIMENSION_TEXTURE2DMS, + D3D10_SRV_DIMENSION_TEXTURE2DMSARRAY = D3D_SRV_DIMENSION_TEXTURE2DMSARRAY, + D3D10_SRV_DIMENSION_TEXTURE3D = D3D_SRV_DIMENSION_TEXTURE3D, + D3D10_SRV_DIMENSION_TEXTURECUBE = D3D_SRV_DIMENSION_TEXTURECUBE, + + D3D10_1_SRV_DIMENSION_UNKNOWN = D3D_SRV_DIMENSION_UNKNOWN, + D3D10_1_SRV_DIMENSION_BUFFER = D3D_SRV_DIMENSION_BUFFER, + D3D10_1_SRV_DIMENSION_TEXTURE1D = D3D_SRV_DIMENSION_TEXTURE1D, + D3D10_1_SRV_DIMENSION_TEXTURE1DARRAY = D3D_SRV_DIMENSION_TEXTURE1DARRAY, + D3D10_1_SRV_DIMENSION_TEXTURE2D = D3D_SRV_DIMENSION_TEXTURE2D, + D3D10_1_SRV_DIMENSION_TEXTURE2DARRAY = D3D_SRV_DIMENSION_TEXTURE2DARRAY, + D3D10_1_SRV_DIMENSION_TEXTURE2DMS = D3D_SRV_DIMENSION_TEXTURE2DMS, + D3D10_1_SRV_DIMENSION_TEXTURE2DMSARRAY = D3D_SRV_DIMENSION_TEXTURE2DMSARRAY, + D3D10_1_SRV_DIMENSION_TEXTURE3D = D3D_SRV_DIMENSION_TEXTURE3D, + D3D10_1_SRV_DIMENSION_TEXTURECUBE = D3D_SRV_DIMENSION_TEXTURECUBE, + D3D10_1_SRV_DIMENSION_TEXTURECUBEARRAY = D3D_SRV_DIMENSION_TEXTURECUBEARRAY, + + D3D11_SRV_DIMENSION_UNKNOWN = D3D_SRV_DIMENSION_UNKNOWN, + D3D11_SRV_DIMENSION_BUFFER = D3D_SRV_DIMENSION_BUFFER, + D3D11_SRV_DIMENSION_TEXTURE1D = D3D_SRV_DIMENSION_TEXTURE1D, + D3D11_SRV_DIMENSION_TEXTURE1DARRAY = D3D_SRV_DIMENSION_TEXTURE1DARRAY, + D3D11_SRV_DIMENSION_TEXTURE2D = D3D_SRV_DIMENSION_TEXTURE2D, + D3D11_SRV_DIMENSION_TEXTURE2DARRAY = D3D_SRV_DIMENSION_TEXTURE2DARRAY, + D3D11_SRV_DIMENSION_TEXTURE2DMS = D3D_SRV_DIMENSION_TEXTURE2DMS, + D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY = D3D_SRV_DIMENSION_TEXTURE2DMSARRAY, + D3D11_SRV_DIMENSION_TEXTURE3D = D3D_SRV_DIMENSION_TEXTURE3D, + D3D11_SRV_DIMENSION_TEXTURECUBE = D3D_SRV_DIMENSION_TEXTURECUBE, + D3D11_SRV_DIMENSION_TEXTURECUBEARRAY = D3D_SRV_DIMENSION_TEXTURECUBEARRAY, + D3D11_SRV_DIMENSION_BUFFEREX = D3D_SRV_DIMENSION_BUFFEREX, +} D3D_SRV_DIMENSION; + +// Bits in shaders indicating features they use which the runtime checks against current device support: +cpp_quote("#define D3D_SHADER_FEATURE_DOUBLES 0x00001") +cpp_quote("#define D3D_SHADER_FEATURE_COMPUTE_SHADERS_PLUS_RAW_AND_STRUCTURED_BUFFERS_VIA_SHADER_4_X 0x00002") +cpp_quote("#define D3D_SHADER_FEATURE_UAVS_AT_EVERY_STAGE 0x00004") +cpp_quote("#define D3D_SHADER_FEATURE_64_UAVS 0x00008") +cpp_quote("#define D3D_SHADER_FEATURE_MINIMUM_PRECISION 0x00010") +cpp_quote("#define D3D_SHADER_FEATURE_11_1_DOUBLE_EXTENSIONS 0x00020") +cpp_quote("#define D3D_SHADER_FEATURE_11_1_SHADER_EXTENSIONS 0x00040") +cpp_quote("#define D3D_SHADER_FEATURE_LEVEL_9_COMPARISON_FILTERING 0x00080") +cpp_quote("#define D3D_SHADER_FEATURE_TILED_RESOURCES 0x00100") +cpp_quote("#define D3D_SHADER_FEATURE_STENCIL_REF 0x00200") +cpp_quote("#define D3D_SHADER_FEATURE_INNER_COVERAGE 0x00400") +cpp_quote("#define D3D_SHADER_FEATURE_TYPED_UAV_LOAD_ADDITIONAL_FORMATS 0x00800") +cpp_quote("#define D3D_SHADER_FEATURE_ROVS 0x01000") +cpp_quote("#define D3D_SHADER_FEATURE_VIEWPORT_AND_RT_ARRAY_INDEX_FROM_ANY_SHADER_FEEDING_RASTERIZER 0x02000") +cpp_quote("#define D3D_SHADER_FEATURE_WAVE_OPS 0x04000") +cpp_quote("#define D3D_SHADER_FEATURE_INT64_OPS 0x08000") +cpp_quote("#define D3D_SHADER_FEATURE_VIEW_ID 0x10000") +cpp_quote("#define D3D_SHADER_FEATURE_BARYCENTRICS 0x20000") +cpp_quote("#define D3D_SHADER_FEATURE_NATIVE_16BIT_OPS 0x40000") +cpp_quote("#define D3D_SHADER_FEATURE_SHADING_RATE 0x80000") +cpp_quote("#define D3D_SHADER_FEATURE_RAYTRACING_TIER_1_1 0x100000") +cpp_quote("#define D3D_SHADER_FEATURE_SAMPLER_FEEDBACK 0x200000") +cpp_quote("#define D3D_SHADER_FEATURE_ATOMIC_INT64_ON_TYPED_RESOURCE 0x400000") +cpp_quote("#define D3D_SHADER_FEATURE_ATOMIC_INT64_ON_GROUP_SHARED 0x800000") +cpp_quote("#define D3D_SHADER_FEATURE_DERIVATIVES_IN_MESH_AND_AMPLIFICATION_SHADERS 0x1000000") +cpp_quote("#define D3D_SHADER_FEATURE_RESOURCE_DESCRIPTOR_HEAP_INDEXING 0x2000000") +cpp_quote("#define D3D_SHADER_FEATURE_SAMPLER_DESCRIPTOR_HEAP_INDEXING 0x4000000") +cpp_quote("#define D3D_SHADER_FEATURE_WAVE_MMA 0x8000000") +cpp_quote("#define D3D_SHADER_FEATURE_ATOMIC_INT64_ON_DESCRIPTOR_HEAP_RESOURCE 0x10000000") +cpp_quote("#define D3D_SHADER_FEATURE_ADVANCED_TEXTURE_OPS 0x20000000") +cpp_quote("#define D3D_SHADER_FEATURE_WRITEABLE_MSAA_TEXTURES 0x40000000") + +// Additional internal shader feature flags are listed in dxbcutils.h (not relevant/useful for public to see) +// When adding entries here, make sure they don't conflict with what's there. + +//---------------------------------------------------------------------------- +// +// Shader compilation information. +// +//---------------------------------------------------------------------------- + +//---------------------------------------------------------------------------- +// D3D_SHADER_MACRO: +// ---------- +// Preprocessor macro definition. The application pass in a NULL-terminated +// array of this structure to various D3D APIs. This enables the application +// to #define tokens at runtime, before the file is parsed. +//---------------------------------------------------------------------------- + +typedef struct _D3D_SHADER_MACRO +{ + LPCSTR Name; + LPCSTR Definition; +} D3D_SHADER_MACRO, *LPD3D_SHADER_MACRO; + +//---------------------------------------------------------------------------- +// ID3DBlob: +// ------------ +// The buffer object is used by D3D to return arbitrary size data. +// For compatibility with D3D10 this interface is also called ID3D10Blob, +// but the version-neutral form is preferred. +// +// GetBufferPointer - +// Returns a pointer to the beginning of the buffer. +// +// GetBufferSize - +// Returns the size of the buffer, in bytes. +//---------------------------------------------------------------------------- + +// {8BA5FB08-5195-40e2-AC58-0D989C3A0102} +cpp_quote("DEFINE_GUID(IID_ID3D10Blob, 0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0xd, 0x98, 0x9c, 0x3a, 0x1, 0x2);") + +[ uuid( 8BA5FB08-5195-40e2-AC58-0D989C3A0102 ), object, local, pointer_default( unique ) ] +interface ID3D10Blob : IUnknown +{ + LPVOID GetBufferPointer(); + SIZE_T GetBufferSize(); +}; + +cpp_quote("typedef interface ID3D10Blob* LPD3D10BLOB;") + +typedef ID3D10Blob ID3DBlob; +cpp_quote("typedef ID3DBlob* LPD3DBLOB;") +cpp_quote("#define IID_ID3DBlob IID_ID3D10Blob") + +// ID3DDestructionNotifier: An interface to QI for, to set a callback which is triggered when the object is fully destroyed +typedef void(__stdcall *PFN_DESTRUCTION_CALLBACK)(void* pData); + +[uuid(a06eb39a-50da-425b-8c31-4eecd6c270f3), object, local, pointer_default(unique)] +interface ID3DDestructionNotifier + : IUnknown +{ + HRESULT RegisterDestructionCallback( + [annotation("_In_")] PFN_DESTRUCTION_CALLBACK callbackFn, + [annotation("_In_")] void* pData, + [annotation("_Out_")] UINT* pCallbackID + ); + HRESULT UnregisterDestructionCallback( + [annotation("_In_")] UINT callbackID + ); +}; + +typedef enum _D3D_INCLUDE_TYPE +{ + D3D_INCLUDE_LOCAL, + D3D_INCLUDE_SYSTEM, + + D3D10_INCLUDE_LOCAL = D3D_INCLUDE_LOCAL, + D3D10_INCLUDE_SYSTEM = D3D_INCLUDE_SYSTEM, + + // force 32-bit size enum + D3D_INCLUDE_FORCE_DWORD = 0x7fffffff +} D3D_INCLUDE_TYPE; + +//---------------------------------------------------------------------------- +// ID3DInclude: +// ------------- +// This interface is intended to be implemented by the application, and can +// be used by various D3D APIs. This enables application-specific handling +// of #include directives in source files. +// +// Open() +// Opens an include file. If successful, it should fill in ppData and +// pBytes. The data pointer returned must remain valid until Close is +// subsequently called. The name of the file is encoded in UTF-8 format. +// Close() +// Closes an include file. If Open was successful, Close is guaranteed +// to be called before the API using this interface returns. +//---------------------------------------------------------------------------- + +cpp_quote("typedef interface ID3DInclude ID3DInclude;") + +cpp_quote("#undef INTERFACE") +cpp_quote("#define INTERFACE ID3DInclude") + +cpp_quote("DECLARE_INTERFACE(ID3DInclude)") +cpp_quote("{") +cpp_quote(" STDMETHOD(Open)(THIS_ D3D_INCLUDE_TYPE IncludeType, LPCSTR pFileName, LPCVOID pParentData, LPCVOID *ppData, UINT *pBytes) PURE;") +cpp_quote(" STDMETHOD(Close)(THIS_ LPCVOID pData) PURE;") +cpp_quote("};") + +cpp_quote("typedef ID3DInclude* LPD3DINCLUDE;") + +//---------------------------------------------------------------------------- +// +// Shader reflection information. +// +//---------------------------------------------------------------------------- + +typedef enum _D3D_SHADER_VARIABLE_CLASS +{ + D3D_SVC_SCALAR, + D3D_SVC_VECTOR, + D3D_SVC_MATRIX_ROWS, + D3D_SVC_MATRIX_COLUMNS, + D3D_SVC_OBJECT, + D3D_SVC_STRUCT, + D3D_SVC_INTERFACE_CLASS, + D3D_SVC_INTERFACE_POINTER, + + D3D10_SVC_SCALAR = D3D_SVC_SCALAR, + D3D10_SVC_VECTOR = D3D_SVC_VECTOR, + D3D10_SVC_MATRIX_ROWS = D3D_SVC_MATRIX_ROWS, + D3D10_SVC_MATRIX_COLUMNS = D3D_SVC_MATRIX_COLUMNS, + D3D10_SVC_OBJECT = D3D_SVC_OBJECT, + D3D10_SVC_STRUCT = D3D_SVC_STRUCT, + + D3D11_SVC_INTERFACE_CLASS = D3D_SVC_INTERFACE_CLASS, + D3D11_SVC_INTERFACE_POINTER = D3D_SVC_INTERFACE_POINTER, + + // force 32-bit size enum + D3D_SVC_FORCE_DWORD = 0x7fffffff +} D3D_SHADER_VARIABLE_CLASS; + +typedef enum _D3D_SHADER_VARIABLE_FLAGS +{ + D3D_SVF_USERPACKED = 1, + D3D_SVF_USED = 2, + + D3D_SVF_INTERFACE_POINTER = 4, + D3D_SVF_INTERFACE_PARAMETER = 8, + + D3D10_SVF_USERPACKED = D3D_SVF_USERPACKED, + D3D10_SVF_USED = D3D_SVF_USED, + + D3D11_SVF_INTERFACE_POINTER = D3D_SVF_INTERFACE_POINTER, + D3D11_SVF_INTERFACE_PARAMETER = D3D_SVF_INTERFACE_PARAMETER, + + // force 32-bit size enum + D3D_SVF_FORCE_DWORD = 0x7fffffff +} D3D_SHADER_VARIABLE_FLAGS; + +typedef enum _D3D_SHADER_VARIABLE_TYPE +{ + D3D_SVT_VOID = 0, + D3D_SVT_BOOL = 1, + D3D_SVT_INT = 2, + D3D_SVT_FLOAT = 3, + D3D_SVT_STRING = 4, + D3D_SVT_TEXTURE = 5, + D3D_SVT_TEXTURE1D = 6, + D3D_SVT_TEXTURE2D = 7, + D3D_SVT_TEXTURE3D = 8, + D3D_SVT_TEXTURECUBE = 9, + D3D_SVT_SAMPLER = 10, + D3D_SVT_SAMPLER1D = 11, + D3D_SVT_SAMPLER2D = 12, + D3D_SVT_SAMPLER3D = 13, + D3D_SVT_SAMPLERCUBE = 14, + D3D_SVT_PIXELSHADER = 15, + D3D_SVT_VERTEXSHADER = 16, + D3D_SVT_PIXELFRAGMENT = 17, + D3D_SVT_VERTEXFRAGMENT = 18, + D3D_SVT_UINT = 19, + D3D_SVT_UINT8 = 20, + D3D_SVT_GEOMETRYSHADER = 21, + D3D_SVT_RASTERIZER = 22, + D3D_SVT_DEPTHSTENCIL = 23, + D3D_SVT_BLEND = 24, + D3D_SVT_BUFFER = 25, + D3D_SVT_CBUFFER = 26, + D3D_SVT_TBUFFER = 27, + D3D_SVT_TEXTURE1DARRAY = 28, + D3D_SVT_TEXTURE2DARRAY = 29, + D3D_SVT_RENDERTARGETVIEW = 30, + D3D_SVT_DEPTHSTENCILVIEW = 31, + + D3D_SVT_TEXTURE2DMS = 32, + D3D_SVT_TEXTURE2DMSARRAY = 33, + + D3D_SVT_TEXTURECUBEARRAY = 34, + + D3D_SVT_HULLSHADER = 35, + D3D_SVT_DOMAINSHADER = 36, + + D3D_SVT_INTERFACE_POINTER = 37, + D3D_SVT_COMPUTESHADER = 38, + + D3D_SVT_DOUBLE = 39, + + D3D_SVT_RWTEXTURE1D = 40, + D3D_SVT_RWTEXTURE1DARRAY = 41, + D3D_SVT_RWTEXTURE2D = 42, + D3D_SVT_RWTEXTURE2DARRAY = 43, + D3D_SVT_RWTEXTURE3D = 44, + D3D_SVT_RWBUFFER = 45, + + D3D_SVT_BYTEADDRESS_BUFFER = 46, + D3D_SVT_RWBYTEADDRESS_BUFFER = 47, + D3D_SVT_STRUCTURED_BUFFER = 48, + D3D_SVT_RWSTRUCTURED_BUFFER = 49, + D3D_SVT_APPEND_STRUCTURED_BUFFER = 50, + D3D_SVT_CONSUME_STRUCTURED_BUFFER = 51, + + D3D_SVT_MIN8FLOAT = 52, + D3D_SVT_MIN10FLOAT = 53, + D3D_SVT_MIN16FLOAT = 54, + D3D_SVT_MIN12INT = 55, + D3D_SVT_MIN16INT = 56, + D3D_SVT_MIN16UINT = 57, + + D3D_SVT_INT16 = 58, + D3D_SVT_UINT16 = 59, + D3D_SVT_FLOAT16 = 60, + D3D_SVT_INT64 = 61, + D3D_SVT_UINT64 = 62, + + D3D10_SVT_VOID = D3D_SVT_VOID, + D3D10_SVT_BOOL = D3D_SVT_BOOL, + D3D10_SVT_INT = D3D_SVT_INT, + D3D10_SVT_FLOAT = D3D_SVT_FLOAT, + D3D10_SVT_STRING = D3D_SVT_STRING, + D3D10_SVT_TEXTURE = D3D_SVT_TEXTURE, + D3D10_SVT_TEXTURE1D = D3D_SVT_TEXTURE1D, + D3D10_SVT_TEXTURE2D = D3D_SVT_TEXTURE2D, + D3D10_SVT_TEXTURE3D = D3D_SVT_TEXTURE3D, + D3D10_SVT_TEXTURECUBE = D3D_SVT_TEXTURECUBE, + D3D10_SVT_SAMPLER = D3D_SVT_SAMPLER, + D3D10_SVT_SAMPLER1D = D3D_SVT_SAMPLER1D, + D3D10_SVT_SAMPLER2D = D3D_SVT_SAMPLER2D, + D3D10_SVT_SAMPLER3D = D3D_SVT_SAMPLER3D, + D3D10_SVT_SAMPLERCUBE = D3D_SVT_SAMPLERCUBE, + D3D10_SVT_PIXELSHADER = D3D_SVT_PIXELSHADER, + D3D10_SVT_VERTEXSHADER = D3D_SVT_VERTEXSHADER, + D3D10_SVT_PIXELFRAGMENT = D3D_SVT_PIXELFRAGMENT, + D3D10_SVT_VERTEXFRAGMENT = D3D_SVT_VERTEXFRAGMENT, + D3D10_SVT_UINT = D3D_SVT_UINT, + D3D10_SVT_UINT8 = D3D_SVT_UINT8, + D3D10_SVT_GEOMETRYSHADER = D3D_SVT_GEOMETRYSHADER, + D3D10_SVT_RASTERIZER = D3D_SVT_RASTERIZER, + D3D10_SVT_DEPTHSTENCIL = D3D_SVT_DEPTHSTENCIL, + D3D10_SVT_BLEND = D3D_SVT_BLEND, + D3D10_SVT_BUFFER = D3D_SVT_BUFFER, + D3D10_SVT_CBUFFER = D3D_SVT_CBUFFER, + D3D10_SVT_TBUFFER = D3D_SVT_TBUFFER, + D3D10_SVT_TEXTURE1DARRAY = D3D_SVT_TEXTURE1DARRAY, + D3D10_SVT_TEXTURE2DARRAY = D3D_SVT_TEXTURE2DARRAY, + D3D10_SVT_RENDERTARGETVIEW = D3D_SVT_RENDERTARGETVIEW, + D3D10_SVT_DEPTHSTENCILVIEW = D3D_SVT_DEPTHSTENCILVIEW, + + D3D10_SVT_TEXTURE2DMS = D3D_SVT_TEXTURE2DMS, + D3D10_SVT_TEXTURE2DMSARRAY = D3D_SVT_TEXTURE2DMSARRAY, + + D3D10_SVT_TEXTURECUBEARRAY = D3D_SVT_TEXTURECUBEARRAY, + + D3D11_SVT_HULLSHADER = D3D_SVT_HULLSHADER, + D3D11_SVT_DOMAINSHADER = D3D_SVT_DOMAINSHADER, + + D3D11_SVT_INTERFACE_POINTER = D3D_SVT_INTERFACE_POINTER, + D3D11_SVT_COMPUTESHADER = D3D_SVT_COMPUTESHADER, + + D3D11_SVT_DOUBLE = D3D_SVT_DOUBLE, + + D3D11_SVT_RWTEXTURE1D = D3D_SVT_RWTEXTURE1D, + D3D11_SVT_RWTEXTURE1DARRAY = D3D_SVT_RWTEXTURE1DARRAY, + D3D11_SVT_RWTEXTURE2D = D3D_SVT_RWTEXTURE2D, + D3D11_SVT_RWTEXTURE2DARRAY = D3D_SVT_RWTEXTURE2DARRAY, + D3D11_SVT_RWTEXTURE3D = D3D_SVT_RWTEXTURE3D, + D3D11_SVT_RWBUFFER = D3D_SVT_RWBUFFER, + + D3D11_SVT_BYTEADDRESS_BUFFER = D3D_SVT_BYTEADDRESS_BUFFER, + D3D11_SVT_RWBYTEADDRESS_BUFFER = D3D_SVT_RWBYTEADDRESS_BUFFER, + D3D11_SVT_STRUCTURED_BUFFER = D3D_SVT_STRUCTURED_BUFFER, + D3D11_SVT_RWSTRUCTURED_BUFFER = D3D_SVT_RWSTRUCTURED_BUFFER, + D3D11_SVT_APPEND_STRUCTURED_BUFFER = D3D_SVT_APPEND_STRUCTURED_BUFFER, + D3D11_SVT_CONSUME_STRUCTURED_BUFFER = D3D_SVT_CONSUME_STRUCTURED_BUFFER, + + // force 32-bit size enum + D3D_SVT_FORCE_DWORD = 0x7fffffff +} D3D_SHADER_VARIABLE_TYPE; + +typedef enum _D3D_SHADER_INPUT_FLAGS +{ + D3D_SIF_USERPACKED = 0x01, + D3D_SIF_COMPARISON_SAMPLER = 0x02, // is this a comparison sampler? + D3D_SIF_TEXTURE_COMPONENT_0 = 0x04, // this 2-bit value encodes c - 1, where c + D3D_SIF_TEXTURE_COMPONENT_1 = 0x08, // is the number of components in the texture + D3D_SIF_TEXTURE_COMPONENTS = 0x0c, + D3D_SIF_UNUSED = 0x10, + + D3D10_SIF_USERPACKED = D3D_SIF_USERPACKED, + D3D10_SIF_COMPARISON_SAMPLER = D3D_SIF_COMPARISON_SAMPLER, + D3D10_SIF_TEXTURE_COMPONENT_0 = D3D_SIF_TEXTURE_COMPONENT_0, + D3D10_SIF_TEXTURE_COMPONENT_1 = D3D_SIF_TEXTURE_COMPONENT_1, + D3D10_SIF_TEXTURE_COMPONENTS = D3D_SIF_TEXTURE_COMPONENTS, + + // force 32-bit size enum + D3D_SIF_FORCE_DWORD = 0x7fffffff +} D3D_SHADER_INPUT_FLAGS; + +typedef enum _D3D_SHADER_INPUT_TYPE +{ + D3D_SIT_CBUFFER, + D3D_SIT_TBUFFER, + D3D_SIT_TEXTURE, + D3D_SIT_SAMPLER, + D3D_SIT_UAV_RWTYPED, + D3D_SIT_STRUCTURED, + D3D_SIT_UAV_RWSTRUCTURED, + D3D_SIT_BYTEADDRESS, + D3D_SIT_UAV_RWBYTEADDRESS, + D3D_SIT_UAV_APPEND_STRUCTURED, + D3D_SIT_UAV_CONSUME_STRUCTURED, + D3D_SIT_UAV_RWSTRUCTURED_WITH_COUNTER, + D3D_SIT_RTACCELERATIONSTRUCTURE, + D3D_SIT_UAV_FEEDBACKTEXTURE, + + D3D10_SIT_CBUFFER = D3D_SIT_CBUFFER, + D3D10_SIT_TBUFFER = D3D_SIT_TBUFFER, + D3D10_SIT_TEXTURE = D3D_SIT_TEXTURE, + D3D10_SIT_SAMPLER = D3D_SIT_SAMPLER, + + D3D11_SIT_UAV_RWTYPED = D3D_SIT_UAV_RWTYPED, + D3D11_SIT_STRUCTURED = D3D_SIT_STRUCTURED, + D3D11_SIT_UAV_RWSTRUCTURED = D3D_SIT_UAV_RWSTRUCTURED, + D3D11_SIT_BYTEADDRESS = D3D_SIT_BYTEADDRESS, + D3D11_SIT_UAV_RWBYTEADDRESS = D3D_SIT_UAV_RWBYTEADDRESS, + D3D11_SIT_UAV_APPEND_STRUCTURED = D3D_SIT_UAV_APPEND_STRUCTURED, + D3D11_SIT_UAV_CONSUME_STRUCTURED = D3D_SIT_UAV_CONSUME_STRUCTURED, + D3D11_SIT_UAV_RWSTRUCTURED_WITH_COUNTER = D3D_SIT_UAV_RWSTRUCTURED_WITH_COUNTER, +} D3D_SHADER_INPUT_TYPE; + +typedef enum _D3D_SHADER_CBUFFER_FLAGS +{ + D3D_CBF_USERPACKED = 1, + + D3D10_CBF_USERPACKED = D3D_CBF_USERPACKED, + + // force 32-bit size enum + D3D_CBF_FORCE_DWORD = 0x7fffffff +} D3D_SHADER_CBUFFER_FLAGS; + +typedef enum _D3D_CBUFFER_TYPE +{ + D3D_CT_CBUFFER, + D3D_CT_TBUFFER, + D3D_CT_INTERFACE_POINTERS, + D3D_CT_RESOURCE_BIND_INFO, + + D3D10_CT_CBUFFER = D3D_CT_CBUFFER, + D3D10_CT_TBUFFER = D3D_CT_TBUFFER, + + D3D11_CT_CBUFFER = D3D_CT_CBUFFER, + D3D11_CT_TBUFFER = D3D_CT_TBUFFER, + D3D11_CT_INTERFACE_POINTERS = D3D_CT_INTERFACE_POINTERS, + D3D11_CT_RESOURCE_BIND_INFO = D3D_CT_RESOURCE_BIND_INFO, +} D3D_CBUFFER_TYPE; + +typedef enum D3D_NAME +{ + D3D_NAME_UNDEFINED = 0, + + // Names meaningful to both HLSL and hardware + D3D_NAME_POSITION = 1, + D3D_NAME_CLIP_DISTANCE = 2, + D3D_NAME_CULL_DISTANCE = 3, + D3D_NAME_RENDER_TARGET_ARRAY_INDEX = 4, + D3D_NAME_VIEWPORT_ARRAY_INDEX = 5, + D3D_NAME_VERTEX_ID = 6, + D3D_NAME_PRIMITIVE_ID = 7, + D3D_NAME_INSTANCE_ID = 8, + D3D_NAME_IS_FRONT_FACE = 9, + D3D_NAME_SAMPLE_INDEX = 10, + D3D_NAME_FINAL_QUAD_EDGE_TESSFACTOR = 11, + D3D_NAME_FINAL_QUAD_INSIDE_TESSFACTOR = 12, + D3D_NAME_FINAL_TRI_EDGE_TESSFACTOR = 13, + D3D_NAME_FINAL_TRI_INSIDE_TESSFACTOR = 14, + D3D_NAME_FINAL_LINE_DETAIL_TESSFACTOR = 15, + D3D_NAME_FINAL_LINE_DENSITY_TESSFACTOR = 16, + D3D_NAME_BARYCENTRICS = 23, + D3D_NAME_SHADINGRATE = 24, + D3D_NAME_CULLPRIMITIVE = 25, + + // Names meaningful to HLSL only + D3D_NAME_TARGET = 64, + D3D_NAME_DEPTH = 65, + D3D_NAME_COVERAGE = 66, + D3D_NAME_DEPTH_GREATER_EQUAL = 67, + D3D_NAME_DEPTH_LESS_EQUAL = 68, + D3D_NAME_STENCIL_REF = 69, + D3D_NAME_INNER_COVERAGE = 70, + + D3D10_NAME_UNDEFINED = D3D_NAME_UNDEFINED, + D3D10_NAME_POSITION = D3D_NAME_POSITION, + D3D10_NAME_CLIP_DISTANCE = D3D_NAME_CLIP_DISTANCE, + D3D10_NAME_CULL_DISTANCE = D3D_NAME_CULL_DISTANCE, + D3D10_NAME_RENDER_TARGET_ARRAY_INDEX = D3D_NAME_RENDER_TARGET_ARRAY_INDEX, + D3D10_NAME_VIEWPORT_ARRAY_INDEX = D3D_NAME_VIEWPORT_ARRAY_INDEX, + D3D10_NAME_VERTEX_ID = D3D_NAME_VERTEX_ID, + D3D10_NAME_PRIMITIVE_ID = D3D_NAME_PRIMITIVE_ID, + D3D10_NAME_INSTANCE_ID = D3D_NAME_INSTANCE_ID, + D3D10_NAME_IS_FRONT_FACE = D3D_NAME_IS_FRONT_FACE, + D3D10_NAME_SAMPLE_INDEX = D3D_NAME_SAMPLE_INDEX, + D3D10_NAME_TARGET = D3D_NAME_TARGET, + D3D10_NAME_DEPTH = D3D_NAME_DEPTH, + D3D10_NAME_COVERAGE = D3D_NAME_COVERAGE, + + D3D11_NAME_FINAL_QUAD_EDGE_TESSFACTOR = D3D_NAME_FINAL_QUAD_EDGE_TESSFACTOR, + D3D11_NAME_FINAL_QUAD_INSIDE_TESSFACTOR = D3D_NAME_FINAL_QUAD_INSIDE_TESSFACTOR, + D3D11_NAME_FINAL_TRI_EDGE_TESSFACTOR = D3D_NAME_FINAL_TRI_EDGE_TESSFACTOR, + D3D11_NAME_FINAL_TRI_INSIDE_TESSFACTOR = D3D_NAME_FINAL_TRI_INSIDE_TESSFACTOR, + D3D11_NAME_FINAL_LINE_DETAIL_TESSFACTOR = D3D_NAME_FINAL_LINE_DETAIL_TESSFACTOR, + D3D11_NAME_FINAL_LINE_DENSITY_TESSFACTOR = D3D_NAME_FINAL_LINE_DENSITY_TESSFACTOR, + D3D11_NAME_DEPTH_GREATER_EQUAL = D3D_NAME_DEPTH_GREATER_EQUAL, + D3D11_NAME_DEPTH_LESS_EQUAL = D3D_NAME_DEPTH_LESS_EQUAL, + + D3D11_NAME_STENCIL_REF = D3D_NAME_STENCIL_REF, + D3D11_NAME_INNER_COVERAGE = D3D_NAME_INNER_COVERAGE, + + D3D12_NAME_BARYCENTRICS = D3D_NAME_BARYCENTRICS, + D3D12_NAME_SHADINGRATE = D3D_NAME_SHADINGRATE, + D3D12_NAME_CULLPRIMITIVE = D3D_NAME_CULLPRIMITIVE, +} D3D_NAME; + +typedef enum D3D_RESOURCE_RETURN_TYPE +{ + D3D_RETURN_TYPE_UNORM = 1, + D3D_RETURN_TYPE_SNORM = 2, + D3D_RETURN_TYPE_SINT = 3, + D3D_RETURN_TYPE_UINT = 4, + D3D_RETURN_TYPE_FLOAT = 5, + D3D_RETURN_TYPE_MIXED = 6, + D3D_RETURN_TYPE_DOUBLE = 7, + D3D_RETURN_TYPE_CONTINUED = 8, + + D3D10_RETURN_TYPE_UNORM = D3D_RETURN_TYPE_UNORM, + D3D10_RETURN_TYPE_SNORM = D3D_RETURN_TYPE_SNORM, + D3D10_RETURN_TYPE_SINT = D3D_RETURN_TYPE_SINT, + D3D10_RETURN_TYPE_UINT = D3D_RETURN_TYPE_UINT, + D3D10_RETURN_TYPE_FLOAT = D3D_RETURN_TYPE_FLOAT, + D3D10_RETURN_TYPE_MIXED = D3D_RETURN_TYPE_MIXED, + + D3D11_RETURN_TYPE_UNORM = D3D_RETURN_TYPE_UNORM, + D3D11_RETURN_TYPE_SNORM = D3D_RETURN_TYPE_SNORM, + D3D11_RETURN_TYPE_SINT = D3D_RETURN_TYPE_SINT, + D3D11_RETURN_TYPE_UINT = D3D_RETURN_TYPE_UINT, + D3D11_RETURN_TYPE_FLOAT = D3D_RETURN_TYPE_FLOAT, + D3D11_RETURN_TYPE_MIXED = D3D_RETURN_TYPE_MIXED, + D3D11_RETURN_TYPE_DOUBLE = D3D_RETURN_TYPE_DOUBLE, + D3D11_RETURN_TYPE_CONTINUED = D3D_RETURN_TYPE_CONTINUED, +} D3D_RESOURCE_RETURN_TYPE; + +typedef enum D3D_REGISTER_COMPONENT_TYPE +{ + D3D_REGISTER_COMPONENT_UNKNOWN = 0, + D3D_REGISTER_COMPONENT_UINT32 = 1, + D3D_REGISTER_COMPONENT_SINT32 = 2, + D3D_REGISTER_COMPONENT_FLOAT32 = 3, + + D3D10_REGISTER_COMPONENT_UNKNOWN = D3D_REGISTER_COMPONENT_UNKNOWN, + D3D10_REGISTER_COMPONENT_UINT32 = D3D_REGISTER_COMPONENT_UINT32, + D3D10_REGISTER_COMPONENT_SINT32 = D3D_REGISTER_COMPONENT_SINT32, + D3D10_REGISTER_COMPONENT_FLOAT32 = D3D_REGISTER_COMPONENT_FLOAT32, +} D3D_REGISTER_COMPONENT_TYPE; + +typedef enum D3D_TESSELLATOR_DOMAIN +{ + D3D_TESSELLATOR_DOMAIN_UNDEFINED = 0, + D3D_TESSELLATOR_DOMAIN_ISOLINE = 1, + D3D_TESSELLATOR_DOMAIN_TRI = 2, + D3D_TESSELLATOR_DOMAIN_QUAD = 3, + + D3D11_TESSELLATOR_DOMAIN_UNDEFINED = D3D_TESSELLATOR_DOMAIN_UNDEFINED, + D3D11_TESSELLATOR_DOMAIN_ISOLINE = D3D_TESSELLATOR_DOMAIN_ISOLINE, + D3D11_TESSELLATOR_DOMAIN_TRI = D3D_TESSELLATOR_DOMAIN_TRI, + D3D11_TESSELLATOR_DOMAIN_QUAD = D3D_TESSELLATOR_DOMAIN_QUAD, +} D3D_TESSELLATOR_DOMAIN; + +typedef enum D3D_TESSELLATOR_PARTITIONING +{ + D3D_TESSELLATOR_PARTITIONING_UNDEFINED = 0, + D3D_TESSELLATOR_PARTITIONING_INTEGER = 1, + D3D_TESSELLATOR_PARTITIONING_POW2 = 2, + D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD = 3, + D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN = 4, + + D3D11_TESSELLATOR_PARTITIONING_UNDEFINED = D3D_TESSELLATOR_PARTITIONING_UNDEFINED, + D3D11_TESSELLATOR_PARTITIONING_INTEGER = D3D_TESSELLATOR_PARTITIONING_INTEGER, + D3D11_TESSELLATOR_PARTITIONING_POW2 = D3D_TESSELLATOR_PARTITIONING_POW2, + D3D11_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD = D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD, + D3D11_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN = D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN, +} D3D_TESSELLATOR_PARTITIONING; + +typedef enum D3D_TESSELLATOR_OUTPUT_PRIMITIVE +{ + D3D_TESSELLATOR_OUTPUT_UNDEFINED = 0, + D3D_TESSELLATOR_OUTPUT_POINT = 1, + D3D_TESSELLATOR_OUTPUT_LINE = 2, + D3D_TESSELLATOR_OUTPUT_TRIANGLE_CW = 3, + D3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW = 4, + + D3D11_TESSELLATOR_OUTPUT_UNDEFINED = D3D_TESSELLATOR_OUTPUT_UNDEFINED, + D3D11_TESSELLATOR_OUTPUT_POINT = D3D_TESSELLATOR_OUTPUT_POINT, + D3D11_TESSELLATOR_OUTPUT_LINE = D3D_TESSELLATOR_OUTPUT_LINE, + D3D11_TESSELLATOR_OUTPUT_TRIANGLE_CW = D3D_TESSELLATOR_OUTPUT_TRIANGLE_CW, + D3D11_TESSELLATOR_OUTPUT_TRIANGLE_CCW = D3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW, +} D3D_TESSELLATOR_OUTPUT_PRIMITIVE; + +typedef enum D3D_MIN_PRECISION +{ + D3D_MIN_PRECISION_DEFAULT = 0, // Default precision for the shader model + D3D_MIN_PRECISION_FLOAT_16 = 1, // Min 16 bit/component float + D3D_MIN_PRECISION_FLOAT_2_8 = 2, // Min 10(2.8)bit/comp. float + D3D_MIN_PRECISION_RESERVED = 3, // Reserved for future use + D3D_MIN_PRECISION_SINT_16 = 4, // Min 16 bit/comp. signed integer + D3D_MIN_PRECISION_UINT_16 = 5, // Min 16 bit/comp. unsigned integer + + // These values are abstractions of width only for use in situations + // where a general width is needed instead of specific types. They + // will never be used in shader operands. + D3D_MIN_PRECISION_ANY_16 = 0xf0, + D3D_MIN_PRECISION_ANY_10 = 0xf1, +} D3D_MIN_PRECISION; + +typedef enum D3D_INTERPOLATION_MODE +{ + D3D_INTERPOLATION_UNDEFINED = 0, + D3D_INTERPOLATION_CONSTANT = 1, + D3D_INTERPOLATION_LINEAR = 2, + D3D_INTERPOLATION_LINEAR_CENTROID = 3, + D3D_INTERPOLATION_LINEAR_NOPERSPECTIVE = 4, + D3D_INTERPOLATION_LINEAR_NOPERSPECTIVE_CENTROID = 5, + D3D_INTERPOLATION_LINEAR_SAMPLE = 6, + D3D_INTERPOLATION_LINEAR_NOPERSPECTIVE_SAMPLE = 7, +} D3D_INTERPOLATION_MODE; + +// Parameter flags. +typedef enum _D3D_PARAMETER_FLAGS +{ + D3D_PF_NONE = 0x00000000, + D3D_PF_IN = 0x00000001, + D3D_PF_OUT = 0x00000002, + D3D_PF_FORCE_DWORD = 0x7fffffff +} D3D_PARAMETER_FLAGS; + +// Format Layout Properties +typedef enum D3D_FORMAT_LAYOUT +{ + D3DFL_STANDARD = 0, // standard layout + D3DFL_CUSTOM = -1 // custom layout + // Note, 1 bit allocated for this in FORMAT_DETAIL below. If you add fields here, add bits... + // NOTE SIGNED VALUES ARE USED SINCE COMPILER MAKES ENUMS SIGNED, AND BITFIELDS ARE SIGN EXTENDED ON READ +} D3D_FORMAT_LAYOUT; + +typedef enum D3D_FORMAT_TYPE_LEVEL +{ + D3DFTL_NO_TYPE = 0, + D3DFTL_PARTIAL_TYPE = -2, + D3DFTL_FULL_TYPE = -1, + // Note, 2 bits allocated for this in FORMAT_DETAIL below. If you add fields here, add bits... + // NOTE SIGNED VALUES ARE USED SINCE COMPILER MAKES ENUMS SIGNED, AND BITFIELDS ARE SIGN EXTENDED ON READ +} D3D_FORMAT_TYPE_LEVEL; + +typedef enum D3D_FORMAT_COMPONENT_NAME +{ + D3DFCN_R = -4, + D3DFCN_G = -3, + D3DFCN_B = -2, + D3DFCN_A = -1, + D3DFCN_D = 0, + D3DFCN_S = 1, + D3DFCN_X = 2, + // Note, 3 bits allocated for this in FORMAT_DETAIL below. If you add fields here, add bits... + // NOTE SIGNED VALUES ARE USED SINCE COMPILER MAKES ENUMS SIGNED, AND BITFIELDS ARE SIGN EXTENDED ON READ +} D3D_FORMAT_COMPONENT_NAME; + +typedef enum D3D_FORMAT_COMPONENT_INTERPRETATION +{ + D3DFCI_TYPELESS = 0, + D3DFCI_FLOAT = -4, + D3DFCI_SNORM = -3, + D3DFCI_UNORM = -2, + D3DFCI_SINT = -1, + D3DFCI_UINT = 1, + D3DFCI_UNORM_SRGB = 2, + D3DFCI_BIASED_FIXED_2_8 = 3, + // Note, 3 bits allocated for this in FORMAT_DETAIL below. If you add fields here, add bits... + // NOTE SIGNED VALUES ARE USED SINCE COMPILER MAKES ENUMS SIGNED, AND BITFIELDS ARE SIGN EXTENDED ON READ +} D3D_FORMAT_COMPONENT_INTERPRETATION; + +// Well-Known Private Data IDs (WKPDID_*): + +// WKPDID_D3DDebugObjectName provides a unique name to objects in order to assist the developer during debugging. +// +// const char c_szName[] = "texture.jpg"; +// pObject->SetPrivateData( WKPDID_D3DDebugObjectName, sizeof( c_szName ) - 1, c_szName ); +cpp_quote("DEFINE_GUID(WKPDID_D3DDebugObjectName,0x429b8c22,0x9188,0x4b0c,0x87,0x42,0xac,0xb0,0xbf,0x85,0xc2,0x00);") +cpp_quote("DEFINE_GUID(WKPDID_D3DDebugObjectNameW,0x4cca5fd8,0x921f,0x42c8,0x85,0x66,0x70,0xca,0xf2,0xa9,0xb7,0x41);") +cpp_quote("DEFINE_GUID(WKPDID_CommentStringW,0xd0149dc0,0x90e8,0x4ec8,0x81, 0x44, 0xe9, 0x00, 0xad, 0x26, 0x6b, 0xb2);") +cpp_quote("DEFINE_GUID(WKPDID_D3D12UniqueObjectId, 0x1b39de15, 0xec04, 0x4bae, 0xba, 0x4d, 0x8c, 0xef, 0x79, 0xfc, 0x04, 0xc1);") + +cpp_quote("#define D3D_SET_OBJECT_NAME_N_A(pObject, Chars, pName) (pObject)->SetPrivateData(WKPDID_D3DDebugObjectName, Chars, pName)") +cpp_quote("#define D3D_SET_OBJECT_NAME_A(pObject, pName) D3D_SET_OBJECT_NAME_N_A(pObject, lstrlenA(pName), pName)") +cpp_quote("#define D3D_SET_OBJECT_NAME_N_W(pObject, Chars, pName) (pObject)->SetPrivateData(WKPDID_D3DDebugObjectNameW, Chars*2, pName)") +cpp_quote("#define D3D_SET_OBJECT_NAME_W(pObject, pName) D3D_SET_OBJECT_NAME_N_W(pObject, wcslen(pName), pName)") + +cpp_quote("#define D3D_COMPONENT_MASK_X 1") +cpp_quote("#define D3D_COMPONENT_MASK_Y 2") +cpp_quote("#define D3D_COMPONENT_MASK_Z 4") +cpp_quote("#define D3D_COMPONENT_MASK_W 8") + +cpp_quote("DEFINE_GUID(D3D_TEXTURE_LAYOUT_ROW_MAJOR,0xb5dc234f,0x72bb,0x4bec,0x97,0x05,0x8c,0xf2,0x58,0xdf,0x6b,0x6c);") // Feature_D3D1XDisplayable +cpp_quote("DEFINE_GUID(D3D_TEXTURE_LAYOUT_64KB_STANDARD_SWIZZLE,0x4c0f29e3,0x3f5f,0x4d35,0x84,0xc9,0xbc,0x09,0x83,0xb6,0x2c,0x28);") // Feature_D3D1XDisplayable + diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3dx12.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3dx12.h new file mode 100644 index 0000000..fe27978 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/d3dx12.h @@ -0,0 +1,5501 @@ +//********************************************************* +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License (MIT). +// +//********************************************************* + +#ifndef __D3DX12_H__ +#define __D3DX12_H__ + +#include "d3d12.h" + +#if defined( __cplusplus ) + +struct CD3DX12_DEFAULT {}; +extern const DECLSPEC_SELECTANY CD3DX12_DEFAULT D3D12_DEFAULT; + +//------------------------------------------------------------------------------------------------ +inline bool operator==( const D3D12_VIEWPORT& l, const D3D12_VIEWPORT& r ) noexcept +{ + return l.TopLeftX == r.TopLeftX && l.TopLeftY == r.TopLeftY && l.Width == r.Width && + l.Height == r.Height && l.MinDepth == r.MinDepth && l.MaxDepth == r.MaxDepth; +} + +//------------------------------------------------------------------------------------------------ +inline bool operator!=( const D3D12_VIEWPORT& l, const D3D12_VIEWPORT& r ) noexcept +{ return !( l == r ); } + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_RECT : public D3D12_RECT +{ + CD3DX12_RECT() = default; + explicit CD3DX12_RECT( const D3D12_RECT& o ) noexcept : + D3D12_RECT( o ) + {} + explicit CD3DX12_RECT( + LONG Left, + LONG Top, + LONG Right, + LONG Bottom ) noexcept + { + left = Left; + top = Top; + right = Right; + bottom = Bottom; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_VIEWPORT : public D3D12_VIEWPORT +{ + CD3DX12_VIEWPORT() = default; + explicit CD3DX12_VIEWPORT( const D3D12_VIEWPORT& o ) noexcept : + D3D12_VIEWPORT( o ) + {} + explicit CD3DX12_VIEWPORT( + FLOAT topLeftX, + FLOAT topLeftY, + FLOAT width, + FLOAT height, + FLOAT minDepth = D3D12_MIN_DEPTH, + FLOAT maxDepth = D3D12_MAX_DEPTH ) noexcept + { + TopLeftX = topLeftX; + TopLeftY = topLeftY; + Width = width; + Height = height; + MinDepth = minDepth; + MaxDepth = maxDepth; + } + explicit CD3DX12_VIEWPORT( + _In_ ID3D12Resource* pResource, + UINT mipSlice = 0, + FLOAT topLeftX = 0.0f, + FLOAT topLeftY = 0.0f, + FLOAT minDepth = D3D12_MIN_DEPTH, + FLOAT maxDepth = D3D12_MAX_DEPTH ) noexcept + { +#if defined(_MSC_VER) || !defined(_WIN32) + const auto Desc = pResource->GetDesc(); +#else + D3D12_RESOURCE_DESC tmpDesc; + const auto& Desc = *pResource->GetDesc(&tmpDesc); +#endif + const UINT64 SubresourceWidth = Desc.Width >> mipSlice; + const UINT64 SubresourceHeight = Desc.Height >> mipSlice; + switch (Desc.Dimension) + { + case D3D12_RESOURCE_DIMENSION_BUFFER: + TopLeftX = topLeftX; + TopLeftY = 0.0f; + Width = float(Desc.Width) - topLeftX; + Height = 1.0f; + break; + case D3D12_RESOURCE_DIMENSION_TEXTURE1D: + TopLeftX = topLeftX; + TopLeftY = 0.0f; + Width = (SubresourceWidth ? float(SubresourceWidth) : 1.0f) - topLeftX; + Height = 1.0f; + break; + case D3D12_RESOURCE_DIMENSION_TEXTURE2D: + case D3D12_RESOURCE_DIMENSION_TEXTURE3D: + TopLeftX = topLeftX; + TopLeftY = topLeftY; + Width = (SubresourceWidth ? float(SubresourceWidth) : 1.0f) - topLeftX; + Height = (SubresourceHeight ? float(SubresourceHeight) : 1.0f) - topLeftY; + break; + default: break; + } + + MinDepth = minDepth; + MaxDepth = maxDepth; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_BOX : public D3D12_BOX +{ + CD3DX12_BOX() = default; + explicit CD3DX12_BOX( const D3D12_BOX& o ) noexcept : + D3D12_BOX( o ) + {} + explicit CD3DX12_BOX( + LONG Left, + LONG Right ) noexcept + { + left = static_cast(Left); + top = 0; + front = 0; + right = static_cast(Right); + bottom = 1; + back = 1; + } + explicit CD3DX12_BOX( + LONG Left, + LONG Top, + LONG Right, + LONG Bottom ) noexcept + { + left = static_cast(Left); + top = static_cast(Top); + front = 0; + right = static_cast(Right); + bottom = static_cast(Bottom); + back = 1; + } + explicit CD3DX12_BOX( + LONG Left, + LONG Top, + LONG Front, + LONG Right, + LONG Bottom, + LONG Back ) noexcept + { + left = static_cast(Left); + top = static_cast(Top); + front = static_cast(Front); + right = static_cast(Right); + bottom = static_cast(Bottom); + back = static_cast(Back); + } +}; +inline bool operator==( const D3D12_BOX& l, const D3D12_BOX& r ) noexcept +{ + return l.left == r.left && l.top == r.top && l.front == r.front && + l.right == r.right && l.bottom == r.bottom && l.back == r.back; +} +inline bool operator!=( const D3D12_BOX& l, const D3D12_BOX& r ) noexcept +{ return !( l == r ); } + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_DEPTH_STENCIL_DESC : public D3D12_DEPTH_STENCIL_DESC +{ + CD3DX12_DEPTH_STENCIL_DESC() = default; + explicit CD3DX12_DEPTH_STENCIL_DESC( const D3D12_DEPTH_STENCIL_DESC& o ) noexcept : + D3D12_DEPTH_STENCIL_DESC( o ) + {} + explicit CD3DX12_DEPTH_STENCIL_DESC( CD3DX12_DEFAULT ) noexcept + { + DepthEnable = TRUE; + DepthWriteMask = D3D12_DEPTH_WRITE_MASK_ALL; + DepthFunc = D3D12_COMPARISON_FUNC_LESS; + StencilEnable = FALSE; + StencilReadMask = D3D12_DEFAULT_STENCIL_READ_MASK; + StencilWriteMask = D3D12_DEFAULT_STENCIL_WRITE_MASK; + const D3D12_DEPTH_STENCILOP_DESC defaultStencilOp = + { D3D12_STENCIL_OP_KEEP, D3D12_STENCIL_OP_KEEP, D3D12_STENCIL_OP_KEEP, D3D12_COMPARISON_FUNC_ALWAYS }; + FrontFace = defaultStencilOp; + BackFace = defaultStencilOp; + } + explicit CD3DX12_DEPTH_STENCIL_DESC( + BOOL depthEnable, + D3D12_DEPTH_WRITE_MASK depthWriteMask, + D3D12_COMPARISON_FUNC depthFunc, + BOOL stencilEnable, + UINT8 stencilReadMask, + UINT8 stencilWriteMask, + D3D12_STENCIL_OP frontStencilFailOp, + D3D12_STENCIL_OP frontStencilDepthFailOp, + D3D12_STENCIL_OP frontStencilPassOp, + D3D12_COMPARISON_FUNC frontStencilFunc, + D3D12_STENCIL_OP backStencilFailOp, + D3D12_STENCIL_OP backStencilDepthFailOp, + D3D12_STENCIL_OP backStencilPassOp, + D3D12_COMPARISON_FUNC backStencilFunc ) noexcept + { + DepthEnable = depthEnable; + DepthWriteMask = depthWriteMask; + DepthFunc = depthFunc; + StencilEnable = stencilEnable; + StencilReadMask = stencilReadMask; + StencilWriteMask = stencilWriteMask; + FrontFace.StencilFailOp = frontStencilFailOp; + FrontFace.StencilDepthFailOp = frontStencilDepthFailOp; + FrontFace.StencilPassOp = frontStencilPassOp; + FrontFace.StencilFunc = frontStencilFunc; + BackFace.StencilFailOp = backStencilFailOp; + BackFace.StencilDepthFailOp = backStencilDepthFailOp; + BackFace.StencilPassOp = backStencilPassOp; + BackFace.StencilFunc = backStencilFunc; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_DEPTH_STENCIL_DESC1 : public D3D12_DEPTH_STENCIL_DESC1 +{ + CD3DX12_DEPTH_STENCIL_DESC1() = default; + explicit CD3DX12_DEPTH_STENCIL_DESC1( const D3D12_DEPTH_STENCIL_DESC1& o ) noexcept : + D3D12_DEPTH_STENCIL_DESC1( o ) + {} + explicit CD3DX12_DEPTH_STENCIL_DESC1( const D3D12_DEPTH_STENCIL_DESC& o ) noexcept + { + DepthEnable = o.DepthEnable; + DepthWriteMask = o.DepthWriteMask; + DepthFunc = o.DepthFunc; + StencilEnable = o.StencilEnable; + StencilReadMask = o.StencilReadMask; + StencilWriteMask = o.StencilWriteMask; + FrontFace.StencilFailOp = o.FrontFace.StencilFailOp; + FrontFace.StencilDepthFailOp = o.FrontFace.StencilDepthFailOp; + FrontFace.StencilPassOp = o.FrontFace.StencilPassOp; + FrontFace.StencilFunc = o.FrontFace.StencilFunc; + BackFace.StencilFailOp = o.BackFace.StencilFailOp; + BackFace.StencilDepthFailOp = o.BackFace.StencilDepthFailOp; + BackFace.StencilPassOp = o.BackFace.StencilPassOp; + BackFace.StencilFunc = o.BackFace.StencilFunc; + DepthBoundsTestEnable = FALSE; + } + explicit CD3DX12_DEPTH_STENCIL_DESC1( CD3DX12_DEFAULT ) noexcept + { + DepthEnable = TRUE; + DepthWriteMask = D3D12_DEPTH_WRITE_MASK_ALL; + DepthFunc = D3D12_COMPARISON_FUNC_LESS; + StencilEnable = FALSE; + StencilReadMask = D3D12_DEFAULT_STENCIL_READ_MASK; + StencilWriteMask = D3D12_DEFAULT_STENCIL_WRITE_MASK; + const D3D12_DEPTH_STENCILOP_DESC defaultStencilOp = + { D3D12_STENCIL_OP_KEEP, D3D12_STENCIL_OP_KEEP, D3D12_STENCIL_OP_KEEP, D3D12_COMPARISON_FUNC_ALWAYS }; + FrontFace = defaultStencilOp; + BackFace = defaultStencilOp; + DepthBoundsTestEnable = FALSE; + } + explicit CD3DX12_DEPTH_STENCIL_DESC1( + BOOL depthEnable, + D3D12_DEPTH_WRITE_MASK depthWriteMask, + D3D12_COMPARISON_FUNC depthFunc, + BOOL stencilEnable, + UINT8 stencilReadMask, + UINT8 stencilWriteMask, + D3D12_STENCIL_OP frontStencilFailOp, + D3D12_STENCIL_OP frontStencilDepthFailOp, + D3D12_STENCIL_OP frontStencilPassOp, + D3D12_COMPARISON_FUNC frontStencilFunc, + D3D12_STENCIL_OP backStencilFailOp, + D3D12_STENCIL_OP backStencilDepthFailOp, + D3D12_STENCIL_OP backStencilPassOp, + D3D12_COMPARISON_FUNC backStencilFunc, + BOOL depthBoundsTestEnable ) noexcept + { + DepthEnable = depthEnable; + DepthWriteMask = depthWriteMask; + DepthFunc = depthFunc; + StencilEnable = stencilEnable; + StencilReadMask = stencilReadMask; + StencilWriteMask = stencilWriteMask; + FrontFace.StencilFailOp = frontStencilFailOp; + FrontFace.StencilDepthFailOp = frontStencilDepthFailOp; + FrontFace.StencilPassOp = frontStencilPassOp; + FrontFace.StencilFunc = frontStencilFunc; + BackFace.StencilFailOp = backStencilFailOp; + BackFace.StencilDepthFailOp = backStencilDepthFailOp; + BackFace.StencilPassOp = backStencilPassOp; + BackFace.StencilFunc = backStencilFunc; + DepthBoundsTestEnable = depthBoundsTestEnable; + } + operator D3D12_DEPTH_STENCIL_DESC() const noexcept + { + D3D12_DEPTH_STENCIL_DESC D; + D.DepthEnable = DepthEnable; + D.DepthWriteMask = DepthWriteMask; + D.DepthFunc = DepthFunc; + D.StencilEnable = StencilEnable; + D.StencilReadMask = StencilReadMask; + D.StencilWriteMask = StencilWriteMask; + D.FrontFace.StencilFailOp = FrontFace.StencilFailOp; + D.FrontFace.StencilDepthFailOp = FrontFace.StencilDepthFailOp; + D.FrontFace.StencilPassOp = FrontFace.StencilPassOp; + D.FrontFace.StencilFunc = FrontFace.StencilFunc; + D.BackFace.StencilFailOp = BackFace.StencilFailOp; + D.BackFace.StencilDepthFailOp = BackFace.StencilDepthFailOp; + D.BackFace.StencilPassOp = BackFace.StencilPassOp; + D.BackFace.StencilFunc = BackFace.StencilFunc; + return D; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_DEPTH_STENCIL_DESC2 : public D3D12_DEPTH_STENCIL_DESC2 +{ + CD3DX12_DEPTH_STENCIL_DESC2() = default; + explicit CD3DX12_DEPTH_STENCIL_DESC2( const D3D12_DEPTH_STENCIL_DESC2& o ) noexcept : + D3D12_DEPTH_STENCIL_DESC2( o ) + {} + explicit CD3DX12_DEPTH_STENCIL_DESC2( const D3D12_DEPTH_STENCIL_DESC1& o ) noexcept + { + DepthEnable = o.DepthEnable; + DepthWriteMask = o.DepthWriteMask; + DepthFunc = o.DepthFunc; + StencilEnable = o.StencilEnable; + FrontFace.StencilFailOp = o.FrontFace.StencilFailOp; + FrontFace.StencilDepthFailOp = o.FrontFace.StencilDepthFailOp; + FrontFace.StencilPassOp = o.FrontFace.StencilPassOp; + FrontFace.StencilFunc = o.FrontFace.StencilFunc; + FrontFace.StencilReadMask = o.StencilReadMask; + FrontFace.StencilWriteMask = o.StencilWriteMask; + + BackFace.StencilFailOp = o.BackFace.StencilFailOp; + BackFace.StencilDepthFailOp = o.BackFace.StencilDepthFailOp; + BackFace.StencilPassOp = o.BackFace.StencilPassOp; + BackFace.StencilFunc = o.BackFace.StencilFunc; + BackFace.StencilReadMask = o.StencilReadMask; + BackFace.StencilWriteMask = o.StencilWriteMask; + DepthBoundsTestEnable = o.DepthBoundsTestEnable; + } + explicit CD3DX12_DEPTH_STENCIL_DESC2( const D3D12_DEPTH_STENCIL_DESC& o ) noexcept + { + DepthEnable = o.DepthEnable; + DepthWriteMask = o.DepthWriteMask; + DepthFunc = o.DepthFunc; + StencilEnable = o.StencilEnable; + + FrontFace.StencilFailOp = o.FrontFace.StencilFailOp; + FrontFace.StencilDepthFailOp = o.FrontFace.StencilDepthFailOp; + FrontFace.StencilPassOp = o.FrontFace.StencilPassOp; + FrontFace.StencilFunc = o.FrontFace.StencilFunc; + FrontFace.StencilReadMask = o.StencilReadMask; + FrontFace.StencilWriteMask = o.StencilWriteMask; + + BackFace.StencilFailOp = o.BackFace.StencilFailOp; + BackFace.StencilDepthFailOp = o.BackFace.StencilDepthFailOp; + BackFace.StencilPassOp = o.BackFace.StencilPassOp; + BackFace.StencilFunc = o.BackFace.StencilFunc; + BackFace.StencilReadMask = o.StencilReadMask; + BackFace.StencilWriteMask = o.StencilWriteMask; + + DepthBoundsTestEnable = FALSE; + } + explicit CD3DX12_DEPTH_STENCIL_DESC2( CD3DX12_DEFAULT ) noexcept + { + DepthEnable = TRUE; + DepthWriteMask = D3D12_DEPTH_WRITE_MASK_ALL; + DepthFunc = D3D12_COMPARISON_FUNC_LESS; + StencilEnable = FALSE; + const D3D12_DEPTH_STENCILOP_DESC1 defaultStencilOp = + { D3D12_STENCIL_OP_KEEP, D3D12_STENCIL_OP_KEEP, D3D12_STENCIL_OP_KEEP, D3D12_COMPARISON_FUNC_ALWAYS, D3D12_DEFAULT_STENCIL_READ_MASK, D3D12_DEFAULT_STENCIL_WRITE_MASK }; + FrontFace = defaultStencilOp; + BackFace = defaultStencilOp; + DepthBoundsTestEnable = FALSE; + } + explicit CD3DX12_DEPTH_STENCIL_DESC2( + BOOL depthEnable, + D3D12_DEPTH_WRITE_MASK depthWriteMask, + D3D12_COMPARISON_FUNC depthFunc, + BOOL stencilEnable, + D3D12_STENCIL_OP frontStencilFailOp, + D3D12_STENCIL_OP frontStencilDepthFailOp, + D3D12_STENCIL_OP frontStencilPassOp, + D3D12_COMPARISON_FUNC frontStencilFunc, + UINT8 frontStencilReadMask, + UINT8 frontStencilWriteMask, + D3D12_STENCIL_OP backStencilFailOp, + D3D12_STENCIL_OP backStencilDepthFailOp, + D3D12_STENCIL_OP backStencilPassOp, + D3D12_COMPARISON_FUNC backStencilFunc, + UINT8 backStencilReadMask, + UINT8 backStencilWriteMask, + BOOL depthBoundsTestEnable ) noexcept + { + DepthEnable = depthEnable; + DepthWriteMask = depthWriteMask; + DepthFunc = depthFunc; + StencilEnable = stencilEnable; + + FrontFace.StencilFailOp = frontStencilFailOp; + FrontFace.StencilDepthFailOp = frontStencilDepthFailOp; + FrontFace.StencilPassOp = frontStencilPassOp; + FrontFace.StencilFunc = frontStencilFunc; + FrontFace.StencilReadMask = frontStencilReadMask; + FrontFace.StencilWriteMask = frontStencilWriteMask; + + BackFace.StencilFailOp = backStencilFailOp; + BackFace.StencilDepthFailOp = backStencilDepthFailOp; + BackFace.StencilPassOp = backStencilPassOp; + BackFace.StencilFunc = backStencilFunc; + BackFace.StencilReadMask = backStencilReadMask; + BackFace.StencilWriteMask = backStencilWriteMask; + + DepthBoundsTestEnable = depthBoundsTestEnable; + } + + operator D3D12_DEPTH_STENCIL_DESC() const noexcept + { + D3D12_DEPTH_STENCIL_DESC D; + D.DepthEnable = DepthEnable; + D.DepthWriteMask = DepthWriteMask; + D.DepthFunc = DepthFunc; + D.StencilEnable = StencilEnable; + D.StencilReadMask = FrontFace.StencilReadMask; + D.StencilWriteMask = FrontFace.StencilWriteMask; + D.FrontFace.StencilFailOp = FrontFace.StencilFailOp; + D.FrontFace.StencilDepthFailOp = FrontFace.StencilDepthFailOp; + D.FrontFace.StencilPassOp = FrontFace.StencilPassOp; + D.FrontFace.StencilFunc = FrontFace.StencilFunc; + D.BackFace.StencilFailOp = BackFace.StencilFailOp; + D.BackFace.StencilDepthFailOp = BackFace.StencilDepthFailOp; + D.BackFace.StencilPassOp = BackFace.StencilPassOp; + D.BackFace.StencilFunc = BackFace.StencilFunc; + return D; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_BLEND_DESC : public D3D12_BLEND_DESC +{ + CD3DX12_BLEND_DESC() = default; + explicit CD3DX12_BLEND_DESC( const D3D12_BLEND_DESC& o ) noexcept : + D3D12_BLEND_DESC( o ) + {} + explicit CD3DX12_BLEND_DESC( CD3DX12_DEFAULT ) noexcept + { + AlphaToCoverageEnable = FALSE; + IndependentBlendEnable = FALSE; + const D3D12_RENDER_TARGET_BLEND_DESC defaultRenderTargetBlendDesc = + { + FALSE,FALSE, + D3D12_BLEND_ONE, D3D12_BLEND_ZERO, D3D12_BLEND_OP_ADD, + D3D12_BLEND_ONE, D3D12_BLEND_ZERO, D3D12_BLEND_OP_ADD, + D3D12_LOGIC_OP_NOOP, + D3D12_COLOR_WRITE_ENABLE_ALL, + }; + for (UINT i = 0; i < D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i) + RenderTarget[ i ] = defaultRenderTargetBlendDesc; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_RASTERIZER_DESC : public D3D12_RASTERIZER_DESC +{ + CD3DX12_RASTERIZER_DESC() = default; + explicit CD3DX12_RASTERIZER_DESC( const D3D12_RASTERIZER_DESC& o ) noexcept : + D3D12_RASTERIZER_DESC( o ) + {} + explicit CD3DX12_RASTERIZER_DESC( CD3DX12_DEFAULT ) noexcept + { + FillMode = D3D12_FILL_MODE_SOLID; + CullMode = D3D12_CULL_MODE_BACK; + FrontCounterClockwise = FALSE; + DepthBias = D3D12_DEFAULT_DEPTH_BIAS; + DepthBiasClamp = D3D12_DEFAULT_DEPTH_BIAS_CLAMP; + SlopeScaledDepthBias = D3D12_DEFAULT_SLOPE_SCALED_DEPTH_BIAS; + DepthClipEnable = TRUE; + MultisampleEnable = FALSE; + AntialiasedLineEnable = FALSE; + ForcedSampleCount = 0; + ConservativeRaster = D3D12_CONSERVATIVE_RASTERIZATION_MODE_OFF; + } + explicit CD3DX12_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) noexcept + { + FillMode = fillMode; + CullMode = cullMode; + FrontCounterClockwise = frontCounterClockwise; + DepthBias = depthBias; + DepthBiasClamp = depthBiasClamp; + SlopeScaledDepthBias = slopeScaledDepthBias; + DepthClipEnable = depthClipEnable; + MultisampleEnable = multisampleEnable; + AntialiasedLineEnable = antialiasedLineEnable; + ForcedSampleCount = forcedSampleCount; + ConservativeRaster = conservativeRaster; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_RESOURCE_ALLOCATION_INFO : public D3D12_RESOURCE_ALLOCATION_INFO +{ + CD3DX12_RESOURCE_ALLOCATION_INFO() = default; + explicit CD3DX12_RESOURCE_ALLOCATION_INFO( const D3D12_RESOURCE_ALLOCATION_INFO& o ) noexcept : + D3D12_RESOURCE_ALLOCATION_INFO( o ) + {} + CD3DX12_RESOURCE_ALLOCATION_INFO( + UINT64 size, + UINT64 alignment ) noexcept + { + SizeInBytes = size; + Alignment = alignment; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_HEAP_PROPERTIES : public D3D12_HEAP_PROPERTIES +{ + CD3DX12_HEAP_PROPERTIES() = default; + explicit CD3DX12_HEAP_PROPERTIES(const D3D12_HEAP_PROPERTIES &o) noexcept : + D3D12_HEAP_PROPERTIES(o) + {} + CD3DX12_HEAP_PROPERTIES( + D3D12_CPU_PAGE_PROPERTY cpuPageProperty, + D3D12_MEMORY_POOL memoryPoolPreference, + UINT creationNodeMask = 1, + UINT nodeMask = 1 ) noexcept + { + Type = D3D12_HEAP_TYPE_CUSTOM; + CPUPageProperty = cpuPageProperty; + MemoryPoolPreference = memoryPoolPreference; + CreationNodeMask = creationNodeMask; + VisibleNodeMask = nodeMask; + } + explicit CD3DX12_HEAP_PROPERTIES( + D3D12_HEAP_TYPE type, + UINT creationNodeMask = 1, + UINT nodeMask = 1 ) noexcept + { + Type = type; + CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_UNKNOWN; + MemoryPoolPreference = D3D12_MEMORY_POOL_UNKNOWN; + CreationNodeMask = creationNodeMask; + VisibleNodeMask = nodeMask; + } + bool IsCPUAccessible() const noexcept + { + return Type == D3D12_HEAP_TYPE_UPLOAD || Type == D3D12_HEAP_TYPE_READBACK || (Type == D3D12_HEAP_TYPE_CUSTOM && + (CPUPageProperty == D3D12_CPU_PAGE_PROPERTY_WRITE_COMBINE || CPUPageProperty == D3D12_CPU_PAGE_PROPERTY_WRITE_BACK)); + } +}; +inline bool operator==( const D3D12_HEAP_PROPERTIES& l, const D3D12_HEAP_PROPERTIES& r ) noexcept +{ + return l.Type == r.Type && l.CPUPageProperty == r.CPUPageProperty && + l.MemoryPoolPreference == r.MemoryPoolPreference && + l.CreationNodeMask == r.CreationNodeMask && + l.VisibleNodeMask == r.VisibleNodeMask; +} +inline bool operator!=( const D3D12_HEAP_PROPERTIES& l, const D3D12_HEAP_PROPERTIES& r ) noexcept +{ return !( l == r ); } + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_HEAP_DESC : public D3D12_HEAP_DESC +{ + CD3DX12_HEAP_DESC() = default; + explicit CD3DX12_HEAP_DESC(const D3D12_HEAP_DESC &o) noexcept : + D3D12_HEAP_DESC(o) + {} + CD3DX12_HEAP_DESC( + UINT64 size, + D3D12_HEAP_PROPERTIES properties, + UINT64 alignment = 0, + D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE ) noexcept + { + SizeInBytes = size; + Properties = properties; + Alignment = alignment; + Flags = flags; + } + CD3DX12_HEAP_DESC( + UINT64 size, + D3D12_HEAP_TYPE type, + UINT64 alignment = 0, + D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE ) noexcept + { + SizeInBytes = size; + Properties = CD3DX12_HEAP_PROPERTIES( type ); + Alignment = alignment; + Flags = flags; + } + CD3DX12_HEAP_DESC( + UINT64 size, + D3D12_CPU_PAGE_PROPERTY cpuPageProperty, + D3D12_MEMORY_POOL memoryPoolPreference, + UINT64 alignment = 0, + D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE ) noexcept + { + SizeInBytes = size; + Properties = CD3DX12_HEAP_PROPERTIES( cpuPageProperty, memoryPoolPreference ); + Alignment = alignment; + Flags = flags; + } + CD3DX12_HEAP_DESC( + const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo, + D3D12_HEAP_PROPERTIES properties, + D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE ) noexcept + { + SizeInBytes = resAllocInfo.SizeInBytes; + Properties = properties; + Alignment = resAllocInfo.Alignment; + Flags = flags; + } + CD3DX12_HEAP_DESC( + const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo, + D3D12_HEAP_TYPE type, + D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE ) noexcept + { + SizeInBytes = resAllocInfo.SizeInBytes; + Properties = CD3DX12_HEAP_PROPERTIES( type ); + Alignment = resAllocInfo.Alignment; + Flags = flags; + } + CD3DX12_HEAP_DESC( + const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo, + D3D12_CPU_PAGE_PROPERTY cpuPageProperty, + D3D12_MEMORY_POOL memoryPoolPreference, + D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE ) noexcept + { + SizeInBytes = resAllocInfo.SizeInBytes; + Properties = CD3DX12_HEAP_PROPERTIES( cpuPageProperty, memoryPoolPreference ); + Alignment = resAllocInfo.Alignment; + Flags = flags; + } + bool IsCPUAccessible() const noexcept + { return static_cast< const CD3DX12_HEAP_PROPERTIES* >( &Properties )->IsCPUAccessible(); } +}; +inline bool operator==( const D3D12_HEAP_DESC& l, const D3D12_HEAP_DESC& r ) noexcept +{ + return l.SizeInBytes == r.SizeInBytes && + l.Properties == r.Properties && + l.Alignment == r.Alignment && + l.Flags == r.Flags; +} +inline bool operator!=( const D3D12_HEAP_DESC& l, const D3D12_HEAP_DESC& r ) noexcept +{ return !( l == r ); } + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_CLEAR_VALUE : public D3D12_CLEAR_VALUE +{ + CD3DX12_CLEAR_VALUE() = default; + explicit CD3DX12_CLEAR_VALUE(const D3D12_CLEAR_VALUE &o) noexcept : + D3D12_CLEAR_VALUE(o) + {} + CD3DX12_CLEAR_VALUE( + DXGI_FORMAT format, + const FLOAT color[4] ) noexcept + { + Format = format; + memcpy( Color, color, sizeof( Color ) ); + } + CD3DX12_CLEAR_VALUE( + DXGI_FORMAT format, + FLOAT depth, + UINT8 stencil ) noexcept + { + Format = format; + memset( &Color, 0, sizeof( Color ) ); + /* Use memcpy to preserve NAN values */ + memcpy( &DepthStencil.Depth, &depth, sizeof( depth ) ); + DepthStencil.Stencil = stencil; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_RANGE : public D3D12_RANGE +{ + CD3DX12_RANGE() = default; + explicit CD3DX12_RANGE(const D3D12_RANGE &o) noexcept : + D3D12_RANGE(o) + {} + CD3DX12_RANGE( + SIZE_T begin, + SIZE_T end ) noexcept + { + Begin = begin; + End = end; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_RANGE_UINT64 : public D3D12_RANGE_UINT64 +{ + CD3DX12_RANGE_UINT64() = default; + explicit CD3DX12_RANGE_UINT64(const D3D12_RANGE_UINT64 &o) noexcept : + D3D12_RANGE_UINT64(o) + {} + CD3DX12_RANGE_UINT64( + UINT64 begin, + UINT64 end ) noexcept + { + Begin = begin; + End = end; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_SUBRESOURCE_RANGE_UINT64 : public D3D12_SUBRESOURCE_RANGE_UINT64 +{ + CD3DX12_SUBRESOURCE_RANGE_UINT64() = default; + explicit CD3DX12_SUBRESOURCE_RANGE_UINT64(const D3D12_SUBRESOURCE_RANGE_UINT64 &o) noexcept : + D3D12_SUBRESOURCE_RANGE_UINT64(o) + {} + CD3DX12_SUBRESOURCE_RANGE_UINT64( + UINT subresource, + const D3D12_RANGE_UINT64& range ) noexcept + { + Subresource = subresource; + Range = range; + } + CD3DX12_SUBRESOURCE_RANGE_UINT64( + UINT subresource, + UINT64 begin, + UINT64 end ) noexcept + { + Subresource = subresource; + Range.Begin = begin; + Range.End = end; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_SHADER_BYTECODE : public D3D12_SHADER_BYTECODE +{ + CD3DX12_SHADER_BYTECODE() = default; + explicit CD3DX12_SHADER_BYTECODE(const D3D12_SHADER_BYTECODE &o) noexcept : + D3D12_SHADER_BYTECODE(o) + {} + CD3DX12_SHADER_BYTECODE( + _In_ ID3DBlob* pShaderBlob ) noexcept + { + pShaderBytecode = pShaderBlob->GetBufferPointer(); + BytecodeLength = pShaderBlob->GetBufferSize(); + } + CD3DX12_SHADER_BYTECODE( + const void* _pShaderBytecode, + SIZE_T bytecodeLength ) noexcept + { + pShaderBytecode = _pShaderBytecode; + BytecodeLength = bytecodeLength; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_TILED_RESOURCE_COORDINATE : public D3D12_TILED_RESOURCE_COORDINATE +{ + CD3DX12_TILED_RESOURCE_COORDINATE() = default; + explicit CD3DX12_TILED_RESOURCE_COORDINATE(const D3D12_TILED_RESOURCE_COORDINATE &o) noexcept : + D3D12_TILED_RESOURCE_COORDINATE(o) + {} + CD3DX12_TILED_RESOURCE_COORDINATE( + UINT x, + UINT y, + UINT z, + UINT subresource ) noexcept + { + X = x; + Y = y; + Z = z; + Subresource = subresource; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_TILE_REGION_SIZE : public D3D12_TILE_REGION_SIZE +{ + CD3DX12_TILE_REGION_SIZE() = default; + explicit CD3DX12_TILE_REGION_SIZE(const D3D12_TILE_REGION_SIZE &o) noexcept : + D3D12_TILE_REGION_SIZE(o) + {} + CD3DX12_TILE_REGION_SIZE( + UINT numTiles, + BOOL useBox, + UINT width, + UINT16 height, + UINT16 depth ) noexcept + { + NumTiles = numTiles; + UseBox = useBox; + Width = width; + Height = height; + Depth = depth; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_SUBRESOURCE_TILING : public D3D12_SUBRESOURCE_TILING +{ + CD3DX12_SUBRESOURCE_TILING() = default; + explicit CD3DX12_SUBRESOURCE_TILING(const D3D12_SUBRESOURCE_TILING &o) noexcept : + D3D12_SUBRESOURCE_TILING(o) + {} + CD3DX12_SUBRESOURCE_TILING( + UINT widthInTiles, + UINT16 heightInTiles, + UINT16 depthInTiles, + UINT startTileIndexInOverallResource ) noexcept + { + WidthInTiles = widthInTiles; + HeightInTiles = heightInTiles; + DepthInTiles = depthInTiles; + StartTileIndexInOverallResource = startTileIndexInOverallResource; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_TILE_SHAPE : public D3D12_TILE_SHAPE +{ + CD3DX12_TILE_SHAPE() = default; + explicit CD3DX12_TILE_SHAPE(const D3D12_TILE_SHAPE &o) noexcept : + D3D12_TILE_SHAPE(o) + {} + CD3DX12_TILE_SHAPE( + UINT widthInTexels, + UINT heightInTexels, + UINT depthInTexels ) noexcept + { + WidthInTexels = widthInTexels; + HeightInTexels = heightInTexels; + DepthInTexels = depthInTexels; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_RESOURCE_BARRIER : public D3D12_RESOURCE_BARRIER +{ + CD3DX12_RESOURCE_BARRIER() = default; + explicit CD3DX12_RESOURCE_BARRIER(const D3D12_RESOURCE_BARRIER &o) noexcept : + D3D12_RESOURCE_BARRIER(o) + {} + static inline CD3DX12_RESOURCE_BARRIER Transition( + _In_ ID3D12Resource* pResource, + D3D12_RESOURCE_STATES stateBefore, + D3D12_RESOURCE_STATES stateAfter, + UINT subresource = D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES, + D3D12_RESOURCE_BARRIER_FLAGS flags = D3D12_RESOURCE_BARRIER_FLAG_NONE) noexcept + { + CD3DX12_RESOURCE_BARRIER result = {}; + D3D12_RESOURCE_BARRIER &barrier = result; + result.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION; + result.Flags = flags; + barrier.Transition.pResource = pResource; + barrier.Transition.StateBefore = stateBefore; + barrier.Transition.StateAfter = stateAfter; + barrier.Transition.Subresource = subresource; + return result; + } + static inline CD3DX12_RESOURCE_BARRIER Aliasing( + _In_ ID3D12Resource* pResourceBefore, + _In_ ID3D12Resource* pResourceAfter) noexcept + { + CD3DX12_RESOURCE_BARRIER result = {}; + D3D12_RESOURCE_BARRIER &barrier = result; + result.Type = D3D12_RESOURCE_BARRIER_TYPE_ALIASING; + barrier.Aliasing.pResourceBefore = pResourceBefore; + barrier.Aliasing.pResourceAfter = pResourceAfter; + return result; + } + static inline CD3DX12_RESOURCE_BARRIER UAV( + _In_ ID3D12Resource* pResource) noexcept + { + CD3DX12_RESOURCE_BARRIER result = {}; + D3D12_RESOURCE_BARRIER &barrier = result; + result.Type = D3D12_RESOURCE_BARRIER_TYPE_UAV; + barrier.UAV.pResource = pResource; + return result; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_PACKED_MIP_INFO : public D3D12_PACKED_MIP_INFO +{ + CD3DX12_PACKED_MIP_INFO() = default; + explicit CD3DX12_PACKED_MIP_INFO(const D3D12_PACKED_MIP_INFO &o) noexcept : + D3D12_PACKED_MIP_INFO(o) + {} + CD3DX12_PACKED_MIP_INFO( + UINT8 numStandardMips, + UINT8 numPackedMips, + UINT numTilesForPackedMips, + UINT startTileIndexInOverallResource ) noexcept + { + NumStandardMips = numStandardMips; + NumPackedMips = numPackedMips; + NumTilesForPackedMips = numTilesForPackedMips; + StartTileIndexInOverallResource = startTileIndexInOverallResource; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_SUBRESOURCE_FOOTPRINT : public D3D12_SUBRESOURCE_FOOTPRINT +{ + CD3DX12_SUBRESOURCE_FOOTPRINT() = default; + explicit CD3DX12_SUBRESOURCE_FOOTPRINT(const D3D12_SUBRESOURCE_FOOTPRINT &o) noexcept : + D3D12_SUBRESOURCE_FOOTPRINT(o) + {} + CD3DX12_SUBRESOURCE_FOOTPRINT( + DXGI_FORMAT format, + UINT width, + UINT height, + UINT depth, + UINT rowPitch ) noexcept + { + Format = format; + Width = width; + Height = height; + Depth = depth; + RowPitch = rowPitch; + } + explicit CD3DX12_SUBRESOURCE_FOOTPRINT( + const D3D12_RESOURCE_DESC& resDesc, + UINT rowPitch ) noexcept + { + Format = resDesc.Format; + Width = UINT( resDesc.Width ); + Height = resDesc.Height; + Depth = (resDesc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? resDesc.DepthOrArraySize : 1u); + RowPitch = rowPitch; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_TEXTURE_COPY_LOCATION : public D3D12_TEXTURE_COPY_LOCATION +{ + CD3DX12_TEXTURE_COPY_LOCATION() = default; + explicit CD3DX12_TEXTURE_COPY_LOCATION(const D3D12_TEXTURE_COPY_LOCATION &o) noexcept : + D3D12_TEXTURE_COPY_LOCATION(o) + {} + CD3DX12_TEXTURE_COPY_LOCATION(_In_ ID3D12Resource* pRes) noexcept + { + pResource = pRes; + Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX; + PlacedFootprint = {}; + } + CD3DX12_TEXTURE_COPY_LOCATION(_In_ ID3D12Resource* pRes, D3D12_PLACED_SUBRESOURCE_FOOTPRINT const& Footprint) noexcept + { + pResource = pRes; + Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT; + PlacedFootprint = Footprint; + } + CD3DX12_TEXTURE_COPY_LOCATION(_In_ ID3D12Resource* pRes, UINT Sub) noexcept + { + pResource = pRes; + Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX; + PlacedFootprint = {}; + SubresourceIndex = Sub; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_DESCRIPTOR_RANGE : public D3D12_DESCRIPTOR_RANGE +{ + CD3DX12_DESCRIPTOR_RANGE() = default; + explicit CD3DX12_DESCRIPTOR_RANGE(const D3D12_DESCRIPTOR_RANGE &o) noexcept : + D3D12_DESCRIPTOR_RANGE(o) + {} + CD3DX12_DESCRIPTOR_RANGE( + D3D12_DESCRIPTOR_RANGE_TYPE rangeType, + UINT numDescriptors, + UINT baseShaderRegister, + UINT registerSpace = 0, + UINT offsetInDescriptorsFromTableStart = + D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND) noexcept + { + Init(rangeType, numDescriptors, baseShaderRegister, registerSpace, offsetInDescriptorsFromTableStart); + } + + inline void Init( + D3D12_DESCRIPTOR_RANGE_TYPE rangeType, + UINT numDescriptors, + UINT baseShaderRegister, + UINT registerSpace = 0, + UINT offsetInDescriptorsFromTableStart = + D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND) noexcept + { + Init(*this, rangeType, numDescriptors, baseShaderRegister, registerSpace, offsetInDescriptorsFromTableStart); + } + + static inline void Init( + _Out_ D3D12_DESCRIPTOR_RANGE &range, + D3D12_DESCRIPTOR_RANGE_TYPE rangeType, + UINT numDescriptors, + UINT baseShaderRegister, + UINT registerSpace = 0, + UINT offsetInDescriptorsFromTableStart = + D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND) noexcept + { + range.RangeType = rangeType; + range.NumDescriptors = numDescriptors; + range.BaseShaderRegister = baseShaderRegister; + range.RegisterSpace = registerSpace; + range.OffsetInDescriptorsFromTableStart = offsetInDescriptorsFromTableStart; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_ROOT_DESCRIPTOR_TABLE : public D3D12_ROOT_DESCRIPTOR_TABLE +{ + CD3DX12_ROOT_DESCRIPTOR_TABLE() = default; + explicit CD3DX12_ROOT_DESCRIPTOR_TABLE(const D3D12_ROOT_DESCRIPTOR_TABLE &o) noexcept : + D3D12_ROOT_DESCRIPTOR_TABLE(o) + {} + CD3DX12_ROOT_DESCRIPTOR_TABLE( + UINT numDescriptorRanges, + _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* _pDescriptorRanges) noexcept + { + Init(numDescriptorRanges, _pDescriptorRanges); + } + + inline void Init( + UINT numDescriptorRanges, + _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* _pDescriptorRanges) noexcept + { + Init(*this, numDescriptorRanges, _pDescriptorRanges); + } + + static inline void Init( + _Out_ D3D12_ROOT_DESCRIPTOR_TABLE &rootDescriptorTable, + UINT numDescriptorRanges, + _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* _pDescriptorRanges) noexcept + { + rootDescriptorTable.NumDescriptorRanges = numDescriptorRanges; + rootDescriptorTable.pDescriptorRanges = _pDescriptorRanges; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_ROOT_CONSTANTS : public D3D12_ROOT_CONSTANTS +{ + CD3DX12_ROOT_CONSTANTS() = default; + explicit CD3DX12_ROOT_CONSTANTS(const D3D12_ROOT_CONSTANTS &o) noexcept : + D3D12_ROOT_CONSTANTS(o) + {} + CD3DX12_ROOT_CONSTANTS( + UINT num32BitValues, + UINT shaderRegister, + UINT registerSpace = 0) noexcept + { + Init(num32BitValues, shaderRegister, registerSpace); + } + + inline void Init( + UINT num32BitValues, + UINT shaderRegister, + UINT registerSpace = 0) noexcept + { + Init(*this, num32BitValues, shaderRegister, registerSpace); + } + + static inline void Init( + _Out_ D3D12_ROOT_CONSTANTS &rootConstants, + UINT num32BitValues, + UINT shaderRegister, + UINT registerSpace = 0) noexcept + { + rootConstants.Num32BitValues = num32BitValues; + rootConstants.ShaderRegister = shaderRegister; + rootConstants.RegisterSpace = registerSpace; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_ROOT_DESCRIPTOR : public D3D12_ROOT_DESCRIPTOR +{ + CD3DX12_ROOT_DESCRIPTOR() = default; + explicit CD3DX12_ROOT_DESCRIPTOR(const D3D12_ROOT_DESCRIPTOR &o) noexcept : + D3D12_ROOT_DESCRIPTOR(o) + {} + CD3DX12_ROOT_DESCRIPTOR( + UINT shaderRegister, + UINT registerSpace = 0) noexcept + { + Init(shaderRegister, registerSpace); + } + + inline void Init( + UINT shaderRegister, + UINT registerSpace = 0) noexcept + { + Init(*this, shaderRegister, registerSpace); + } + + static inline void Init(_Out_ D3D12_ROOT_DESCRIPTOR &table, UINT shaderRegister, UINT registerSpace = 0) noexcept + { + table.ShaderRegister = shaderRegister; + table.RegisterSpace = registerSpace; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_ROOT_PARAMETER : public D3D12_ROOT_PARAMETER +{ + CD3DX12_ROOT_PARAMETER() = default; + explicit CD3DX12_ROOT_PARAMETER(const D3D12_ROOT_PARAMETER &o) noexcept : + D3D12_ROOT_PARAMETER(o) + {} + + static inline void InitAsDescriptorTable( + _Out_ D3D12_ROOT_PARAMETER &rootParam, + UINT numDescriptorRanges, + _In_reads_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* pDescriptorRanges, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE; + rootParam.ShaderVisibility = visibility; + CD3DX12_ROOT_DESCRIPTOR_TABLE::Init(rootParam.DescriptorTable, numDescriptorRanges, pDescriptorRanges); + } + + static inline void InitAsConstants( + _Out_ D3D12_ROOT_PARAMETER &rootParam, + UINT num32BitValues, + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS; + rootParam.ShaderVisibility = visibility; + CD3DX12_ROOT_CONSTANTS::Init(rootParam.Constants, num32BitValues, shaderRegister, registerSpace); + } + + static inline void InitAsConstantBufferView( + _Out_ D3D12_ROOT_PARAMETER &rootParam, + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_CBV; + rootParam.ShaderVisibility = visibility; + CD3DX12_ROOT_DESCRIPTOR::Init(rootParam.Descriptor, shaderRegister, registerSpace); + } + + static inline void InitAsShaderResourceView( + _Out_ D3D12_ROOT_PARAMETER &rootParam, + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_SRV; + rootParam.ShaderVisibility = visibility; + CD3DX12_ROOT_DESCRIPTOR::Init(rootParam.Descriptor, shaderRegister, registerSpace); + } + + static inline void InitAsUnorderedAccessView( + _Out_ D3D12_ROOT_PARAMETER &rootParam, + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_UAV; + rootParam.ShaderVisibility = visibility; + CD3DX12_ROOT_DESCRIPTOR::Init(rootParam.Descriptor, shaderRegister, registerSpace); + } + + inline void InitAsDescriptorTable( + UINT numDescriptorRanges, + _In_reads_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* pDescriptorRanges, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + InitAsDescriptorTable(*this, numDescriptorRanges, pDescriptorRanges, visibility); + } + + inline void InitAsConstants( + UINT num32BitValues, + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + InitAsConstants(*this, num32BitValues, shaderRegister, registerSpace, visibility); + } + + inline void InitAsConstantBufferView( + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + InitAsConstantBufferView(*this, shaderRegister, registerSpace, visibility); + } + + inline void InitAsShaderResourceView( + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + InitAsShaderResourceView(*this, shaderRegister, registerSpace, visibility); + } + + inline void InitAsUnorderedAccessView( + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + InitAsUnorderedAccessView(*this, shaderRegister, registerSpace, visibility); + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_STATIC_SAMPLER_DESC : public D3D12_STATIC_SAMPLER_DESC +{ + CD3DX12_STATIC_SAMPLER_DESC() = default; + explicit CD3DX12_STATIC_SAMPLER_DESC(const D3D12_STATIC_SAMPLER_DESC &o) noexcept : + D3D12_STATIC_SAMPLER_DESC(o) + {} + CD3DX12_STATIC_SAMPLER_DESC( + UINT shaderRegister, + D3D12_FILTER filter = D3D12_FILTER_ANISOTROPIC, + D3D12_TEXTURE_ADDRESS_MODE addressU = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + D3D12_TEXTURE_ADDRESS_MODE addressV = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + D3D12_TEXTURE_ADDRESS_MODE addressW = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + FLOAT mipLODBias = 0, + UINT maxAnisotropy = 16, + D3D12_COMPARISON_FUNC comparisonFunc = D3D12_COMPARISON_FUNC_LESS_EQUAL, + D3D12_STATIC_BORDER_COLOR borderColor = D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE, + FLOAT minLOD = 0.f, + FLOAT maxLOD = D3D12_FLOAT32_MAX, + D3D12_SHADER_VISIBILITY shaderVisibility = D3D12_SHADER_VISIBILITY_ALL, + UINT registerSpace = 0) noexcept + { + Init( + shaderRegister, + filter, + addressU, + addressV, + addressW, + mipLODBias, + maxAnisotropy, + comparisonFunc, + borderColor, + minLOD, + maxLOD, + shaderVisibility, + registerSpace); + } + + static inline void Init( + _Out_ D3D12_STATIC_SAMPLER_DESC &samplerDesc, + UINT shaderRegister, + D3D12_FILTER filter = D3D12_FILTER_ANISOTROPIC, + D3D12_TEXTURE_ADDRESS_MODE addressU = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + D3D12_TEXTURE_ADDRESS_MODE addressV = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + D3D12_TEXTURE_ADDRESS_MODE addressW = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + FLOAT mipLODBias = 0, + UINT maxAnisotropy = 16, + D3D12_COMPARISON_FUNC comparisonFunc = D3D12_COMPARISON_FUNC_LESS_EQUAL, + D3D12_STATIC_BORDER_COLOR borderColor = D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE, + FLOAT minLOD = 0.f, + FLOAT maxLOD = D3D12_FLOAT32_MAX, + D3D12_SHADER_VISIBILITY shaderVisibility = D3D12_SHADER_VISIBILITY_ALL, + UINT registerSpace = 0) noexcept + { + samplerDesc.ShaderRegister = shaderRegister; + samplerDesc.Filter = filter; + samplerDesc.AddressU = addressU; + samplerDesc.AddressV = addressV; + samplerDesc.AddressW = addressW; + samplerDesc.MipLODBias = mipLODBias; + samplerDesc.MaxAnisotropy = maxAnisotropy; + samplerDesc.ComparisonFunc = comparisonFunc; + samplerDesc.BorderColor = borderColor; + samplerDesc.MinLOD = minLOD; + samplerDesc.MaxLOD = maxLOD; + samplerDesc.ShaderVisibility = shaderVisibility; + samplerDesc.RegisterSpace = registerSpace; + } + inline void Init( + UINT shaderRegister, + D3D12_FILTER filter = D3D12_FILTER_ANISOTROPIC, + D3D12_TEXTURE_ADDRESS_MODE addressU = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + D3D12_TEXTURE_ADDRESS_MODE addressV = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + D3D12_TEXTURE_ADDRESS_MODE addressW = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + FLOAT mipLODBias = 0, + UINT maxAnisotropy = 16, + D3D12_COMPARISON_FUNC comparisonFunc = D3D12_COMPARISON_FUNC_LESS_EQUAL, + D3D12_STATIC_BORDER_COLOR borderColor = D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE, + FLOAT minLOD = 0.f, + FLOAT maxLOD = D3D12_FLOAT32_MAX, + D3D12_SHADER_VISIBILITY shaderVisibility = D3D12_SHADER_VISIBILITY_ALL, + UINT registerSpace = 0) noexcept + { + Init( + *this, + shaderRegister, + filter, + addressU, + addressV, + addressW, + mipLODBias, + maxAnisotropy, + comparisonFunc, + borderColor, + minLOD, + maxLOD, + shaderVisibility, + registerSpace); + } + +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_ROOT_SIGNATURE_DESC : public D3D12_ROOT_SIGNATURE_DESC +{ + CD3DX12_ROOT_SIGNATURE_DESC() = default; + explicit CD3DX12_ROOT_SIGNATURE_DESC(const D3D12_ROOT_SIGNATURE_DESC &o) noexcept : + D3D12_ROOT_SIGNATURE_DESC(o) + {} + CD3DX12_ROOT_SIGNATURE_DESC( + UINT numParameters, + _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER* _pParameters, + UINT numStaticSamplers = 0, + _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr, + D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE) noexcept + { + Init(numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags); + } + CD3DX12_ROOT_SIGNATURE_DESC(CD3DX12_DEFAULT) noexcept + { + Init(0, nullptr, 0, nullptr, D3D12_ROOT_SIGNATURE_FLAG_NONE); + } + + inline void Init( + UINT numParameters, + _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER* _pParameters, + UINT numStaticSamplers = 0, + _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr, + D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE) noexcept + { + Init(*this, numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags); + } + + static inline void Init( + _Out_ D3D12_ROOT_SIGNATURE_DESC &desc, + UINT numParameters, + _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER* _pParameters, + UINT numStaticSamplers = 0, + _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr, + D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE) noexcept + { + desc.NumParameters = numParameters; + desc.pParameters = _pParameters; + desc.NumStaticSamplers = numStaticSamplers; + desc.pStaticSamplers = _pStaticSamplers; + desc.Flags = flags; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_DESCRIPTOR_RANGE1 : public D3D12_DESCRIPTOR_RANGE1 +{ + CD3DX12_DESCRIPTOR_RANGE1() = default; + explicit CD3DX12_DESCRIPTOR_RANGE1(const D3D12_DESCRIPTOR_RANGE1 &o) noexcept : + D3D12_DESCRIPTOR_RANGE1(o) + {} + CD3DX12_DESCRIPTOR_RANGE1( + D3D12_DESCRIPTOR_RANGE_TYPE rangeType, + UINT numDescriptors, + UINT baseShaderRegister, + UINT registerSpace = 0, + D3D12_DESCRIPTOR_RANGE_FLAGS flags = D3D12_DESCRIPTOR_RANGE_FLAG_NONE, + UINT offsetInDescriptorsFromTableStart = + D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND) noexcept + { + Init(rangeType, numDescriptors, baseShaderRegister, registerSpace, flags, offsetInDescriptorsFromTableStart); + } + + inline void Init( + D3D12_DESCRIPTOR_RANGE_TYPE rangeType, + UINT numDescriptors, + UINT baseShaderRegister, + UINT registerSpace = 0, + D3D12_DESCRIPTOR_RANGE_FLAGS flags = D3D12_DESCRIPTOR_RANGE_FLAG_NONE, + UINT offsetInDescriptorsFromTableStart = + D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND) noexcept + { + Init(*this, rangeType, numDescriptors, baseShaderRegister, registerSpace, flags, offsetInDescriptorsFromTableStart); + } + + static inline void Init( + _Out_ D3D12_DESCRIPTOR_RANGE1 &range, + D3D12_DESCRIPTOR_RANGE_TYPE rangeType, + UINT numDescriptors, + UINT baseShaderRegister, + UINT registerSpace = 0, + D3D12_DESCRIPTOR_RANGE_FLAGS flags = D3D12_DESCRIPTOR_RANGE_FLAG_NONE, + UINT offsetInDescriptorsFromTableStart = + D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND) noexcept + { + range.RangeType = rangeType; + range.NumDescriptors = numDescriptors; + range.BaseShaderRegister = baseShaderRegister; + range.RegisterSpace = registerSpace; + range.Flags = flags; + range.OffsetInDescriptorsFromTableStart = offsetInDescriptorsFromTableStart; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_ROOT_DESCRIPTOR_TABLE1 : public D3D12_ROOT_DESCRIPTOR_TABLE1 +{ + CD3DX12_ROOT_DESCRIPTOR_TABLE1() = default; + explicit CD3DX12_ROOT_DESCRIPTOR_TABLE1(const D3D12_ROOT_DESCRIPTOR_TABLE1 &o) noexcept : + D3D12_ROOT_DESCRIPTOR_TABLE1(o) + {} + CD3DX12_ROOT_DESCRIPTOR_TABLE1( + UINT numDescriptorRanges, + _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE1* _pDescriptorRanges) noexcept + { + Init(numDescriptorRanges, _pDescriptorRanges); + } + + inline void Init( + UINT numDescriptorRanges, + _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE1* _pDescriptorRanges) noexcept + { + Init(*this, numDescriptorRanges, _pDescriptorRanges); + } + + static inline void Init( + _Out_ D3D12_ROOT_DESCRIPTOR_TABLE1 &rootDescriptorTable, + UINT numDescriptorRanges, + _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE1* _pDescriptorRanges) noexcept + { + rootDescriptorTable.NumDescriptorRanges = numDescriptorRanges; + rootDescriptorTable.pDescriptorRanges = _pDescriptorRanges; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_ROOT_DESCRIPTOR1 : public D3D12_ROOT_DESCRIPTOR1 +{ + CD3DX12_ROOT_DESCRIPTOR1() = default; + explicit CD3DX12_ROOT_DESCRIPTOR1(const D3D12_ROOT_DESCRIPTOR1 &o) noexcept : + D3D12_ROOT_DESCRIPTOR1(o) + {} + CD3DX12_ROOT_DESCRIPTOR1( + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE) noexcept + { + Init(shaderRegister, registerSpace, flags); + } + + inline void Init( + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE) noexcept + { + Init(*this, shaderRegister, registerSpace, flags); + } + + static inline void Init( + _Out_ D3D12_ROOT_DESCRIPTOR1 &table, + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE) noexcept + { + table.ShaderRegister = shaderRegister; + table.RegisterSpace = registerSpace; + table.Flags = flags; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_ROOT_PARAMETER1 : public D3D12_ROOT_PARAMETER1 +{ + CD3DX12_ROOT_PARAMETER1() = default; + explicit CD3DX12_ROOT_PARAMETER1(const D3D12_ROOT_PARAMETER1 &o) noexcept : + D3D12_ROOT_PARAMETER1(o) + {} + + static inline void InitAsDescriptorTable( + _Out_ D3D12_ROOT_PARAMETER1 &rootParam, + UINT numDescriptorRanges, + _In_reads_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE1* pDescriptorRanges, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE; + rootParam.ShaderVisibility = visibility; + CD3DX12_ROOT_DESCRIPTOR_TABLE1::Init(rootParam.DescriptorTable, numDescriptorRanges, pDescriptorRanges); + } + + static inline void InitAsConstants( + _Out_ D3D12_ROOT_PARAMETER1 &rootParam, + UINT num32BitValues, + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS; + rootParam.ShaderVisibility = visibility; + CD3DX12_ROOT_CONSTANTS::Init(rootParam.Constants, num32BitValues, shaderRegister, registerSpace); + } + + static inline void InitAsConstantBufferView( + _Out_ D3D12_ROOT_PARAMETER1 &rootParam, + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_CBV; + rootParam.ShaderVisibility = visibility; + CD3DX12_ROOT_DESCRIPTOR1::Init(rootParam.Descriptor, shaderRegister, registerSpace, flags); + } + + static inline void InitAsShaderResourceView( + _Out_ D3D12_ROOT_PARAMETER1 &rootParam, + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_SRV; + rootParam.ShaderVisibility = visibility; + CD3DX12_ROOT_DESCRIPTOR1::Init(rootParam.Descriptor, shaderRegister, registerSpace, flags); + } + + static inline void InitAsUnorderedAccessView( + _Out_ D3D12_ROOT_PARAMETER1 &rootParam, + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_UAV; + rootParam.ShaderVisibility = visibility; + CD3DX12_ROOT_DESCRIPTOR1::Init(rootParam.Descriptor, shaderRegister, registerSpace, flags); + } + + inline void InitAsDescriptorTable( + UINT numDescriptorRanges, + _In_reads_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE1* pDescriptorRanges, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + InitAsDescriptorTable(*this, numDescriptorRanges, pDescriptorRanges, visibility); + } + + inline void InitAsConstants( + UINT num32BitValues, + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + InitAsConstants(*this, num32BitValues, shaderRegister, registerSpace, visibility); + } + + inline void InitAsConstantBufferView( + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + InitAsConstantBufferView(*this, shaderRegister, registerSpace, flags, visibility); + } + + inline void InitAsShaderResourceView( + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + InitAsShaderResourceView(*this, shaderRegister, registerSpace, flags, visibility); + } + + inline void InitAsUnorderedAccessView( + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + InitAsUnorderedAccessView(*this, shaderRegister, registerSpace, flags, visibility); + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC : public D3D12_VERSIONED_ROOT_SIGNATURE_DESC +{ + CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC() = default; + explicit CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC(const D3D12_VERSIONED_ROOT_SIGNATURE_DESC &o) noexcept : + D3D12_VERSIONED_ROOT_SIGNATURE_DESC(o) + {} + explicit CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC(const D3D12_ROOT_SIGNATURE_DESC &o) noexcept + { + Version = D3D_ROOT_SIGNATURE_VERSION_1_0; + Desc_1_0 = o; + } + explicit CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC(const D3D12_ROOT_SIGNATURE_DESC1 &o) noexcept + { + Version = D3D_ROOT_SIGNATURE_VERSION_1_1; + Desc_1_1 = o; + } + CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC( + UINT numParameters, + _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER* _pParameters, + UINT numStaticSamplers = 0, + _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr, + D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE) noexcept + { + Init_1_0(numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags); + } + CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC( + UINT numParameters, + _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER1* _pParameters, + UINT numStaticSamplers = 0, + _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr, + D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE) noexcept + { + Init_1_1(numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags); + } + CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC(CD3DX12_DEFAULT) noexcept + { + Init_1_1(0, nullptr, 0, nullptr, D3D12_ROOT_SIGNATURE_FLAG_NONE); + } + + inline void Init_1_0( + UINT numParameters, + _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER* _pParameters, + UINT numStaticSamplers = 0, + _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr, + D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE) noexcept + { + Init_1_0(*this, numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags); + } + + static inline void Init_1_0( + _Out_ D3D12_VERSIONED_ROOT_SIGNATURE_DESC &desc, + UINT numParameters, + _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER* _pParameters, + UINT numStaticSamplers = 0, + _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr, + D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE) noexcept + { + desc.Version = D3D_ROOT_SIGNATURE_VERSION_1_0; + desc.Desc_1_0.NumParameters = numParameters; + desc.Desc_1_0.pParameters = _pParameters; + desc.Desc_1_0.NumStaticSamplers = numStaticSamplers; + desc.Desc_1_0.pStaticSamplers = _pStaticSamplers; + desc.Desc_1_0.Flags = flags; + } + + inline void Init_1_1( + UINT numParameters, + _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER1* _pParameters, + UINT numStaticSamplers = 0, + _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr, + D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE) noexcept + { + Init_1_1(*this, numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags); + } + + static inline void Init_1_1( + _Out_ D3D12_VERSIONED_ROOT_SIGNATURE_DESC &desc, + UINT numParameters, + _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER1* _pParameters, + UINT numStaticSamplers = 0, + _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr, + D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE) noexcept + { + desc.Version = D3D_ROOT_SIGNATURE_VERSION_1_1; + desc.Desc_1_1.NumParameters = numParameters; + desc.Desc_1_1.pParameters = _pParameters; + desc.Desc_1_1.NumStaticSamplers = numStaticSamplers; + desc.Desc_1_1.pStaticSamplers = _pStaticSamplers; + desc.Desc_1_1.Flags = flags; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_CPU_DESCRIPTOR_HANDLE : public D3D12_CPU_DESCRIPTOR_HANDLE +{ + CD3DX12_CPU_DESCRIPTOR_HANDLE() = default; + explicit CD3DX12_CPU_DESCRIPTOR_HANDLE(const D3D12_CPU_DESCRIPTOR_HANDLE &o) noexcept : + D3D12_CPU_DESCRIPTOR_HANDLE(o) + {} + CD3DX12_CPU_DESCRIPTOR_HANDLE(CD3DX12_DEFAULT) noexcept { ptr = 0; } + CD3DX12_CPU_DESCRIPTOR_HANDLE(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &other, INT offsetScaledByIncrementSize) noexcept + { + InitOffsetted(other, offsetScaledByIncrementSize); + } + CD3DX12_CPU_DESCRIPTOR_HANDLE(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &other, INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept + { + InitOffsetted(other, offsetInDescriptors, descriptorIncrementSize); + } + CD3DX12_CPU_DESCRIPTOR_HANDLE& Offset(INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept + { + ptr = SIZE_T(INT64(ptr) + INT64(offsetInDescriptors) * INT64(descriptorIncrementSize)); + return *this; + } + CD3DX12_CPU_DESCRIPTOR_HANDLE& Offset(INT offsetScaledByIncrementSize) noexcept + { + ptr = SIZE_T(INT64(ptr) + INT64(offsetScaledByIncrementSize)); + return *this; + } + bool operator==(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE& other) const noexcept + { + return (ptr == other.ptr); + } + bool operator!=(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE& other) const noexcept + { + return (ptr != other.ptr); + } + CD3DX12_CPU_DESCRIPTOR_HANDLE &operator=(const D3D12_CPU_DESCRIPTOR_HANDLE &other) noexcept + { + ptr = other.ptr; + return *this; + } + + inline void InitOffsetted(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize) noexcept + { + InitOffsetted(*this, base, offsetScaledByIncrementSize); + } + + inline void InitOffsetted(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &base, INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept + { + InitOffsetted(*this, base, offsetInDescriptors, descriptorIncrementSize); + } + + static inline void InitOffsetted(_Out_ D3D12_CPU_DESCRIPTOR_HANDLE &handle, _In_ const D3D12_CPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize) noexcept + { + handle.ptr = SIZE_T(INT64(base.ptr) + INT64(offsetScaledByIncrementSize)); + } + + static inline void InitOffsetted(_Out_ D3D12_CPU_DESCRIPTOR_HANDLE &handle, _In_ const D3D12_CPU_DESCRIPTOR_HANDLE &base, INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept + { + handle.ptr = SIZE_T(INT64(base.ptr) + INT64(offsetInDescriptors) * INT64(descriptorIncrementSize)); + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_GPU_DESCRIPTOR_HANDLE : public D3D12_GPU_DESCRIPTOR_HANDLE +{ + CD3DX12_GPU_DESCRIPTOR_HANDLE() = default; + explicit CD3DX12_GPU_DESCRIPTOR_HANDLE(const D3D12_GPU_DESCRIPTOR_HANDLE &o) noexcept : + D3D12_GPU_DESCRIPTOR_HANDLE(o) + {} + CD3DX12_GPU_DESCRIPTOR_HANDLE(CD3DX12_DEFAULT) noexcept { ptr = 0; } + CD3DX12_GPU_DESCRIPTOR_HANDLE(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &other, INT offsetScaledByIncrementSize) noexcept + { + InitOffsetted(other, offsetScaledByIncrementSize); + } + CD3DX12_GPU_DESCRIPTOR_HANDLE(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &other, INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept + { + InitOffsetted(other, offsetInDescriptors, descriptorIncrementSize); + } + CD3DX12_GPU_DESCRIPTOR_HANDLE& Offset(INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept + { + ptr = UINT64(INT64(ptr) + INT64(offsetInDescriptors) * INT64(descriptorIncrementSize)); + return *this; + } + CD3DX12_GPU_DESCRIPTOR_HANDLE& Offset(INT offsetScaledByIncrementSize) noexcept + { + ptr = UINT64(INT64(ptr) + INT64(offsetScaledByIncrementSize)); + return *this; + } + inline bool operator==(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE& other) const noexcept + { + return (ptr == other.ptr); + } + inline bool operator!=(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE& other) const noexcept + { + return (ptr != other.ptr); + } + CD3DX12_GPU_DESCRIPTOR_HANDLE &operator=(const D3D12_GPU_DESCRIPTOR_HANDLE &other) noexcept + { + ptr = other.ptr; + return *this; + } + + inline void InitOffsetted(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize) noexcept + { + InitOffsetted(*this, base, offsetScaledByIncrementSize); + } + + inline void InitOffsetted(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &base, INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept + { + InitOffsetted(*this, base, offsetInDescriptors, descriptorIncrementSize); + } + + static inline void InitOffsetted(_Out_ D3D12_GPU_DESCRIPTOR_HANDLE &handle, _In_ const D3D12_GPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize) noexcept + { + handle.ptr = UINT64(INT64(base.ptr) + INT64(offsetScaledByIncrementSize)); + } + + static inline void InitOffsetted(_Out_ D3D12_GPU_DESCRIPTOR_HANDLE &handle, _In_ const D3D12_GPU_DESCRIPTOR_HANDLE &base, INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept + { + handle.ptr = UINT64(INT64(base.ptr) + INT64(offsetInDescriptors) * INT64(descriptorIncrementSize)); + } +}; + +//------------------------------------------------------------------------------------------------ +constexpr UINT D3D12CalcSubresource( UINT MipSlice, UINT ArraySlice, UINT PlaneSlice, UINT MipLevels, UINT ArraySize ) noexcept +{ + return MipSlice + ArraySlice * MipLevels + PlaneSlice * MipLevels * ArraySize; +} + +//------------------------------------------------------------------------------------------------ +template +inline void D3D12DecomposeSubresource( UINT Subresource, UINT MipLevels, UINT ArraySize, _Out_ T& MipSlice, _Out_ U& ArraySlice, _Out_ V& PlaneSlice ) noexcept +{ + MipSlice = static_cast(Subresource % MipLevels); + ArraySlice = static_cast((Subresource / MipLevels) % ArraySize); + PlaneSlice = static_cast(Subresource / (MipLevels * ArraySize)); +} + +//------------------------------------------------------------------------------------------------ +inline UINT8 D3D12GetFormatPlaneCount( + _In_ ID3D12Device* pDevice, + DXGI_FORMAT Format + ) noexcept +{ + D3D12_FEATURE_DATA_FORMAT_INFO formatInfo = { Format, 0 }; + if (FAILED(pDevice->CheckFeatureSupport(D3D12_FEATURE_FORMAT_INFO, &formatInfo, sizeof(formatInfo)))) + { + return 0; + } + return formatInfo.PlaneCount; +} + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_RESOURCE_DESC : public D3D12_RESOURCE_DESC +{ + CD3DX12_RESOURCE_DESC() = default; + explicit CD3DX12_RESOURCE_DESC( const D3D12_RESOURCE_DESC& o ) noexcept : + D3D12_RESOURCE_DESC( o ) + {} + CD3DX12_RESOURCE_DESC( + D3D12_RESOURCE_DIMENSION dimension, + UINT64 alignment, + UINT64 width, + UINT height, + UINT16 depthOrArraySize, + UINT16 mipLevels, + DXGI_FORMAT format, + UINT sampleCount, + UINT sampleQuality, + D3D12_TEXTURE_LAYOUT layout, + D3D12_RESOURCE_FLAGS flags ) noexcept + { + Dimension = dimension; + Alignment = alignment; + Width = width; + Height = height; + DepthOrArraySize = depthOrArraySize; + MipLevels = mipLevels; + Format = format; + SampleDesc.Count = sampleCount; + SampleDesc.Quality = sampleQuality; + Layout = layout; + Flags = flags; + } + static inline CD3DX12_RESOURCE_DESC Buffer( + const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE ) noexcept + { + return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_BUFFER, resAllocInfo.Alignment, resAllocInfo.SizeInBytes, + 1, 1, 1, DXGI_FORMAT_UNKNOWN, 1, 0, D3D12_TEXTURE_LAYOUT_ROW_MAJOR, flags ); + } + static inline CD3DX12_RESOURCE_DESC Buffer( + UINT64 width, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, + UINT64 alignment = 0 ) noexcept + { + return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_BUFFER, alignment, width, 1, 1, 1, + DXGI_FORMAT_UNKNOWN, 1, 0, D3D12_TEXTURE_LAYOUT_ROW_MAJOR, flags ); + } + static inline CD3DX12_RESOURCE_DESC Tex1D( + DXGI_FORMAT format, + UINT64 width, + UINT16 arraySize = 1, + UINT16 mipLevels = 0, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, + D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN, + UINT64 alignment = 0 ) noexcept + { + return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_TEXTURE1D, alignment, width, 1, arraySize, + mipLevels, format, 1, 0, layout, flags ); + } + static inline CD3DX12_RESOURCE_DESC Tex2D( + DXGI_FORMAT format, + UINT64 width, + UINT height, + UINT16 arraySize = 1, + UINT16 mipLevels = 0, + UINT sampleCount = 1, + UINT sampleQuality = 0, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, + D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN, + UINT64 alignment = 0 ) noexcept + { + return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_TEXTURE2D, alignment, width, height, arraySize, + mipLevels, format, sampleCount, sampleQuality, layout, flags ); + } + static inline CD3DX12_RESOURCE_DESC Tex3D( + DXGI_FORMAT format, + UINT64 width, + UINT height, + UINT16 depth, + UINT16 mipLevels = 0, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, + D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN, + UINT64 alignment = 0 ) noexcept + { + return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_TEXTURE3D, alignment, width, height, depth, + mipLevels, format, 1, 0, layout, flags ); + } + inline UINT16 Depth() const noexcept + { return (Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1u); } + inline UINT16 ArraySize() const noexcept + { return (Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1u); } + inline UINT8 PlaneCount(_In_ ID3D12Device* pDevice) const noexcept + { return D3D12GetFormatPlaneCount(pDevice, Format); } + inline UINT Subresources(_In_ ID3D12Device* pDevice) const noexcept + { return static_cast(MipLevels) * ArraySize() * PlaneCount(pDevice); } + inline UINT CalcSubresource(UINT MipSlice, UINT ArraySlice, UINT PlaneSlice) noexcept + { return D3D12CalcSubresource(MipSlice, ArraySlice, PlaneSlice, MipLevels, ArraySize()); } +}; +inline bool operator==( const D3D12_RESOURCE_DESC& l, const D3D12_RESOURCE_DESC& r ) noexcept +{ + return l.Dimension == r.Dimension && + l.Alignment == r.Alignment && + l.Width == r.Width && + l.Height == r.Height && + l.DepthOrArraySize == r.DepthOrArraySize && + l.MipLevels == r.MipLevels && + l.Format == r.Format && + l.SampleDesc.Count == r.SampleDesc.Count && + l.SampleDesc.Quality == r.SampleDesc.Quality && + l.Layout == r.Layout && + l.Flags == r.Flags; +} +inline bool operator!=( const D3D12_RESOURCE_DESC& l, const D3D12_RESOURCE_DESC& r ) noexcept +{ return !( l == r ); } + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_RESOURCE_DESC1 : public D3D12_RESOURCE_DESC1 +{ + CD3DX12_RESOURCE_DESC1() = default; + explicit CD3DX12_RESOURCE_DESC1( const D3D12_RESOURCE_DESC1& o ) noexcept : + D3D12_RESOURCE_DESC1( o ) + {} + explicit CD3DX12_RESOURCE_DESC1( const D3D12_RESOURCE_DESC& o ) noexcept + { + Dimension = o.Dimension; + Alignment = o.Alignment; + Width = o.Width; + Height = o.Height; + DepthOrArraySize = o.DepthOrArraySize; + MipLevels = o.MipLevels; + Format = o.Format; + SampleDesc = o.SampleDesc; + Layout = o.Layout; + Flags = o.Flags; + SamplerFeedbackMipRegion = {}; + } + CD3DX12_RESOURCE_DESC1( + D3D12_RESOURCE_DIMENSION dimension, + UINT64 alignment, + UINT64 width, + UINT height, + UINT16 depthOrArraySize, + UINT16 mipLevels, + DXGI_FORMAT format, + UINT sampleCount, + UINT sampleQuality, + D3D12_TEXTURE_LAYOUT layout, + D3D12_RESOURCE_FLAGS flags, + UINT samplerFeedbackMipRegionWidth = 0, + UINT samplerFeedbackMipRegionHeight = 0, + UINT samplerFeedbackMipRegionDepth = 0) noexcept + { + Dimension = dimension; + Alignment = alignment; + Width = width; + Height = height; + DepthOrArraySize = depthOrArraySize; + MipLevels = mipLevels; + Format = format; + SampleDesc.Count = sampleCount; + SampleDesc.Quality = sampleQuality; + Layout = layout; + Flags = flags; + SamplerFeedbackMipRegion.Width = samplerFeedbackMipRegionWidth; + SamplerFeedbackMipRegion.Height = samplerFeedbackMipRegionHeight; + SamplerFeedbackMipRegion.Depth = samplerFeedbackMipRegionDepth; + } + static inline CD3DX12_RESOURCE_DESC1 Buffer( + const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE ) noexcept + { + return CD3DX12_RESOURCE_DESC1( D3D12_RESOURCE_DIMENSION_BUFFER, resAllocInfo.Alignment, resAllocInfo.SizeInBytes, + 1, 1, 1, DXGI_FORMAT_UNKNOWN, 1, 0, D3D12_TEXTURE_LAYOUT_ROW_MAJOR, flags, 0, 0, 0 ); + } + static inline CD3DX12_RESOURCE_DESC1 Buffer( + UINT64 width, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, + UINT64 alignment = 0 ) noexcept + { + return CD3DX12_RESOURCE_DESC1( D3D12_RESOURCE_DIMENSION_BUFFER, alignment, width, 1, 1, 1, + DXGI_FORMAT_UNKNOWN, 1, 0, D3D12_TEXTURE_LAYOUT_ROW_MAJOR, flags, 0, 0, 0 ); + } + static inline CD3DX12_RESOURCE_DESC1 Tex1D( + DXGI_FORMAT format, + UINT64 width, + UINT16 arraySize = 1, + UINT16 mipLevels = 0, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, + D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN, + UINT64 alignment = 0 ) noexcept + { + return CD3DX12_RESOURCE_DESC1( D3D12_RESOURCE_DIMENSION_TEXTURE1D, alignment, width, 1, arraySize, + mipLevels, format, 1, 0, layout, flags, 0, 0, 0 ); + } + static inline CD3DX12_RESOURCE_DESC1 Tex2D( + DXGI_FORMAT format, + UINT64 width, + UINT height, + UINT16 arraySize = 1, + UINT16 mipLevels = 0, + UINT sampleCount = 1, + UINT sampleQuality = 0, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, + D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN, + UINT64 alignment = 0, + UINT samplerFeedbackMipRegionWidth = 0, + UINT samplerFeedbackMipRegionHeight = 0, + UINT samplerFeedbackMipRegionDepth = 0) noexcept + { + return CD3DX12_RESOURCE_DESC1( D3D12_RESOURCE_DIMENSION_TEXTURE2D, alignment, width, height, arraySize, + mipLevels, format, sampleCount, sampleQuality, layout, flags, samplerFeedbackMipRegionWidth, + samplerFeedbackMipRegionHeight, samplerFeedbackMipRegionDepth ); + } + static inline CD3DX12_RESOURCE_DESC1 Tex3D( + DXGI_FORMAT format, + UINT64 width, + UINT height, + UINT16 depth, + UINT16 mipLevels = 0, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, + D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN, + UINT64 alignment = 0 ) noexcept + { + return CD3DX12_RESOURCE_DESC1( D3D12_RESOURCE_DIMENSION_TEXTURE3D, alignment, width, height, depth, + mipLevels, format, 1, 0, layout, flags, 0, 0, 0 ); + } + inline UINT16 Depth() const noexcept + { return (Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1u); } + inline UINT16 ArraySize() const noexcept + { return (Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1u); } + inline UINT8 PlaneCount(_In_ ID3D12Device* pDevice) const noexcept + { return D3D12GetFormatPlaneCount(pDevice, Format); } + inline UINT Subresources(_In_ ID3D12Device* pDevice) const noexcept + { return static_cast(MipLevels) * ArraySize() * PlaneCount(pDevice); } + inline UINT CalcSubresource(UINT MipSlice, UINT ArraySlice, UINT PlaneSlice) noexcept + { return D3D12CalcSubresource(MipSlice, ArraySlice, PlaneSlice, MipLevels, ArraySize()); } +}; +inline bool operator==( const D3D12_RESOURCE_DESC1& l, const D3D12_RESOURCE_DESC1& r ) noexcept +{ + return l.Dimension == r.Dimension && + l.Alignment == r.Alignment && + l.Width == r.Width && + l.Height == r.Height && + l.DepthOrArraySize == r.DepthOrArraySize && + l.MipLevels == r.MipLevels && + l.Format == r.Format && + l.SampleDesc.Count == r.SampleDesc.Count && + l.SampleDesc.Quality == r.SampleDesc.Quality && + l.Layout == r.Layout && + l.Flags == r.Flags && + l.SamplerFeedbackMipRegion.Width == r.SamplerFeedbackMipRegion.Width && + l.SamplerFeedbackMipRegion.Height == r.SamplerFeedbackMipRegion.Height && + l.SamplerFeedbackMipRegion.Depth == r.SamplerFeedbackMipRegion.Depth; +} +inline bool operator!=( const D3D12_RESOURCE_DESC1& l, const D3D12_RESOURCE_DESC1& r ) noexcept +{ return !( l == r ); } + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_VIEW_INSTANCING_DESC : public D3D12_VIEW_INSTANCING_DESC +{ + CD3DX12_VIEW_INSTANCING_DESC() = default; + explicit CD3DX12_VIEW_INSTANCING_DESC( const D3D12_VIEW_INSTANCING_DESC& o ) noexcept : + D3D12_VIEW_INSTANCING_DESC( o ) + {} + explicit CD3DX12_VIEW_INSTANCING_DESC( CD3DX12_DEFAULT ) noexcept + { + ViewInstanceCount = 0; + pViewInstanceLocations = nullptr; + Flags = D3D12_VIEW_INSTANCING_FLAG_NONE; + } + explicit CD3DX12_VIEW_INSTANCING_DESC( + UINT InViewInstanceCount, + const D3D12_VIEW_INSTANCE_LOCATION* InViewInstanceLocations, + D3D12_VIEW_INSTANCING_FLAGS InFlags) noexcept + { + ViewInstanceCount = InViewInstanceCount; + pViewInstanceLocations = InViewInstanceLocations; + Flags = InFlags; + } +}; + +//------------------------------------------------------------------------------------------------ +// Row-by-row memcpy +inline void MemcpySubresource( + _In_ const D3D12_MEMCPY_DEST* pDest, + _In_ const D3D12_SUBRESOURCE_DATA* pSrc, + SIZE_T RowSizeInBytes, + UINT NumRows, + UINT NumSlices) noexcept +{ + for (UINT z = 0; z < NumSlices; ++z) + { + auto pDestSlice = static_cast(pDest->pData) + pDest->SlicePitch * z; + auto pSrcSlice = static_cast(pSrc->pData) + pSrc->SlicePitch * LONG_PTR(z); + for (UINT y = 0; y < NumRows; ++y) + { + memcpy(pDestSlice + pDest->RowPitch * y, + pSrcSlice + pSrc->RowPitch * LONG_PTR(y), + RowSizeInBytes); + } + } +} + +//------------------------------------------------------------------------------------------------ +// Row-by-row memcpy +inline void MemcpySubresource( + _In_ const D3D12_MEMCPY_DEST* pDest, + _In_ const void* pResourceData, + _In_ const D3D12_SUBRESOURCE_INFO* pSrc, + SIZE_T RowSizeInBytes, + UINT NumRows, + UINT NumSlices) noexcept +{ + for (UINT z = 0; z < NumSlices; ++z) + { + auto pDestSlice = static_cast(pDest->pData) + pDest->SlicePitch * z; + auto pSrcSlice = (static_cast(pResourceData) + pSrc->Offset) + pSrc->DepthPitch * ULONG_PTR(z); + for (UINT y = 0; y < NumRows; ++y) + { + memcpy(pDestSlice + pDest->RowPitch * y, + pSrcSlice + pSrc->RowPitch * ULONG_PTR(y), + RowSizeInBytes); + } + } +} + +//------------------------------------------------------------------------------------------------ +// Returns required size of a buffer to be used for data upload +inline UINT64 GetRequiredIntermediateSize( + _In_ ID3D12Resource* pDestinationResource, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources) noexcept +{ +#if defined(_MSC_VER) || !defined(_WIN32) + const auto Desc = pDestinationResource->GetDesc(); +#else + D3D12_RESOURCE_DESC tmpDesc; + const auto& Desc = *pDestinationResource->GetDesc(&tmpDesc); +#endif + UINT64 RequiredSize = 0; + + ID3D12Device* pDevice = nullptr; + pDestinationResource->GetDevice(IID_ID3D12Device, reinterpret_cast(&pDevice)); + pDevice->GetCopyableFootprints(&Desc, FirstSubresource, NumSubresources, 0, nullptr, nullptr, nullptr, &RequiredSize); + pDevice->Release(); + + return RequiredSize; +} + +//------------------------------------------------------------------------------------------------ +// All arrays must be populated (e.g. by calling GetCopyableFootprints) +inline UINT64 UpdateSubresources( + _In_ ID3D12GraphicsCommandList* pCmdList, + _In_ ID3D12Resource* pDestinationResource, + _In_ ID3D12Resource* pIntermediate, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 RequiredSize, + _In_reads_(NumSubresources) const D3D12_PLACED_SUBRESOURCE_FOOTPRINT* pLayouts, + _In_reads_(NumSubresources) const UINT* pNumRows, + _In_reads_(NumSubresources) const UINT64* pRowSizesInBytes, + _In_reads_(NumSubresources) const D3D12_SUBRESOURCE_DATA* pSrcData) noexcept +{ + // Minor validation +#if defined(_MSC_VER) || !defined(_WIN32) + const auto IntermediateDesc = pIntermediate->GetDesc(); + const auto DestinationDesc = pDestinationResource->GetDesc(); +#else + D3D12_RESOURCE_DESC tmpDesc1, tmpDesc2; + const auto& IntermediateDesc = *pIntermediate->GetDesc(&tmpDesc1); + const auto& DestinationDesc = *pDestinationResource->GetDesc(&tmpDesc2); +#endif + if (IntermediateDesc.Dimension != D3D12_RESOURCE_DIMENSION_BUFFER || + IntermediateDesc.Width < RequiredSize + pLayouts[0].Offset || + RequiredSize > SIZE_T(-1) || + (DestinationDesc.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER && + (FirstSubresource != 0 || NumSubresources != 1))) + { + return 0; + } + + BYTE* pData; + HRESULT hr = pIntermediate->Map(0, nullptr, reinterpret_cast(&pData)); + if (FAILED(hr)) + { + return 0; + } + + for (UINT i = 0; i < NumSubresources; ++i) + { + if (pRowSizesInBytes[i] > SIZE_T(-1)) return 0; + D3D12_MEMCPY_DEST DestData = { pData + pLayouts[i].Offset, pLayouts[i].Footprint.RowPitch, SIZE_T(pLayouts[i].Footprint.RowPitch) * SIZE_T(pNumRows[i]) }; + MemcpySubresource(&DestData, &pSrcData[i], static_cast(pRowSizesInBytes[i]), pNumRows[i], pLayouts[i].Footprint.Depth); + } + pIntermediate->Unmap(0, nullptr); + + if (DestinationDesc.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER) + { + pCmdList->CopyBufferRegion( + pDestinationResource, 0, pIntermediate, pLayouts[0].Offset, pLayouts[0].Footprint.Width); + } + else + { + for (UINT i = 0; i < NumSubresources; ++i) + { + const CD3DX12_TEXTURE_COPY_LOCATION Dst(pDestinationResource, i + FirstSubresource); + const CD3DX12_TEXTURE_COPY_LOCATION Src(pIntermediate, pLayouts[i]); + pCmdList->CopyTextureRegion(&Dst, 0, 0, 0, &Src, nullptr); + } + } + return RequiredSize; +} + +//------------------------------------------------------------------------------------------------ +// All arrays must be populated (e.g. by calling GetCopyableFootprints) +inline UINT64 UpdateSubresources( + _In_ ID3D12GraphicsCommandList* pCmdList, + _In_ ID3D12Resource* pDestinationResource, + _In_ ID3D12Resource* pIntermediate, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 RequiredSize, + _In_reads_(NumSubresources) const D3D12_PLACED_SUBRESOURCE_FOOTPRINT* pLayouts, + _In_reads_(NumSubresources) const UINT* pNumRows, + _In_reads_(NumSubresources) const UINT64* pRowSizesInBytes, + _In_ const void* pResourceData, + _In_reads_(NumSubresources) const D3D12_SUBRESOURCE_INFO* pSrcData) noexcept +{ + // Minor validation +#if defined(_MSC_VER) || !defined(_WIN32) + const auto IntermediateDesc = pIntermediate->GetDesc(); + const auto DestinationDesc = pDestinationResource->GetDesc(); +#else + D3D12_RESOURCE_DESC tmpDesc1, tmpDesc2; + const auto& IntermediateDesc = *pIntermediate->GetDesc(&tmpDesc1); + const auto& DestinationDesc = *pDestinationResource->GetDesc(&tmpDesc2); +#endif + if (IntermediateDesc.Dimension != D3D12_RESOURCE_DIMENSION_BUFFER || + IntermediateDesc.Width < RequiredSize + pLayouts[0].Offset || + RequiredSize > SIZE_T(-1) || + (DestinationDesc.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER && + (FirstSubresource != 0 || NumSubresources != 1))) + { + return 0; + } + + BYTE* pData; + HRESULT hr = pIntermediate->Map(0, nullptr, reinterpret_cast(&pData)); + if (FAILED(hr)) + { + return 0; + } + + for (UINT i = 0; i < NumSubresources; ++i) + { + if (pRowSizesInBytes[i] > SIZE_T(-1)) return 0; + D3D12_MEMCPY_DEST DestData = { pData + pLayouts[i].Offset, pLayouts[i].Footprint.RowPitch, SIZE_T(pLayouts[i].Footprint.RowPitch) * SIZE_T(pNumRows[i]) }; + MemcpySubresource(&DestData, pResourceData, &pSrcData[i], static_cast(pRowSizesInBytes[i]), pNumRows[i], pLayouts[i].Footprint.Depth); + } + pIntermediate->Unmap(0, nullptr); + + if (DestinationDesc.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER) + { + pCmdList->CopyBufferRegion( + pDestinationResource, 0, pIntermediate, pLayouts[0].Offset, pLayouts[0].Footprint.Width); + } + else + { + for (UINT i = 0; i < NumSubresources; ++i) + { + const CD3DX12_TEXTURE_COPY_LOCATION Dst(pDestinationResource, i + FirstSubresource); + const CD3DX12_TEXTURE_COPY_LOCATION Src(pIntermediate, pLayouts[i]); + pCmdList->CopyTextureRegion(&Dst, 0, 0, 0, &Src, nullptr); + } + } + return RequiredSize; +} + +//------------------------------------------------------------------------------------------------ +// Heap-allocating UpdateSubresources implementation +inline UINT64 UpdateSubresources( + _In_ ID3D12GraphicsCommandList* pCmdList, + _In_ ID3D12Resource* pDestinationResource, + _In_ ID3D12Resource* pIntermediate, + UINT64 IntermediateOffset, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + _In_reads_(NumSubresources) const D3D12_SUBRESOURCE_DATA* pSrcData) noexcept +{ + UINT64 RequiredSize = 0; + const auto MemToAlloc = static_cast(sizeof(D3D12_PLACED_SUBRESOURCE_FOOTPRINT) + sizeof(UINT) + sizeof(UINT64)) * NumSubresources; + if (MemToAlloc > SIZE_MAX) + { + return 0; + } + void* pMem = HeapAlloc(GetProcessHeap(), 0, static_cast(MemToAlloc)); + if (pMem == nullptr) + { + return 0; + } + auto pLayouts = static_cast(pMem); + auto pRowSizesInBytes = reinterpret_cast(pLayouts + NumSubresources); + auto pNumRows = reinterpret_cast(pRowSizesInBytes + NumSubresources); + +#if defined(_MSC_VER) || !defined(_WIN32) + const auto Desc = pDestinationResource->GetDesc(); +#else + D3D12_RESOURCE_DESC tmpDesc; + const auto& Desc = *pDestinationResource->GetDesc(&tmpDesc); +#endif + ID3D12Device* pDevice = nullptr; + pDestinationResource->GetDevice(IID_ID3D12Device, reinterpret_cast(&pDevice)); + pDevice->GetCopyableFootprints(&Desc, FirstSubresource, NumSubresources, IntermediateOffset, pLayouts, pNumRows, pRowSizesInBytes, &RequiredSize); + pDevice->Release(); + + const UINT64 Result = UpdateSubresources(pCmdList, pDestinationResource, pIntermediate, FirstSubresource, NumSubresources, RequiredSize, pLayouts, pNumRows, pRowSizesInBytes, pSrcData); + HeapFree(GetProcessHeap(), 0, pMem); + return Result; +} + +//------------------------------------------------------------------------------------------------ +// Heap-allocating UpdateSubresources implementation +inline UINT64 UpdateSubresources( + _In_ ID3D12GraphicsCommandList* pCmdList, + _In_ ID3D12Resource* pDestinationResource, + _In_ ID3D12Resource* pIntermediate, + UINT64 IntermediateOffset, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + _In_ const void* pResourceData, + _In_reads_(NumSubresources) const D3D12_SUBRESOURCE_INFO* pSrcData) noexcept +{ + UINT64 RequiredSize = 0; + const auto MemToAlloc = static_cast(sizeof(D3D12_PLACED_SUBRESOURCE_FOOTPRINT) + sizeof(UINT) + sizeof(UINT64)) * NumSubresources; + if (MemToAlloc > SIZE_MAX) + { + return 0; + } + void* pMem = HeapAlloc(GetProcessHeap(), 0, static_cast(MemToAlloc)); + if (pMem == nullptr) + { + return 0; + } + auto pLayouts = static_cast(pMem); + auto pRowSizesInBytes = reinterpret_cast(pLayouts + NumSubresources); + auto pNumRows = reinterpret_cast(pRowSizesInBytes + NumSubresources); + +#if defined(_MSC_VER) || !defined(_WIN32) + const auto Desc = pDestinationResource->GetDesc(); +#else + D3D12_RESOURCE_DESC tmpDesc; + const auto& Desc = *pDestinationResource->GetDesc(&tmpDesc); +#endif + ID3D12Device* pDevice = nullptr; + pDestinationResource->GetDevice(IID_ID3D12Device, reinterpret_cast(&pDevice)); + pDevice->GetCopyableFootprints(&Desc, FirstSubresource, NumSubresources, IntermediateOffset, pLayouts, pNumRows, pRowSizesInBytes, &RequiredSize); + pDevice->Release(); + + const UINT64 Result = UpdateSubresources(pCmdList, pDestinationResource, pIntermediate, FirstSubresource, NumSubresources, RequiredSize, pLayouts, pNumRows, pRowSizesInBytes, pResourceData, pSrcData); + HeapFree(GetProcessHeap(), 0, pMem); + return Result; +} + +//------------------------------------------------------------------------------------------------ +// Stack-allocating UpdateSubresources implementation +template +inline UINT64 UpdateSubresources( + _In_ ID3D12GraphicsCommandList* pCmdList, + _In_ ID3D12Resource* pDestinationResource, + _In_ ID3D12Resource* pIntermediate, + UINT64 IntermediateOffset, + _In_range_(0,MaxSubresources) UINT FirstSubresource, + _In_range_(1,MaxSubresources-FirstSubresource) UINT NumSubresources, + _In_reads_(NumSubresources) const D3D12_SUBRESOURCE_DATA* pSrcData) noexcept +{ + UINT64 RequiredSize = 0; + D3D12_PLACED_SUBRESOURCE_FOOTPRINT Layouts[MaxSubresources]; + UINT NumRows[MaxSubresources]; + UINT64 RowSizesInBytes[MaxSubresources]; + +#if defined(_MSC_VER) || !defined(_WIN32) + const auto Desc = pDestinationResource->GetDesc(); +#else + D3D12_RESOURCE_DESC tmpDesc; + const auto& Desc = *pDestinationResource->GetDesc(&tmpDesc); +#endif + ID3D12Device* pDevice = nullptr; + pDestinationResource->GetDevice(IID_ID3D12Device, reinterpret_cast(&pDevice)); + pDevice->GetCopyableFootprints(&Desc, FirstSubresource, NumSubresources, IntermediateOffset, Layouts, NumRows, RowSizesInBytes, &RequiredSize); + pDevice->Release(); + + return UpdateSubresources(pCmdList, pDestinationResource, pIntermediate, FirstSubresource, NumSubresources, RequiredSize, Layouts, NumRows, RowSizesInBytes, pSrcData); +} + +//------------------------------------------------------------------------------------------------ +// Stack-allocating UpdateSubresources implementation +template +inline UINT64 UpdateSubresources( + _In_ ID3D12GraphicsCommandList* pCmdList, + _In_ ID3D12Resource* pDestinationResource, + _In_ ID3D12Resource* pIntermediate, + UINT64 IntermediateOffset, + _In_range_(0,MaxSubresources) UINT FirstSubresource, + _In_range_(1,MaxSubresources-FirstSubresource) UINT NumSubresources, + _In_ const void* pResourceData, + _In_reads_(NumSubresources) const D3D12_SUBRESOURCE_INFO* pSrcData) noexcept +{ + UINT64 RequiredSize = 0; + D3D12_PLACED_SUBRESOURCE_FOOTPRINT Layouts[MaxSubresources]; + UINT NumRows[MaxSubresources]; + UINT64 RowSizesInBytes[MaxSubresources]; + +#if defined(_MSC_VER) || !defined(_WIN32) + const auto Desc = pDestinationResource->GetDesc(); +#else + D3D12_RESOURCE_DESC tmpDesc; + const auto& Desc = *pDestinationResource->GetDesc(&tmpDesc); +#endif + ID3D12Device* pDevice = nullptr; + pDestinationResource->GetDevice(IID_ID3D12Device, reinterpret_cast(&pDevice)); + pDevice->GetCopyableFootprints(&Desc, FirstSubresource, NumSubresources, IntermediateOffset, Layouts, NumRows, RowSizesInBytes, &RequiredSize); + pDevice->Release(); + + return UpdateSubresources(pCmdList, pDestinationResource, pIntermediate, FirstSubresource, NumSubresources, RequiredSize, Layouts, NumRows, RowSizesInBytes, pResourceData, pSrcData); +} + +//------------------------------------------------------------------------------------------------ +constexpr bool D3D12IsLayoutOpaque( D3D12_TEXTURE_LAYOUT Layout ) noexcept +{ return Layout == D3D12_TEXTURE_LAYOUT_UNKNOWN || Layout == D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE; } + +//------------------------------------------------------------------------------------------------ +template +inline ID3D12CommandList * const * CommandListCast(t_CommandListType * const * pp) noexcept +{ + // This cast is useful for passing strongly typed command list pointers into + // ExecuteCommandLists. + // This cast is valid as long as the const-ness is respected. D3D12 APIs do + // respect the const-ness of their arguments. + return reinterpret_cast(pp); +} + +//------------------------------------------------------------------------------------------------ +// D3D12 exports a new method for serializing root signatures in the Windows 10 Anniversary Update. +// To help enable root signature 1.1 features when they are available and not require maintaining +// two code paths for building root signatures, this helper method reconstructs a 1.0 signature when +// 1.1 is not supported. +inline HRESULT D3DX12SerializeVersionedRootSignature( + _In_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC* pRootSignatureDesc, + D3D_ROOT_SIGNATURE_VERSION MaxVersion, + _Outptr_ ID3DBlob** ppBlob, + _Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorBlob) noexcept +{ + if (ppErrorBlob != nullptr) + { + *ppErrorBlob = nullptr; + } + + switch (MaxVersion) + { + case D3D_ROOT_SIGNATURE_VERSION_1_0: + switch (pRootSignatureDesc->Version) + { + case D3D_ROOT_SIGNATURE_VERSION_1_0: + return D3D12SerializeRootSignature(&pRootSignatureDesc->Desc_1_0, D3D_ROOT_SIGNATURE_VERSION_1, ppBlob, ppErrorBlob); + + case D3D_ROOT_SIGNATURE_VERSION_1_1: + { + HRESULT hr = S_OK; + const D3D12_ROOT_SIGNATURE_DESC1& desc_1_1 = pRootSignatureDesc->Desc_1_1; + + const SIZE_T ParametersSize = sizeof(D3D12_ROOT_PARAMETER) * desc_1_1.NumParameters; + void* pParameters = (ParametersSize > 0) ? HeapAlloc(GetProcessHeap(), 0, ParametersSize) : nullptr; + if (ParametersSize > 0 && pParameters == nullptr) + { + hr = E_OUTOFMEMORY; + } + auto pParameters_1_0 = static_cast(pParameters); + + if (SUCCEEDED(hr)) + { + for (UINT n = 0; n < desc_1_1.NumParameters; n++) + { + __analysis_assume(ParametersSize == sizeof(D3D12_ROOT_PARAMETER) * desc_1_1.NumParameters); + pParameters_1_0[n].ParameterType = desc_1_1.pParameters[n].ParameterType; + pParameters_1_0[n].ShaderVisibility = desc_1_1.pParameters[n].ShaderVisibility; + + switch (desc_1_1.pParameters[n].ParameterType) + { + case D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS: + pParameters_1_0[n].Constants.Num32BitValues = desc_1_1.pParameters[n].Constants.Num32BitValues; + pParameters_1_0[n].Constants.RegisterSpace = desc_1_1.pParameters[n].Constants.RegisterSpace; + pParameters_1_0[n].Constants.ShaderRegister = desc_1_1.pParameters[n].Constants.ShaderRegister; + break; + + case D3D12_ROOT_PARAMETER_TYPE_CBV: + case D3D12_ROOT_PARAMETER_TYPE_SRV: + case D3D12_ROOT_PARAMETER_TYPE_UAV: + pParameters_1_0[n].Descriptor.RegisterSpace = desc_1_1.pParameters[n].Descriptor.RegisterSpace; + pParameters_1_0[n].Descriptor.ShaderRegister = desc_1_1.pParameters[n].Descriptor.ShaderRegister; + break; + + case D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE: + const D3D12_ROOT_DESCRIPTOR_TABLE1& table_1_1 = desc_1_1.pParameters[n].DescriptorTable; + + const SIZE_T DescriptorRangesSize = sizeof(D3D12_DESCRIPTOR_RANGE) * table_1_1.NumDescriptorRanges; + void* pDescriptorRanges = (DescriptorRangesSize > 0 && SUCCEEDED(hr)) ? HeapAlloc(GetProcessHeap(), 0, DescriptorRangesSize) : nullptr; + if (DescriptorRangesSize > 0 && pDescriptorRanges == nullptr) + { + hr = E_OUTOFMEMORY; + } + auto pDescriptorRanges_1_0 = static_cast(pDescriptorRanges); + + if (SUCCEEDED(hr)) + { + for (UINT x = 0; x < table_1_1.NumDescriptorRanges; x++) + { + __analysis_assume(DescriptorRangesSize == sizeof(D3D12_DESCRIPTOR_RANGE) * table_1_1.NumDescriptorRanges); + pDescriptorRanges_1_0[x].BaseShaderRegister = table_1_1.pDescriptorRanges[x].BaseShaderRegister; + pDescriptorRanges_1_0[x].NumDescriptors = table_1_1.pDescriptorRanges[x].NumDescriptors; + pDescriptorRanges_1_0[x].OffsetInDescriptorsFromTableStart = table_1_1.pDescriptorRanges[x].OffsetInDescriptorsFromTableStart; + pDescriptorRanges_1_0[x].RangeType = table_1_1.pDescriptorRanges[x].RangeType; + pDescriptorRanges_1_0[x].RegisterSpace = table_1_1.pDescriptorRanges[x].RegisterSpace; + } + } + + D3D12_ROOT_DESCRIPTOR_TABLE& table_1_0 = pParameters_1_0[n].DescriptorTable; + table_1_0.NumDescriptorRanges = table_1_1.NumDescriptorRanges; + table_1_0.pDescriptorRanges = pDescriptorRanges_1_0; + } + } + } + + if (SUCCEEDED(hr)) + { + const CD3DX12_ROOT_SIGNATURE_DESC desc_1_0(desc_1_1.NumParameters, pParameters_1_0, desc_1_1.NumStaticSamplers, desc_1_1.pStaticSamplers, desc_1_1.Flags); + hr = D3D12SerializeRootSignature(&desc_1_0, D3D_ROOT_SIGNATURE_VERSION_1, ppBlob, ppErrorBlob); + } + + if (pParameters) + { + for (UINT n = 0; n < desc_1_1.NumParameters; n++) + { + if (desc_1_1.pParameters[n].ParameterType == D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE) + { + auto pDescriptorRanges_1_0 = pParameters_1_0[n].DescriptorTable.pDescriptorRanges; + HeapFree(GetProcessHeap(), 0, reinterpret_cast(const_cast(pDescriptorRanges_1_0))); + } + } + HeapFree(GetProcessHeap(), 0, pParameters); + } + return hr; + } + } + break; + + case D3D_ROOT_SIGNATURE_VERSION_1_1: + return D3D12SerializeVersionedRootSignature(pRootSignatureDesc, ppBlob, ppErrorBlob); + } + + return E_INVALIDARG; +} + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_RT_FORMAT_ARRAY : public D3D12_RT_FORMAT_ARRAY +{ + CD3DX12_RT_FORMAT_ARRAY() = default; + explicit CD3DX12_RT_FORMAT_ARRAY(const D3D12_RT_FORMAT_ARRAY& o) noexcept + : D3D12_RT_FORMAT_ARRAY(o) + {} + explicit CD3DX12_RT_FORMAT_ARRAY(_In_reads_(NumFormats) const DXGI_FORMAT* pFormats, UINT NumFormats) noexcept + { + NumRenderTargets = NumFormats; + memcpy(RTFormats, pFormats, sizeof(RTFormats)); + // assumes ARRAY_SIZE(pFormats) == ARRAY_SIZE(RTFormats) + } +}; + +//------------------------------------------------------------------------------------------------ +// Pipeline State Stream Helpers +//------------------------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------------------------ +// Stream Subobjects, i.e. elements of a stream + +struct DefaultSampleMask { operator UINT() noexcept { return UINT_MAX; } }; +struct DefaultSampleDesc { operator DXGI_SAMPLE_DESC() noexcept { return DXGI_SAMPLE_DESC{1, 0}; } }; + +#pragma warning(push) +#pragma warning(disable : 4324) +template +class alignas(void*) CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT +{ +private: + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE pssType; + InnerStructType pssInner; +public: + CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT() noexcept : pssType(Type), pssInner(DefaultArg()) {} + CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT(InnerStructType const& i) noexcept : pssType(Type), pssInner(i) {} + CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT& operator=(InnerStructType const& i) noexcept { pssType = Type; pssInner = i; return *this; } + operator InnerStructType const&() const noexcept { return pssInner; } + operator InnerStructType&() noexcept { return pssInner; } + InnerStructType* operator&() noexcept { return &pssInner; } + InnerStructType const* operator&() const noexcept { return &pssInner; } +}; +#pragma warning(pop) +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_PIPELINE_STATE_FLAGS, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_FLAGS> CD3DX12_PIPELINE_STATE_STREAM_FLAGS; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< UINT, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_NODE_MASK> CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< ID3D12RootSignature*, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_ROOT_SIGNATURE> CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_INPUT_LAYOUT_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_INPUT_LAYOUT> CD3DX12_PIPELINE_STATE_STREAM_INPUT_LAYOUT; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_INDEX_BUFFER_STRIP_CUT_VALUE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_IB_STRIP_CUT_VALUE> CD3DX12_PIPELINE_STATE_STREAM_IB_STRIP_CUT_VALUE; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_PRIMITIVE_TOPOLOGY_TYPE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PRIMITIVE_TOPOLOGY> CD3DX12_PIPELINE_STATE_STREAM_PRIMITIVE_TOPOLOGY; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VS> CD3DX12_PIPELINE_STATE_STREAM_VS; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_GS> CD3DX12_PIPELINE_STATE_STREAM_GS; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_STREAM_OUTPUT_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_STREAM_OUTPUT> CD3DX12_PIPELINE_STATE_STREAM_STREAM_OUTPUT; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_HS> CD3DX12_PIPELINE_STATE_STREAM_HS; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DS> CD3DX12_PIPELINE_STATE_STREAM_DS; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PS> CD3DX12_PIPELINE_STATE_STREAM_PS; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_AS> CD3DX12_PIPELINE_STATE_STREAM_AS; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MS> CD3DX12_PIPELINE_STATE_STREAM_MS; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CS> CD3DX12_PIPELINE_STATE_STREAM_CS; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_BLEND_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_BLEND, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_DEPTH_STENCIL_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_DEPTH_STENCIL_DESC1, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL1; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_DEPTH_STENCIL_DESC2, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL2; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< DXGI_FORMAT, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL_FORMAT> CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_RASTERIZER_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_RT_FORMAT_ARRAY, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RENDER_TARGET_FORMATS> CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< DXGI_SAMPLE_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_DESC, DefaultSampleDesc> CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< UINT, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_MASK, DefaultSampleMask> CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_CACHED_PIPELINE_STATE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CACHED_PSO> CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_VIEW_INSTANCING_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VIEW_INSTANCING, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_VIEW_INSTANCING; + +//------------------------------------------------------------------------------------------------ +// Stream Parser Helpers + +struct ID3DX12PipelineParserCallbacks +{ + // Subobject Callbacks + virtual void FlagsCb(D3D12_PIPELINE_STATE_FLAGS) {} + virtual void NodeMaskCb(UINT) {} + virtual void RootSignatureCb(ID3D12RootSignature*) {} + virtual void InputLayoutCb(const D3D12_INPUT_LAYOUT_DESC&) {} + virtual void IBStripCutValueCb(D3D12_INDEX_BUFFER_STRIP_CUT_VALUE) {} + virtual void PrimitiveTopologyTypeCb(D3D12_PRIMITIVE_TOPOLOGY_TYPE) {} + virtual void VSCb(const D3D12_SHADER_BYTECODE&) {} + virtual void GSCb(const D3D12_SHADER_BYTECODE&) {} + virtual void StreamOutputCb(const D3D12_STREAM_OUTPUT_DESC&) {} + virtual void HSCb(const D3D12_SHADER_BYTECODE&) {} + virtual void DSCb(const D3D12_SHADER_BYTECODE&) {} + virtual void PSCb(const D3D12_SHADER_BYTECODE&) {} + virtual void CSCb(const D3D12_SHADER_BYTECODE&) {} + virtual void ASCb(const D3D12_SHADER_BYTECODE&) {} + virtual void MSCb(const D3D12_SHADER_BYTECODE&) {} + virtual void BlendStateCb(const D3D12_BLEND_DESC&) {} + virtual void DepthStencilStateCb(const D3D12_DEPTH_STENCIL_DESC&) {} + virtual void DepthStencilState1Cb(const D3D12_DEPTH_STENCIL_DESC1&) {} + virtual void DepthStencilState2Cb(const D3D12_DEPTH_STENCIL_DESC2&) {} + virtual void DSVFormatCb(DXGI_FORMAT) {} + virtual void RasterizerStateCb(const D3D12_RASTERIZER_DESC&) {} + virtual void RTVFormatsCb(const D3D12_RT_FORMAT_ARRAY&) {} + virtual void SampleDescCb(const DXGI_SAMPLE_DESC&) {} + virtual void SampleMaskCb(UINT) {} + virtual void ViewInstancingCb(const D3D12_VIEW_INSTANCING_DESC&) {} + virtual void CachedPSOCb(const D3D12_CACHED_PIPELINE_STATE&) {} + + // Error Callbacks + virtual void ErrorBadInputParameter(UINT /*ParameterIndex*/) {} + virtual void ErrorDuplicateSubobject(D3D12_PIPELINE_STATE_SUBOBJECT_TYPE /*DuplicateType*/) {} + virtual void ErrorUnknownSubobject(UINT /*UnknownTypeValue*/) {} + + virtual ~ID3DX12PipelineParserCallbacks() = default; +}; + +struct D3DX12_MESH_SHADER_PIPELINE_STATE_DESC +{ + ID3D12RootSignature* pRootSignature; + D3D12_SHADER_BYTECODE AS; + D3D12_SHADER_BYTECODE MS; + D3D12_SHADER_BYTECODE PS; + D3D12_BLEND_DESC BlendState; + UINT SampleMask; + D3D12_RASTERIZER_DESC RasterizerState; + D3D12_DEPTH_STENCIL_DESC DepthStencilState; + D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType; + UINT NumRenderTargets; + DXGI_FORMAT RTVFormats[ D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT ]; + DXGI_FORMAT DSVFormat; + DXGI_SAMPLE_DESC SampleDesc; + UINT NodeMask; + D3D12_CACHED_PIPELINE_STATE CachedPSO; + D3D12_PIPELINE_STATE_FLAGS Flags; +}; + + +// Use CD3DX12_PIPELINE_STATE_STREAM3 for D3D12_DEPTH_STENCIL_DESC2 when CheckFeatureSupport returns true for Options14::IndependentFrontAndBackStencilSupported is true +// Use CD3DX12_PIPELINE_STATE_STREAM2 for OS Build 19041+ (where there is a new mesh shader pipeline). +// Use CD3DX12_PIPELINE_STATE_STREAM1 for OS Build 16299+ (where there is a new view instancing subobject). +// Use CD3DX12_PIPELINE_STATE_STREAM for OS Build 15063+ support. +struct CD3DX12_PIPELINE_STATE_STREAM3 +{ + CD3DX12_PIPELINE_STATE_STREAM3() = default; + // Mesh and amplification shaders must be set manually, since they do not have representation in D3D12_GRAPHICS_PIPELINE_STATE_DESC + CD3DX12_PIPELINE_STATE_STREAM3(const D3D12_GRAPHICS_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , InputLayout(Desc.InputLayout) + , IBStripCutValue(Desc.IBStripCutValue) + , PrimitiveTopologyType(Desc.PrimitiveTopologyType) + , VS(Desc.VS) + , GS(Desc.GS) + , StreamOutput(Desc.StreamOutput) + , HS(Desc.HS) + , DS(Desc.DS) + , PS(Desc.PS) + , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState)) + , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC2(Desc.DepthStencilState)) + , DSVFormat(Desc.DSVFormat) + , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState)) + , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets)) + , SampleDesc(Desc.SampleDesc) + , SampleMask(Desc.SampleMask) + , CachedPSO(Desc.CachedPSO) + , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT())) + {} + CD3DX12_PIPELINE_STATE_STREAM3(const D3DX12_MESH_SHADER_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , PrimitiveTopologyType(Desc.PrimitiveTopologyType) + , PS(Desc.PS) + , AS(Desc.AS) + , MS(Desc.MS) + , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState)) + , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC2(Desc.DepthStencilState)) + , DSVFormat(Desc.DSVFormat) + , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState)) + , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets)) + , SampleDesc(Desc.SampleDesc) + , SampleMask(Desc.SampleMask) + , CachedPSO(Desc.CachedPSO) + , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT())) + {} + CD3DX12_PIPELINE_STATE_STREAM3(const D3D12_COMPUTE_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , CS(CD3DX12_SHADER_BYTECODE(Desc.CS)) + , CachedPSO(Desc.CachedPSO) + { + static_cast(DepthStencilState).DepthEnable = false; + } + CD3DX12_PIPELINE_STATE_STREAM_FLAGS Flags; + CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK NodeMask; + CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE pRootSignature; + CD3DX12_PIPELINE_STATE_STREAM_INPUT_LAYOUT InputLayout; + CD3DX12_PIPELINE_STATE_STREAM_IB_STRIP_CUT_VALUE IBStripCutValue; + CD3DX12_PIPELINE_STATE_STREAM_PRIMITIVE_TOPOLOGY PrimitiveTopologyType; + CD3DX12_PIPELINE_STATE_STREAM_VS VS; + CD3DX12_PIPELINE_STATE_STREAM_GS GS; + CD3DX12_PIPELINE_STATE_STREAM_STREAM_OUTPUT StreamOutput; + CD3DX12_PIPELINE_STATE_STREAM_HS HS; + CD3DX12_PIPELINE_STATE_STREAM_DS DS; + CD3DX12_PIPELINE_STATE_STREAM_PS PS; + CD3DX12_PIPELINE_STATE_STREAM_AS AS; + CD3DX12_PIPELINE_STATE_STREAM_MS MS; + CD3DX12_PIPELINE_STATE_STREAM_CS CS; + CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC BlendState; + CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL2 DepthStencilState; + CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT DSVFormat; + CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER RasterizerState; + CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS RTVFormats; + CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC SampleDesc; + CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK SampleMask; + CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO CachedPSO; + CD3DX12_PIPELINE_STATE_STREAM_VIEW_INSTANCING ViewInstancingDesc; + + D3D12_GRAPHICS_PIPELINE_STATE_DESC GraphicsDescV0() const noexcept + { + D3D12_GRAPHICS_PIPELINE_STATE_DESC D; + D.Flags = this->Flags; + D.NodeMask = this->NodeMask; + D.pRootSignature = this->pRootSignature; + D.InputLayout = this->InputLayout; + D.IBStripCutValue = this->IBStripCutValue; + D.PrimitiveTopologyType = this->PrimitiveTopologyType; + D.VS = this->VS; + D.GS = this->GS; + D.StreamOutput = this->StreamOutput; + D.HS = this->HS; + D.DS = this->DS; + D.PS = this->PS; + D.BlendState = this->BlendState; + D.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(D3D12_DEPTH_STENCIL_DESC2(this->DepthStencilState)); + D.DSVFormat = this->DSVFormat; + D.RasterizerState = this->RasterizerState; + D.NumRenderTargets = D3D12_RT_FORMAT_ARRAY(this->RTVFormats).NumRenderTargets; + memcpy(D.RTVFormats, D3D12_RT_FORMAT_ARRAY(this->RTVFormats).RTFormats, sizeof(D.RTVFormats)); + D.SampleDesc = this->SampleDesc; + D.SampleMask = this->SampleMask; + D.CachedPSO = this->CachedPSO; + return D; + } + D3D12_COMPUTE_PIPELINE_STATE_DESC ComputeDescV0() const noexcept + { + D3D12_COMPUTE_PIPELINE_STATE_DESC D; + D.Flags = this->Flags; + D.NodeMask = this->NodeMask; + D.pRootSignature = this->pRootSignature; + D.CS = this->CS; + D.CachedPSO = this->CachedPSO; + return D; + } +}; + + +// CD3DX12_PIPELINE_STATE_STREAM2 Works on OS Build 19041+ (where there is a new mesh shader pipeline). +// Use CD3DX12_PIPELINE_STATE_STREAM1 for OS Build 16299+ (where there is a new view instancing subobject). +// Use CD3DX12_PIPELINE_STATE_STREAM for OS Build 15063+ support. +struct CD3DX12_PIPELINE_STATE_STREAM2 +{ + CD3DX12_PIPELINE_STATE_STREAM2() = default; + // Mesh and amplification shaders must be set manually, since they do not have representation in D3D12_GRAPHICS_PIPELINE_STATE_DESC + CD3DX12_PIPELINE_STATE_STREAM2(const D3D12_GRAPHICS_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , InputLayout(Desc.InputLayout) + , IBStripCutValue(Desc.IBStripCutValue) + , PrimitiveTopologyType(Desc.PrimitiveTopologyType) + , VS(Desc.VS) + , GS(Desc.GS) + , StreamOutput(Desc.StreamOutput) + , HS(Desc.HS) + , DS(Desc.DS) + , PS(Desc.PS) + , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState)) + , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC1(Desc.DepthStencilState)) + , DSVFormat(Desc.DSVFormat) + , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState)) + , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets)) + , SampleDesc(Desc.SampleDesc) + , SampleMask(Desc.SampleMask) + , CachedPSO(Desc.CachedPSO) + , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT())) + {} + CD3DX12_PIPELINE_STATE_STREAM2(const D3DX12_MESH_SHADER_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , PrimitiveTopologyType(Desc.PrimitiveTopologyType) + , PS(Desc.PS) + , AS(Desc.AS) + , MS(Desc.MS) + , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState)) + , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC1(Desc.DepthStencilState)) + , DSVFormat(Desc.DSVFormat) + , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState)) + , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets)) + , SampleDesc(Desc.SampleDesc) + , SampleMask(Desc.SampleMask) + , CachedPSO(Desc.CachedPSO) + , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT())) + {} + CD3DX12_PIPELINE_STATE_STREAM2(const D3D12_COMPUTE_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , CS(CD3DX12_SHADER_BYTECODE(Desc.CS)) + , CachedPSO(Desc.CachedPSO) + { + static_cast(DepthStencilState).DepthEnable = false; + } + CD3DX12_PIPELINE_STATE_STREAM_FLAGS Flags; + CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK NodeMask; + CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE pRootSignature; + CD3DX12_PIPELINE_STATE_STREAM_INPUT_LAYOUT InputLayout; + CD3DX12_PIPELINE_STATE_STREAM_IB_STRIP_CUT_VALUE IBStripCutValue; + CD3DX12_PIPELINE_STATE_STREAM_PRIMITIVE_TOPOLOGY PrimitiveTopologyType; + CD3DX12_PIPELINE_STATE_STREAM_VS VS; + CD3DX12_PIPELINE_STATE_STREAM_GS GS; + CD3DX12_PIPELINE_STATE_STREAM_STREAM_OUTPUT StreamOutput; + CD3DX12_PIPELINE_STATE_STREAM_HS HS; + CD3DX12_PIPELINE_STATE_STREAM_DS DS; + CD3DX12_PIPELINE_STATE_STREAM_PS PS; + CD3DX12_PIPELINE_STATE_STREAM_AS AS; + CD3DX12_PIPELINE_STATE_STREAM_MS MS; + CD3DX12_PIPELINE_STATE_STREAM_CS CS; + CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC BlendState; + CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL1 DepthStencilState; + CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT DSVFormat; + CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER RasterizerState; + CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS RTVFormats; + CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC SampleDesc; + CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK SampleMask; + CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO CachedPSO; + CD3DX12_PIPELINE_STATE_STREAM_VIEW_INSTANCING ViewInstancingDesc; + D3D12_GRAPHICS_PIPELINE_STATE_DESC GraphicsDescV0() const noexcept + { + D3D12_GRAPHICS_PIPELINE_STATE_DESC D; + D.Flags = this->Flags; + D.NodeMask = this->NodeMask; + D.pRootSignature = this->pRootSignature; + D.InputLayout = this->InputLayout; + D.IBStripCutValue = this->IBStripCutValue; + D.PrimitiveTopologyType = this->PrimitiveTopologyType; + D.VS = this->VS; + D.GS = this->GS; + D.StreamOutput = this->StreamOutput; + D.HS = this->HS; + D.DS = this->DS; + D.PS = this->PS; + D.BlendState = this->BlendState; + D.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(D3D12_DEPTH_STENCIL_DESC1(this->DepthStencilState)); + D.DSVFormat = this->DSVFormat; + D.RasterizerState = this->RasterizerState; + D.NumRenderTargets = D3D12_RT_FORMAT_ARRAY(this->RTVFormats).NumRenderTargets; + memcpy(D.RTVFormats, D3D12_RT_FORMAT_ARRAY(this->RTVFormats).RTFormats, sizeof(D.RTVFormats)); + D.SampleDesc = this->SampleDesc; + D.SampleMask = this->SampleMask; + D.CachedPSO = this->CachedPSO; + return D; + } + D3D12_COMPUTE_PIPELINE_STATE_DESC ComputeDescV0() const noexcept + { + D3D12_COMPUTE_PIPELINE_STATE_DESC D; + D.Flags = this->Flags; + D.NodeMask = this->NodeMask; + D.pRootSignature = this->pRootSignature; + D.CS = this->CS; + D.CachedPSO = this->CachedPSO; + return D; + } +}; + +// CD3DX12_PIPELINE_STATE_STREAM1 Works on OS Build 16299+ (where there is a new view instancing subobject). +// Use CD3DX12_PIPELINE_STATE_STREAM for OS Build 15063+ support. +struct CD3DX12_PIPELINE_STATE_STREAM1 +{ + CD3DX12_PIPELINE_STATE_STREAM1() = default; + // Mesh and amplification shaders must be set manually, since they do not have representation in D3D12_GRAPHICS_PIPELINE_STATE_DESC + CD3DX12_PIPELINE_STATE_STREAM1(const D3D12_GRAPHICS_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , InputLayout(Desc.InputLayout) + , IBStripCutValue(Desc.IBStripCutValue) + , PrimitiveTopologyType(Desc.PrimitiveTopologyType) + , VS(Desc.VS) + , GS(Desc.GS) + , StreamOutput(Desc.StreamOutput) + , HS(Desc.HS) + , DS(Desc.DS) + , PS(Desc.PS) + , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState)) + , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC1(Desc.DepthStencilState)) + , DSVFormat(Desc.DSVFormat) + , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState)) + , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets)) + , SampleDesc(Desc.SampleDesc) + , SampleMask(Desc.SampleMask) + , CachedPSO(Desc.CachedPSO) + , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT())) + {} + CD3DX12_PIPELINE_STATE_STREAM1(const D3DX12_MESH_SHADER_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , PrimitiveTopologyType(Desc.PrimitiveTopologyType) + , PS(Desc.PS) + , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState)) + , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC1(Desc.DepthStencilState)) + , DSVFormat(Desc.DSVFormat) + , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState)) + , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets)) + , SampleDesc(Desc.SampleDesc) + , SampleMask(Desc.SampleMask) + , CachedPSO(Desc.CachedPSO) + , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT())) + {} + CD3DX12_PIPELINE_STATE_STREAM1(const D3D12_COMPUTE_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , CS(CD3DX12_SHADER_BYTECODE(Desc.CS)) + , CachedPSO(Desc.CachedPSO) + { + static_cast(DepthStencilState).DepthEnable = false; + } + CD3DX12_PIPELINE_STATE_STREAM_FLAGS Flags; + CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK NodeMask; + CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE pRootSignature; + CD3DX12_PIPELINE_STATE_STREAM_INPUT_LAYOUT InputLayout; + CD3DX12_PIPELINE_STATE_STREAM_IB_STRIP_CUT_VALUE IBStripCutValue; + CD3DX12_PIPELINE_STATE_STREAM_PRIMITIVE_TOPOLOGY PrimitiveTopologyType; + CD3DX12_PIPELINE_STATE_STREAM_VS VS; + CD3DX12_PIPELINE_STATE_STREAM_GS GS; + CD3DX12_PIPELINE_STATE_STREAM_STREAM_OUTPUT StreamOutput; + CD3DX12_PIPELINE_STATE_STREAM_HS HS; + CD3DX12_PIPELINE_STATE_STREAM_DS DS; + CD3DX12_PIPELINE_STATE_STREAM_PS PS; + CD3DX12_PIPELINE_STATE_STREAM_CS CS; + CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC BlendState; + CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL1 DepthStencilState; + CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT DSVFormat; + CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER RasterizerState; + CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS RTVFormats; + CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC SampleDesc; + CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK SampleMask; + CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO CachedPSO; + CD3DX12_PIPELINE_STATE_STREAM_VIEW_INSTANCING ViewInstancingDesc; + D3D12_GRAPHICS_PIPELINE_STATE_DESC GraphicsDescV0() const noexcept + { + D3D12_GRAPHICS_PIPELINE_STATE_DESC D; + D.Flags = this->Flags; + D.NodeMask = this->NodeMask; + D.pRootSignature = this->pRootSignature; + D.InputLayout = this->InputLayout; + D.IBStripCutValue = this->IBStripCutValue; + D.PrimitiveTopologyType = this->PrimitiveTopologyType; + D.VS = this->VS; + D.GS = this->GS; + D.StreamOutput = this->StreamOutput; + D.HS = this->HS; + D.DS = this->DS; + D.PS = this->PS; + D.BlendState = this->BlendState; + D.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(D3D12_DEPTH_STENCIL_DESC1(this->DepthStencilState)); + D.DSVFormat = this->DSVFormat; + D.RasterizerState = this->RasterizerState; + D.NumRenderTargets = D3D12_RT_FORMAT_ARRAY(this->RTVFormats).NumRenderTargets; + memcpy(D.RTVFormats, D3D12_RT_FORMAT_ARRAY(this->RTVFormats).RTFormats, sizeof(D.RTVFormats)); + D.SampleDesc = this->SampleDesc; + D.SampleMask = this->SampleMask; + D.CachedPSO = this->CachedPSO; + return D; + } + D3D12_COMPUTE_PIPELINE_STATE_DESC ComputeDescV0() const noexcept + { + D3D12_COMPUTE_PIPELINE_STATE_DESC D; + D.Flags = this->Flags; + D.NodeMask = this->NodeMask; + D.pRootSignature = this->pRootSignature; + D.CS = this->CS; + D.CachedPSO = this->CachedPSO; + return D; + } +}; + + +struct CD3DX12_PIPELINE_MESH_STATE_STREAM +{ + CD3DX12_PIPELINE_MESH_STATE_STREAM() = default; + CD3DX12_PIPELINE_MESH_STATE_STREAM(const D3DX12_MESH_SHADER_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , PS(Desc.PS) + , AS(Desc.AS) + , MS(Desc.MS) + , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState)) + , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC1(Desc.DepthStencilState)) + , DSVFormat(Desc.DSVFormat) + , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState)) + , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets)) + , SampleDesc(Desc.SampleDesc) + , SampleMask(Desc.SampleMask) + , CachedPSO(Desc.CachedPSO) + , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT())) + {} + CD3DX12_PIPELINE_STATE_STREAM_FLAGS Flags; + CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK NodeMask; + CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE pRootSignature; + CD3DX12_PIPELINE_STATE_STREAM_PS PS; + CD3DX12_PIPELINE_STATE_STREAM_AS AS; + CD3DX12_PIPELINE_STATE_STREAM_MS MS; + CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC BlendState; + CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL1 DepthStencilState; + CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT DSVFormat; + CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER RasterizerState; + CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS RTVFormats; + CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC SampleDesc; + CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK SampleMask; + CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO CachedPSO; + CD3DX12_PIPELINE_STATE_STREAM_VIEW_INSTANCING ViewInstancingDesc; + D3DX12_MESH_SHADER_PIPELINE_STATE_DESC MeshShaderDescV0() const noexcept + { + D3DX12_MESH_SHADER_PIPELINE_STATE_DESC D; + D.Flags = this->Flags; + D.NodeMask = this->NodeMask; + D.pRootSignature = this->pRootSignature; + D.PS = this->PS; + D.AS = this->AS; + D.MS = this->MS; + D.BlendState = this->BlendState; + D.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(D3D12_DEPTH_STENCIL_DESC1(this->DepthStencilState)); + D.DSVFormat = this->DSVFormat; + D.RasterizerState = this->RasterizerState; + D.NumRenderTargets = D3D12_RT_FORMAT_ARRAY(this->RTVFormats).NumRenderTargets; + memcpy(D.RTVFormats, D3D12_RT_FORMAT_ARRAY(this->RTVFormats).RTFormats, sizeof(D.RTVFormats)); + D.SampleDesc = this->SampleDesc; + D.SampleMask = this->SampleMask; + D.CachedPSO = this->CachedPSO; + return D; + } +}; + +// CD3DX12_PIPELINE_STATE_STREAM works on OS Build 15063+ but does not support new subobject(s) added in OS Build 16299+. +// See CD3DX12_PIPELINE_STATE_STREAM1 for instance. +struct CD3DX12_PIPELINE_STATE_STREAM +{ + CD3DX12_PIPELINE_STATE_STREAM() = default; + CD3DX12_PIPELINE_STATE_STREAM(const D3D12_GRAPHICS_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , InputLayout(Desc.InputLayout) + , IBStripCutValue(Desc.IBStripCutValue) + , PrimitiveTopologyType(Desc.PrimitiveTopologyType) + , VS(Desc.VS) + , GS(Desc.GS) + , StreamOutput(Desc.StreamOutput) + , HS(Desc.HS) + , DS(Desc.DS) + , PS(Desc.PS) + , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState)) + , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC1(Desc.DepthStencilState)) + , DSVFormat(Desc.DSVFormat) + , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState)) + , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets)) + , SampleDesc(Desc.SampleDesc) + , SampleMask(Desc.SampleMask) + , CachedPSO(Desc.CachedPSO) + {} + CD3DX12_PIPELINE_STATE_STREAM(const D3D12_COMPUTE_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , CS(CD3DX12_SHADER_BYTECODE(Desc.CS)) + , CachedPSO(Desc.CachedPSO) + {} + CD3DX12_PIPELINE_STATE_STREAM_FLAGS Flags; + CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK NodeMask; + CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE pRootSignature; + CD3DX12_PIPELINE_STATE_STREAM_INPUT_LAYOUT InputLayout; + CD3DX12_PIPELINE_STATE_STREAM_IB_STRIP_CUT_VALUE IBStripCutValue; + CD3DX12_PIPELINE_STATE_STREAM_PRIMITIVE_TOPOLOGY PrimitiveTopologyType; + CD3DX12_PIPELINE_STATE_STREAM_VS VS; + CD3DX12_PIPELINE_STATE_STREAM_GS GS; + CD3DX12_PIPELINE_STATE_STREAM_STREAM_OUTPUT StreamOutput; + CD3DX12_PIPELINE_STATE_STREAM_HS HS; + CD3DX12_PIPELINE_STATE_STREAM_DS DS; + CD3DX12_PIPELINE_STATE_STREAM_PS PS; + CD3DX12_PIPELINE_STATE_STREAM_CS CS; + CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC BlendState; + CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL1 DepthStencilState; + CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT DSVFormat; + CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER RasterizerState; + CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS RTVFormats; + CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC SampleDesc; + CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK SampleMask; + CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO CachedPSO; + D3D12_GRAPHICS_PIPELINE_STATE_DESC GraphicsDescV0() const noexcept + { + D3D12_GRAPHICS_PIPELINE_STATE_DESC D; + D.Flags = this->Flags; + D.NodeMask = this->NodeMask; + D.pRootSignature = this->pRootSignature; + D.InputLayout = this->InputLayout; + D.IBStripCutValue = this->IBStripCutValue; + D.PrimitiveTopologyType = this->PrimitiveTopologyType; + D.VS = this->VS; + D.GS = this->GS; + D.StreamOutput = this->StreamOutput; + D.HS = this->HS; + D.DS = this->DS; + D.PS = this->PS; + D.BlendState = this->BlendState; + D.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(D3D12_DEPTH_STENCIL_DESC1(this->DepthStencilState)); + D.DSVFormat = this->DSVFormat; + D.RasterizerState = this->RasterizerState; + D.NumRenderTargets = D3D12_RT_FORMAT_ARRAY(this->RTVFormats).NumRenderTargets; + memcpy(D.RTVFormats, D3D12_RT_FORMAT_ARRAY(this->RTVFormats).RTFormats, sizeof(D.RTVFormats)); + D.SampleDesc = this->SampleDesc; + D.SampleMask = this->SampleMask; + D.CachedPSO = this->CachedPSO; + return D; + } + D3D12_COMPUTE_PIPELINE_STATE_DESC ComputeDescV0() const noexcept + { + D3D12_COMPUTE_PIPELINE_STATE_DESC D; + D.Flags = this->Flags; + D.NodeMask = this->NodeMask; + D.pRootSignature = this->pRootSignature; + D.CS = this->CS; + D.CachedPSO = this->CachedPSO; + return D; + } +}; + +struct CD3DX12_PIPELINE_STATE_STREAM2_PARSE_HELPER : public ID3DX12PipelineParserCallbacks +{ + CD3DX12_PIPELINE_STATE_STREAM2 PipelineStream; + CD3DX12_PIPELINE_STATE_STREAM2_PARSE_HELPER() noexcept + : SeenDSS(false) + { + // Adjust defaults to account for absent members. + PipelineStream.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE; + + // Depth disabled if no DSV format specified. + static_cast(PipelineStream.DepthStencilState).DepthEnable = false; + } + + // ID3DX12PipelineParserCallbacks + void FlagsCb(D3D12_PIPELINE_STATE_FLAGS Flags) override {PipelineStream.Flags = Flags;} + void NodeMaskCb(UINT NodeMask) override {PipelineStream.NodeMask = NodeMask;} + void RootSignatureCb(ID3D12RootSignature* pRootSignature) override {PipelineStream.pRootSignature = pRootSignature;} + void InputLayoutCb(const D3D12_INPUT_LAYOUT_DESC& InputLayout) override {PipelineStream.InputLayout = InputLayout;} + void IBStripCutValueCb(D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue) override {PipelineStream.IBStripCutValue = IBStripCutValue;} + void PrimitiveTopologyTypeCb(D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType) override {PipelineStream.PrimitiveTopologyType = PrimitiveTopologyType;} + void VSCb(const D3D12_SHADER_BYTECODE& VS) override {PipelineStream.VS = VS;} + void GSCb(const D3D12_SHADER_BYTECODE& GS) override {PipelineStream.GS = GS;} + void StreamOutputCb(const D3D12_STREAM_OUTPUT_DESC& StreamOutput) override {PipelineStream.StreamOutput = StreamOutput;} + void HSCb(const D3D12_SHADER_BYTECODE& HS) override {PipelineStream.HS = HS;} + void DSCb(const D3D12_SHADER_BYTECODE& DS) override {PipelineStream.DS = DS;} + void PSCb(const D3D12_SHADER_BYTECODE& PS) override {PipelineStream.PS = PS;} + void CSCb(const D3D12_SHADER_BYTECODE& CS) override {PipelineStream.CS = CS;} + void ASCb(const D3D12_SHADER_BYTECODE& AS) override {PipelineStream.AS = AS;} + void MSCb(const D3D12_SHADER_BYTECODE& MS) override {PipelineStream.MS = MS;} + void BlendStateCb(const D3D12_BLEND_DESC& BlendState) override {PipelineStream.BlendState = CD3DX12_BLEND_DESC(BlendState);} + void DepthStencilStateCb(const D3D12_DEPTH_STENCIL_DESC& DepthStencilState) override + { + PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(DepthStencilState); + SeenDSS = true; + } + void DepthStencilState1Cb(const D3D12_DEPTH_STENCIL_DESC1& DepthStencilState) override + { + PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(DepthStencilState); + SeenDSS = true; + } + void DSVFormatCb(DXGI_FORMAT DSVFormat) override + { + PipelineStream.DSVFormat = DSVFormat; + if (!SeenDSS && DSVFormat != DXGI_FORMAT_UNKNOWN) + { + // Re-enable depth for the default state. + static_cast(PipelineStream.DepthStencilState).DepthEnable = true; + } + } + void RasterizerStateCb(const D3D12_RASTERIZER_DESC& RasterizerState) override {PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC(RasterizerState);} + void RTVFormatsCb(const D3D12_RT_FORMAT_ARRAY& RTVFormats) override {PipelineStream.RTVFormats = RTVFormats;} + void SampleDescCb(const DXGI_SAMPLE_DESC& SampleDesc) override {PipelineStream.SampleDesc = SampleDesc;} + void SampleMaskCb(UINT SampleMask) override {PipelineStream.SampleMask = SampleMask;} + void ViewInstancingCb(const D3D12_VIEW_INSTANCING_DESC& ViewInstancingDesc) override {PipelineStream.ViewInstancingDesc = CD3DX12_VIEW_INSTANCING_DESC(ViewInstancingDesc);} + void CachedPSOCb(const D3D12_CACHED_PIPELINE_STATE& CachedPSO) override {PipelineStream.CachedPSO = CachedPSO;} + +private: + bool SeenDSS; +}; + + +struct CD3DX12_PIPELINE_STATE_STREAM3_PARSE_HELPER : public ID3DX12PipelineParserCallbacks +{ + CD3DX12_PIPELINE_STATE_STREAM3 PipelineStream; + CD3DX12_PIPELINE_STATE_STREAM3_PARSE_HELPER() noexcept + : SeenDSS(false) + { + // Adjust defaults to account for absent members. + PipelineStream.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE; + + // Depth disabled if no DSV format specified. + static_cast(PipelineStream.DepthStencilState).DepthEnable = false; + } + + // ID3DX12PipelineParserCallbacks + void FlagsCb(D3D12_PIPELINE_STATE_FLAGS Flags) override { PipelineStream.Flags = Flags; } + void NodeMaskCb(UINT NodeMask) override { PipelineStream.NodeMask = NodeMask; } + void RootSignatureCb(ID3D12RootSignature* pRootSignature) override { PipelineStream.pRootSignature = pRootSignature; } + void InputLayoutCb(const D3D12_INPUT_LAYOUT_DESC& InputLayout) override { PipelineStream.InputLayout = InputLayout; } + void IBStripCutValueCb(D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue) override { PipelineStream.IBStripCutValue = IBStripCutValue; } + void PrimitiveTopologyTypeCb(D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType) override { PipelineStream.PrimitiveTopologyType = PrimitiveTopologyType; } + void VSCb(const D3D12_SHADER_BYTECODE& VS) override { PipelineStream.VS = VS; } + void GSCb(const D3D12_SHADER_BYTECODE& GS) override { PipelineStream.GS = GS; } + void StreamOutputCb(const D3D12_STREAM_OUTPUT_DESC& StreamOutput) override { PipelineStream.StreamOutput = StreamOutput; } + void HSCb(const D3D12_SHADER_BYTECODE& HS) override { PipelineStream.HS = HS; } + void DSCb(const D3D12_SHADER_BYTECODE& DS) override { PipelineStream.DS = DS; } + void PSCb(const D3D12_SHADER_BYTECODE& PS) override { PipelineStream.PS = PS; } + void CSCb(const D3D12_SHADER_BYTECODE& CS) override { PipelineStream.CS = CS; } + void ASCb(const D3D12_SHADER_BYTECODE& AS) override { PipelineStream.AS = AS; } + void MSCb(const D3D12_SHADER_BYTECODE& MS) override { PipelineStream.MS = MS; } + void BlendStateCb(const D3D12_BLEND_DESC& BlendState) override { PipelineStream.BlendState = CD3DX12_BLEND_DESC(BlendState); } + void DepthStencilStateCb(const D3D12_DEPTH_STENCIL_DESC& DepthStencilState) override + { + PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(DepthStencilState); + SeenDSS = true; + } + void DepthStencilState1Cb(const D3D12_DEPTH_STENCIL_DESC1& DepthStencilState) override + { + PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(DepthStencilState); + SeenDSS = true; + } + void DepthStencilState2Cb(const D3D12_DEPTH_STENCIL_DESC2& DepthStencilState) override + { + PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(DepthStencilState); + SeenDSS = true; + } + void DSVFormatCb(DXGI_FORMAT DSVFormat) override + { + PipelineStream.DSVFormat = DSVFormat; + if (!SeenDSS && DSVFormat != DXGI_FORMAT_UNKNOWN) + { + // Re-enable depth for the default state. + static_cast(PipelineStream.DepthStencilState).DepthEnable = true; + } + } + void RasterizerStateCb(const D3D12_RASTERIZER_DESC& RasterizerState) override { PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC(RasterizerState); } + void RTVFormatsCb(const D3D12_RT_FORMAT_ARRAY& RTVFormats) override { PipelineStream.RTVFormats = RTVFormats; } + void SampleDescCb(const DXGI_SAMPLE_DESC& SampleDesc) override { PipelineStream.SampleDesc = SampleDesc; } + void SampleMaskCb(UINT SampleMask) override { PipelineStream.SampleMask = SampleMask; } + void ViewInstancingCb(const D3D12_VIEW_INSTANCING_DESC& ViewInstancingDesc) override { PipelineStream.ViewInstancingDesc = CD3DX12_VIEW_INSTANCING_DESC(ViewInstancingDesc); } + void CachedPSOCb(const D3D12_CACHED_PIPELINE_STATE& CachedPSO) override { PipelineStream.CachedPSO = CachedPSO; } + +private: + bool SeenDSS; +}; + +struct CD3DX12_PIPELINE_STATE_STREAM_PARSE_HELPER : public ID3DX12PipelineParserCallbacks +{ + CD3DX12_PIPELINE_STATE_STREAM1 PipelineStream; + CD3DX12_PIPELINE_STATE_STREAM_PARSE_HELPER() noexcept + : SeenDSS(false) + { + // Adjust defaults to account for absent members. + PipelineStream.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE; + + // Depth disabled if no DSV format specified. + static_cast(PipelineStream.DepthStencilState).DepthEnable = false; + } + + // ID3DX12PipelineParserCallbacks + void FlagsCb(D3D12_PIPELINE_STATE_FLAGS Flags) override {PipelineStream.Flags = Flags;} + void NodeMaskCb(UINT NodeMask) override {PipelineStream.NodeMask = NodeMask;} + void RootSignatureCb(ID3D12RootSignature* pRootSignature) override {PipelineStream.pRootSignature = pRootSignature;} + void InputLayoutCb(const D3D12_INPUT_LAYOUT_DESC& InputLayout) override {PipelineStream.InputLayout = InputLayout;} + void IBStripCutValueCb(D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue) override {PipelineStream.IBStripCutValue = IBStripCutValue;} + void PrimitiveTopologyTypeCb(D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType) override {PipelineStream.PrimitiveTopologyType = PrimitiveTopologyType;} + void VSCb(const D3D12_SHADER_BYTECODE& VS) override {PipelineStream.VS = VS;} + void GSCb(const D3D12_SHADER_BYTECODE& GS) override {PipelineStream.GS = GS;} + void StreamOutputCb(const D3D12_STREAM_OUTPUT_DESC& StreamOutput) override {PipelineStream.StreamOutput = StreamOutput;} + void HSCb(const D3D12_SHADER_BYTECODE& HS) override {PipelineStream.HS = HS;} + void DSCb(const D3D12_SHADER_BYTECODE& DS) override {PipelineStream.DS = DS;} + void PSCb(const D3D12_SHADER_BYTECODE& PS) override {PipelineStream.PS = PS;} + void CSCb(const D3D12_SHADER_BYTECODE& CS) override {PipelineStream.CS = CS;} + void BlendStateCb(const D3D12_BLEND_DESC& BlendState) override {PipelineStream.BlendState = CD3DX12_BLEND_DESC(BlendState);} + void DepthStencilStateCb(const D3D12_DEPTH_STENCIL_DESC& DepthStencilState) override + { + PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(DepthStencilState); + SeenDSS = true; + } + void DepthStencilState1Cb(const D3D12_DEPTH_STENCIL_DESC1& DepthStencilState) override + { + PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(DepthStencilState); + SeenDSS = true; + } + void DSVFormatCb(DXGI_FORMAT DSVFormat) override + { + PipelineStream.DSVFormat = DSVFormat; + if (!SeenDSS && DSVFormat != DXGI_FORMAT_UNKNOWN) + { + // Re-enable depth for the default state. + static_cast(PipelineStream.DepthStencilState).DepthEnable = true; + } + } + void RasterizerStateCb(const D3D12_RASTERIZER_DESC& RasterizerState) override {PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC(RasterizerState);} + void RTVFormatsCb(const D3D12_RT_FORMAT_ARRAY& RTVFormats) override {PipelineStream.RTVFormats = RTVFormats;} + void SampleDescCb(const DXGI_SAMPLE_DESC& SampleDesc) override {PipelineStream.SampleDesc = SampleDesc;} + void SampleMaskCb(UINT SampleMask) override {PipelineStream.SampleMask = SampleMask;} + void ViewInstancingCb(const D3D12_VIEW_INSTANCING_DESC& ViewInstancingDesc) override {PipelineStream.ViewInstancingDesc = CD3DX12_VIEW_INSTANCING_DESC(ViewInstancingDesc);} + void CachedPSOCb(const D3D12_CACHED_PIPELINE_STATE& CachedPSO) override {PipelineStream.CachedPSO = CachedPSO;} + +private: + bool SeenDSS; +}; + +inline D3D12_PIPELINE_STATE_SUBOBJECT_TYPE D3DX12GetBaseSubobjectType(D3D12_PIPELINE_STATE_SUBOBJECT_TYPE SubobjectType) noexcept +{ + switch (SubobjectType) + { + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1: + return D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2: + return D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL; + default: + return SubobjectType; + } +} + +inline HRESULT D3DX12ParsePipelineStream(const D3D12_PIPELINE_STATE_STREAM_DESC& Desc, ID3DX12PipelineParserCallbacks* pCallbacks) +{ + if (pCallbacks == nullptr) + { + return E_INVALIDARG; + } + + if (Desc.SizeInBytes == 0 || Desc.pPipelineStateSubobjectStream == nullptr) + { + pCallbacks->ErrorBadInputParameter(1); // first parameter issue + return E_INVALIDARG; + } + + bool SubobjectSeen[D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MAX_VALID] = {}; + for (SIZE_T CurOffset = 0, SizeOfSubobject = 0; CurOffset < Desc.SizeInBytes; CurOffset += SizeOfSubobject) + { + BYTE* pStream = static_cast(Desc.pPipelineStateSubobjectStream)+CurOffset; + auto SubobjectType = *reinterpret_cast(pStream); + if (SubobjectType < 0 || SubobjectType >= D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MAX_VALID) + { + pCallbacks->ErrorUnknownSubobject(SubobjectType); + return E_INVALIDARG; + } + if (SubobjectSeen[D3DX12GetBaseSubobjectType(SubobjectType)]) + { + pCallbacks->ErrorDuplicateSubobject(SubobjectType); + return E_INVALIDARG; // disallow subobject duplicates in a stream + } + SubobjectSeen[SubobjectType] = true; + switch (SubobjectType) + { + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_ROOT_SIGNATURE: + pCallbacks->RootSignatureCb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::pRootSignature); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VS: + pCallbacks->VSCb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::VS); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PS: + pCallbacks->PSCb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::PS); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DS: + pCallbacks->DSCb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::DS); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_HS: + pCallbacks->HSCb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::HS); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_GS: + pCallbacks->GSCb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::GS); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CS: + pCallbacks->CSCb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::CS); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_AS: + pCallbacks->ASCb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM2::AS); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MS: + pCallbacks->MSCb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM2::MS); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_STREAM_OUTPUT: + pCallbacks->StreamOutputCb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::StreamOutput); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_BLEND: + pCallbacks->BlendStateCb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::BlendState); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_MASK: + pCallbacks->SampleMaskCb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::SampleMask); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER: + pCallbacks->RasterizerStateCb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::RasterizerState); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL: + pCallbacks->DepthStencilStateCb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1: + pCallbacks->DepthStencilState1Cb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::DepthStencilState); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2: + pCallbacks->DepthStencilState2Cb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM3::DepthStencilState); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_INPUT_LAYOUT: + pCallbacks->InputLayoutCb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::InputLayout); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_IB_STRIP_CUT_VALUE: + pCallbacks->IBStripCutValueCb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::IBStripCutValue); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PRIMITIVE_TOPOLOGY: + pCallbacks->PrimitiveTopologyTypeCb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::PrimitiveTopologyType); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RENDER_TARGET_FORMATS: + pCallbacks->RTVFormatsCb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::RTVFormats); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL_FORMAT: + pCallbacks->DSVFormatCb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::DSVFormat); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_DESC: + pCallbacks->SampleDescCb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::SampleDesc); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_NODE_MASK: + pCallbacks->NodeMaskCb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::NodeMask); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CACHED_PSO: + pCallbacks->CachedPSOCb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::CachedPSO); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_FLAGS: + pCallbacks->FlagsCb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::Flags); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VIEW_INSTANCING: + pCallbacks->ViewInstancingCb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM1::ViewInstancingDesc); + break; + default: + pCallbacks->ErrorUnknownSubobject(SubobjectType); + return E_INVALIDARG; + } + } + + return S_OK; +} + +//------------------------------------------------------------------------------------------------ +inline bool operator==( const D3D12_CLEAR_VALUE &a, const D3D12_CLEAR_VALUE &b) noexcept +{ + if (a.Format != b.Format) return false; + if (a.Format == DXGI_FORMAT_D24_UNORM_S8_UINT + || a.Format == DXGI_FORMAT_D16_UNORM + || a.Format == DXGI_FORMAT_D32_FLOAT + || a.Format == DXGI_FORMAT_D32_FLOAT_S8X24_UINT) + { + return (a.DepthStencil.Depth == b.DepthStencil.Depth) && + (a.DepthStencil.Stencil == b.DepthStencil.Stencil); + } else { + return (a.Color[0] == b.Color[0]) && + (a.Color[1] == b.Color[1]) && + (a.Color[2] == b.Color[2]) && + (a.Color[3] == b.Color[3]); + } +} +inline bool operator==( const D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS &a, const D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS &b) noexcept +{ + return a.ClearValue == b.ClearValue; +} +inline bool operator==( const D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS &a, const D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS &b) noexcept +{ + if (a.pSrcResource != b.pSrcResource) return false; + if (a.pDstResource != b.pDstResource) return false; + if (a.SubresourceCount != b.SubresourceCount) return false; + if (a.Format != b.Format) return false; + if (a.ResolveMode != b.ResolveMode) return false; + if (a.PreserveResolveSource != b.PreserveResolveSource) return false; + return true; +} +inline bool operator==( const D3D12_RENDER_PASS_BEGINNING_ACCESS &a, const D3D12_RENDER_PASS_BEGINNING_ACCESS &b) noexcept +{ + if (a.Type != b.Type) return false; + if (a.Type == D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_CLEAR && !(a.Clear == b.Clear)) return false; + return true; +} +inline bool operator==( const D3D12_RENDER_PASS_ENDING_ACCESS &a, const D3D12_RENDER_PASS_ENDING_ACCESS &b) noexcept +{ + if (a.Type != b.Type) return false; + if (a.Type == D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_RESOLVE && !(a.Resolve == b.Resolve)) return false; + return true; +} +inline bool operator==( const D3D12_RENDER_PASS_RENDER_TARGET_DESC &a, const D3D12_RENDER_PASS_RENDER_TARGET_DESC &b) noexcept +{ + if (a.cpuDescriptor.ptr != b.cpuDescriptor.ptr) return false; + if (!(a.BeginningAccess == b.BeginningAccess)) return false; + if (!(a.EndingAccess == b.EndingAccess)) return false; + return true; +} +inline bool operator==( const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC &a, const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC &b) noexcept +{ + if (a.cpuDescriptor.ptr != b.cpuDescriptor.ptr) return false; + if (!(a.DepthBeginningAccess == b.DepthBeginningAccess)) return false; + if (!(a.StencilBeginningAccess == b.StencilBeginningAccess)) return false; + if (!(a.DepthEndingAccess == b.DepthEndingAccess)) return false; + if (!(a.StencilEndingAccess == b.StencilEndingAccess)) return false; + return true; +} + + +#ifndef D3DX12_NO_STATE_OBJECT_HELPERS + +//================================================================================================ +// D3DX12 State Object Creation Helpers +// +// Helper classes for creating new style state objects out of an arbitrary set of subobjects. +// Uses STL +// +// Start by instantiating CD3DX12_STATE_OBJECT_DESC (see its public methods). +// One of its methods is CreateSubobject(), which has a comment showing a couple of options for +// defining subobjects using the helper classes for each subobject (CD3DX12_DXIL_LIBRARY_SUBOBJECT +// etc.). The subobject helpers each have methods specific to the subobject for configuring its +// contents. +// +//================================================================================================ +#include +#include +#include +#include +#ifndef D3DX12_USE_ATL +#include +#define D3DX12_COM_PTR Microsoft::WRL::ComPtr +#define D3DX12_COM_PTR_GET(x) x.Get() +#define D3DX12_COM_PTR_ADDRESSOF(x) x.GetAddressOf() +#else +#include +#define D3DX12_COM_PTR ATL::CComPtr +#define D3DX12_COM_PTR_GET(x) x.p +#define D3DX12_COM_PTR_ADDRESSOF(x) &x.p +#endif + +//------------------------------------------------------------------------------------------------ +class CD3DX12_STATE_OBJECT_DESC +{ +public: + CD3DX12_STATE_OBJECT_DESC() noexcept + { + Init(D3D12_STATE_OBJECT_TYPE_COLLECTION); + } + CD3DX12_STATE_OBJECT_DESC(D3D12_STATE_OBJECT_TYPE Type) noexcept + { + Init(Type); + } + void SetStateObjectType(D3D12_STATE_OBJECT_TYPE Type) noexcept { m_Desc.Type = Type; } + operator const D3D12_STATE_OBJECT_DESC&() + { + // Do final preparation work + m_RepointedAssociations.clear(); + m_SubobjectArray.clear(); + m_SubobjectArray.reserve(m_Desc.NumSubobjects); + // Flatten subobjects into an array (each flattened subobject still has a + // member that's a pointer to its desc that's not flattened) + for (auto Iter = m_SubobjectList.begin(); + Iter != m_SubobjectList.end(); Iter++) + { + m_SubobjectArray.push_back(*Iter); + // Store new location in array so we can redirect pointers contained in subobjects + Iter->pSubobjectArrayLocation = &m_SubobjectArray.back(); + } + // For subobjects with pointer fields, create a new copy of those subobject definitions + // with fixed pointers + for (UINT i = 0; i < m_Desc.NumSubobjects; i++) + { + if (m_SubobjectArray[i].Type == D3D12_STATE_SUBOBJECT_TYPE_SUBOBJECT_TO_EXPORTS_ASSOCIATION) + { + auto pOriginalSubobjectAssociation = + static_cast(m_SubobjectArray[i].pDesc); + D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION Repointed = *pOriginalSubobjectAssociation; + auto pWrapper = + static_cast(pOriginalSubobjectAssociation->pSubobjectToAssociate); + Repointed.pSubobjectToAssociate = pWrapper->pSubobjectArrayLocation; + m_RepointedAssociations.push_back(Repointed); + m_SubobjectArray[i].pDesc = &m_RepointedAssociations.back(); + } + } + // Below: using ugly way to get pointer in case .data() is not defined + m_Desc.pSubobjects = m_Desc.NumSubobjects ? &m_SubobjectArray[0] : nullptr; + return m_Desc; + } + operator const D3D12_STATE_OBJECT_DESC*() + { + // Cast calls the above final preparation work + return &static_cast(*this); + } + + // CreateSubobject creates a sububject helper (e.g. CD3DX12_HIT_GROUP_SUBOBJECT) + // whose lifetime is owned by this class. + // e.g. + // + // CD3DX12_STATE_OBJECT_DESC Collection1(D3D12_STATE_OBJECT_TYPE_COLLECTION); + // auto Lib0 = Collection1.CreateSubobject(); + // Lib0->SetDXILLibrary(&pMyAppDxilLibs[0]); + // Lib0->DefineExport(L"rayGenShader0"); // in practice these export listings might be + // // data/engine driven + // etc. + // + // Alternatively, users can instantiate sububject helpers explicitly, such as via local + // variables instead, passing the state object desc that should point to it into the helper + // constructor (or call mySubobjectHelper.AddToStateObject(Collection1)). + // In this alternative scenario, the user must keep the subobject alive as long as the state + // object it is associated with is alive, else its pointer references will be stale. + // e.g. + // + // CD3DX12_STATE_OBJECT_DESC RaytracingState2(D3D12_STATE_OBJECT_TYPE_RAYTRACING_PIPELINE); + // CD3DX12_DXIL_LIBRARY_SUBOBJECT LibA(RaytracingState2); + // LibA.SetDXILLibrary(&pMyAppDxilLibs[4]); // not manually specifying exports + // // - meaning all exports in the libraries + // // are exported + // etc. + + template + T* CreateSubobject() + { + T* pSubobject = new T(*this); + m_OwnedSubobjectHelpers.emplace_back(pSubobject); + return pSubobject; + } + +private: + D3D12_STATE_SUBOBJECT* TrackSubobject(D3D12_STATE_SUBOBJECT_TYPE Type, void* pDesc) + { + SUBOBJECT_WRAPPER Subobject; + Subobject.pSubobjectArrayLocation = nullptr; + Subobject.Type = Type; + Subobject.pDesc = pDesc; + m_SubobjectList.push_back(Subobject); + m_Desc.NumSubobjects++; + return &m_SubobjectList.back(); + } + void Init(D3D12_STATE_OBJECT_TYPE Type) noexcept + { + SetStateObjectType(Type); + m_Desc.pSubobjects = nullptr; + m_Desc.NumSubobjects = 0; + m_SubobjectList.clear(); + m_SubobjectArray.clear(); + m_RepointedAssociations.clear(); + } + typedef struct SUBOBJECT_WRAPPER : public D3D12_STATE_SUBOBJECT + { + D3D12_STATE_SUBOBJECT* pSubobjectArrayLocation; // new location when flattened into array + // for repointing pointers in subobjects + } SUBOBJECT_WRAPPER; + D3D12_STATE_OBJECT_DESC m_Desc; + std::list m_SubobjectList; // Pointers to list nodes handed out so + // these can be edited live + std::vector m_SubobjectArray; // Built at the end, copying list contents + + std::list + m_RepointedAssociations; // subobject type that contains pointers to other subobjects, + // repointed to flattened array + + class StringContainer + { + public: + LPCWSTR LocalCopy(LPCWSTR string, bool bSingleString = false) + { + if (string) + { + if (bSingleString) + { + m_Strings.clear(); + m_Strings.push_back(string); + } + else + { + m_Strings.push_back(string); + } + return m_Strings.back().c_str(); + } + else + { + return nullptr; + } + } + void clear() noexcept { m_Strings.clear(); } + private: + std::list m_Strings; + }; + + class SUBOBJECT_HELPER_BASE + { + public: + SUBOBJECT_HELPER_BASE() noexcept { Init(); } + virtual ~SUBOBJECT_HELPER_BASE() = default; + virtual D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept = 0; + void AddToStateObject(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + m_pSubobject = ContainingStateObject.TrackSubobject(Type(), Data()); + } + protected: + virtual void* Data() noexcept = 0; + void Init() noexcept { m_pSubobject = nullptr; } + D3D12_STATE_SUBOBJECT* m_pSubobject; + }; + +#if(__cplusplus >= 201103L) + std::list> m_OwnedSubobjectHelpers; +#else + class OWNED_HELPER + { + public: + OWNED_HELPER(const SUBOBJECT_HELPER_BASE* pHelper) noexcept { m_pHelper = pHelper; } + ~OWNED_HELPER() { delete m_pHelper; } + const SUBOBJECT_HELPER_BASE* m_pHelper; + }; + + std::list m_OwnedSubobjectHelpers; +#endif + + friend class CD3DX12_DXIL_LIBRARY_SUBOBJECT; + friend class CD3DX12_EXISTING_COLLECTION_SUBOBJECT; + friend class CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT; + friend class CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION; + friend class CD3DX12_HIT_GROUP_SUBOBJECT; + friend class CD3DX12_RAYTRACING_SHADER_CONFIG_SUBOBJECT; + friend class CD3DX12_RAYTRACING_PIPELINE_CONFIG_SUBOBJECT; + friend class CD3DX12_RAYTRACING_PIPELINE_CONFIG1_SUBOBJECT; + friend class CD3DX12_GLOBAL_ROOT_SIGNATURE_SUBOBJECT; + friend class CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT; + friend class CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT; + friend class CD3DX12_NODE_MASK_SUBOBJECT; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_DXIL_LIBRARY_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_DXIL_LIBRARY_SUBOBJECT() noexcept + { + Init(); + } + CD3DX12_DXIL_LIBRARY_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetDXILLibrary(const D3D12_SHADER_BYTECODE* pCode) noexcept + { + static const D3D12_SHADER_BYTECODE Default = {}; + m_Desc.DXILLibrary = pCode ? *pCode : Default; + } + void DefineExport( + LPCWSTR Name, + LPCWSTR ExportToRename = nullptr, + D3D12_EXPORT_FLAGS Flags = D3D12_EXPORT_FLAG_NONE) + { + D3D12_EXPORT_DESC Export; + Export.Name = m_Strings.LocalCopy(Name); + Export.ExportToRename = m_Strings.LocalCopy(ExportToRename); + Export.Flags = Flags; + m_Exports.push_back(Export); + m_Desc.pExports = &m_Exports[0]; // using ugly way to get pointer in case .data() is not defined + m_Desc.NumExports = static_cast(m_Exports.size()); + } + template + void DefineExports(LPCWSTR(&Exports)[N]) + { + for (UINT i = 0; i < N; i++) + { + DefineExport(Exports[i]); + } + } + void DefineExports(const LPCWSTR* Exports, UINT N) + { + for (UINT i = 0; i < N; i++) + { + DefineExport(Exports[i]); + } + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_DXIL_LIBRARY; + } + operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } + operator const D3D12_DXIL_LIBRARY_DESC&() const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + m_Strings.clear(); + m_Exports.clear(); + } + void* Data() noexcept override { return &m_Desc; } + D3D12_DXIL_LIBRARY_DESC m_Desc; + CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings; + std::vector m_Exports; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_EXISTING_COLLECTION_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_EXISTING_COLLECTION_SUBOBJECT() noexcept + { + Init(); + } + CD3DX12_EXISTING_COLLECTION_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetExistingCollection(ID3D12StateObject*pExistingCollection) noexcept + { + m_Desc.pExistingCollection = pExistingCollection; + m_CollectionRef = pExistingCollection; + } + void DefineExport( + LPCWSTR Name, + LPCWSTR ExportToRename = nullptr, + D3D12_EXPORT_FLAGS Flags = D3D12_EXPORT_FLAG_NONE) + { + D3D12_EXPORT_DESC Export; + Export.Name = m_Strings.LocalCopy(Name); + Export.ExportToRename = m_Strings.LocalCopy(ExportToRename); + Export.Flags = Flags; + m_Exports.push_back(Export); + m_Desc.pExports = &m_Exports[0]; // using ugly way to get pointer in case .data() is not defined + m_Desc.NumExports = static_cast(m_Exports.size()); + } + template + void DefineExports(LPCWSTR(&Exports)[N]) + { + for (UINT i = 0; i < N; i++) + { + DefineExport(Exports[i]); + } + } + void DefineExports(const LPCWSTR* Exports, UINT N) + { + for (UINT i = 0; i < N; i++) + { + DefineExport(Exports[i]); + } + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_EXISTING_COLLECTION; + } + operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } + operator const D3D12_EXISTING_COLLECTION_DESC&() const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + m_CollectionRef = nullptr; + m_Strings.clear(); + m_Exports.clear(); + } + void* Data() noexcept override { return &m_Desc; } + D3D12_EXISTING_COLLECTION_DESC m_Desc; + D3DX12_COM_PTR m_CollectionRef; + CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings; + std::vector m_Exports; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT() noexcept + { + Init(); + } + CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetSubobjectToAssociate(const D3D12_STATE_SUBOBJECT& SubobjectToAssociate) noexcept + { + m_Desc.pSubobjectToAssociate = &SubobjectToAssociate; + } + void AddExport(LPCWSTR Export) + { + m_Desc.NumExports++; + m_Exports.push_back(m_Strings.LocalCopy(Export)); + m_Desc.pExports = &m_Exports[0]; // using ugly way to get pointer in case .data() is not defined + } + template + void AddExports(LPCWSTR (&Exports)[N]) + { + for (UINT i = 0; i < N; i++) + { + AddExport(Exports[i]); + } + } + void AddExports(const LPCWSTR* Exports, UINT N) + { + for (UINT i = 0; i < N; i++) + { + AddExport(Exports[i]); + } + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_SUBOBJECT_TO_EXPORTS_ASSOCIATION; + } + operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } + operator const D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION&() const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + m_Strings.clear(); + m_Exports.clear(); + } + void* Data() noexcept override { return &m_Desc; } + D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION m_Desc; + CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings; + std::vector m_Exports; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION() noexcept + { + Init(); + } + CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetSubobjectNameToAssociate(LPCWSTR SubobjectToAssociate) + { + m_Desc.SubobjectToAssociate = m_SubobjectName.LocalCopy(SubobjectToAssociate, true); + } + void AddExport(LPCWSTR Export) + { + m_Desc.NumExports++; + m_Exports.push_back(m_Strings.LocalCopy(Export)); + m_Desc.pExports = &m_Exports[0]; // using ugly way to get pointer in case .data() is not defined + } + template + void AddExports(LPCWSTR (&Exports)[N]) + { + for (UINT i = 0; i < N; i++) + { + AddExport(Exports[i]); + } + } + void AddExports(const LPCWSTR* Exports, UINT N) + { + for (UINT i = 0; i < N; i++) + { + AddExport(Exports[i]); + } + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION; + } + operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } + operator const D3D12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION&() const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + m_Strings.clear(); + m_SubobjectName.clear(); + m_Exports.clear(); + } + void* Data() noexcept override { return &m_Desc; } + D3D12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION m_Desc; + CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings; + CD3DX12_STATE_OBJECT_DESC::StringContainer m_SubobjectName; + std::vector m_Exports; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_HIT_GROUP_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_HIT_GROUP_SUBOBJECT() noexcept + { + Init(); + } + CD3DX12_HIT_GROUP_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetHitGroupExport(LPCWSTR exportName) + { + m_Desc.HitGroupExport = m_Strings[0].LocalCopy(exportName, true); + } + void SetHitGroupType(D3D12_HIT_GROUP_TYPE Type) noexcept { m_Desc.Type = Type; } + void SetAnyHitShaderImport(LPCWSTR importName) + { + m_Desc.AnyHitShaderImport = m_Strings[1].LocalCopy(importName, true); + } + void SetClosestHitShaderImport(LPCWSTR importName) + { + m_Desc.ClosestHitShaderImport = m_Strings[2].LocalCopy(importName, true); + } + void SetIntersectionShaderImport(LPCWSTR importName) + { + m_Desc.IntersectionShaderImport = m_Strings[3].LocalCopy(importName, true); + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_HIT_GROUP; + } + operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } + operator const D3D12_HIT_GROUP_DESC&() const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + for (UINT i = 0; i < m_NumStrings; i++) + { + m_Strings[i].clear(); + } + } + void* Data() noexcept override { return &m_Desc; } + D3D12_HIT_GROUP_DESC m_Desc; + static constexpr UINT m_NumStrings = 4; + CD3DX12_STATE_OBJECT_DESC::StringContainer + m_Strings[m_NumStrings]; // one string for every entrypoint name +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_RAYTRACING_SHADER_CONFIG_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_RAYTRACING_SHADER_CONFIG_SUBOBJECT() noexcept + { + Init(); + } + CD3DX12_RAYTRACING_SHADER_CONFIG_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void Config(UINT MaxPayloadSizeInBytes, UINT MaxAttributeSizeInBytes) noexcept + { + m_Desc.MaxPayloadSizeInBytes = MaxPayloadSizeInBytes; + m_Desc.MaxAttributeSizeInBytes = MaxAttributeSizeInBytes; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_SHADER_CONFIG; + } + operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } + operator const D3D12_RAYTRACING_SHADER_CONFIG&() const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + } + void* Data() noexcept override { return &m_Desc; } + D3D12_RAYTRACING_SHADER_CONFIG m_Desc; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_RAYTRACING_PIPELINE_CONFIG_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_RAYTRACING_PIPELINE_CONFIG_SUBOBJECT() noexcept + { + Init(); + } + CD3DX12_RAYTRACING_PIPELINE_CONFIG_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void Config(UINT MaxTraceRecursionDepth) noexcept + { + m_Desc.MaxTraceRecursionDepth = MaxTraceRecursionDepth; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG; + } + operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } + operator const D3D12_RAYTRACING_PIPELINE_CONFIG&() const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + } + void* Data() noexcept override { return &m_Desc; } + D3D12_RAYTRACING_PIPELINE_CONFIG m_Desc; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_RAYTRACING_PIPELINE_CONFIG1_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_RAYTRACING_PIPELINE_CONFIG1_SUBOBJECT() noexcept + { + Init(); + } + CD3DX12_RAYTRACING_PIPELINE_CONFIG1_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void Config(UINT MaxTraceRecursionDepth, D3D12_RAYTRACING_PIPELINE_FLAGS Flags) noexcept + { + m_Desc.MaxTraceRecursionDepth = MaxTraceRecursionDepth; + m_Desc.Flags = Flags; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG1; + } + operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } + operator const D3D12_RAYTRACING_PIPELINE_CONFIG1&() const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + } + void* Data() noexcept override { return &m_Desc; } + D3D12_RAYTRACING_PIPELINE_CONFIG1 m_Desc; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_GLOBAL_ROOT_SIGNATURE_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_GLOBAL_ROOT_SIGNATURE_SUBOBJECT() noexcept + { + Init(); + } + CD3DX12_GLOBAL_ROOT_SIGNATURE_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetRootSignature(ID3D12RootSignature* pRootSig) noexcept + { + m_pRootSig = pRootSig; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_GLOBAL_ROOT_SIGNATURE; + } + operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } + operator ID3D12RootSignature*() const noexcept { return D3DX12_COM_PTR_GET(m_pRootSig); } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_pRootSig = nullptr; + } + void* Data() noexcept override { return D3DX12_COM_PTR_ADDRESSOF(m_pRootSig); } + D3DX12_COM_PTR m_pRootSig; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT() noexcept + { + Init(); + } + CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetRootSignature(ID3D12RootSignature* pRootSig) noexcept + { + m_pRootSig = pRootSig; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_LOCAL_ROOT_SIGNATURE; + } + operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } + operator ID3D12RootSignature*() const noexcept { return D3DX12_COM_PTR_GET(m_pRootSig); } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_pRootSig = nullptr; + } + void* Data() noexcept override { return D3DX12_COM_PTR_ADDRESSOF(m_pRootSig); } + D3DX12_COM_PTR m_pRootSig; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT() noexcept + { + Init(); + } + CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetFlags(D3D12_STATE_OBJECT_FLAGS Flags) noexcept + { + m_Desc.Flags = Flags; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_STATE_OBJECT_CONFIG; + } + operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } + operator const D3D12_STATE_OBJECT_CONFIG&() const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + } + void* Data() noexcept override { return &m_Desc; } + D3D12_STATE_OBJECT_CONFIG m_Desc; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_NODE_MASK_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_NODE_MASK_SUBOBJECT() noexcept + { + Init(); + } + CD3DX12_NODE_MASK_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetNodeMask(UINT NodeMask) noexcept + { + m_Desc.NodeMask = NodeMask; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_NODE_MASK; + } + operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } + operator const D3D12_NODE_MASK&() const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + } + void* Data() noexcept override { return &m_Desc; } + D3D12_NODE_MASK m_Desc; +}; + +#endif // !D3DX12_NO_STATE_OBJECT_HELPERS + + +//================================================================================================ +// D3DX12 Enhanced Barrier Helpers +//================================================================================================ + +class CD3DX12_BARRIER_SUBRESOURCE_RANGE : public D3D12_BARRIER_SUBRESOURCE_RANGE +{ +public: + CD3DX12_BARRIER_SUBRESOURCE_RANGE() = default; + CD3DX12_BARRIER_SUBRESOURCE_RANGE(const D3D12_BARRIER_SUBRESOURCE_RANGE &o) noexcept : + D3D12_BARRIER_SUBRESOURCE_RANGE(o) + {} + explicit CD3DX12_BARRIER_SUBRESOURCE_RANGE(UINT Subresource) noexcept : + D3D12_BARRIER_SUBRESOURCE_RANGE{ Subresource, 0, 0, 0, 0, 0 } + {} + CD3DX12_BARRIER_SUBRESOURCE_RANGE( + UINT FirstMipLevel, + UINT NumMips, + UINT FirstArraySlice, + UINT NumArraySlices, + UINT FirstPlane = 0, + UINT NumPlanes = 1) noexcept : + D3D12_BARRIER_SUBRESOURCE_RANGE + { + FirstMipLevel, + NumMips, + FirstArraySlice, + NumArraySlices, + FirstPlane, + NumPlanes + } + {} +}; + +class CD3DX12_GLOBAL_BARRIER : public D3D12_GLOBAL_BARRIER +{ +public: + CD3DX12_GLOBAL_BARRIER() = default; + CD3DX12_GLOBAL_BARRIER(const D3D12_GLOBAL_BARRIER &o) noexcept : D3D12_GLOBAL_BARRIER(o){} + CD3DX12_GLOBAL_BARRIER( + D3D12_BARRIER_SYNC syncBefore, + D3D12_BARRIER_SYNC syncAfter, + D3D12_BARRIER_ACCESS accessBefore, + D3D12_BARRIER_ACCESS accessAfter) noexcept : D3D12_GLOBAL_BARRIER { + syncBefore, + syncAfter, + accessBefore, + accessAfter + } + {} +}; + +class CD3DX12_BUFFER_BARRIER : public D3D12_BUFFER_BARRIER +{ +public: + CD3DX12_BUFFER_BARRIER() = default; + CD3DX12_BUFFER_BARRIER(const D3D12_BUFFER_BARRIER &o) noexcept : D3D12_BUFFER_BARRIER(o){} + CD3DX12_BUFFER_BARRIER( + D3D12_BARRIER_SYNC syncBefore, + D3D12_BARRIER_SYNC syncAfter, + D3D12_BARRIER_ACCESS accessBefore, + D3D12_BARRIER_ACCESS accessAfter, + ID3D12Resource *pRes) noexcept : D3D12_BUFFER_BARRIER { + syncBefore, + syncAfter, + accessBefore, + accessAfter, + pRes, + 0, ULLONG_MAX + } + {} +}; + +class CD3DX12_TEXTURE_BARRIER : public D3D12_TEXTURE_BARRIER +{ +public: + CD3DX12_TEXTURE_BARRIER() = default; + CD3DX12_TEXTURE_BARRIER(const D3D12_TEXTURE_BARRIER &o) noexcept : D3D12_TEXTURE_BARRIER(o){} + CD3DX12_TEXTURE_BARRIER( + D3D12_BARRIER_SYNC syncBefore, + D3D12_BARRIER_SYNC syncAfter, + D3D12_BARRIER_ACCESS accessBefore, + D3D12_BARRIER_ACCESS accessAfter, + D3D12_BARRIER_LAYOUT layoutBefore, + D3D12_BARRIER_LAYOUT layoutAfter, + ID3D12Resource *pRes, + const D3D12_BARRIER_SUBRESOURCE_RANGE &subresources, + D3D12_TEXTURE_BARRIER_FLAGS flag = D3D12_TEXTURE_BARRIER_FLAG_NONE) noexcept : D3D12_TEXTURE_BARRIER { + syncBefore, + syncAfter, + accessBefore, + accessAfter, + layoutBefore, + layoutAfter, + pRes, + subresources, + flag + } + {} +}; + +class CD3DX12_BARRIER_GROUP : public D3D12_BARRIER_GROUP +{ +public: + CD3DX12_BARRIER_GROUP() = default; + CD3DX12_BARRIER_GROUP(const D3D12_BARRIER_GROUP &o) noexcept : D3D12_BARRIER_GROUP(o){} + CD3DX12_BARRIER_GROUP(UINT32 numBarriers, const D3D12_BUFFER_BARRIER *pBarriers) noexcept + { + Type = D3D12_BARRIER_TYPE_BUFFER; + NumBarriers = numBarriers; + pBufferBarriers = pBarriers; + } + CD3DX12_BARRIER_GROUP(UINT32 numBarriers, const D3D12_TEXTURE_BARRIER *pBarriers) noexcept + { + Type = D3D12_BARRIER_TYPE_TEXTURE; + NumBarriers = numBarriers; + pTextureBarriers = pBarriers; + } + CD3DX12_BARRIER_GROUP(UINT32 numBarriers, const D3D12_GLOBAL_BARRIER *pBarriers) noexcept + { + Type = D3D12_BARRIER_TYPE_GLOBAL; + NumBarriers = numBarriers; + pGlobalBarriers = pBarriers; + } +}; + + +#ifndef D3DX12_NO_CHECK_FEATURE_SUPPORT_CLASS + +//================================================================================================ +// D3DX12 Check Feature Support +//================================================================================================ + +#include + +class CD3DX12FeatureSupport +{ +public: // Function declaration + // Default constructor that creates an empty object + CD3DX12FeatureSupport() noexcept; + + // Initialize data from the given device + HRESULT Init(ID3D12Device* pDevice); + + // Retreives the status of the object. If an error occurred in the initialization process, the function returns the error code. + HRESULT GetStatus() const noexcept { return m_hStatus; } + + // Getter functions for each feature class + // D3D12_OPTIONS + BOOL DoublePrecisionFloatShaderOps() const noexcept; + BOOL OutputMergerLogicOp() const noexcept; + D3D12_SHADER_MIN_PRECISION_SUPPORT MinPrecisionSupport() const noexcept; + D3D12_TILED_RESOURCES_TIER TiledResourcesTier() const noexcept; + D3D12_RESOURCE_BINDING_TIER ResourceBindingTier() const noexcept; + BOOL PSSpecifiedStencilRefSupported() const noexcept; + BOOL TypedUAVLoadAdditionalFormats() const noexcept; + BOOL ROVsSupported() const noexcept; + D3D12_CONSERVATIVE_RASTERIZATION_TIER ConservativeRasterizationTier() const noexcept; + BOOL StandardSwizzle64KBSupported() const noexcept; + BOOL CrossAdapterRowMajorTextureSupported() const noexcept; + BOOL VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation() const noexcept; + D3D12_RESOURCE_HEAP_TIER ResourceHeapTier() const noexcept; + D3D12_CROSS_NODE_SHARING_TIER CrossNodeSharingTier() const noexcept; + UINT MaxGPUVirtualAddressBitsPerResource() const noexcept; + + // FEATURE_LEVELS + D3D_FEATURE_LEVEL MaxSupportedFeatureLevel() const noexcept; + + // FORMAT_SUPPORT + HRESULT FormatSupport(DXGI_FORMAT Format, D3D12_FORMAT_SUPPORT1& Support1, D3D12_FORMAT_SUPPORT2& Support2) const; + + // MUTLTISAMPLE_QUALITY_LEVELS + HRESULT MultisampleQualityLevels(DXGI_FORMAT Format, UINT SampleCount, D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS Flags, UINT& NumQualityLevels) const; + + // FORMAT_INFO + HRESULT FormatInfo(DXGI_FORMAT Format, UINT8& PlaneCount) const; + + // GPU_VIRTUAL_ADDRESS_SUPPORT + UINT MaxGPUVirtualAddressBitsPerProcess() const noexcept; + + // SHADER_MODEL + D3D_SHADER_MODEL HighestShaderModel() const noexcept; + + // D3D12_OPTIONS1 + BOOL WaveOps() const noexcept; + UINT WaveLaneCountMin() const noexcept; + UINT WaveLaneCountMax() const noexcept; + UINT TotalLaneCount() const noexcept; + BOOL ExpandedComputeResourceStates() const noexcept; + BOOL Int64ShaderOps() const noexcept; + + // PROTECTED_RESOURCE_SESSION_SUPPORT + D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS ProtectedResourceSessionSupport(UINT NodeIndex = 0) const; + + // ROOT_SIGNATURE + D3D_ROOT_SIGNATURE_VERSION HighestRootSignatureVersion() const noexcept; + + // ARCHITECTURE1 + BOOL TileBasedRenderer(UINT NodeIndex = 0) const; + BOOL UMA(UINT NodeIndex = 0) const; + BOOL CacheCoherentUMA(UINT NodeIndex = 0) const; + BOOL IsolatedMMU(UINT NodeIndex = 0) const; + + // D3D12_OPTIONS2 + BOOL DepthBoundsTestSupported() const noexcept; + D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER ProgrammableSamplePositionsTier() const noexcept; + + // SHADER_CACHE + D3D12_SHADER_CACHE_SUPPORT_FLAGS ShaderCacheSupportFlags() const noexcept; + + // COMMAND_QUEUE_PRIORITY + BOOL CommandQueuePrioritySupported(D3D12_COMMAND_LIST_TYPE CommandListType, UINT Priority); + + // D3D12_OPTIONS3 + BOOL CopyQueueTimestampQueriesSupported() const noexcept; + BOOL CastingFullyTypedFormatSupported() const noexcept; + D3D12_COMMAND_LIST_SUPPORT_FLAGS WriteBufferImmediateSupportFlags() const noexcept; + D3D12_VIEW_INSTANCING_TIER ViewInstancingTier() const noexcept; + BOOL BarycentricsSupported() const noexcept; + + // EXISTING_HEAPS + BOOL ExistingHeapsSupported() const noexcept; + + // D3D12_OPTIONS4 + BOOL MSAA64KBAlignedTextureSupported() const noexcept; + D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER SharedResourceCompatibilityTier() const noexcept; + BOOL Native16BitShaderOpsSupported() const noexcept; + + // SERIALIZATION + D3D12_HEAP_SERIALIZATION_TIER HeapSerializationTier(UINT NodeIndex = 0) const; + + // CROSS_NODE + // CrossNodeSharingTier handled in D3D12Options + BOOL CrossNodeAtomicShaderInstructions() const noexcept; + + // D3D12_OPTIONS5 + BOOL SRVOnlyTiledResourceTier3() const noexcept; + D3D12_RENDER_PASS_TIER RenderPassesTier() const noexcept; + D3D12_RAYTRACING_TIER RaytracingTier() const noexcept; + + // DISPLAYABLE + BOOL DisplayableTexture() const noexcept; + // SharedResourceCompatibilityTier handled in D3D12Options4 + + // D3D12_OPTIONS6 + BOOL AdditionalShadingRatesSupported() const noexcept; + BOOL PerPrimitiveShadingRateSupportedWithViewportIndexing() const noexcept; + D3D12_VARIABLE_SHADING_RATE_TIER VariableShadingRateTier() const noexcept; + UINT ShadingRateImageTileSize() const noexcept; + BOOL BackgroundProcessingSupported() const noexcept; + + // QUERY_META_COMMAND + HRESULT QueryMetaCommand(D3D12_FEATURE_DATA_QUERY_META_COMMAND& dQueryMetaCommand) const; + + // D3D12_OPTIONS7 + D3D12_MESH_SHADER_TIER MeshShaderTier() const noexcept; + D3D12_SAMPLER_FEEDBACK_TIER SamplerFeedbackTier() const noexcept; + + // PROTECTED_RESOURCE_SESSION_TYPE_COUNT + UINT ProtectedResourceSessionTypeCount(UINT NodeIndex = 0) const; + + // PROTECTED_RESOURCE_SESSION_TYPES + std::vector ProtectedResourceSessionTypes(UINT NodeIndex = 0) const; + + // D3D12_OPTIONS8 + BOOL UnalignedBlockTexturesSupported() const noexcept; + + // D3D12_OPTIONS9 + BOOL MeshShaderPipelineStatsSupported() const noexcept; + BOOL MeshShaderSupportsFullRangeRenderTargetArrayIndex() const noexcept; + BOOL AtomicInt64OnTypedResourceSupported() const noexcept; + BOOL AtomicInt64OnGroupSharedSupported() const noexcept; + BOOL DerivativesInMeshAndAmplificationShadersSupported() const noexcept; + D3D12_WAVE_MMA_TIER WaveMMATier() const noexcept; + + // D3D12_OPTIONS10 + BOOL VariableRateShadingSumCombinerSupported() const noexcept; + BOOL MeshShaderPerPrimitiveShadingRateSupported() const noexcept; + + // D3D12_OPTIONS11 + BOOL AtomicInt64OnDescriptorHeapResourceSupported() const noexcept; + + // D3D12_OPTIONS12 + D3D12_TRI_STATE MSPrimitivesPipelineStatisticIncludesCulledPrimitives() const noexcept; + BOOL EnhancedBarriersSupported() const noexcept; + BOOL RelaxedFormatCastingSupported() const noexcept; + + // D3D12_OPTIONS13 + BOOL UnrestrictedBufferTextureCopyPitchSupported() const noexcept; + BOOL UnrestrictedVertexElementAlignmentSupported() const noexcept; + BOOL InvertedViewportHeightFlipsYSupported() const noexcept; + BOOL InvertedViewportDepthFlipsZSupported() const noexcept; + BOOL TextureCopyBetweenDimensionsSupported() const noexcept; + BOOL AlphaBlendFactorSupported() const noexcept; + + // D3D12_OPTIONS14 + BOOL AdvancedTextureOpsSupported() const noexcept; + BOOL WriteableMSAATexturesSupported() const noexcept; + BOOL IndependentFrontAndBackStencilRefMaskSupported() const noexcept; + + // D3D12_OPTIONS15 + BOOL TriangleFanSupported() const noexcept; + BOOL DynamicIndexBufferStripCutSupported() const noexcept; + +private: // Private structs and helpers declaration + struct ProtectedResourceSessionTypesLocal : D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPES + { + std::vector TypeVec; + }; + + // Helper function to decide the highest shader model supported by the system + // Stores the result in m_dShaderModel + // Must be updated whenever a new shader model is added to the d3d12.h header + HRESULT QueryHighestShaderModel(); + + // Helper function to decide the highest root signature supported + // Must be updated whenever a new root signature version is added to the d3d12.h header + HRESULT QueryHighestRootSignatureVersion(); + + // Helper funcion to decide the highest feature level + HRESULT QueryHighestFeatureLevel(); + + // Helper function to initialize local protected resource session types structs + HRESULT QueryProtectedResourceSessionTypes(UINT NodeIndex, UINT Count); + +private: // Member data + // Pointer to the underlying device + ID3D12Device* m_pDevice; + + // Stores the error code from initialization + HRESULT m_hStatus; + + // Feature support data structs + D3D12_FEATURE_DATA_D3D12_OPTIONS m_dOptions; + D3D_FEATURE_LEVEL m_eMaxFeatureLevel; + D3D12_FEATURE_DATA_GPU_VIRTUAL_ADDRESS_SUPPORT m_dGPUVASupport; + D3D12_FEATURE_DATA_SHADER_MODEL m_dShaderModel; + D3D12_FEATURE_DATA_D3D12_OPTIONS1 m_dOptions1; + std::vector m_dProtectedResourceSessionSupport; + D3D12_FEATURE_DATA_ROOT_SIGNATURE m_dRootSignature; + std::vector m_dArchitecture1; + D3D12_FEATURE_DATA_D3D12_OPTIONS2 m_dOptions2; + D3D12_FEATURE_DATA_SHADER_CACHE m_dShaderCache; + D3D12_FEATURE_DATA_COMMAND_QUEUE_PRIORITY m_dCommandQueuePriority; + D3D12_FEATURE_DATA_D3D12_OPTIONS3 m_dOptions3; + D3D12_FEATURE_DATA_EXISTING_HEAPS m_dExistingHeaps; + D3D12_FEATURE_DATA_D3D12_OPTIONS4 m_dOptions4; + std::vector m_dSerialization; // Cat2 NodeIndex + D3D12_FEATURE_DATA_CROSS_NODE m_dCrossNode; + D3D12_FEATURE_DATA_D3D12_OPTIONS5 m_dOptions5; + D3D12_FEATURE_DATA_DISPLAYABLE m_dDisplayable; + D3D12_FEATURE_DATA_D3D12_OPTIONS6 m_dOptions6; + D3D12_FEATURE_DATA_D3D12_OPTIONS7 m_dOptions7; + std::vector m_dProtectedResourceSessionTypeCount; // Cat2 NodeIndex + std::vector m_dProtectedResourceSessionTypes; // Cat3 + D3D12_FEATURE_DATA_D3D12_OPTIONS8 m_dOptions8; + D3D12_FEATURE_DATA_D3D12_OPTIONS9 m_dOptions9; + D3D12_FEATURE_DATA_D3D12_OPTIONS10 m_dOptions10; + D3D12_FEATURE_DATA_D3D12_OPTIONS11 m_dOptions11; + D3D12_FEATURE_DATA_D3D12_OPTIONS12 m_dOptions12; + D3D12_FEATURE_DATA_D3D12_OPTIONS13 m_dOptions13; + D3D12_FEATURE_DATA_D3D12_OPTIONS14 m_dOptions14; + D3D12_FEATURE_DATA_D3D12_OPTIONS15 m_dOptions15; +}; + +// Implementations for CD3DX12FeatureSupport functions + +// Macro to set up a getter function for each entry in feature support data +// The getter function will have the same name as the feature option name +#define FEATURE_SUPPORT_GET(RETTYPE,FEATURE,OPTION) \ +inline RETTYPE CD3DX12FeatureSupport::OPTION() const noexcept \ +{ \ + return FEATURE.OPTION; \ +} + +// Macro to set up a getter function for each entry in feature support data +// Also specifies the name for the function which can be different from the feature name +#define FEATURE_SUPPORT_GET_NAME(RETTYPE,FEATURE,OPTION,NAME) \ +inline RETTYPE CD3DX12FeatureSupport::NAME() const noexcept \ +{\ + return FEATURE.OPTION; \ +} + +// Macro to set up a getter function for feature data indexed by the graphics node ID +// The default parameter is 0, or the first availabe graphics device node +#define FEATURE_SUPPORT_GET_NODE_INDEXED(RETTYPE,FEATURE,OPTION) \ +inline RETTYPE CD3DX12FeatureSupport::OPTION(UINT NodeIndex) const \ +{\ + return FEATURE[NodeIndex].OPTION; \ +} + +// Macro to set up a getter function for feature data indexed by NodeIndex +// Allows a custom name for the getter function +#define FEATURE_SUPPORT_GET_NODE_INDEXED_NAME(RETTYPE,FEATURE,OPTION,NAME) \ +inline RETTYPE CD3DX12FeatureSupport::NAME(UINT NodeIndex) const \ +{\ + return FEATURE[NodeIndex].OPTION; \ +} + +inline CD3DX12FeatureSupport::CD3DX12FeatureSupport() noexcept +: m_pDevice(nullptr) +, m_hStatus(E_INVALIDARG) +, m_dOptions{} +, m_eMaxFeatureLevel{} +, m_dGPUVASupport{} +, m_dShaderModel{} +, m_dOptions1{} +, m_dRootSignature{} +, m_dOptions2{} +, m_dShaderCache{} +, m_dCommandQueuePriority{} +, m_dOptions3{} +, m_dExistingHeaps{} +, m_dOptions4{} +, m_dCrossNode{} +, m_dOptions5{} +, m_dDisplayable{} +, m_dOptions6{} +, m_dOptions7{} +, m_dOptions8{} +, m_dOptions9{} +, m_dOptions10{} +, m_dOptions11{} +, m_dOptions12{} +, m_dOptions13{} +, m_dOptions14{} +, m_dOptions15{} +{} + +inline HRESULT CD3DX12FeatureSupport::Init(ID3D12Device* pDevice) +{ + if (!pDevice) + { + m_hStatus = E_INVALIDARG; + return m_hStatus; + } + + m_pDevice = pDevice; + + // Initialize static feature support data structures + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS, &m_dOptions, sizeof(m_dOptions)))) + { + m_dOptions.DoublePrecisionFloatShaderOps = false; + m_dOptions.OutputMergerLogicOp = false; + m_dOptions.MinPrecisionSupport = D3D12_SHADER_MIN_PRECISION_SUPPORT_NONE; + m_dOptions.TiledResourcesTier = D3D12_TILED_RESOURCES_TIER_NOT_SUPPORTED; + m_dOptions.ResourceBindingTier = static_cast(0); + m_dOptions.PSSpecifiedStencilRefSupported = false; + m_dOptions.TypedUAVLoadAdditionalFormats = false; + m_dOptions.ROVsSupported = false; + m_dOptions.ConservativeRasterizationTier = D3D12_CONSERVATIVE_RASTERIZATION_TIER_NOT_SUPPORTED; + m_dOptions.MaxGPUVirtualAddressBitsPerResource = 0; + m_dOptions.StandardSwizzle64KBSupported = false; + m_dOptions.CrossNodeSharingTier = D3D12_CROSS_NODE_SHARING_TIER_NOT_SUPPORTED; + m_dOptions.CrossAdapterRowMajorTextureSupported = false; + m_dOptions.VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation = false; + m_dOptions.ResourceHeapTier = static_cast(0); + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_GPU_VIRTUAL_ADDRESS_SUPPORT, &m_dGPUVASupport, sizeof(m_dGPUVASupport)))) + { + m_dGPUVASupport.MaxGPUVirtualAddressBitsPerProcess = 0; + m_dGPUVASupport.MaxGPUVirtualAddressBitsPerResource = 0; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS1, &m_dOptions1, sizeof(m_dOptions1)))) + { + m_dOptions1.WaveOps = false; + m_dOptions1.WaveLaneCountMax = 0; + m_dOptions1.WaveLaneCountMin = 0; + m_dOptions1.TotalLaneCount = 0; + m_dOptions1.ExpandedComputeResourceStates = 0; + m_dOptions1.Int64ShaderOps = 0; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS2, &m_dOptions2, sizeof(m_dOptions2)))) + { + m_dOptions2.DepthBoundsTestSupported = false; + m_dOptions2.ProgrammableSamplePositionsTier = D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_NOT_SUPPORTED; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_SHADER_CACHE, &m_dShaderCache, sizeof(m_dShaderCache)))) + { + m_dShaderCache.SupportFlags = D3D12_SHADER_CACHE_SUPPORT_NONE; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS3, &m_dOptions3, sizeof(m_dOptions3)))) + { + m_dOptions3.CopyQueueTimestampQueriesSupported = false; + m_dOptions3.CastingFullyTypedFormatSupported = false; + m_dOptions3.WriteBufferImmediateSupportFlags = D3D12_COMMAND_LIST_SUPPORT_FLAG_NONE; + m_dOptions3.ViewInstancingTier = D3D12_VIEW_INSTANCING_TIER_NOT_SUPPORTED; + m_dOptions3.BarycentricsSupported = false; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_EXISTING_HEAPS, &m_dExistingHeaps, sizeof(m_dExistingHeaps)))) + { + m_dExistingHeaps.Supported = false; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS4, &m_dOptions4, sizeof(m_dOptions4)))) + { + m_dOptions4.MSAA64KBAlignedTextureSupported = false; + m_dOptions4.Native16BitShaderOpsSupported = false; + m_dOptions4.SharedResourceCompatibilityTier = D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_0; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_CROSS_NODE, &m_dCrossNode, sizeof(m_dCrossNode)))) + { + m_dCrossNode.SharingTier = D3D12_CROSS_NODE_SHARING_TIER_NOT_SUPPORTED; + m_dCrossNode.AtomicShaderInstructions = false; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS5, &m_dOptions5, sizeof(m_dOptions5)))) + { + m_dOptions5.SRVOnlyTiledResourceTier3 = false; + m_dOptions5.RenderPassesTier = D3D12_RENDER_PASS_TIER_0; + m_dOptions5.RaytracingTier = D3D12_RAYTRACING_TIER_NOT_SUPPORTED; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_DISPLAYABLE, &m_dDisplayable, sizeof(m_dDisplayable)))) + { + m_dDisplayable.DisplayableTexture = false; + m_dDisplayable.SharedResourceCompatibilityTier = D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_0; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS6, &m_dOptions6, sizeof(m_dOptions6)))) + { + m_dOptions6.AdditionalShadingRatesSupported = false; + m_dOptions6.PerPrimitiveShadingRateSupportedWithViewportIndexing = false; + m_dOptions6.VariableShadingRateTier = D3D12_VARIABLE_SHADING_RATE_TIER_NOT_SUPPORTED; + m_dOptions6.ShadingRateImageTileSize = 0; + m_dOptions6.BackgroundProcessingSupported = false; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS7, &m_dOptions7, sizeof(m_dOptions7)))) + { + m_dOptions7.MeshShaderTier = D3D12_MESH_SHADER_TIER_NOT_SUPPORTED; + m_dOptions7.SamplerFeedbackTier = D3D12_SAMPLER_FEEDBACK_TIER_NOT_SUPPORTED; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS8, &m_dOptions8, sizeof(m_dOptions8)))) + { + m_dOptions8.UnalignedBlockTexturesSupported = false; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS9, &m_dOptions9, sizeof(m_dOptions9)))) + { + m_dOptions9.MeshShaderPipelineStatsSupported = false; + m_dOptions9.MeshShaderSupportsFullRangeRenderTargetArrayIndex = false; + m_dOptions9.AtomicInt64OnGroupSharedSupported = false; + m_dOptions9.AtomicInt64OnTypedResourceSupported = false; + m_dOptions9.DerivativesInMeshAndAmplificationShadersSupported = false; + m_dOptions9.WaveMMATier = D3D12_WAVE_MMA_TIER_NOT_SUPPORTED; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS10, &m_dOptions10, sizeof(m_dOptions10)))) + { + m_dOptions10.MeshShaderPerPrimitiveShadingRateSupported = false; + m_dOptions10.VariableRateShadingSumCombinerSupported = false; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS11, &m_dOptions11, sizeof(m_dOptions11)))) + { + m_dOptions11.AtomicInt64OnDescriptorHeapResourceSupported = false; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS12, &m_dOptions12, sizeof(m_dOptions12)))) + { + m_dOptions12.MSPrimitivesPipelineStatisticIncludesCulledPrimitives = D3D12_TRI_STATE::D3D12_TRI_STATE_UNKNOWN; + m_dOptions12.EnhancedBarriersSupported = false; + m_dOptions12.RelaxedFormatCastingSupported = false; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS13, &m_dOptions13, sizeof(m_dOptions13)))) + { + m_dOptions13.UnrestrictedBufferTextureCopyPitchSupported = false; + m_dOptions13.UnrestrictedVertexElementAlignmentSupported = false; + m_dOptions13.InvertedViewportHeightFlipsYSupported = false; + m_dOptions13.InvertedViewportDepthFlipsZSupported = false; + m_dOptions13.TextureCopyBetweenDimensionsSupported = false; + m_dOptions13.AlphaBlendFactorSupported = false; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS14, &m_dOptions14, sizeof(m_dOptions14)))) + { + m_dOptions14.AdvancedTextureOpsSupported = false; + m_dOptions14.WriteableMSAATexturesSupported = false; + m_dOptions14.IndependentFrontAndBackStencilRefMaskSupported = false; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS15, &m_dOptions15, sizeof(m_dOptions15)))) + { + m_dOptions15.TriangleFanSupported = false; + m_dOptions15.DynamicIndexBufferStripCutSupported = false; + } + + // Initialize per-node feature support data structures + const UINT uNodeCount = m_pDevice->GetNodeCount(); + m_dProtectedResourceSessionSupport.resize(uNodeCount); + m_dArchitecture1.resize(uNodeCount); + m_dSerialization.resize(uNodeCount); + m_dProtectedResourceSessionTypeCount.resize(uNodeCount); + m_dProtectedResourceSessionTypes.resize(uNodeCount); + for (UINT NodeIndex = 0; NodeIndex < uNodeCount; NodeIndex++) + { + m_dProtectedResourceSessionSupport[NodeIndex].NodeIndex = NodeIndex; + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_SUPPORT, &m_dProtectedResourceSessionSupport[NodeIndex], sizeof(m_dProtectedResourceSessionSupport[NodeIndex])))) + { + m_dProtectedResourceSessionSupport[NodeIndex].Support = D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_NONE; + } + + m_dArchitecture1[NodeIndex].NodeIndex = NodeIndex; + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_ARCHITECTURE1, &m_dArchitecture1[NodeIndex], sizeof(m_dArchitecture1[NodeIndex])))) + { + D3D12_FEATURE_DATA_ARCHITECTURE dArchLocal = {}; + dArchLocal.NodeIndex = NodeIndex; + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_ARCHITECTURE, &dArchLocal, sizeof(dArchLocal)))) + { + dArchLocal.TileBasedRenderer = false; + dArchLocal.UMA = false; + dArchLocal.CacheCoherentUMA = false; + } + + m_dArchitecture1[NodeIndex].TileBasedRenderer = dArchLocal.TileBasedRenderer; + m_dArchitecture1[NodeIndex].UMA = dArchLocal.UMA; + m_dArchitecture1[NodeIndex].CacheCoherentUMA = dArchLocal.CacheCoherentUMA; + m_dArchitecture1[NodeIndex].IsolatedMMU = false; + } + + m_dSerialization[NodeIndex].NodeIndex = NodeIndex; + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_SERIALIZATION, &m_dSerialization[NodeIndex], sizeof(m_dSerialization[NodeIndex])))) + { + m_dSerialization[NodeIndex].HeapSerializationTier = D3D12_HEAP_SERIALIZATION_TIER_0; + } + + m_dProtectedResourceSessionTypeCount[NodeIndex].NodeIndex = NodeIndex; + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_TYPE_COUNT, &m_dProtectedResourceSessionTypeCount[NodeIndex], sizeof(m_dProtectedResourceSessionTypeCount[NodeIndex])))) + { + m_dProtectedResourceSessionTypeCount[NodeIndex].Count = 0; + } + + // Special procedure to initialize local protected resource session types structs + // Must wait until session type count initialized + QueryProtectedResourceSessionTypes(NodeIndex, m_dProtectedResourceSessionTypeCount[NodeIndex].Count); + } + + // Initialize features that requires highest version check + if (FAILED(m_hStatus = QueryHighestShaderModel())) + { + return m_hStatus; + } + + if (FAILED(m_hStatus = QueryHighestRootSignatureVersion())) + { + return m_hStatus; + } + + // Initialize Feature Levels data + if (FAILED(m_hStatus = QueryHighestFeatureLevel())) + { + return m_hStatus; + } + + return m_hStatus; +} + +// 0: D3D12_OPTIONS +FEATURE_SUPPORT_GET(BOOL, m_dOptions, DoublePrecisionFloatShaderOps); +FEATURE_SUPPORT_GET(BOOL, m_dOptions, OutputMergerLogicOp); +FEATURE_SUPPORT_GET(D3D12_SHADER_MIN_PRECISION_SUPPORT, m_dOptions, MinPrecisionSupport); +FEATURE_SUPPORT_GET(D3D12_TILED_RESOURCES_TIER, m_dOptions, TiledResourcesTier); +FEATURE_SUPPORT_GET(D3D12_RESOURCE_BINDING_TIER, m_dOptions, ResourceBindingTier); +FEATURE_SUPPORT_GET(BOOL, m_dOptions, PSSpecifiedStencilRefSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions, TypedUAVLoadAdditionalFormats); +FEATURE_SUPPORT_GET(BOOL, m_dOptions, ROVsSupported); +FEATURE_SUPPORT_GET(D3D12_CONSERVATIVE_RASTERIZATION_TIER, m_dOptions, ConservativeRasterizationTier); +FEATURE_SUPPORT_GET(BOOL, m_dOptions, StandardSwizzle64KBSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions, CrossAdapterRowMajorTextureSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions, VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation); +FEATURE_SUPPORT_GET(D3D12_RESOURCE_HEAP_TIER, m_dOptions, ResourceHeapTier); + +// Special procedure for handling caps that is also part of other features +inline D3D12_CROSS_NODE_SHARING_TIER CD3DX12FeatureSupport::CrossNodeSharingTier() const noexcept +{ + if (m_dCrossNode.SharingTier > D3D12_CROSS_NODE_SHARING_TIER_NOT_SUPPORTED) + { + return m_dCrossNode.SharingTier; + } + else + { + return m_dOptions.CrossNodeSharingTier; + } +} + +inline UINT CD3DX12FeatureSupport::MaxGPUVirtualAddressBitsPerResource() const noexcept +{ + if (m_dOptions.MaxGPUVirtualAddressBitsPerResource > 0) + { + return m_dOptions.MaxGPUVirtualAddressBitsPerResource; + } + else + { + return m_dGPUVASupport.MaxGPUVirtualAddressBitsPerResource; + } +} + +// 1: Architecture +// Combined with Architecture1 + +// 2: Feature Levels +// Simply returns the highest supported feature level +inline D3D_FEATURE_LEVEL CD3DX12FeatureSupport::MaxSupportedFeatureLevel() const noexcept +{ + return m_eMaxFeatureLevel; +} + +// 3: Feature Format Support +inline HRESULT CD3DX12FeatureSupport::FormatSupport(DXGI_FORMAT Format, D3D12_FORMAT_SUPPORT1& Support1, D3D12_FORMAT_SUPPORT2& Support2) const +{ + D3D12_FEATURE_DATA_FORMAT_SUPPORT dFormatSupport; + dFormatSupport.Format = Format; + + // It is possible that the function call returns an error + HRESULT result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, &dFormatSupport, sizeof(D3D12_FEATURE_DATA_FORMAT_SUPPORT)); + + Support1 = dFormatSupport.Support1; + Support2 = dFormatSupport.Support2; // Two outputs. Probably better just to take in the struct as an argument? + + return result; +} + +// 4: Multisample Quality Levels +inline HRESULT CD3DX12FeatureSupport::MultisampleQualityLevels(DXGI_FORMAT Format, UINT SampleCount, D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS Flags, UINT& NumQualityLevels) const +{ + D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS dMultisampleQualityLevels; + dMultisampleQualityLevels.Format = Format; + dMultisampleQualityLevels.SampleCount = SampleCount; + dMultisampleQualityLevels.Flags = Flags; + + HRESULT result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS, &dMultisampleQualityLevels, sizeof(D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS)); + + if (SUCCEEDED(result)) + { + NumQualityLevels = dMultisampleQualityLevels.NumQualityLevels; + } + else + { + NumQualityLevels = 0; + } + + return result; +} + +// 5: Format Info +inline HRESULT CD3DX12FeatureSupport::FormatInfo(DXGI_FORMAT Format, UINT8& PlaneCount) const +{ + D3D12_FEATURE_DATA_FORMAT_INFO dFormatInfo; + dFormatInfo.Format = Format; + + HRESULT result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_FORMAT_INFO, &dFormatInfo, sizeof(D3D12_FEATURE_DATA_FORMAT_INFO)); + if (FAILED(result)) + { + PlaneCount = 0; + } + else + { + PlaneCount = dFormatInfo.PlaneCount; + } + return result; +} + +// 6: GPU Virtual Address Support +// MaxGPUVirtualAddressBitsPerResource handled in D3D12Options +FEATURE_SUPPORT_GET(UINT, m_dGPUVASupport, MaxGPUVirtualAddressBitsPerProcess); + +// 7: Shader Model +inline D3D_SHADER_MODEL CD3DX12FeatureSupport::HighestShaderModel() const noexcept +{ + return m_dShaderModel.HighestShaderModel; +} + +// 8: D3D12 Options1 +FEATURE_SUPPORT_GET(BOOL, m_dOptions1, WaveOps); +FEATURE_SUPPORT_GET(UINT, m_dOptions1, WaveLaneCountMin); +FEATURE_SUPPORT_GET(UINT, m_dOptions1, WaveLaneCountMax); +FEATURE_SUPPORT_GET(UINT, m_dOptions1, TotalLaneCount); +FEATURE_SUPPORT_GET(BOOL, m_dOptions1, ExpandedComputeResourceStates); +FEATURE_SUPPORT_GET(BOOL, m_dOptions1, Int64ShaderOps); + +// 10: Protected Resource Session Support +inline D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS CD3DX12FeatureSupport::ProtectedResourceSessionSupport(UINT NodeIndex) const +{ + return m_dProtectedResourceSessionSupport[NodeIndex].Support; +} + +// 12: Root Signature +inline D3D_ROOT_SIGNATURE_VERSION CD3DX12FeatureSupport::HighestRootSignatureVersion() const noexcept +{ + return m_dRootSignature.HighestVersion; +} + +// 16: Architecture1 +// Same data fields can be queried from m_dArchitecture +FEATURE_SUPPORT_GET_NODE_INDEXED(BOOL, m_dArchitecture1, TileBasedRenderer); +FEATURE_SUPPORT_GET_NODE_INDEXED(BOOL, m_dArchitecture1, UMA); +FEATURE_SUPPORT_GET_NODE_INDEXED(BOOL, m_dArchitecture1, CacheCoherentUMA); +FEATURE_SUPPORT_GET_NODE_INDEXED(BOOL, m_dArchitecture1, IsolatedMMU); + +// 18: D3D12 Options2 +FEATURE_SUPPORT_GET(BOOL, m_dOptions2, DepthBoundsTestSupported); +FEATURE_SUPPORT_GET(D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER, m_dOptions2, ProgrammableSamplePositionsTier); + +// 19: Shader Cache +FEATURE_SUPPORT_GET_NAME(D3D12_SHADER_CACHE_SUPPORT_FLAGS, m_dShaderCache, SupportFlags, ShaderCacheSupportFlags); + +// 20: Command Queue Priority +inline BOOL CD3DX12FeatureSupport::CommandQueuePrioritySupported(D3D12_COMMAND_LIST_TYPE CommandListType, UINT Priority) +{ + m_dCommandQueuePriority.CommandListType = CommandListType; + m_dCommandQueuePriority.Priority = Priority; + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_COMMAND_QUEUE_PRIORITY, &m_dCommandQueuePriority, sizeof(D3D12_FEATURE_DATA_COMMAND_QUEUE_PRIORITY)))) + { + return false; + } + + return m_dCommandQueuePriority.PriorityForTypeIsSupported; +} + +// 21: D3D12 Options3 +FEATURE_SUPPORT_GET(BOOL, m_dOptions3, CopyQueueTimestampQueriesSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions3, CastingFullyTypedFormatSupported); +FEATURE_SUPPORT_GET(D3D12_COMMAND_LIST_SUPPORT_FLAGS, m_dOptions3, WriteBufferImmediateSupportFlags); +FEATURE_SUPPORT_GET(D3D12_VIEW_INSTANCING_TIER, m_dOptions3, ViewInstancingTier); +FEATURE_SUPPORT_GET(BOOL, m_dOptions3, BarycentricsSupported); + +// 22: Existing Heaps +FEATURE_SUPPORT_GET_NAME(BOOL, m_dExistingHeaps, Supported, ExistingHeapsSupported); + +// 23: D3D12 Options4 +FEATURE_SUPPORT_GET(BOOL, m_dOptions4, MSAA64KBAlignedTextureSupported); +FEATURE_SUPPORT_GET(D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER, m_dOptions4, SharedResourceCompatibilityTier); +FEATURE_SUPPORT_GET(BOOL, m_dOptions4, Native16BitShaderOpsSupported); + +// 24: Serialization +FEATURE_SUPPORT_GET_NODE_INDEXED(D3D12_HEAP_SERIALIZATION_TIER, m_dSerialization, HeapSerializationTier); + +// 25: Cross Node +// CrossNodeSharingTier handled in D3D12Options +FEATURE_SUPPORT_GET_NAME(BOOL, m_dCrossNode, AtomicShaderInstructions, CrossNodeAtomicShaderInstructions); + +// 27: D3D12 Options5 +FEATURE_SUPPORT_GET(BOOL, m_dOptions5, SRVOnlyTiledResourceTier3); +FEATURE_SUPPORT_GET(D3D12_RENDER_PASS_TIER, m_dOptions5, RenderPassesTier); +FEATURE_SUPPORT_GET(D3D12_RAYTRACING_TIER, m_dOptions5, RaytracingTier); + +// 28: Displayable +FEATURE_SUPPORT_GET(BOOL, m_dDisplayable, DisplayableTexture); +// SharedResourceCompatibilityTier handled in D3D12Options4 + +// 30: D3D12 Options6 +FEATURE_SUPPORT_GET(BOOL, m_dOptions6, AdditionalShadingRatesSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions6, PerPrimitiveShadingRateSupportedWithViewportIndexing); +FEATURE_SUPPORT_GET(D3D12_VARIABLE_SHADING_RATE_TIER, m_dOptions6, VariableShadingRateTier); +FEATURE_SUPPORT_GET(UINT, m_dOptions6, ShadingRateImageTileSize); +FEATURE_SUPPORT_GET(BOOL, m_dOptions6, BackgroundProcessingSupported); + +// 31: Query Meta Command +// Keep the original call routine +inline HRESULT CD3DX12FeatureSupport::QueryMetaCommand(D3D12_FEATURE_DATA_QUERY_META_COMMAND& dQueryMetaCommand) const +{ + return m_pDevice->CheckFeatureSupport(D3D12_FEATURE_QUERY_META_COMMAND, &dQueryMetaCommand, sizeof(D3D12_FEATURE_DATA_QUERY_META_COMMAND)); +} + +// 32: D3D12 Options7 +FEATURE_SUPPORT_GET(D3D12_MESH_SHADER_TIER, m_dOptions7, MeshShaderTier); +FEATURE_SUPPORT_GET(D3D12_SAMPLER_FEEDBACK_TIER, m_dOptions7, SamplerFeedbackTier); + +// 33: Protected Resource Session Type Count +FEATURE_SUPPORT_GET_NODE_INDEXED_NAME(UINT, m_dProtectedResourceSessionTypeCount, Count, ProtectedResourceSessionTypeCount); + +// 34: Protected Resource Session Types +FEATURE_SUPPORT_GET_NODE_INDEXED_NAME(std::vector, m_dProtectedResourceSessionTypes, TypeVec, ProtectedResourceSessionTypes); + +// 36: Options8 +FEATURE_SUPPORT_GET(BOOL, m_dOptions8, UnalignedBlockTexturesSupported); + +// 37: Options9 +FEATURE_SUPPORT_GET(BOOL, m_dOptions9, MeshShaderPipelineStatsSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions9, MeshShaderSupportsFullRangeRenderTargetArrayIndex); +FEATURE_SUPPORT_GET(BOOL, m_dOptions9, AtomicInt64OnTypedResourceSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions9, AtomicInt64OnGroupSharedSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions9, DerivativesInMeshAndAmplificationShadersSupported); +FEATURE_SUPPORT_GET(D3D12_WAVE_MMA_TIER, m_dOptions9, WaveMMATier); + +// 39: Options10 +FEATURE_SUPPORT_GET(BOOL, m_dOptions10, VariableRateShadingSumCombinerSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions10, MeshShaderPerPrimitiveShadingRateSupported); + +// 40: Options11 +FEATURE_SUPPORT_GET(BOOL, m_dOptions11, AtomicInt64OnDescriptorHeapResourceSupported); + +// 41: Options12 +FEATURE_SUPPORT_GET(D3D12_TRI_STATE, m_dOptions12, MSPrimitivesPipelineStatisticIncludesCulledPrimitives); +FEATURE_SUPPORT_GET(BOOL, m_dOptions12, EnhancedBarriersSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions12, RelaxedFormatCastingSupported); + +// 42: Options13 +FEATURE_SUPPORT_GET(BOOL, m_dOptions13, UnrestrictedBufferTextureCopyPitchSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions13, UnrestrictedVertexElementAlignmentSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions13, InvertedViewportHeightFlipsYSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions13, InvertedViewportDepthFlipsZSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions13, TextureCopyBetweenDimensionsSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions13, AlphaBlendFactorSupported); + +// 43: Options14 +FEATURE_SUPPORT_GET(BOOL, m_dOptions14, AdvancedTextureOpsSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions14, WriteableMSAATexturesSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions14, IndependentFrontAndBackStencilRefMaskSupported); + +// 44: Options15 +FEATURE_SUPPORT_GET(BOOL, m_dOptions15, TriangleFanSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions15, DynamicIndexBufferStripCutSupported); + +// Helper function to decide the highest shader model supported by the system +// Stores the result in m_dShaderModel +// Must be updated whenever a new shader model is added to the d3d12.h header +inline HRESULT CD3DX12FeatureSupport::QueryHighestShaderModel() +{ + // Check support in descending order + HRESULT result; + + const D3D_SHADER_MODEL allModelVersions[] = + { + D3D_SHADER_MODEL_6_8, + D3D_SHADER_MODEL_6_7, + D3D_SHADER_MODEL_6_6, + D3D_SHADER_MODEL_6_5, + D3D_SHADER_MODEL_6_4, + D3D_SHADER_MODEL_6_3, + D3D_SHADER_MODEL_6_2, + D3D_SHADER_MODEL_6_1, + D3D_SHADER_MODEL_6_0, + D3D_SHADER_MODEL_5_1 + }; + constexpr size_t numModelVersions = sizeof(allModelVersions) / sizeof(D3D_SHADER_MODEL); + + for (size_t i = 0; i < numModelVersions; i++) + { + m_dShaderModel.HighestShaderModel = allModelVersions[i]; + result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_SHADER_MODEL, &m_dShaderModel, sizeof(D3D12_FEATURE_DATA_SHADER_MODEL)); + if (result != E_INVALIDARG) + { + // Indicates that the version is recognizable by the runtime and stored in the struct + // Also terminate on unexpected error code + if (FAILED(result)) + { + m_dShaderModel.HighestShaderModel = static_cast(0); + } + return result; + } + } + + // Shader model may not be supported. Continue the rest initializations + m_dShaderModel.HighestShaderModel = static_cast(0); + return S_OK; +} + +// Helper function to decide the highest root signature supported +// Must be updated whenever a new root signature version is added to the d3d12.h header +inline HRESULT CD3DX12FeatureSupport::QueryHighestRootSignatureVersion() +{ + HRESULT result; + + const D3D_ROOT_SIGNATURE_VERSION allRootSignatureVersions[] = + { + D3D_ROOT_SIGNATURE_VERSION_1_1, + D3D_ROOT_SIGNATURE_VERSION_1_0, + D3D_ROOT_SIGNATURE_VERSION_1, + }; + constexpr size_t numRootSignatureVersions = sizeof(allRootSignatureVersions) / sizeof(D3D_ROOT_SIGNATURE_VERSION); + + for (size_t i = 0; i < numRootSignatureVersions; i++) + { + m_dRootSignature.HighestVersion = allRootSignatureVersions[i]; + result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_ROOT_SIGNATURE, &m_dRootSignature, sizeof(D3D12_FEATURE_DATA_ROOT_SIGNATURE)); + if (result != E_INVALIDARG) + { + if (FAILED(result)) + { + m_dRootSignature.HighestVersion = static_cast(0); + } + // If succeeded, the highest version is already written into the member struct + return result; + } + } + + // No version left. Set to invalid value and continue. + m_dRootSignature.HighestVersion = static_cast(0); + return S_OK; +} + +// Helper funcion to decide the highest feature level +inline HRESULT CD3DX12FeatureSupport::QueryHighestFeatureLevel() +{ + HRESULT result; + + // Check against a list of all feature levels present in d3dcommon.h + // Needs to be updated for future feature levels + const D3D_FEATURE_LEVEL allLevels[] = + { + D3D_FEATURE_LEVEL_12_2, + D3D_FEATURE_LEVEL_12_1, + D3D_FEATURE_LEVEL_12_0, + D3D_FEATURE_LEVEL_11_1, + D3D_FEATURE_LEVEL_11_0, + D3D_FEATURE_LEVEL_10_1, + D3D_FEATURE_LEVEL_10_0, + D3D_FEATURE_LEVEL_9_3, + D3D_FEATURE_LEVEL_9_2, + D3D_FEATURE_LEVEL_9_1, + D3D_FEATURE_LEVEL_1_0_CORE + }; + + D3D12_FEATURE_DATA_FEATURE_LEVELS dFeatureLevel; + dFeatureLevel.NumFeatureLevels = static_cast(sizeof(allLevels) / sizeof(D3D_FEATURE_LEVEL)); + dFeatureLevel.pFeatureLevelsRequested = allLevels; + + result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_FEATURE_LEVELS, &dFeatureLevel, sizeof(D3D12_FEATURE_DATA_FEATURE_LEVELS)); + if (SUCCEEDED(result)) + { + m_eMaxFeatureLevel = dFeatureLevel.MaxSupportedFeatureLevel; + } + else + { + m_eMaxFeatureLevel = static_cast(0); + + if (result == DXGI_ERROR_UNSUPPORTED) + { + // Indicates that none supported. Continue initialization + result = S_OK; + } + } + return result; +} + +// Helper function to initialize local protected resource session types structs +inline HRESULT CD3DX12FeatureSupport::QueryProtectedResourceSessionTypes(UINT NodeIndex, UINT Count) +{ + auto& CurrentPRSTypes = m_dProtectedResourceSessionTypes[NodeIndex]; + CurrentPRSTypes.NodeIndex = NodeIndex; + CurrentPRSTypes.Count = Count; + CurrentPRSTypes.TypeVec.resize(CurrentPRSTypes.Count); + CurrentPRSTypes.pTypes = CurrentPRSTypes.TypeVec.data(); + + HRESULT result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_TYPES, &m_dProtectedResourceSessionTypes[NodeIndex], sizeof(D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPES)); + if (FAILED(result)) + { + // Resize TypeVec to empty + CurrentPRSTypes.TypeVec.clear(); + } + + return result; +} + +#undef FEATURE_SUPPORT_GET +#undef FEATURE_SUPPORT_GET_NAME +#undef FEATURE_SUPPORT_GET_NODE_INDEXED +#undef FEATURE_SUPPORT_GET_NODE_INDEXED_NAME + +// end CD3DX12FeatureSupport + +#endif // !D3DX12_NO_CHECK_FEATURE_SUPPORT_CLASS + +#undef D3DX12_COM_PTR +#undef D3DX12_COM_PTR_GET +#undef D3DX12_COM_PTR_ADDRESSOF + +#endif // defined( __cplusplus ) + +#endif //__D3DX12_H__ + diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/dxcore.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/dxcore.h new file mode 100644 index 0000000..4244eaa --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/dxcore.h @@ -0,0 +1,41 @@ +/************************************************************ +* * +* Copyright (c) Microsoft Corporation. * +* Licensed under the MIT license. * +* * +************************************************************/ + +#ifndef _DXCOREEXTMODULE_H_ +#define _DXCOREEXTMODULE_H_ + +#include +#include "dxcore_interface.h" + +#pragma region Application Family or OneCore Family +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) + +#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10) + +STDAPI +DXCoreCreateAdapterFactory( + REFIID riid, + _COM_Outptr_ void** ppvFactory +); + +template +HRESULT +DXCoreCreateAdapterFactory( + _COM_Outptr_ T** ppvFactory +) +{ + return DXCoreCreateAdapterFactory(IID_PPV_ARGS(ppvFactory)); +} + +#endif // (_WIN32_WINNT >= _WIN32_WINNT_WIN10) + +#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */ +#pragma endregion + +#endif // _DXCOREEXTMODULE_H_ + + diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/dxcore_interface.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/dxcore_interface.h new file mode 100644 index 0000000..b487fe1 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/dxcore_interface.h @@ -0,0 +1,316 @@ +// +// DXCore Interface +// Copyright (C) Microsoft Corporation. +// Licensed under the MIT license. +// + +#ifndef __dxcore_interface_h__ +#define __dxcore_interface_h__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#include + +#ifdef __cplusplus + +#define _FACDXCORE 0x880 +#define MAKE_DXCORE_HRESULT( code ) MAKE_HRESULT( 1, _FACDXCORE, code ) + +enum class DXCoreAdapterProperty : uint32_t +{ + InstanceLuid = 0, + DriverVersion = 1, + DriverDescription = 2, + HardwareID = 3, // Use HardwareIDParts instead, if available. + KmdModelVersion = 4, + ComputePreemptionGranularity = 5, + GraphicsPreemptionGranularity = 6, + DedicatedAdapterMemory = 7, + DedicatedSystemMemory = 8, + SharedSystemMemory = 9, + AcgCompatible = 10, + IsHardware = 11, + IsIntegrated = 12, + IsDetachable = 13, + HardwareIDParts = 14 +}; + +enum class DXCoreAdapterState : uint32_t +{ + IsDriverUpdateInProgress = 0, + AdapterMemoryBudget = 1 +}; + +enum class DXCoreSegmentGroup : uint32_t +{ + Local = 0, + NonLocal = 1 +}; + +enum class DXCoreNotificationType : uint32_t +{ + AdapterListStale = 0, + AdapterNoLongerValid = 1, + AdapterBudgetChange = 2, + AdapterHardwareContentProtectionTeardown = 3 +}; + +enum class DXCoreAdapterPreference : uint32_t +{ + Hardware = 0, + MinimumPower = 1, + HighPerformance = 2 +}; + +struct DXCoreHardwareID +{ + uint32_t vendorID; + uint32_t deviceID; + uint32_t subSysID; + uint32_t revision; +}; + +struct DXCoreHardwareIDParts +{ + uint32_t vendorID; + uint32_t deviceID; + uint32_t subSystemID; + uint32_t subVendorID; + uint32_t revisionID; +}; + +struct DXCoreAdapterMemoryBudgetNodeSegmentGroup +{ + uint32_t nodeIndex; + DXCoreSegmentGroup segmentGroup; +}; + +struct DXCoreAdapterMemoryBudget +{ + uint64_t budget; + uint64_t currentUsage; + uint64_t availableForReservation; + uint64_t currentReservation; +}; + +typedef void (STDMETHODCALLTYPE *PFN_DXCORE_NOTIFICATION_CALLBACK)( + DXCoreNotificationType notificationType, + _In_ IUnknown *object, + _In_opt_ void *context); + +static_assert(sizeof(bool) == 1, "bool assumed as one byte"); + +DEFINE_GUID(IID_IDXCoreAdapterFactory, 0x78ee5945, 0xc36e, 0x4b13, 0xa6, 0x69, 0x00, 0x5d, 0xd1, 0x1c, 0x0f, 0x06); +DEFINE_GUID(IID_IDXCoreAdapterList, 0x526c7776, 0x40e9, 0x459b, 0xb7, 0x11, 0xf3, 0x2a, 0xd7, 0x6d, 0xfc, 0x28); +DEFINE_GUID(IID_IDXCoreAdapter, 0xf0db4c7f, 0xfe5a, 0x42a2, 0xbd, 0x62, 0xf2, 0xa6, 0xcf, 0x6f, 0xc8, 0x3e); +DEFINE_GUID(DXCORE_ADAPTER_ATTRIBUTE_D3D11_GRAPHICS, 0x8c47866b, 0x7583, 0x450d, 0xf0, 0xf0, 0x6b, 0xad, 0xa8, 0x95, 0xaf, 0x4b); +DEFINE_GUID(DXCORE_ADAPTER_ATTRIBUTE_D3D12_GRAPHICS, 0x0c9ece4d, 0x2f6e, 0x4f01, 0x8c, 0x96, 0xe8, 0x9e, 0x33, 0x1b, 0x47, 0xb1); +DEFINE_GUID(DXCORE_ADAPTER_ATTRIBUTE_D3D12_CORE_COMPUTE, 0x248e2800, 0xa793, 0x4724, 0xab, 0xaa, 0x23, 0xa6, 0xde, 0x1b, 0xe0, 0x90); + +/* interface IDXCoreAdapter */ +MIDL_INTERFACE("f0db4c7f-fe5a-42a2-bd62-f2a6cf6fc83e") +IDXCoreAdapter : public IUnknown +{ +public: + virtual bool STDMETHODCALLTYPE IsValid() = 0; + + virtual bool STDMETHODCALLTYPE IsAttributeSupported( + REFGUID attributeGUID) = 0; + + virtual bool STDMETHODCALLTYPE IsPropertySupported( + DXCoreAdapterProperty property) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetProperty( + DXCoreAdapterProperty property, + size_t bufferSize, + _Out_writes_bytes_(bufferSize) void *propertyData) = 0; + + template + HRESULT GetProperty( + DXCoreAdapterProperty property, + _Out_writes_bytes_(sizeof(T)) T *propertyData) + { + return GetProperty(property, + sizeof(T), + (void*)propertyData); + } + + virtual HRESULT STDMETHODCALLTYPE GetPropertySize( + DXCoreAdapterProperty property, + _Out_ size_t *bufferSize) = 0; + + virtual bool STDMETHODCALLTYPE IsQueryStateSupported( + DXCoreAdapterState property) = 0; + + virtual HRESULT STDMETHODCALLTYPE QueryState( + DXCoreAdapterState state, + size_t inputStateDetailsSize, + _In_reads_bytes_opt_(inputStateDetailsSize) const void *inputStateDetails, + size_t outputBufferSize, + _Out_writes_bytes_(outputBufferSize) void *outputBuffer) = 0; + + template + HRESULT QueryState( + DXCoreAdapterState state, + _In_reads_bytes_opt_(sizeof(T1)) const T1 *inputStateDetails, + _Out_writes_bytes_(sizeof(T2)) T2 *outputBuffer) + { + return QueryState(state, + sizeof(T1), + (const void*)inputStateDetails, + sizeof(T2), + (void*)outputBuffer); + } + + template + HRESULT QueryState( + DXCoreAdapterState state, + _Out_writes_bytes_(sizeof(T)) T *outputBuffer) + { + return QueryState(state, + 0, + nullptr, + sizeof(T), + (void*)outputBuffer); + } + + virtual bool STDMETHODCALLTYPE IsSetStateSupported( + DXCoreAdapterState property) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetState( + DXCoreAdapterState state, + size_t inputStateDetailsSize, + _In_reads_bytes_opt_(inputStateDetailsSize) const void *inputStateDetails, + size_t inputDataSize, + _In_reads_bytes_(inputDataSize) const void *inputData) = 0; + + template + HRESULT SetState( + DXCoreAdapterState state, + const T1 *inputStateDetails, + const T2 *inputData) + { + return SetState(state, + sizeof(T1), + (const void*)inputStateDetails, + sizeof(T2), + (const void*)inputData); + } + + virtual HRESULT STDMETHODCALLTYPE GetFactory( + REFIID riid, + _COM_Outptr_ void** ppvFactory + ) = 0; + + template + HRESULT GetFactory( + _COM_Outptr_ T** ppvFactory + ) + { + return GetFactory(IID_PPV_ARGS(ppvFactory)); + } +}; + +/* interface IDXCoreAdapterList */ +MIDL_INTERFACE("526c7776-40e9-459b-b711-f32ad76dfc28") +IDXCoreAdapterList : public IUnknown +{ +public: + virtual HRESULT STDMETHODCALLTYPE GetAdapter( + uint32_t index, + REFIID riid, + _COM_Outptr_ void **ppvAdapter) = 0; + + template + HRESULT STDMETHODCALLTYPE GetAdapter( + uint32_t index, + _COM_Outptr_ T **ppvAdapter) + { + return GetAdapter(index, + IID_PPV_ARGS(ppvAdapter)); + } + + virtual uint32_t STDMETHODCALLTYPE GetAdapterCount() = 0; + + virtual bool STDMETHODCALLTYPE IsStale() = 0; + + virtual HRESULT STDMETHODCALLTYPE GetFactory( + REFIID riid, + _COM_Outptr_ void** ppvFactory + ) = 0; + + template + HRESULT GetFactory( + _COM_Outptr_ T** ppvFactory + ) + { + return GetFactory(IID_PPV_ARGS(ppvFactory)); + } + + virtual HRESULT STDMETHODCALLTYPE Sort( + uint32_t numPreferences, + _In_reads_(numPreferences) const DXCoreAdapterPreference* preferences) = 0; + + virtual bool STDMETHODCALLTYPE IsAdapterPreferenceSupported( + DXCoreAdapterPreference preference) = 0; +}; + +/* interface IDXCoreAdapterFactory */ +MIDL_INTERFACE("78ee5945-c36e-4b13-a669-005dd11c0f06") +IDXCoreAdapterFactory : public IUnknown +{ +public: + + virtual HRESULT STDMETHODCALLTYPE CreateAdapterList( + uint32_t numAttributes, + _In_reads_(numAttributes) const GUID *filterAttributes, + REFIID riid, + _COM_Outptr_ void **ppvAdapterList) = 0; + + template + HRESULT STDMETHODCALLTYPE CreateAdapterList( + uint32_t numAttributes, + _In_reads_(numAttributes) const GUID *filterAttributes, + _COM_Outptr_ T **ppvAdapterList) + { + return CreateAdapterList(numAttributes, + filterAttributes, + IID_PPV_ARGS(ppvAdapterList)); + } + + virtual HRESULT STDMETHODCALLTYPE GetAdapterByLuid( + const LUID &adapterLUID, + REFIID riid, + _COM_Outptr_ void **ppvAdapter) = 0; + + template + HRESULT STDMETHODCALLTYPE GetAdapterByLuid( + const LUID &adapterLUID, + _COM_Outptr_ T **ppvAdapter) + { + return GetAdapterByLuid(adapterLUID, + IID_PPV_ARGS(ppvAdapter)); + } + + virtual bool STDMETHODCALLTYPE IsNotificationTypeSupported( + DXCoreNotificationType notificationType) = 0; + + virtual HRESULT STDMETHODCALLTYPE RegisterEventNotification( + _In_ IUnknown *dxCoreObject, + DXCoreNotificationType notificationType, + _In_ PFN_DXCORE_NOTIFICATION_CALLBACK callbackFunction, + _In_opt_ void *callbackContext, + _Out_ uint32_t *eventCookie) = 0; + + virtual HRESULT STDMETHODCALLTYPE UnregisterEventNotification( + uint32_t eventCookie) = 0; +}; + +#endif // __cplusplus + +#endif // __dxcore_interface_h__ + + diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/dxgicommon.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/dxgicommon.h new file mode 100644 index 0000000..f83aa01 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/dxgicommon.h @@ -0,0 +1,57 @@ +// +// Copyright (C) Microsoft Corporation. +// Licensed under the MIT license +// + +#ifndef __dxgicommon_h__ +#define __dxgicommon_h__ + + +typedef struct DXGI_RATIONAL +{ + UINT Numerator; + UINT Denominator; +} DXGI_RATIONAL; + +// The following values are used with DXGI_SAMPLE_DESC::Quality: +#define DXGI_STANDARD_MULTISAMPLE_QUALITY_PATTERN 0xffffffff +#define DXGI_CENTER_MULTISAMPLE_QUALITY_PATTERN 0xfffffffe + +typedef struct DXGI_SAMPLE_DESC +{ + UINT Count; + UINT Quality; +} DXGI_SAMPLE_DESC; + +typedef enum DXGI_COLOR_SPACE_TYPE +{ + DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 = 0, + DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 = 1, + DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P709 = 2, + DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P2020 = 3, + DXGI_COLOR_SPACE_RESERVED = 4, + DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 = 5, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 = 6, + DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P601 = 7, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 = 8, + DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P709 = 9, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 = 10, + DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 = 11, + DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 = 12, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_LEFT_P2020 = 13, + DXGI_COLOR_SPACE_RGB_STUDIO_G2084_NONE_P2020 = 14, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_TOPLEFT_P2020 = 15, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_TOPLEFT_P2020 = 16, + DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P2020 = 17, + DXGI_COLOR_SPACE_YCBCR_STUDIO_GHLG_TOPLEFT_P2020 = 18, + DXGI_COLOR_SPACE_YCBCR_FULL_GHLG_TOPLEFT_P2020 = 19, + DXGI_COLOR_SPACE_RGB_STUDIO_G24_NONE_P709 = 20, + DXGI_COLOR_SPACE_RGB_STUDIO_G24_NONE_P2020 = 21, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G24_LEFT_P709 = 22, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G24_LEFT_P2020 = 23, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G24_TOPLEFT_P2020 = 24, + DXGI_COLOR_SPACE_CUSTOM = 0xFFFFFFFF +} DXGI_COLOR_SPACE_TYPE; + +#endif // __dxgicommon_h__ + diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/dxgicommon.idl b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/dxgicommon.idl new file mode 100644 index 0000000..ab73230 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/dxgicommon.idl @@ -0,0 +1,52 @@ +// +// Copyright (C) Microsoft Corporation. +// Licensed under the MIT license +// + + +typedef struct DXGI_RATIONAL +{ + UINT Numerator; + UINT Denominator; +} DXGI_RATIONAL; + +// The following values are used with DXGI_SAMPLE_DESC::Quality: +#define DXGI_STANDARD_MULTISAMPLE_QUALITY_PATTERN 0xffffffff +#define DXGI_CENTER_MULTISAMPLE_QUALITY_PATTERN 0xfffffffe + +typedef struct DXGI_SAMPLE_DESC +{ + UINT Count; + UINT Quality; +} DXGI_SAMPLE_DESC; + +typedef enum DXGI_COLOR_SPACE_TYPE +{ + DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 = 0, + DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 = 1, + DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P709 = 2, + DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P2020 = 3, + DXGI_COLOR_SPACE_RESERVED = 4, + DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 = 5, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 = 6, + DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P601 = 7, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 = 8, + DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P709 = 9, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 = 10, + DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 = 11, + DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 = 12, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_LEFT_P2020 = 13, + DXGI_COLOR_SPACE_RGB_STUDIO_G2084_NONE_P2020 = 14, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_TOPLEFT_P2020 = 15, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_TOPLEFT_P2020 = 16, + DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P2020 = 17, + DXGI_COLOR_SPACE_YCBCR_STUDIO_GHLG_TOPLEFT_P2020 = 18, + DXGI_COLOR_SPACE_YCBCR_FULL_GHLG_TOPLEFT_P2020 = 19, + DXGI_COLOR_SPACE_RGB_STUDIO_G24_NONE_P709 = 20, + DXGI_COLOR_SPACE_RGB_STUDIO_G24_NONE_P2020 = 21, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G24_LEFT_P709 = 22, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G24_LEFT_P2020 = 23, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G24_TOPLEFT_P2020 = 24, + DXGI_COLOR_SPACE_CUSTOM = 0xFFFFFFFF +} DXGI_COLOR_SPACE_TYPE; + diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/dxgiformat.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/dxgiformat.h new file mode 100644 index 0000000..52aae1b --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/dxgiformat.h @@ -0,0 +1,142 @@ +// +// Copyright (C) Microsoft Corporation. +// Licensed under the MIT license +// + +#ifndef __dxgiformat_h__ +#define __dxgiformat_h__ + +#define DXGI_FORMAT_DEFINED 1 + +typedef enum DXGI_FORMAT +{ + DXGI_FORMAT_UNKNOWN = 0, + DXGI_FORMAT_R32G32B32A32_TYPELESS = 1, + DXGI_FORMAT_R32G32B32A32_FLOAT = 2, + DXGI_FORMAT_R32G32B32A32_UINT = 3, + DXGI_FORMAT_R32G32B32A32_SINT = 4, + DXGI_FORMAT_R32G32B32_TYPELESS = 5, + DXGI_FORMAT_R32G32B32_FLOAT = 6, + DXGI_FORMAT_R32G32B32_UINT = 7, + DXGI_FORMAT_R32G32B32_SINT = 8, + DXGI_FORMAT_R16G16B16A16_TYPELESS = 9, + DXGI_FORMAT_R16G16B16A16_FLOAT = 10, + DXGI_FORMAT_R16G16B16A16_UNORM = 11, + DXGI_FORMAT_R16G16B16A16_UINT = 12, + DXGI_FORMAT_R16G16B16A16_SNORM = 13, + DXGI_FORMAT_R16G16B16A16_SINT = 14, + DXGI_FORMAT_R32G32_TYPELESS = 15, + DXGI_FORMAT_R32G32_FLOAT = 16, + DXGI_FORMAT_R32G32_UINT = 17, + DXGI_FORMAT_R32G32_SINT = 18, + DXGI_FORMAT_R32G8X24_TYPELESS = 19, + DXGI_FORMAT_D32_FLOAT_S8X24_UINT = 20, + DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS = 21, + DXGI_FORMAT_X32_TYPELESS_G8X24_UINT = 22, + DXGI_FORMAT_R10G10B10A2_TYPELESS = 23, + DXGI_FORMAT_R10G10B10A2_UNORM = 24, + DXGI_FORMAT_R10G10B10A2_UINT = 25, + DXGI_FORMAT_R11G11B10_FLOAT = 26, + DXGI_FORMAT_R8G8B8A8_TYPELESS = 27, + DXGI_FORMAT_R8G8B8A8_UNORM = 28, + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29, + DXGI_FORMAT_R8G8B8A8_UINT = 30, + DXGI_FORMAT_R8G8B8A8_SNORM = 31, + DXGI_FORMAT_R8G8B8A8_SINT = 32, + DXGI_FORMAT_R16G16_TYPELESS = 33, + DXGI_FORMAT_R16G16_FLOAT = 34, + DXGI_FORMAT_R16G16_UNORM = 35, + DXGI_FORMAT_R16G16_UINT = 36, + DXGI_FORMAT_R16G16_SNORM = 37, + DXGI_FORMAT_R16G16_SINT = 38, + DXGI_FORMAT_R32_TYPELESS = 39, + DXGI_FORMAT_D32_FLOAT = 40, + DXGI_FORMAT_R32_FLOAT = 41, + DXGI_FORMAT_R32_UINT = 42, + DXGI_FORMAT_R32_SINT = 43, + DXGI_FORMAT_R24G8_TYPELESS = 44, + DXGI_FORMAT_D24_UNORM_S8_UINT = 45, + DXGI_FORMAT_R24_UNORM_X8_TYPELESS = 46, + DXGI_FORMAT_X24_TYPELESS_G8_UINT = 47, + DXGI_FORMAT_R8G8_TYPELESS = 48, + DXGI_FORMAT_R8G8_UNORM = 49, + DXGI_FORMAT_R8G8_UINT = 50, + DXGI_FORMAT_R8G8_SNORM = 51, + DXGI_FORMAT_R8G8_SINT = 52, + DXGI_FORMAT_R16_TYPELESS = 53, + DXGI_FORMAT_R16_FLOAT = 54, + DXGI_FORMAT_D16_UNORM = 55, + DXGI_FORMAT_R16_UNORM = 56, + DXGI_FORMAT_R16_UINT = 57, + DXGI_FORMAT_R16_SNORM = 58, + DXGI_FORMAT_R16_SINT = 59, + DXGI_FORMAT_R8_TYPELESS = 60, + DXGI_FORMAT_R8_UNORM = 61, + DXGI_FORMAT_R8_UINT = 62, + DXGI_FORMAT_R8_SNORM = 63, + DXGI_FORMAT_R8_SINT = 64, + DXGI_FORMAT_A8_UNORM = 65, + DXGI_FORMAT_R1_UNORM = 66, + DXGI_FORMAT_R9G9B9E5_SHAREDEXP = 67, + DXGI_FORMAT_R8G8_B8G8_UNORM = 68, + DXGI_FORMAT_G8R8_G8B8_UNORM = 69, + DXGI_FORMAT_BC1_TYPELESS = 70, + DXGI_FORMAT_BC1_UNORM = 71, + DXGI_FORMAT_BC1_UNORM_SRGB = 72, + DXGI_FORMAT_BC2_TYPELESS = 73, + DXGI_FORMAT_BC2_UNORM = 74, + DXGI_FORMAT_BC2_UNORM_SRGB = 75, + DXGI_FORMAT_BC3_TYPELESS = 76, + DXGI_FORMAT_BC3_UNORM = 77, + DXGI_FORMAT_BC3_UNORM_SRGB = 78, + DXGI_FORMAT_BC4_TYPELESS = 79, + DXGI_FORMAT_BC4_UNORM = 80, + DXGI_FORMAT_BC4_SNORM = 81, + DXGI_FORMAT_BC5_TYPELESS = 82, + DXGI_FORMAT_BC5_UNORM = 83, + DXGI_FORMAT_BC5_SNORM = 84, + DXGI_FORMAT_B5G6R5_UNORM = 85, + DXGI_FORMAT_B5G5R5A1_UNORM = 86, + DXGI_FORMAT_B8G8R8A8_UNORM = 87, + DXGI_FORMAT_B8G8R8X8_UNORM = 88, + DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM = 89, + DXGI_FORMAT_B8G8R8A8_TYPELESS = 90, + DXGI_FORMAT_B8G8R8A8_UNORM_SRGB = 91, + DXGI_FORMAT_B8G8R8X8_TYPELESS = 92, + DXGI_FORMAT_B8G8R8X8_UNORM_SRGB = 93, + DXGI_FORMAT_BC6H_TYPELESS = 94, + DXGI_FORMAT_BC6H_UF16 = 95, + DXGI_FORMAT_BC6H_SF16 = 96, + DXGI_FORMAT_BC7_TYPELESS = 97, + DXGI_FORMAT_BC7_UNORM = 98, + DXGI_FORMAT_BC7_UNORM_SRGB = 99, + DXGI_FORMAT_AYUV = 100, + DXGI_FORMAT_Y410 = 101, + DXGI_FORMAT_Y416 = 102, + DXGI_FORMAT_NV12 = 103, + DXGI_FORMAT_P010 = 104, + DXGI_FORMAT_P016 = 105, + DXGI_FORMAT_420_OPAQUE = 106, + DXGI_FORMAT_YUY2 = 107, + DXGI_FORMAT_Y210 = 108, + DXGI_FORMAT_Y216 = 109, + DXGI_FORMAT_NV11 = 110, + DXGI_FORMAT_AI44 = 111, + DXGI_FORMAT_IA44 = 112, + DXGI_FORMAT_P8 = 113, + DXGI_FORMAT_A8P8 = 114, + DXGI_FORMAT_B4G4R4A4_UNORM = 115, + + DXGI_FORMAT_P208 = 130, + DXGI_FORMAT_V208 = 131, + DXGI_FORMAT_V408 = 132, + + + DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE = 189, + DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE = 190, + + + DXGI_FORMAT_FORCE_UINT = 0xffffffff +} DXGI_FORMAT; + +#endif // __dxgiformat_h__ diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/dxgiformat.idl b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/dxgiformat.idl new file mode 100644 index 0000000..d9576ef --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directx/dxgiformat.idl @@ -0,0 +1,137 @@ +// +// Copyright (C) Microsoft Corporation. +// Licensed under the MIT license +// + + +typedef enum DXGI_FORMAT +{ + DXGI_FORMAT_UNKNOWN = 0, + DXGI_FORMAT_R32G32B32A32_TYPELESS = 1, + DXGI_FORMAT_R32G32B32A32_FLOAT = 2, + DXGI_FORMAT_R32G32B32A32_UINT = 3, + DXGI_FORMAT_R32G32B32A32_SINT = 4, + DXGI_FORMAT_R32G32B32_TYPELESS = 5, + DXGI_FORMAT_R32G32B32_FLOAT = 6, + DXGI_FORMAT_R32G32B32_UINT = 7, + DXGI_FORMAT_R32G32B32_SINT = 8, + DXGI_FORMAT_R16G16B16A16_TYPELESS = 9, + DXGI_FORMAT_R16G16B16A16_FLOAT = 10, + DXGI_FORMAT_R16G16B16A16_UNORM = 11, + DXGI_FORMAT_R16G16B16A16_UINT = 12, + DXGI_FORMAT_R16G16B16A16_SNORM = 13, + DXGI_FORMAT_R16G16B16A16_SINT = 14, + DXGI_FORMAT_R32G32_TYPELESS = 15, + DXGI_FORMAT_R32G32_FLOAT = 16, + DXGI_FORMAT_R32G32_UINT = 17, + DXGI_FORMAT_R32G32_SINT = 18, + DXGI_FORMAT_R32G8X24_TYPELESS = 19, + DXGI_FORMAT_D32_FLOAT_S8X24_UINT = 20, + DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS = 21, + DXGI_FORMAT_X32_TYPELESS_G8X24_UINT = 22, + DXGI_FORMAT_R10G10B10A2_TYPELESS = 23, + DXGI_FORMAT_R10G10B10A2_UNORM = 24, + DXGI_FORMAT_R10G10B10A2_UINT = 25, + DXGI_FORMAT_R11G11B10_FLOAT = 26, + DXGI_FORMAT_R8G8B8A8_TYPELESS = 27, + DXGI_FORMAT_R8G8B8A8_UNORM = 28, + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29, + DXGI_FORMAT_R8G8B8A8_UINT = 30, + DXGI_FORMAT_R8G8B8A8_SNORM = 31, + DXGI_FORMAT_R8G8B8A8_SINT = 32, + DXGI_FORMAT_R16G16_TYPELESS = 33, + DXGI_FORMAT_R16G16_FLOAT = 34, + DXGI_FORMAT_R16G16_UNORM = 35, + DXGI_FORMAT_R16G16_UINT = 36, + DXGI_FORMAT_R16G16_SNORM = 37, + DXGI_FORMAT_R16G16_SINT = 38, + DXGI_FORMAT_R32_TYPELESS = 39, + DXGI_FORMAT_D32_FLOAT = 40, + DXGI_FORMAT_R32_FLOAT = 41, + DXGI_FORMAT_R32_UINT = 42, + DXGI_FORMAT_R32_SINT = 43, + DXGI_FORMAT_R24G8_TYPELESS = 44, + DXGI_FORMAT_D24_UNORM_S8_UINT = 45, + DXGI_FORMAT_R24_UNORM_X8_TYPELESS = 46, + DXGI_FORMAT_X24_TYPELESS_G8_UINT = 47, + DXGI_FORMAT_R8G8_TYPELESS = 48, + DXGI_FORMAT_R8G8_UNORM = 49, + DXGI_FORMAT_R8G8_UINT = 50, + DXGI_FORMAT_R8G8_SNORM = 51, + DXGI_FORMAT_R8G8_SINT = 52, + DXGI_FORMAT_R16_TYPELESS = 53, + DXGI_FORMAT_R16_FLOAT = 54, + DXGI_FORMAT_D16_UNORM = 55, + DXGI_FORMAT_R16_UNORM = 56, + DXGI_FORMAT_R16_UINT = 57, + DXGI_FORMAT_R16_SNORM = 58, + DXGI_FORMAT_R16_SINT = 59, + DXGI_FORMAT_R8_TYPELESS = 60, + DXGI_FORMAT_R8_UNORM = 61, + DXGI_FORMAT_R8_UINT = 62, + DXGI_FORMAT_R8_SNORM = 63, + DXGI_FORMAT_R8_SINT = 64, + DXGI_FORMAT_A8_UNORM = 65, + DXGI_FORMAT_R1_UNORM = 66, + DXGI_FORMAT_R9G9B9E5_SHAREDEXP = 67, + DXGI_FORMAT_R8G8_B8G8_UNORM = 68, + DXGI_FORMAT_G8R8_G8B8_UNORM = 69, + DXGI_FORMAT_BC1_TYPELESS = 70, + DXGI_FORMAT_BC1_UNORM = 71, + DXGI_FORMAT_BC1_UNORM_SRGB = 72, + DXGI_FORMAT_BC2_TYPELESS = 73, + DXGI_FORMAT_BC2_UNORM = 74, + DXGI_FORMAT_BC2_UNORM_SRGB = 75, + DXGI_FORMAT_BC3_TYPELESS = 76, + DXGI_FORMAT_BC3_UNORM = 77, + DXGI_FORMAT_BC3_UNORM_SRGB = 78, + DXGI_FORMAT_BC4_TYPELESS = 79, + DXGI_FORMAT_BC4_UNORM = 80, + DXGI_FORMAT_BC4_SNORM = 81, + DXGI_FORMAT_BC5_TYPELESS = 82, + DXGI_FORMAT_BC5_UNORM = 83, + DXGI_FORMAT_BC5_SNORM = 84, + DXGI_FORMAT_B5G6R5_UNORM = 85, + DXGI_FORMAT_B5G5R5A1_UNORM = 86, + DXGI_FORMAT_B8G8R8A8_UNORM = 87, + DXGI_FORMAT_B8G8R8X8_UNORM = 88, + DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM = 89, + DXGI_FORMAT_B8G8R8A8_TYPELESS = 90, + DXGI_FORMAT_B8G8R8A8_UNORM_SRGB = 91, + DXGI_FORMAT_B8G8R8X8_TYPELESS = 92, + DXGI_FORMAT_B8G8R8X8_UNORM_SRGB = 93, + DXGI_FORMAT_BC6H_TYPELESS = 94, + DXGI_FORMAT_BC6H_UF16 = 95, + DXGI_FORMAT_BC6H_SF16 = 96, + DXGI_FORMAT_BC7_TYPELESS = 97, + DXGI_FORMAT_BC7_UNORM = 98, + DXGI_FORMAT_BC7_UNORM_SRGB = 99, + DXGI_FORMAT_AYUV = 100, + DXGI_FORMAT_Y410 = 101, + DXGI_FORMAT_Y416 = 102, + DXGI_FORMAT_NV12 = 103, + DXGI_FORMAT_P010 = 104, + DXGI_FORMAT_P016 = 105, + DXGI_FORMAT_420_OPAQUE = 106, + DXGI_FORMAT_YUY2 = 107, + DXGI_FORMAT_Y210 = 108, + DXGI_FORMAT_Y216 = 109, + DXGI_FORMAT_NV11 = 110, + DXGI_FORMAT_AI44 = 111, + DXGI_FORMAT_IA44 = 112, + DXGI_FORMAT_P8 = 113, + DXGI_FORMAT_A8P8 = 114, + DXGI_FORMAT_B4G4R4A4_UNORM = 115, + + DXGI_FORMAT_P208 = 130, + DXGI_FORMAT_V208 = 131, + DXGI_FORMAT_V408 = 132, + + + DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE = 189, + DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE = 190, + + + DXGI_FORMAT_FORCE_UINT = 0xffffffff +} DXGI_FORMAT; + diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXCollision.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXCollision.h new file mode 100644 index 0000000..989c469 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXCollision.h @@ -0,0 +1,359 @@ +//------------------------------------------------------------------------------------- +// DirectXCollision.h -- C++ Collision Math library +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +// +// http://go.microsoft.com/fwlink/?LinkID=615560 +//------------------------------------------------------------------------------------- + +#pragma once + +#include "DirectXMath.h" + +namespace DirectX +{ + + enum ContainmentType + { + DISJOINT = 0, + INTERSECTS = 1, + CONTAINS = 2 + }; + + enum PlaneIntersectionType + { + FRONT = 0, + INTERSECTING = 1, + BACK = 2 + }; + + struct BoundingBox; + struct BoundingOrientedBox; + struct BoundingFrustum; + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4324 4820) + // C4324: alignment padding warnings + // C4820: Off by default noise +#endif + + //------------------------------------------------------------------------------------- + // Bounding sphere + //------------------------------------------------------------------------------------- + struct BoundingSphere + { + XMFLOAT3 Center; // Center of the sphere. + float Radius; // Radius of the sphere. + + // Creators + BoundingSphere() noexcept : Center(0, 0, 0), Radius(1.f) {} + + BoundingSphere(const BoundingSphere&) = default; + BoundingSphere& operator=(const BoundingSphere&) = default; + + BoundingSphere(BoundingSphere&&) = default; + BoundingSphere& operator=(BoundingSphere&&) = default; + + constexpr BoundingSphere(_In_ const XMFLOAT3& center, _In_ float radius) noexcept + : Center(center), Radius(radius) {} + + // Methods + void XM_CALLCONV Transform(_Out_ BoundingSphere& Out, _In_ FXMMATRIX M) const noexcept; + void XM_CALLCONV Transform(_Out_ BoundingSphere& Out, _In_ float Scale, _In_ FXMVECTOR Rotation, _In_ FXMVECTOR Translation) const noexcept; + // Transform the sphere + + ContainmentType XM_CALLCONV Contains(_In_ FXMVECTOR Point) const noexcept; + ContainmentType XM_CALLCONV Contains(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, _In_ FXMVECTOR V2) const noexcept; + ContainmentType Contains(_In_ const BoundingSphere& sh) const noexcept; + ContainmentType Contains(_In_ const BoundingBox& box) const noexcept; + ContainmentType Contains(_In_ const BoundingOrientedBox& box) const noexcept; + ContainmentType Contains(_In_ const BoundingFrustum& fr) const noexcept; + + bool Intersects(_In_ const BoundingSphere& sh) const noexcept; + bool Intersects(_In_ const BoundingBox& box) const noexcept; + bool Intersects(_In_ const BoundingOrientedBox& box) const noexcept; + bool Intersects(_In_ const BoundingFrustum& fr) const noexcept; + + bool XM_CALLCONV Intersects(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, _In_ FXMVECTOR V2) const noexcept; + // Triangle-sphere test + + PlaneIntersectionType XM_CALLCONV Intersects(_In_ FXMVECTOR Plane) const noexcept; + // Plane-sphere test + + bool XM_CALLCONV Intersects(_In_ FXMVECTOR Origin, _In_ FXMVECTOR Direction, _Out_ float& Dist) const noexcept; + // Ray-sphere test + + ContainmentType XM_CALLCONV ContainedBy(_In_ FXMVECTOR Plane0, _In_ FXMVECTOR Plane1, _In_ FXMVECTOR Plane2, + _In_ GXMVECTOR Plane3, _In_ HXMVECTOR Plane4, _In_ HXMVECTOR Plane5) const noexcept; + // Test sphere against six planes (see BoundingFrustum::GetPlanes) + + // Static methods + static void CreateMerged(_Out_ BoundingSphere& Out, _In_ const BoundingSphere& S1, _In_ const BoundingSphere& S2) noexcept; + + static void CreateFromBoundingBox(_Out_ BoundingSphere& Out, _In_ const BoundingBox& box) noexcept; + static void CreateFromBoundingBox(_Out_ BoundingSphere& Out, _In_ const BoundingOrientedBox& box) noexcept; + + static void CreateFromPoints(_Out_ BoundingSphere& Out, _In_ size_t Count, + _In_reads_bytes_(sizeof(XMFLOAT3) + Stride * (Count - 1)) const XMFLOAT3* pPoints, _In_ size_t Stride) noexcept; + + static void CreateFromFrustum(_Out_ BoundingSphere& Out, _In_ const BoundingFrustum& fr) noexcept; + }; + + //------------------------------------------------------------------------------------- + // Axis-aligned bounding box + //------------------------------------------------------------------------------------- + struct BoundingBox + { + static constexpr size_t CORNER_COUNT = 8; + + XMFLOAT3 Center; // Center of the box. + XMFLOAT3 Extents; // Distance from the center to each side. + + // Creators + BoundingBox() noexcept : Center(0, 0, 0), Extents(1.f, 1.f, 1.f) {} + + BoundingBox(const BoundingBox&) = default; + BoundingBox& operator=(const BoundingBox&) = default; + + BoundingBox(BoundingBox&&) = default; + BoundingBox& operator=(BoundingBox&&) = default; + + constexpr BoundingBox(_In_ const XMFLOAT3& center, _In_ const XMFLOAT3& extents) noexcept + : Center(center), Extents(extents) {} + + // Methods + void XM_CALLCONV Transform(_Out_ BoundingBox& Out, _In_ FXMMATRIX M) const noexcept; + void XM_CALLCONV Transform(_Out_ BoundingBox& Out, _In_ float Scale, _In_ FXMVECTOR Rotation, _In_ FXMVECTOR Translation) const noexcept; + + void GetCorners(_Out_writes_(8) XMFLOAT3* Corners) const noexcept; + // Gets the 8 corners of the box + + ContainmentType XM_CALLCONV Contains(_In_ FXMVECTOR Point) const noexcept; + ContainmentType XM_CALLCONV Contains(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, _In_ FXMVECTOR V2) const noexcept; + ContainmentType Contains(_In_ const BoundingSphere& sh) const noexcept; + ContainmentType Contains(_In_ const BoundingBox& box) const noexcept; + ContainmentType Contains(_In_ const BoundingOrientedBox& box) const noexcept; + ContainmentType Contains(_In_ const BoundingFrustum& fr) const noexcept; + + bool Intersects(_In_ const BoundingSphere& sh) const noexcept; + bool Intersects(_In_ const BoundingBox& box) const noexcept; + bool Intersects(_In_ const BoundingOrientedBox& box) const noexcept; + bool Intersects(_In_ const BoundingFrustum& fr) const noexcept; + + bool XM_CALLCONV Intersects(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, _In_ FXMVECTOR V2) const noexcept; + // Triangle-Box test + + PlaneIntersectionType XM_CALLCONV Intersects(_In_ FXMVECTOR Plane) const noexcept; + // Plane-box test + + bool XM_CALLCONV Intersects(_In_ FXMVECTOR Origin, _In_ FXMVECTOR Direction, _Out_ float& Dist) const noexcept; + // Ray-Box test + + ContainmentType XM_CALLCONV ContainedBy(_In_ FXMVECTOR Plane0, _In_ FXMVECTOR Plane1, _In_ FXMVECTOR Plane2, + _In_ GXMVECTOR Plane3, _In_ HXMVECTOR Plane4, _In_ HXMVECTOR Plane5) const noexcept; + // Test box against six planes (see BoundingFrustum::GetPlanes) + + // Static methods + static void CreateMerged(_Out_ BoundingBox& Out, _In_ const BoundingBox& b1, _In_ const BoundingBox& b2) noexcept; + + static void CreateFromSphere(_Out_ BoundingBox& Out, _In_ const BoundingSphere& sh) noexcept; + + static void XM_CALLCONV CreateFromPoints(_Out_ BoundingBox& Out, _In_ FXMVECTOR pt1, _In_ FXMVECTOR pt2) noexcept; + static void CreateFromPoints(_Out_ BoundingBox& Out, _In_ size_t Count, + _In_reads_bytes_(sizeof(XMFLOAT3) + Stride * (Count - 1)) const XMFLOAT3* pPoints, _In_ size_t Stride) noexcept; + }; + + //------------------------------------------------------------------------------------- + // Oriented bounding box + //------------------------------------------------------------------------------------- + struct BoundingOrientedBox + { + static constexpr size_t CORNER_COUNT = 8; + + XMFLOAT3 Center; // Center of the box. + XMFLOAT3 Extents; // Distance from the center to each side. + XMFLOAT4 Orientation; // Unit quaternion representing rotation (box -> world). + + // Creators + BoundingOrientedBox() noexcept : Center(0, 0, 0), Extents(1.f, 1.f, 1.f), Orientation(0, 0, 0, 1.f) {} + + BoundingOrientedBox(const BoundingOrientedBox&) = default; + BoundingOrientedBox& operator=(const BoundingOrientedBox&) = default; + + BoundingOrientedBox(BoundingOrientedBox&&) = default; + BoundingOrientedBox& operator=(BoundingOrientedBox&&) = default; + + constexpr BoundingOrientedBox(_In_ const XMFLOAT3& center, _In_ const XMFLOAT3& extents, _In_ const XMFLOAT4& orientation) noexcept + : Center(center), Extents(extents), Orientation(orientation) {} + + // Methods + void XM_CALLCONV Transform(_Out_ BoundingOrientedBox& Out, _In_ FXMMATRIX M) const noexcept; + void XM_CALLCONV Transform(_Out_ BoundingOrientedBox& Out, _In_ float Scale, _In_ FXMVECTOR Rotation, _In_ FXMVECTOR Translation) const noexcept; + + void GetCorners(_Out_writes_(8) XMFLOAT3* Corners) const noexcept; + // Gets the 8 corners of the box + + ContainmentType XM_CALLCONV Contains(_In_ FXMVECTOR Point) const noexcept; + ContainmentType XM_CALLCONV Contains(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, _In_ FXMVECTOR V2) const noexcept; + ContainmentType Contains(_In_ const BoundingSphere& sh) const noexcept; + ContainmentType Contains(_In_ const BoundingBox& box) const noexcept; + ContainmentType Contains(_In_ const BoundingOrientedBox& box) const noexcept; + ContainmentType Contains(_In_ const BoundingFrustum& fr) const noexcept; + + bool Intersects(_In_ const BoundingSphere& sh) const noexcept; + bool Intersects(_In_ const BoundingBox& box) const noexcept; + bool Intersects(_In_ const BoundingOrientedBox& box) const noexcept; + bool Intersects(_In_ const BoundingFrustum& fr) const noexcept; + + bool XM_CALLCONV Intersects(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, _In_ FXMVECTOR V2) const noexcept; + // Triangle-OrientedBox test + + PlaneIntersectionType XM_CALLCONV Intersects(_In_ FXMVECTOR Plane) const noexcept; + // Plane-OrientedBox test + + bool XM_CALLCONV Intersects(_In_ FXMVECTOR Origin, _In_ FXMVECTOR Direction, _Out_ float& Dist) const noexcept; + // Ray-OrientedBox test + + ContainmentType XM_CALLCONV ContainedBy(_In_ FXMVECTOR Plane0, _In_ FXMVECTOR Plane1, _In_ FXMVECTOR Plane2, + _In_ GXMVECTOR Plane3, _In_ HXMVECTOR Plane4, _In_ HXMVECTOR Plane5) const noexcept; + // Test OrientedBox against six planes (see BoundingFrustum::GetPlanes) + + // Static methods + static void CreateFromBoundingBox(_Out_ BoundingOrientedBox& Out, _In_ const BoundingBox& box) noexcept; + + static void CreateFromPoints(_Out_ BoundingOrientedBox& Out, _In_ size_t Count, + _In_reads_bytes_(sizeof(XMFLOAT3) + Stride * (Count - 1)) const XMFLOAT3* pPoints, _In_ size_t Stride) noexcept; + }; + + //------------------------------------------------------------------------------------- + // Bounding frustum + //------------------------------------------------------------------------------------- + struct BoundingFrustum + { + static constexpr size_t CORNER_COUNT = 8; + + XMFLOAT3 Origin; // Origin of the frustum (and projection). + XMFLOAT4 Orientation; // Quaternion representing rotation. + + float RightSlope; // Positive X (X/Z) + float LeftSlope; // Negative X + float TopSlope; // Positive Y (Y/Z) + float BottomSlope; // Negative Y + float Near, Far; // Z of the near plane and far plane. + + // Creators + BoundingFrustum() noexcept : + Origin(0, 0, 0), Orientation(0, 0, 0, 1.f), RightSlope(1.f), LeftSlope(-1.f), + TopSlope(1.f), BottomSlope(-1.f), Near(0), Far(1.f) {} + + BoundingFrustum(const BoundingFrustum&) = default; + BoundingFrustum& operator=(const BoundingFrustum&) = default; + + BoundingFrustum(BoundingFrustum&&) = default; + BoundingFrustum& operator=(BoundingFrustum&&) = default; + + constexpr BoundingFrustum(_In_ const XMFLOAT3& origin, _In_ const XMFLOAT4& orientation, + _In_ float rightSlope, _In_ float leftSlope, _In_ float topSlope, _In_ float bottomSlope, + _In_ float nearPlane, _In_ float farPlane) noexcept + : Origin(origin), Orientation(orientation), + RightSlope(rightSlope), LeftSlope(leftSlope), TopSlope(topSlope), BottomSlope(bottomSlope), + Near(nearPlane), Far(farPlane) {} + BoundingFrustum(_In_ CXMMATRIX Projection, bool rhcoords = false) noexcept; + + // Methods + void XM_CALLCONV Transform(_Out_ BoundingFrustum& Out, _In_ FXMMATRIX M) const noexcept; + void XM_CALLCONV Transform(_Out_ BoundingFrustum& Out, _In_ float Scale, _In_ FXMVECTOR Rotation, _In_ FXMVECTOR Translation) const noexcept; + + void GetCorners(_Out_writes_(8) XMFLOAT3* Corners) const noexcept; + // Gets the 8 corners of the frustum + + ContainmentType XM_CALLCONV Contains(_In_ FXMVECTOR Point) const noexcept; + ContainmentType XM_CALLCONV Contains(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, _In_ FXMVECTOR V2) const noexcept; + ContainmentType Contains(_In_ const BoundingSphere& sp) const noexcept; + ContainmentType Contains(_In_ const BoundingBox& box) const noexcept; + ContainmentType Contains(_In_ const BoundingOrientedBox& box) const noexcept; + ContainmentType Contains(_In_ const BoundingFrustum& fr) const noexcept; + // Frustum-Frustum test + + bool Intersects(_In_ const BoundingSphere& sh) const noexcept; + bool Intersects(_In_ const BoundingBox& box) const noexcept; + bool Intersects(_In_ const BoundingOrientedBox& box) const noexcept; + bool Intersects(_In_ const BoundingFrustum& fr) const noexcept; + + bool XM_CALLCONV Intersects(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, _In_ FXMVECTOR V2) const noexcept; + // Triangle-Frustum test + + PlaneIntersectionType XM_CALLCONV Intersects(_In_ FXMVECTOR Plane) const noexcept; + // Plane-Frustum test + + bool XM_CALLCONV Intersects(_In_ FXMVECTOR rayOrigin, _In_ FXMVECTOR Direction, _Out_ float& Dist) const noexcept; + // Ray-Frustum test + + ContainmentType XM_CALLCONV ContainedBy(_In_ FXMVECTOR Plane0, _In_ FXMVECTOR Plane1, _In_ FXMVECTOR Plane2, + _In_ GXMVECTOR Plane3, _In_ HXMVECTOR Plane4, _In_ HXMVECTOR Plane5) const noexcept; + // Test frustum against six planes (see BoundingFrustum::GetPlanes) + + void GetPlanes(_Out_opt_ XMVECTOR* NearPlane, _Out_opt_ XMVECTOR* FarPlane, _Out_opt_ XMVECTOR* RightPlane, + _Out_opt_ XMVECTOR* LeftPlane, _Out_opt_ XMVECTOR* TopPlane, _Out_opt_ XMVECTOR* BottomPlane) const noexcept; + // Create 6 Planes representation of Frustum + + // Static methods + static void XM_CALLCONV CreateFromMatrix(_Out_ BoundingFrustum& Out, _In_ FXMMATRIX Projection, bool rhcoords = false) noexcept; + }; + + //----------------------------------------------------------------------------- + // Triangle intersection testing routines. + //----------------------------------------------------------------------------- + namespace TriangleTests + { + bool XM_CALLCONV Intersects(_In_ FXMVECTOR Origin, _In_ FXMVECTOR Direction, _In_ FXMVECTOR V0, _In_ GXMVECTOR V1, _In_ HXMVECTOR V2, _Out_ float& Dist) noexcept; + // Ray-Triangle + + bool XM_CALLCONV Intersects(_In_ FXMVECTOR A0, _In_ FXMVECTOR A1, _In_ FXMVECTOR A2, _In_ GXMVECTOR B0, _In_ HXMVECTOR B1, _In_ HXMVECTOR B2) noexcept; + // Triangle-Triangle + + PlaneIntersectionType XM_CALLCONV Intersects(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, _In_ FXMVECTOR V2, _In_ GXMVECTOR Plane) noexcept; + // Plane-Triangle + + ContainmentType XM_CALLCONV ContainedBy(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, _In_ FXMVECTOR V2, + _In_ GXMVECTOR Plane0, _In_ HXMVECTOR Plane1, _In_ HXMVECTOR Plane2, + _In_ CXMVECTOR Plane3, _In_ CXMVECTOR Plane4, _In_ CXMVECTOR Plane5) noexcept; + // Test a triangle against six planes at once (see BoundingFrustum::GetPlanes) + } + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + + /**************************************************************************** + * + * Implementation + * + ****************************************************************************/ + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4068 4365 4616 6001) + // C4068/4616: ignore unknown pragmas + // C4365: Off by default noise + // C6001: False positives +#endif +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable : 25000, "FXMVECTOR is 16 bytes") +#pragma prefast(disable : 26495, "Union initialization confuses /analyze") +#endif + +#include "DirectXCollision.inl" + +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +} // namespace DirectX + diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXCollision.inl b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXCollision.inl new file mode 100644 index 0000000..51d3792 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXCollision.inl @@ -0,0 +1,4816 @@ +//------------------------------------------------------------------------------------- +// DirectXCollision.inl -- C++ Collision Math library +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +// +// http://go.microsoft.com/fwlink/?LinkID=615560 +//------------------------------------------------------------------------------------- + +#pragma once + +XMGLOBALCONST XMVECTORF32 g_BoxOffset[8] = +{ + { { { -1.0f, -1.0f, 1.0f, 0.0f } } }, + { { { 1.0f, -1.0f, 1.0f, 0.0f } } }, + { { { 1.0f, 1.0f, 1.0f, 0.0f } } }, + { { { -1.0f, 1.0f, 1.0f, 0.0f } } }, + { { { -1.0f, -1.0f, -1.0f, 0.0f } } }, + { { { 1.0f, -1.0f, -1.0f, 0.0f } } }, + { { { 1.0f, 1.0f, -1.0f, 0.0f } } }, + { { { -1.0f, 1.0f, -1.0f, 0.0f } } }, +}; + +XMGLOBALCONST XMVECTORF32 g_RayEpsilon = { { { 1e-20f, 1e-20f, 1e-20f, 1e-20f } } }; +XMGLOBALCONST XMVECTORF32 g_RayNegEpsilon = { { { -1e-20f, -1e-20f, -1e-20f, -1e-20f } } }; +XMGLOBALCONST XMVECTORF32 g_FltMin = { { { -FLT_MAX, -FLT_MAX, -FLT_MAX, -FLT_MAX } } }; +XMGLOBALCONST XMVECTORF32 g_FltMax = { { { FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX } } }; + +namespace Internal +{ + + //----------------------------------------------------------------------------- + // Return true if any of the elements of a 3 vector are equal to 0xffffffff. + // Slightly more efficient than using XMVector3EqualInt. + //----------------------------------------------------------------------------- + inline bool XMVector3AnyTrue(_In_ FXMVECTOR V) noexcept + { + // Duplicate the fourth element from the first element. + XMVECTOR C = XMVectorSwizzle(V); + + return XMComparisonAnyTrue(XMVector4EqualIntR(C, XMVectorTrueInt())); + } + + + //----------------------------------------------------------------------------- + // Return true if all of the elements of a 3 vector are equal to 0xffffffff. + // Slightly more efficient than using XMVector3EqualInt. + //----------------------------------------------------------------------------- + inline bool XMVector3AllTrue(_In_ FXMVECTOR V) noexcept + { + // Duplicate the fourth element from the first element. + XMVECTOR C = XMVectorSwizzle(V); + + return XMComparisonAllTrue(XMVector4EqualIntR(C, XMVectorTrueInt())); + } + +#if defined(_PREFAST_) || !defined(NDEBUG) + + XMGLOBALCONST XMVECTORF32 g_UnitVectorEpsilon = { { { 1.0e-4f, 1.0e-4f, 1.0e-4f, 1.0e-4f } } }; + XMGLOBALCONST XMVECTORF32 g_UnitQuaternionEpsilon = { { { 1.0e-4f, 1.0e-4f, 1.0e-4f, 1.0e-4f } } }; + XMGLOBALCONST XMVECTORF32 g_UnitPlaneEpsilon = { { { 1.0e-4f, 1.0e-4f, 1.0e-4f, 1.0e-4f } } }; + + //----------------------------------------------------------------------------- + // Return true if the vector is a unit vector (length == 1). + //----------------------------------------------------------------------------- + inline bool XMVector3IsUnit(_In_ FXMVECTOR V) noexcept + { + XMVECTOR Difference = XMVectorSubtract(XMVector3Length(V), XMVectorSplatOne()); + return XMVector4Less(XMVectorAbs(Difference), g_UnitVectorEpsilon); + } + + //----------------------------------------------------------------------------- + // Return true if the quaterion is a unit quaternion. + //----------------------------------------------------------------------------- + inline bool XMQuaternionIsUnit(_In_ FXMVECTOR Q) noexcept + { + XMVECTOR Difference = XMVectorSubtract(XMVector4Length(Q), XMVectorSplatOne()); + return XMVector4Less(XMVectorAbs(Difference), g_UnitQuaternionEpsilon); + } + + //----------------------------------------------------------------------------- + // Return true if the plane is a unit plane. + //----------------------------------------------------------------------------- + inline bool XMPlaneIsUnit(_In_ FXMVECTOR Plane) noexcept + { + XMVECTOR Difference = XMVectorSubtract(XMVector3Length(Plane), XMVectorSplatOne()); + return XMVector4Less(XMVectorAbs(Difference), g_UnitPlaneEpsilon); + } + +#endif // _PREFAST_ || !NDEBUG + + //----------------------------------------------------------------------------- + inline XMVECTOR XMPlaneTransform(_In_ FXMVECTOR Plane, _In_ FXMVECTOR Rotation, _In_ FXMVECTOR Translation) noexcept + { + XMVECTOR vNormal = XMVector3Rotate(Plane, Rotation); + XMVECTOR vD = XMVectorSubtract(XMVectorSplatW(Plane), XMVector3Dot(vNormal, Translation)); + + return XMVectorInsert<0, 0, 0, 0, 1>(vNormal, vD); + } + + //----------------------------------------------------------------------------- + // Return the point on the line segement (S1, S2) nearest the point P. + //----------------------------------------------------------------------------- + inline XMVECTOR PointOnLineSegmentNearestPoint(_In_ FXMVECTOR S1, _In_ FXMVECTOR S2, _In_ FXMVECTOR P) noexcept + { + XMVECTOR Dir = XMVectorSubtract(S2, S1); + XMVECTOR Projection = XMVectorSubtract(XMVector3Dot(P, Dir), XMVector3Dot(S1, Dir)); + XMVECTOR LengthSq = XMVector3Dot(Dir, Dir); + + XMVECTOR t = XMVectorMultiply(Projection, XMVectorReciprocal(LengthSq)); + XMVECTOR Point = XMVectorMultiplyAdd(t, Dir, S1); + + // t < 0 + XMVECTOR SelectS1 = XMVectorLess(Projection, XMVectorZero()); + Point = XMVectorSelect(Point, S1, SelectS1); + + // t > 1 + XMVECTOR SelectS2 = XMVectorGreater(Projection, LengthSq); + Point = XMVectorSelect(Point, S2, SelectS2); + + return Point; + } + + //----------------------------------------------------------------------------- + // Test if the point (P) on the plane of the triangle is inside the triangle + // (V0, V1, V2). + //----------------------------------------------------------------------------- + inline XMVECTOR XM_CALLCONV PointOnPlaneInsideTriangle(_In_ FXMVECTOR P, _In_ FXMVECTOR V0, _In_ FXMVECTOR V1, _In_ GXMVECTOR V2) noexcept + { + // Compute the triangle normal. + XMVECTOR N = XMVector3Cross(XMVectorSubtract(V2, V0), XMVectorSubtract(V1, V0)); + + // Compute the cross products of the vector from the base of each edge to + // the point with each edge vector. + XMVECTOR C0 = XMVector3Cross(XMVectorSubtract(P, V0), XMVectorSubtract(V1, V0)); + XMVECTOR C1 = XMVector3Cross(XMVectorSubtract(P, V1), XMVectorSubtract(V2, V1)); + XMVECTOR C2 = XMVector3Cross(XMVectorSubtract(P, V2), XMVectorSubtract(V0, V2)); + + // If the cross product points in the same direction as the normal the the + // point is inside the edge (it is zero if is on the edge). + XMVECTOR Zero = XMVectorZero(); + XMVECTOR Inside0 = XMVectorGreaterOrEqual(XMVector3Dot(C0, N), Zero); + XMVECTOR Inside1 = XMVectorGreaterOrEqual(XMVector3Dot(C1, N), Zero); + XMVECTOR Inside2 = XMVectorGreaterOrEqual(XMVector3Dot(C2, N), Zero); + + // If the point inside all of the edges it is inside. + return XMVectorAndInt(XMVectorAndInt(Inside0, Inside1), Inside2); + } + + //----------------------------------------------------------------------------- + inline bool SolveCubic(_In_ float e, _In_ float f, _In_ float g, _Out_ float* t, _Out_ float* u, _Out_ float* v) noexcept + { + float p, q, h, rc, d, theta, costh3, sinth3; + + p = f - e * e / 3.0f; + q = g - e * f / 3.0f + e * e * e * 2.0f / 27.0f; + h = q * q / 4.0f + p * p * p / 27.0f; + + if (h > 0) + { + *t = *u = *v = 0.f; + return false; // only one real root + } + + if ((h == 0) && (q == 0)) // all the same root + { + *t = -e / 3; + *u = -e / 3; + *v = -e / 3; + + return true; + } + + d = sqrtf(q * q / 4.0f - h); + if (d < 0) + rc = -powf(-d, 1.0f / 3.0f); + else + rc = powf(d, 1.0f / 3.0f); + + theta = XMScalarACos(-q / (2.0f * d)); + costh3 = XMScalarCos(theta / 3.0f); + sinth3 = sqrtf(3.0f) * XMScalarSin(theta / 3.0f); + *t = 2.0f * rc * costh3 - e / 3.0f; + *u = -rc * (costh3 + sinth3) - e / 3.0f; + *v = -rc * (costh3 - sinth3) - e / 3.0f; + + return true; + } + + //----------------------------------------------------------------------------- + inline XMVECTOR CalculateEigenVector(_In_ float m11, _In_ float m12, _In_ float m13, + _In_ float m22, _In_ float m23, _In_ float m33, _In_ float e) noexcept + { + float fTmp[3]; + fTmp[0] = m12 * m23 - m13 * (m22 - e); + fTmp[1] = m13 * m12 - m23 * (m11 - e); + fTmp[2] = (m11 - e) * (m22 - e) - m12 * m12; + + XMVECTOR vTmp = XMLoadFloat3(reinterpret_cast(fTmp)); + + if (XMVector3Equal(vTmp, XMVectorZero())) // planar or linear + { + float f1, f2, f3; + + // we only have one equation - find a valid one + if ((m11 - e != 0) || (m12 != 0) || (m13 != 0)) + { + f1 = m11 - e; f2 = m12; f3 = m13; + } + else if ((m12 != 0) || (m22 - e != 0) || (m23 != 0)) + { + f1 = m12; f2 = m22 - e; f3 = m23; + } + else if ((m13 != 0) || (m23 != 0) || (m33 - e != 0)) + { + f1 = m13; f2 = m23; f3 = m33 - e; + } + else + { + // error, we'll just make something up - we have NO context + f1 = 1.0f; f2 = 0.0f; f3 = 0.0f; + } + + if (f1 == 0) + vTmp = XMVectorSetX(vTmp, 0.0f); + else + vTmp = XMVectorSetX(vTmp, 1.0f); + + if (f2 == 0) + vTmp = XMVectorSetY(vTmp, 0.0f); + else + vTmp = XMVectorSetY(vTmp, 1.0f); + + if (f3 == 0) + { + vTmp = XMVectorSetZ(vTmp, 0.0f); + // recalculate y to make equation work + if (m12 != 0) + vTmp = XMVectorSetY(vTmp, -f1 / f2); + } + else + { + vTmp = XMVectorSetZ(vTmp, (f2 - f1) / f3); + } + } + + if (XMVectorGetX(XMVector3LengthSq(vTmp)) > 1e-5f) + { + return XMVector3Normalize(vTmp); + } + else + { + // Multiply by a value large enough to make the vector non-zero. + vTmp = XMVectorScale(vTmp, 1e5f); + return XMVector3Normalize(vTmp); + } + } + + //----------------------------------------------------------------------------- + inline bool CalculateEigenVectors(_In_ float m11, _In_ float m12, _In_ float m13, + _In_ float m22, _In_ float m23, _In_ float m33, + _In_ float e1, _In_ float e2, _In_ float e3, + _Out_ XMVECTOR* pV1, _Out_ XMVECTOR* pV2, _Out_ XMVECTOR* pV3) noexcept + { + *pV1 = DirectX::Internal::CalculateEigenVector(m11, m12, m13, m22, m23, m33, e1); + *pV2 = DirectX::Internal::CalculateEigenVector(m11, m12, m13, m22, m23, m33, e2); + *pV3 = DirectX::Internal::CalculateEigenVector(m11, m12, m13, m22, m23, m33, e3); + + bool v1z = false; + bool v2z = false; + bool v3z = false; + + XMVECTOR Zero = XMVectorZero(); + + if (XMVector3Equal(*pV1, Zero)) + v1z = true; + + if (XMVector3Equal(*pV2, Zero)) + v2z = true; + + if (XMVector3Equal(*pV3, Zero)) + v3z = true; + + bool e12 = (fabsf(XMVectorGetX(XMVector3Dot(*pV1, *pV2))) > 0.1f); // check for non-orthogonal vectors + bool e13 = (fabsf(XMVectorGetX(XMVector3Dot(*pV1, *pV3))) > 0.1f); + bool e23 = (fabsf(XMVectorGetX(XMVector3Dot(*pV2, *pV3))) > 0.1f); + + if ((v1z && v2z && v3z) || (e12 && e13 && e23) || + (e12 && v3z) || (e13 && v2z) || (e23 && v1z)) // all eigenvectors are 0- any basis set + { + *pV1 = g_XMIdentityR0.v; + *pV2 = g_XMIdentityR1.v; + *pV3 = g_XMIdentityR2.v; + return true; + } + + if (v1z && v2z) + { + XMVECTOR vTmp = XMVector3Cross(g_XMIdentityR1, *pV3); + if (XMVectorGetX(XMVector3LengthSq(vTmp)) < 1e-5f) + { + vTmp = XMVector3Cross(g_XMIdentityR0, *pV3); + } + *pV1 = XMVector3Normalize(vTmp); + *pV2 = XMVector3Cross(*pV3, *pV1); + return true; + } + + if (v3z && v1z) + { + XMVECTOR vTmp = XMVector3Cross(g_XMIdentityR1, *pV2); + if (XMVectorGetX(XMVector3LengthSq(vTmp)) < 1e-5f) + { + vTmp = XMVector3Cross(g_XMIdentityR0, *pV2); + } + *pV3 = XMVector3Normalize(vTmp); + *pV1 = XMVector3Cross(*pV2, *pV3); + return true; + } + + if (v2z && v3z) + { + XMVECTOR vTmp = XMVector3Cross(g_XMIdentityR1, *pV1); + if (XMVectorGetX(XMVector3LengthSq(vTmp)) < 1e-5f) + { + vTmp = XMVector3Cross(g_XMIdentityR0, *pV1); + } + *pV2 = XMVector3Normalize(vTmp); + *pV3 = XMVector3Cross(*pV1, *pV2); + return true; + } + + if ((v1z) || e12) + { + *pV1 = XMVector3Cross(*pV2, *pV3); + return true; + } + + if ((v2z) || e23) + { + *pV2 = XMVector3Cross(*pV3, *pV1); + return true; + } + + if ((v3z) || e13) + { + *pV3 = XMVector3Cross(*pV1, *pV2); + return true; + } + + return true; + } + + //----------------------------------------------------------------------------- + inline bool CalculateEigenVectorsFromCovarianceMatrix(_In_ float Cxx, _In_ float Cyy, _In_ float Czz, + _In_ float Cxy, _In_ float Cxz, _In_ float Cyz, + _Out_ XMVECTOR* pV1, _Out_ XMVECTOR* pV2, _Out_ XMVECTOR* pV3) noexcept + { + // Calculate the eigenvalues by solving a cubic equation. + float e = -(Cxx + Cyy + Czz); + float f = Cxx * Cyy + Cyy * Czz + Czz * Cxx - Cxy * Cxy - Cxz * Cxz - Cyz * Cyz; + float g = Cxy * Cxy * Czz + Cxz * Cxz * Cyy + Cyz * Cyz * Cxx - Cxy * Cyz * Cxz * 2.0f - Cxx * Cyy * Czz; + + float ev1, ev2, ev3; + if (!DirectX::Internal::SolveCubic(e, f, g, &ev1, &ev2, &ev3)) + { + // set them to arbitrary orthonormal basis set + *pV1 = g_XMIdentityR0.v; + *pV2 = g_XMIdentityR1.v; + *pV3 = g_XMIdentityR2.v; + return false; + } + + return DirectX::Internal::CalculateEigenVectors(Cxx, Cxy, Cxz, Cyy, Cyz, Czz, ev1, ev2, ev3, pV1, pV2, pV3); + } + + //----------------------------------------------------------------------------- + inline void XM_CALLCONV FastIntersectTrianglePlane( + FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2, + GXMVECTOR Plane, + XMVECTOR& Outside, XMVECTOR& Inside) noexcept + { + // Plane0 + XMVECTOR Dist0 = XMVector4Dot(V0, Plane); + XMVECTOR Dist1 = XMVector4Dot(V1, Plane); + XMVECTOR Dist2 = XMVector4Dot(V2, Plane); + + XMVECTOR MinDist = XMVectorMin(Dist0, Dist1); + MinDist = XMVectorMin(MinDist, Dist2); + + XMVECTOR MaxDist = XMVectorMax(Dist0, Dist1); + MaxDist = XMVectorMax(MaxDist, Dist2); + + XMVECTOR Zero = XMVectorZero(); + + // Outside the plane? + Outside = XMVectorGreater(MinDist, Zero); + + // Fully inside the plane? + Inside = XMVectorLess(MaxDist, Zero); + } + + //----------------------------------------------------------------------------- + inline void FastIntersectSpherePlane(_In_ FXMVECTOR Center, _In_ FXMVECTOR Radius, _In_ FXMVECTOR Plane, + _Out_ XMVECTOR& Outside, _Out_ XMVECTOR& Inside) noexcept + { + XMVECTOR Dist = XMVector4Dot(Center, Plane); + + // Outside the plane? + Outside = XMVectorGreater(Dist, Radius); + + // Fully inside the plane? + Inside = XMVectorLess(Dist, XMVectorNegate(Radius)); + } + + //----------------------------------------------------------------------------- + inline void FastIntersectAxisAlignedBoxPlane(_In_ FXMVECTOR Center, _In_ FXMVECTOR Extents, _In_ FXMVECTOR Plane, + _Out_ XMVECTOR& Outside, _Out_ XMVECTOR& Inside) noexcept + { + // Compute the distance to the center of the box. + XMVECTOR Dist = XMVector4Dot(Center, Plane); + + // Project the axes of the box onto the normal of the plane. Half the + // length of the projection (sometime called the "radius") is equal to + // h(u) * abs(n dot b(u))) + h(v) * abs(n dot b(v)) + h(w) * abs(n dot b(w)) + // where h(i) are extents of the box, n is the plane normal, and b(i) are the + // axes of the box. In this case b(i) = [(1,0,0), (0,1,0), (0,0,1)]. + XMVECTOR Radius = XMVector3Dot(Extents, XMVectorAbs(Plane)); + + // Outside the plane? + Outside = XMVectorGreater(Dist, Radius); + + // Fully inside the plane? + Inside = XMVectorLess(Dist, XMVectorNegate(Radius)); + } + + //----------------------------------------------------------------------------- + inline void XM_CALLCONV FastIntersectOrientedBoxPlane( + _In_ FXMVECTOR Center, _In_ FXMVECTOR Extents, _In_ FXMVECTOR Axis0, + _In_ GXMVECTOR Axis1, + _In_ HXMVECTOR Axis2, _In_ HXMVECTOR Plane, + _Out_ XMVECTOR& Outside, _Out_ XMVECTOR& Inside) noexcept + { + // Compute the distance to the center of the box. + XMVECTOR Dist = XMVector4Dot(Center, Plane); + + // Project the axes of the box onto the normal of the plane. Half the + // length of the projection (sometime called the "radius") is equal to + // h(u) * abs(n dot b(u))) + h(v) * abs(n dot b(v)) + h(w) * abs(n dot b(w)) + // where h(i) are extents of the box, n is the plane normal, and b(i) are the + // axes of the box. + XMVECTOR Radius = XMVector3Dot(Plane, Axis0); + Radius = XMVectorInsert<0, 0, 1, 0, 0>(Radius, XMVector3Dot(Plane, Axis1)); + Radius = XMVectorInsert<0, 0, 0, 1, 0>(Radius, XMVector3Dot(Plane, Axis2)); + Radius = XMVector3Dot(Extents, XMVectorAbs(Radius)); + + // Outside the plane? + Outside = XMVectorGreater(Dist, Radius); + + // Fully inside the plane? + Inside = XMVectorLess(Dist, XMVectorNegate(Radius)); + } + + //----------------------------------------------------------------------------- + inline void XM_CALLCONV FastIntersectFrustumPlane( + _In_ FXMVECTOR Point0, _In_ FXMVECTOR Point1, _In_ FXMVECTOR Point2, + _In_ GXMVECTOR Point3, + _In_ HXMVECTOR Point4, _In_ HXMVECTOR Point5, + _In_ CXMVECTOR Point6, _In_ CXMVECTOR Point7, _In_ CXMVECTOR Plane, + _Out_ XMVECTOR& Outside, _Out_ XMVECTOR& Inside) noexcept + { + // Find the min/max projection of the frustum onto the plane normal. + XMVECTOR Min, Max, Dist; + + Min = Max = XMVector3Dot(Plane, Point0); + + Dist = XMVector3Dot(Plane, Point1); + Min = XMVectorMin(Min, Dist); + Max = XMVectorMax(Max, Dist); + + Dist = XMVector3Dot(Plane, Point2); + Min = XMVectorMin(Min, Dist); + Max = XMVectorMax(Max, Dist); + + Dist = XMVector3Dot(Plane, Point3); + Min = XMVectorMin(Min, Dist); + Max = XMVectorMax(Max, Dist); + + Dist = XMVector3Dot(Plane, Point4); + Min = XMVectorMin(Min, Dist); + Max = XMVectorMax(Max, Dist); + + Dist = XMVector3Dot(Plane, Point5); + Min = XMVectorMin(Min, Dist); + Max = XMVectorMax(Max, Dist); + + Dist = XMVector3Dot(Plane, Point6); + Min = XMVectorMin(Min, Dist); + Max = XMVectorMax(Max, Dist); + + Dist = XMVector3Dot(Plane, Point7); + Min = XMVectorMin(Min, Dist); + Max = XMVectorMax(Max, Dist); + + XMVECTOR PlaneDist = XMVectorNegate(XMVectorSplatW(Plane)); + + // Outside the plane? + Outside = XMVectorGreater(Min, PlaneDist); + + // Fully inside the plane? + Inside = XMVectorLess(Max, PlaneDist); + } + +} // namespace Internal + + +/**************************************************************************** + * + * BoundingSphere + * + ****************************************************************************/ + + //----------------------------------------------------------------------------- + // Transform a sphere by an angle preserving transform. + //----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void XM_CALLCONV BoundingSphere::Transform(BoundingSphere& Out, FXMMATRIX M) const noexcept +{ + // Load the center of the sphere. + XMVECTOR vCenter = XMLoadFloat3(&Center); + + // Transform the center of the sphere. + XMVECTOR C = XMVector3Transform(vCenter, M); + + XMVECTOR dX = XMVector3Dot(M.r[0], M.r[0]); + XMVECTOR dY = XMVector3Dot(M.r[1], M.r[1]); + XMVECTOR dZ = XMVector3Dot(M.r[2], M.r[2]); + + XMVECTOR d = XMVectorMax(dX, XMVectorMax(dY, dZ)); + + // Store the center sphere. + XMStoreFloat3(&Out.Center, C); + + // Scale the radius of the pshere. + float Scale = sqrtf(XMVectorGetX(d)); + Out.Radius = Radius * Scale; +} + +_Use_decl_annotations_ +inline void XM_CALLCONV BoundingSphere::Transform(BoundingSphere& Out, float Scale, FXMVECTOR Rotation, FXMVECTOR Translation) const noexcept +{ + // Load the center of the sphere. + XMVECTOR vCenter = XMLoadFloat3(&Center); + + // Transform the center of the sphere. + vCenter = XMVectorAdd(XMVector3Rotate(XMVectorScale(vCenter, Scale), Rotation), Translation); + + // Store the center sphere. + XMStoreFloat3(&Out.Center, vCenter); + + // Scale the radius of the pshere. + Out.Radius = Radius * Scale; +} + + +//----------------------------------------------------------------------------- +// Point in sphere test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType XM_CALLCONV BoundingSphere::Contains(FXMVECTOR Point) const noexcept +{ + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); + + XMVECTOR DistanceSquared = XMVector3LengthSq(XMVectorSubtract(Point, vCenter)); + XMVECTOR RadiusSquared = XMVectorMultiply(vRadius, vRadius); + + return XMVector3LessOrEqual(DistanceSquared, RadiusSquared) ? CONTAINS : DISJOINT; +} + + +//----------------------------------------------------------------------------- +// Triangle in sphere test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType XM_CALLCONV BoundingSphere::Contains(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2) const noexcept +{ + if (!Intersects(V0, V1, V2)) + return DISJOINT; + + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); + XMVECTOR RadiusSquared = XMVectorMultiply(vRadius, vRadius); + + XMVECTOR DistanceSquared = XMVector3LengthSq(XMVectorSubtract(V0, vCenter)); + XMVECTOR Inside = XMVectorLessOrEqual(DistanceSquared, RadiusSquared); + + DistanceSquared = XMVector3LengthSq(XMVectorSubtract(V1, vCenter)); + Inside = XMVectorAndInt(Inside, XMVectorLessOrEqual(DistanceSquared, RadiusSquared)); + + DistanceSquared = XMVector3LengthSq(XMVectorSubtract(V2, vCenter)); + Inside = XMVectorAndInt(Inside, XMVectorLessOrEqual(DistanceSquared, RadiusSquared)); + + return (XMVector3EqualInt(Inside, XMVectorTrueInt())) ? CONTAINS : INTERSECTS; +} + + +//----------------------------------------------------------------------------- +// Sphere in sphere test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingSphere::Contains(const BoundingSphere& sh) const noexcept +{ + XMVECTOR Center1 = XMLoadFloat3(&Center); + float r1 = Radius; + + XMVECTOR Center2 = XMLoadFloat3(&sh.Center); + float r2 = sh.Radius; + + XMVECTOR V = XMVectorSubtract(Center2, Center1); + + XMVECTOR Dist = XMVector3Length(V); + + float d = XMVectorGetX(Dist); + + return (r1 + r2 >= d) ? ((r1 - r2 >= d) ? CONTAINS : INTERSECTS) : DISJOINT; +} + + +//----------------------------------------------------------------------------- +// Axis-aligned box in sphere test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingSphere::Contains(const BoundingBox& box) const noexcept +{ + if (!box.Intersects(*this)) + return DISJOINT; + + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); + XMVECTOR RadiusSq = XMVectorMultiply(vRadius, vRadius); + + XMVECTOR boxCenter = XMLoadFloat3(&box.Center); + XMVECTOR boxExtents = XMLoadFloat3(&box.Extents); + + XMVECTOR InsideAll = XMVectorTrueInt(); + + XMVECTOR offset = XMVectorSubtract(boxCenter, vCenter); + + for (size_t i = 0; i < BoundingBox::CORNER_COUNT; ++i) + { + XMVECTOR C = XMVectorMultiplyAdd(boxExtents, g_BoxOffset[i], offset); + XMVECTOR d = XMVector3LengthSq(C); + InsideAll = XMVectorAndInt(InsideAll, XMVectorLessOrEqual(d, RadiusSq)); + } + + return (XMVector3EqualInt(InsideAll, XMVectorTrueInt())) ? CONTAINS : INTERSECTS; +} + + +//----------------------------------------------------------------------------- +// Oriented box in sphere test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingSphere::Contains(const BoundingOrientedBox& box) const noexcept +{ + if (!box.Intersects(*this)) + return DISJOINT; + + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); + XMVECTOR RadiusSq = XMVectorMultiply(vRadius, vRadius); + + XMVECTOR boxCenter = XMLoadFloat3(&box.Center); + XMVECTOR boxExtents = XMLoadFloat3(&box.Extents); + XMVECTOR boxOrientation = XMLoadFloat4(&box.Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(boxOrientation)); + + XMVECTOR InsideAll = XMVectorTrueInt(); + + for (size_t i = 0; i < BoundingOrientedBox::CORNER_COUNT; ++i) + { + XMVECTOR C = XMVectorAdd(XMVector3Rotate(XMVectorMultiply(boxExtents, g_BoxOffset[i]), boxOrientation), boxCenter); + XMVECTOR d = XMVector3LengthSq(XMVectorSubtract(vCenter, C)); + InsideAll = XMVectorAndInt(InsideAll, XMVectorLessOrEqual(d, RadiusSq)); + } + + return (XMVector3EqualInt(InsideAll, XMVectorTrueInt())) ? CONTAINS : INTERSECTS; + +} + + +//----------------------------------------------------------------------------- +// Frustum in sphere test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingSphere::Contains(const BoundingFrustum& fr) const noexcept +{ + if (!fr.Intersects(*this)) + return DISJOINT; + + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); + XMVECTOR RadiusSq = XMVectorMultiply(vRadius, vRadius); + + XMVECTOR vOrigin = XMLoadFloat3(&fr.Origin); + XMVECTOR vOrientation = XMLoadFloat4(&fr.Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(vOrientation)); + + // Build the corners of the frustum. + XMVECTOR vRightTop = XMVectorSet(fr.RightSlope, fr.TopSlope, 1.0f, 0.0f); + XMVECTOR vRightBottom = XMVectorSet(fr.RightSlope, fr.BottomSlope, 1.0f, 0.0f); + XMVECTOR vLeftTop = XMVectorSet(fr.LeftSlope, fr.TopSlope, 1.0f, 0.0f); + XMVECTOR vLeftBottom = XMVectorSet(fr.LeftSlope, fr.BottomSlope, 1.0f, 0.0f); + XMVECTOR vNear = XMVectorReplicatePtr(&fr.Near); + XMVECTOR vFar = XMVectorReplicatePtr(&fr.Far); + + XMVECTOR Corners[BoundingFrustum::CORNER_COUNT]; + Corners[0] = XMVectorMultiply(vRightTop, vNear); + Corners[1] = XMVectorMultiply(vRightBottom, vNear); + Corners[2] = XMVectorMultiply(vLeftTop, vNear); + Corners[3] = XMVectorMultiply(vLeftBottom, vNear); + Corners[4] = XMVectorMultiply(vRightTop, vFar); + Corners[5] = XMVectorMultiply(vRightBottom, vFar); + Corners[6] = XMVectorMultiply(vLeftTop, vFar); + Corners[7] = XMVectorMultiply(vLeftBottom, vFar); + + XMVECTOR InsideAll = XMVectorTrueInt(); + for (size_t i = 0; i < BoundingFrustum::CORNER_COUNT; ++i) + { + XMVECTOR C = XMVectorAdd(XMVector3Rotate(Corners[i], vOrientation), vOrigin); + XMVECTOR d = XMVector3LengthSq(XMVectorSubtract(vCenter, C)); + InsideAll = XMVectorAndInt(InsideAll, XMVectorLessOrEqual(d, RadiusSq)); + } + + return (XMVector3EqualInt(InsideAll, XMVectorTrueInt())) ? CONTAINS : INTERSECTS; +} + + +//----------------------------------------------------------------------------- +// Sphere vs. sphere test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingSphere::Intersects(const BoundingSphere& sh) const noexcept +{ + // Load A. + XMVECTOR vCenterA = XMLoadFloat3(&Center); + XMVECTOR vRadiusA = XMVectorReplicatePtr(&Radius); + + // Load B. + XMVECTOR vCenterB = XMLoadFloat3(&sh.Center); + XMVECTOR vRadiusB = XMVectorReplicatePtr(&sh.Radius); + + // Distance squared between centers. + XMVECTOR Delta = XMVectorSubtract(vCenterB, vCenterA); + XMVECTOR DistanceSquared = XMVector3LengthSq(Delta); + + // Sum of the radii squared. + XMVECTOR RadiusSquared = XMVectorAdd(vRadiusA, vRadiusB); + RadiusSquared = XMVectorMultiply(RadiusSquared, RadiusSquared); + + return XMVector3LessOrEqual(DistanceSquared, RadiusSquared); +} + + +//----------------------------------------------------------------------------- +// Box vs. sphere test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingSphere::Intersects(const BoundingBox& box) const noexcept +{ + return box.Intersects(*this); +} + +_Use_decl_annotations_ +inline bool BoundingSphere::Intersects(const BoundingOrientedBox& box) const noexcept +{ + return box.Intersects(*this); +} + + +//----------------------------------------------------------------------------- +// Frustum vs. sphere test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingSphere::Intersects(const BoundingFrustum& fr) const noexcept +{ + return fr.Intersects(*this); +} + + +//----------------------------------------------------------------------------- +// Triangle vs sphere test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool XM_CALLCONV BoundingSphere::Intersects(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2) const noexcept +{ + // Load the sphere. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); + + // Compute the plane of the triangle (has to be normalized). + XMVECTOR N = XMVector3Normalize(XMVector3Cross(XMVectorSubtract(V1, V0), XMVectorSubtract(V2, V0))); + + // Assert that the triangle is not degenerate. + assert(!XMVector3Equal(N, XMVectorZero())); + + // Find the nearest feature on the triangle to the sphere. + XMVECTOR Dist = XMVector3Dot(XMVectorSubtract(vCenter, V0), N); + + // If the center of the sphere is farther from the plane of the triangle than + // the radius of the sphere, then there cannot be an intersection. + XMVECTOR NoIntersection = XMVectorLess(Dist, XMVectorNegate(vRadius)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Dist, vRadius)); + + // Project the center of the sphere onto the plane of the triangle. + XMVECTOR Point = XMVectorNegativeMultiplySubtract(N, Dist, vCenter); + + // Is it inside all the edges? If so we intersect because the distance + // to the plane is less than the radius. + XMVECTOR Intersection = DirectX::Internal::PointOnPlaneInsideTriangle(Point, V0, V1, V2); + + // Find the nearest point on each edge. + XMVECTOR RadiusSq = XMVectorMultiply(vRadius, vRadius); + + // Edge 0,1 + Point = DirectX::Internal::PointOnLineSegmentNearestPoint(V0, V1, vCenter); + + // If the distance to the center of the sphere to the point is less than + // the radius of the sphere then it must intersect. + Intersection = XMVectorOrInt(Intersection, XMVectorLessOrEqual(XMVector3LengthSq(XMVectorSubtract(vCenter, Point)), RadiusSq)); + + // Edge 1,2 + Point = DirectX::Internal::PointOnLineSegmentNearestPoint(V1, V2, vCenter); + + // If the distance to the center of the sphere to the point is less than + // the radius of the sphere then it must intersect. + Intersection = XMVectorOrInt(Intersection, XMVectorLessOrEqual(XMVector3LengthSq(XMVectorSubtract(vCenter, Point)), RadiusSq)); + + // Edge 2,0 + Point = DirectX::Internal::PointOnLineSegmentNearestPoint(V2, V0, vCenter); + + // If the distance to the center of the sphere to the point is less than + // the radius of the sphere then it must intersect. + Intersection = XMVectorOrInt(Intersection, XMVectorLessOrEqual(XMVector3LengthSq(XMVectorSubtract(vCenter, Point)), RadiusSq)); + + return XMVector4EqualInt(XMVectorAndCInt(Intersection, NoIntersection), XMVectorTrueInt()); +} + + +//----------------------------------------------------------------------------- +// Sphere-plane intersection +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline PlaneIntersectionType XM_CALLCONV BoundingSphere::Intersects(FXMVECTOR Plane) const noexcept +{ + assert(DirectX::Internal::XMPlaneIsUnit(Plane)); + + // Load the sphere. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); + + // Set w of the center to one so we can dot4 with a plane. + vCenter = XMVectorInsert<0, 0, 0, 0, 1>(vCenter, XMVectorSplatOne()); + + XMVECTOR Outside, Inside; + DirectX::Internal::FastIntersectSpherePlane(vCenter, vRadius, Plane, Outside, Inside); + + // If the sphere is outside any plane it is outside. + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return FRONT; + + // If the sphere is inside all planes it is inside. + if (XMVector4EqualInt(Inside, XMVectorTrueInt())) + return BACK; + + // The sphere is not inside all planes or outside a plane it intersects. + return INTERSECTING; +} + + +//----------------------------------------------------------------------------- +// Compute the intersection of a ray (Origin, Direction) with a sphere. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool XM_CALLCONV BoundingSphere::Intersects(FXMVECTOR Origin, FXMVECTOR Direction, float& Dist) const noexcept +{ + assert(DirectX::Internal::XMVector3IsUnit(Direction)); + + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); + + // l is the vector from the ray origin to the center of the sphere. + XMVECTOR l = XMVectorSubtract(vCenter, Origin); + + // s is the projection of the l onto the ray direction. + XMVECTOR s = XMVector3Dot(l, Direction); + + XMVECTOR l2 = XMVector3Dot(l, l); + + XMVECTOR r2 = XMVectorMultiply(vRadius, vRadius); + + // m2 is squared distance from the center of the sphere to the projection. + XMVECTOR m2 = XMVectorNegativeMultiplySubtract(s, s, l2); + + XMVECTOR NoIntersection; + + // If the ray origin is outside the sphere and the center of the sphere is + // behind the ray origin there is no intersection. + NoIntersection = XMVectorAndInt(XMVectorLess(s, XMVectorZero()), XMVectorGreater(l2, r2)); + + // If the squared distance from the center of the sphere to the projection + // is greater than the radius squared the ray will miss the sphere. + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(m2, r2)); + + // The ray hits the sphere, compute the nearest intersection point. + XMVECTOR q = XMVectorSqrt(XMVectorSubtract(r2, m2)); + XMVECTOR t1 = XMVectorSubtract(s, q); + XMVECTOR t2 = XMVectorAdd(s, q); + + XMVECTOR OriginInside = XMVectorLessOrEqual(l2, r2); + XMVECTOR t = XMVectorSelect(t1, t2, OriginInside); + + if (XMVector4NotEqualInt(NoIntersection, XMVectorTrueInt())) + { + // Store the x-component to *pDist. + XMStoreFloat(&Dist, t); + return true; + } + + Dist = 0.f; + return false; +} + + +//----------------------------------------------------------------------------- +// Test a sphere vs 6 planes (typically forming a frustum). +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType XM_CALLCONV BoundingSphere::ContainedBy( + FXMVECTOR Plane0, FXMVECTOR Plane1, FXMVECTOR Plane2, + GXMVECTOR Plane3, + HXMVECTOR Plane4, HXMVECTOR Plane5) const noexcept +{ + // Load the sphere. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); + + // Set w of the center to one so we can dot4 with a plane. + vCenter = XMVectorInsert<0, 0, 0, 0, 1>(vCenter, XMVectorSplatOne()); + + XMVECTOR Outside, Inside; + + // Test against each plane. + DirectX::Internal::FastIntersectSpherePlane(vCenter, vRadius, Plane0, Outside, Inside); + + XMVECTOR AnyOutside = Outside; + XMVECTOR AllInside = Inside; + + DirectX::Internal::FastIntersectSpherePlane(vCenter, vRadius, Plane1, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::Internal::FastIntersectSpherePlane(vCenter, vRadius, Plane2, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::Internal::FastIntersectSpherePlane(vCenter, vRadius, Plane3, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::Internal::FastIntersectSpherePlane(vCenter, vRadius, Plane4, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::Internal::FastIntersectSpherePlane(vCenter, vRadius, Plane5, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + // If the sphere is outside any plane it is outside. + if (XMVector4EqualInt(AnyOutside, XMVectorTrueInt())) + return DISJOINT; + + // If the sphere is inside all planes it is inside. + if (XMVector4EqualInt(AllInside, XMVectorTrueInt())) + return CONTAINS; + + // The sphere is not inside all planes or outside a plane, it may intersect. + return INTERSECTS; +} + + +//----------------------------------------------------------------------------- +// Creates a bounding sphere that contains two other bounding spheres +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void BoundingSphere::CreateMerged(BoundingSphere& Out, const BoundingSphere& S1, const BoundingSphere& S2) noexcept +{ + XMVECTOR Center1 = XMLoadFloat3(&S1.Center); + float r1 = S1.Radius; + + XMVECTOR Center2 = XMLoadFloat3(&S2.Center); + float r2 = S2.Radius; + + XMVECTOR V = XMVectorSubtract(Center2, Center1); + + XMVECTOR Dist = XMVector3Length(V); + + float d = XMVectorGetX(Dist); + + if (r1 + r2 >= d) + { + if (r1 - r2 >= d) + { + Out = S1; + return; + } + else if (r2 - r1 >= d) + { + Out = S2; + return; + } + } + + XMVECTOR N = XMVectorDivide(V, Dist); + + float t1 = XMMin(-r1, d - r2); + float t2 = XMMax(r1, d + r2); + float t_5 = (t2 - t1) * 0.5f; + + XMVECTOR NCenter = XMVectorAdd(Center1, XMVectorMultiply(N, XMVectorReplicate(t_5 + t1))); + + XMStoreFloat3(&Out.Center, NCenter); + Out.Radius = t_5; +} + + +//----------------------------------------------------------------------------- +// Create sphere enscribing bounding box +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void BoundingSphere::CreateFromBoundingBox(BoundingSphere& Out, const BoundingBox& box) noexcept +{ + Out.Center = box.Center; + XMVECTOR vExtents = XMLoadFloat3(&box.Extents); + Out.Radius = XMVectorGetX(XMVector3Length(vExtents)); +} + +_Use_decl_annotations_ +inline void BoundingSphere::CreateFromBoundingBox(BoundingSphere& Out, const BoundingOrientedBox& box) noexcept +{ + // Bounding box orientation is irrelevant because a sphere is rotationally invariant + Out.Center = box.Center; + XMVECTOR vExtents = XMLoadFloat3(&box.Extents); + Out.Radius = XMVectorGetX(XMVector3Length(vExtents)); +} + + +//----------------------------------------------------------------------------- +// Find the approximate smallest enclosing bounding sphere for a set of +// points. Exact computation of the smallest enclosing bounding sphere is +// possible but is slower and requires a more complex algorithm. +// The algorithm is based on Jack Ritter, "An Efficient Bounding Sphere", +// Graphics Gems. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void BoundingSphere::CreateFromPoints(BoundingSphere& Out, size_t Count, const XMFLOAT3* pPoints, size_t Stride) noexcept +{ + assert(Count > 0); + assert(pPoints); + + // Find the points with minimum and maximum x, y, and z + XMVECTOR MinX, MaxX, MinY, MaxY, MinZ, MaxZ; + + MinX = MaxX = MinY = MaxY = MinZ = MaxZ = XMLoadFloat3(pPoints); + + for (size_t i = 1; i < Count; ++i) + { + XMVECTOR Point = XMLoadFloat3(reinterpret_cast(reinterpret_cast(pPoints) + i * Stride)); + + float px = XMVectorGetX(Point); + float py = XMVectorGetY(Point); + float pz = XMVectorGetZ(Point); + + if (px < XMVectorGetX(MinX)) + MinX = Point; + + if (px > XMVectorGetX(MaxX)) + MaxX = Point; + + if (py < XMVectorGetY(MinY)) + MinY = Point; + + if (py > XMVectorGetY(MaxY)) + MaxY = Point; + + if (pz < XMVectorGetZ(MinZ)) + MinZ = Point; + + if (pz > XMVectorGetZ(MaxZ)) + MaxZ = Point; + } + + // Use the min/max pair that are farthest apart to form the initial sphere. + XMVECTOR DeltaX = XMVectorSubtract(MaxX, MinX); + XMVECTOR DistX = XMVector3Length(DeltaX); + + XMVECTOR DeltaY = XMVectorSubtract(MaxY, MinY); + XMVECTOR DistY = XMVector3Length(DeltaY); + + XMVECTOR DeltaZ = XMVectorSubtract(MaxZ, MinZ); + XMVECTOR DistZ = XMVector3Length(DeltaZ); + + XMVECTOR vCenter; + XMVECTOR vRadius; + + if (XMVector3Greater(DistX, DistY)) + { + if (XMVector3Greater(DistX, DistZ)) + { + // Use min/max x. + vCenter = XMVectorLerp(MaxX, MinX, 0.5f); + vRadius = XMVectorScale(DistX, 0.5f); + } + else + { + // Use min/max z. + vCenter = XMVectorLerp(MaxZ, MinZ, 0.5f); + vRadius = XMVectorScale(DistZ, 0.5f); + } + } + else // Y >= X + { + if (XMVector3Greater(DistY, DistZ)) + { + // Use min/max y. + vCenter = XMVectorLerp(MaxY, MinY, 0.5f); + vRadius = XMVectorScale(DistY, 0.5f); + } + else + { + // Use min/max z. + vCenter = XMVectorLerp(MaxZ, MinZ, 0.5f); + vRadius = XMVectorScale(DistZ, 0.5f); + } + } + + // Add any points not inside the sphere. + for (size_t i = 0; i < Count; ++i) + { + XMVECTOR Point = XMLoadFloat3(reinterpret_cast(reinterpret_cast(pPoints) + i * Stride)); + + XMVECTOR Delta = XMVectorSubtract(Point, vCenter); + + XMVECTOR Dist = XMVector3Length(Delta); + + if (XMVector3Greater(Dist, vRadius)) + { + // Adjust sphere to include the new point. + vRadius = XMVectorScale(XMVectorAdd(vRadius, Dist), 0.5f); + vCenter = XMVectorAdd(vCenter, XMVectorMultiply(XMVectorSubtract(XMVectorReplicate(1.0f), XMVectorDivide(vRadius, Dist)), Delta)); + } + } + + XMStoreFloat3(&Out.Center, vCenter); + XMStoreFloat(&Out.Radius, vRadius); +} + + +//----------------------------------------------------------------------------- +// Create sphere containing frustum +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void BoundingSphere::CreateFromFrustum(BoundingSphere& Out, const BoundingFrustum& fr) noexcept +{ + XMFLOAT3 Corners[BoundingFrustum::CORNER_COUNT]; + fr.GetCorners(Corners); + CreateFromPoints(Out, BoundingFrustum::CORNER_COUNT, Corners, sizeof(XMFLOAT3)); +} + + +/**************************************************************************** + * + * BoundingBox + * + ****************************************************************************/ + + //----------------------------------------------------------------------------- + // Transform an axis aligned box by an angle preserving transform. + //----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void XM_CALLCONV BoundingBox::Transform(BoundingBox& Out, FXMMATRIX M) const noexcept +{ + // Load center and extents. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + + // Compute and transform the corners and find new min/max bounds. + XMVECTOR Corner = XMVectorMultiplyAdd(vExtents, g_BoxOffset[0], vCenter); + Corner = XMVector3Transform(Corner, M); + + XMVECTOR Min, Max; + Min = Max = Corner; + + for (size_t i = 1; i < CORNER_COUNT; ++i) + { + Corner = XMVectorMultiplyAdd(vExtents, g_BoxOffset[i], vCenter); + Corner = XMVector3Transform(Corner, M); + + Min = XMVectorMin(Min, Corner); + Max = XMVectorMax(Max, Corner); + } + + // Store center and extents. + XMStoreFloat3(&Out.Center, XMVectorScale(XMVectorAdd(Min, Max), 0.5f)); + XMStoreFloat3(&Out.Extents, XMVectorScale(XMVectorSubtract(Max, Min), 0.5f)); +} + +_Use_decl_annotations_ +inline void XM_CALLCONV BoundingBox::Transform(BoundingBox& Out, float Scale, FXMVECTOR Rotation, FXMVECTOR Translation) const noexcept +{ + assert(DirectX::Internal::XMQuaternionIsUnit(Rotation)); + + // Load center and extents. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + + XMVECTOR VectorScale = XMVectorReplicate(Scale); + + // Compute and transform the corners and find new min/max bounds. + XMVECTOR Corner = XMVectorMultiplyAdd(vExtents, g_BoxOffset[0], vCenter); + Corner = XMVectorAdd(XMVector3Rotate(XMVectorMultiply(Corner, VectorScale), Rotation), Translation); + + XMVECTOR Min, Max; + Min = Max = Corner; + + for (size_t i = 1; i < CORNER_COUNT; ++i) + { + Corner = XMVectorMultiplyAdd(vExtents, g_BoxOffset[i], vCenter); + Corner = XMVectorAdd(XMVector3Rotate(XMVectorMultiply(Corner, VectorScale), Rotation), Translation); + + Min = XMVectorMin(Min, Corner); + Max = XMVectorMax(Max, Corner); + } + + // Store center and extents. + XMStoreFloat3(&Out.Center, XMVectorScale(XMVectorAdd(Min, Max), 0.5f)); + XMStoreFloat3(&Out.Extents, XMVectorScale(XMVectorSubtract(Max, Min), 0.5f)); +} + + +//----------------------------------------------------------------------------- +// Get the corner points of the box +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void BoundingBox::GetCorners(XMFLOAT3* Corners) const noexcept +{ + assert(Corners != nullptr); + + // Load the box + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + + for (size_t i = 0; i < CORNER_COUNT; ++i) + { + XMVECTOR C = XMVectorMultiplyAdd(vExtents, g_BoxOffset[i], vCenter); + XMStoreFloat3(&Corners[i], C); + } +} + + +//----------------------------------------------------------------------------- +// Point in axis-aligned box test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType XM_CALLCONV BoundingBox::Contains(FXMVECTOR Point) const noexcept +{ + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + + return XMVector3InBounds(XMVectorSubtract(Point, vCenter), vExtents) ? CONTAINS : DISJOINT; +} + + +//----------------------------------------------------------------------------- +// Triangle in axis-aligned box test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType XM_CALLCONV BoundingBox::Contains(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2) const noexcept +{ + if (!Intersects(V0, V1, V2)) + return DISJOINT; + + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + + XMVECTOR d = XMVectorAbs(XMVectorSubtract(V0, vCenter)); + XMVECTOR Inside = XMVectorLessOrEqual(d, vExtents); + + d = XMVectorAbs(XMVectorSubtract(V1, vCenter)); + Inside = XMVectorAndInt(Inside, XMVectorLessOrEqual(d, vExtents)); + + d = XMVectorAbs(XMVectorSubtract(V2, vCenter)); + Inside = XMVectorAndInt(Inside, XMVectorLessOrEqual(d, vExtents)); + + return (XMVector3EqualInt(Inside, XMVectorTrueInt())) ? CONTAINS : INTERSECTS; +} + + +//----------------------------------------------------------------------------- +// Sphere in axis-aligned box test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingBox::Contains(const BoundingSphere& sh) const noexcept +{ + XMVECTOR SphereCenter = XMLoadFloat3(&sh.Center); + XMVECTOR SphereRadius = XMVectorReplicatePtr(&sh.Radius); + + XMVECTOR BoxCenter = XMLoadFloat3(&Center); + XMVECTOR BoxExtents = XMLoadFloat3(&Extents); + + XMVECTOR BoxMin = XMVectorSubtract(BoxCenter, BoxExtents); + XMVECTOR BoxMax = XMVectorAdd(BoxCenter, BoxExtents); + + // Find the distance to the nearest point on the box. + // for each i in (x, y, z) + // if (SphereCenter(i) < BoxMin(i)) d2 += (SphereCenter(i) - BoxMin(i)) ^ 2 + // else if (SphereCenter(i) > BoxMax(i)) d2 += (SphereCenter(i) - BoxMax(i)) ^ 2 + + XMVECTOR d = XMVectorZero(); + + // Compute d for each dimension. + XMVECTOR LessThanMin = XMVectorLess(SphereCenter, BoxMin); + XMVECTOR GreaterThanMax = XMVectorGreater(SphereCenter, BoxMax); + + XMVECTOR MinDelta = XMVectorSubtract(SphereCenter, BoxMin); + XMVECTOR MaxDelta = XMVectorSubtract(SphereCenter, BoxMax); + + // Choose value for each dimension based on the comparison. + d = XMVectorSelect(d, MinDelta, LessThanMin); + d = XMVectorSelect(d, MaxDelta, GreaterThanMax); + + // Use a dot-product to square them and sum them together. + XMVECTOR d2 = XMVector3Dot(d, d); + + if (XMVector3Greater(d2, XMVectorMultiply(SphereRadius, SphereRadius))) + return DISJOINT; + + XMVECTOR InsideAll = XMVectorLessOrEqual(XMVectorAdd(BoxMin, SphereRadius), SphereCenter); + InsideAll = XMVectorAndInt(InsideAll, XMVectorLessOrEqual(SphereCenter, XMVectorSubtract(BoxMax, SphereRadius))); + InsideAll = XMVectorAndInt(InsideAll, XMVectorGreater(XMVectorSubtract(BoxMax, BoxMin), SphereRadius)); + + return (XMVector3EqualInt(InsideAll, XMVectorTrueInt())) ? CONTAINS : INTERSECTS; +} + + +//----------------------------------------------------------------------------- +// Axis-aligned box in axis-aligned box test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingBox::Contains(const BoundingBox& box) const noexcept +{ + XMVECTOR CenterA = XMLoadFloat3(&Center); + XMVECTOR ExtentsA = XMLoadFloat3(&Extents); + + XMVECTOR CenterB = XMLoadFloat3(&box.Center); + XMVECTOR ExtentsB = XMLoadFloat3(&box.Extents); + + XMVECTOR MinA = XMVectorSubtract(CenterA, ExtentsA); + XMVECTOR MaxA = XMVectorAdd(CenterA, ExtentsA); + + XMVECTOR MinB = XMVectorSubtract(CenterB, ExtentsB); + XMVECTOR MaxB = XMVectorAdd(CenterB, ExtentsB); + + // for each i in (x, y, z) if a_min(i) > b_max(i) or b_min(i) > a_max(i) then return false + XMVECTOR Disjoint = XMVectorOrInt(XMVectorGreater(MinA, MaxB), XMVectorGreater(MinB, MaxA)); + + if (DirectX::Internal::XMVector3AnyTrue(Disjoint)) + return DISJOINT; + + // for each i in (x, y, z) if a_min(i) <= b_min(i) and b_max(i) <= a_max(i) then A contains B + XMVECTOR Inside = XMVectorAndInt(XMVectorLessOrEqual(MinA, MinB), XMVectorLessOrEqual(MaxB, MaxA)); + + return DirectX::Internal::XMVector3AllTrue(Inside) ? CONTAINS : INTERSECTS; +} + + +//----------------------------------------------------------------------------- +// Oriented box in axis-aligned box test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingBox::Contains(const BoundingOrientedBox& box) const noexcept +{ + if (!box.Intersects(*this)) + return DISJOINT; + + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + + // Subtract off the AABB center to remove a subtract below + XMVECTOR oCenter = XMVectorSubtract(XMLoadFloat3(&box.Center), vCenter); + + XMVECTOR oExtents = XMLoadFloat3(&box.Extents); + XMVECTOR oOrientation = XMLoadFloat4(&box.Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(oOrientation)); + + XMVECTOR Inside = XMVectorTrueInt(); + + for (size_t i = 0; i < BoundingOrientedBox::CORNER_COUNT; ++i) + { + XMVECTOR C = XMVectorAdd(XMVector3Rotate(XMVectorMultiply(oExtents, g_BoxOffset[i]), oOrientation), oCenter); + XMVECTOR d = XMVectorAbs(C); + Inside = XMVectorAndInt(Inside, XMVectorLessOrEqual(d, vExtents)); + } + + return (XMVector3EqualInt(Inside, XMVectorTrueInt())) ? CONTAINS : INTERSECTS; +} + + +//----------------------------------------------------------------------------- +// Frustum in axis-aligned box test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingBox::Contains(const BoundingFrustum& fr) const noexcept +{ + if (!fr.Intersects(*this)) + return DISJOINT; + + XMFLOAT3 Corners[BoundingFrustum::CORNER_COUNT]; + fr.GetCorners(Corners); + + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + + XMVECTOR Inside = XMVectorTrueInt(); + + for (size_t i = 0; i < BoundingFrustum::CORNER_COUNT; ++i) + { + XMVECTOR Point = XMLoadFloat3(&Corners[i]); + XMVECTOR d = XMVectorAbs(XMVectorSubtract(Point, vCenter)); + Inside = XMVectorAndInt(Inside, XMVectorLessOrEqual(d, vExtents)); + } + + return (XMVector3EqualInt(Inside, XMVectorTrueInt())) ? CONTAINS : INTERSECTS; +} + + +//----------------------------------------------------------------------------- +// Sphere vs axis-aligned box test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingBox::Intersects(const BoundingSphere& sh) const noexcept +{ + XMVECTOR SphereCenter = XMLoadFloat3(&sh.Center); + XMVECTOR SphereRadius = XMVectorReplicatePtr(&sh.Radius); + + XMVECTOR BoxCenter = XMLoadFloat3(&Center); + XMVECTOR BoxExtents = XMLoadFloat3(&Extents); + + XMVECTOR BoxMin = XMVectorSubtract(BoxCenter, BoxExtents); + XMVECTOR BoxMax = XMVectorAdd(BoxCenter, BoxExtents); + + // Find the distance to the nearest point on the box. + // for each i in (x, y, z) + // if (SphereCenter(i) < BoxMin(i)) d2 += (SphereCenter(i) - BoxMin(i)) ^ 2 + // else if (SphereCenter(i) > BoxMax(i)) d2 += (SphereCenter(i) - BoxMax(i)) ^ 2 + + XMVECTOR d = XMVectorZero(); + + // Compute d for each dimension. + XMVECTOR LessThanMin = XMVectorLess(SphereCenter, BoxMin); + XMVECTOR GreaterThanMax = XMVectorGreater(SphereCenter, BoxMax); + + XMVECTOR MinDelta = XMVectorSubtract(SphereCenter, BoxMin); + XMVECTOR MaxDelta = XMVectorSubtract(SphereCenter, BoxMax); + + // Choose value for each dimension based on the comparison. + d = XMVectorSelect(d, MinDelta, LessThanMin); + d = XMVectorSelect(d, MaxDelta, GreaterThanMax); + + // Use a dot-product to square them and sum them together. + XMVECTOR d2 = XMVector3Dot(d, d); + + return XMVector3LessOrEqual(d2, XMVectorMultiply(SphereRadius, SphereRadius)); +} + + +//----------------------------------------------------------------------------- +// Axis-aligned box vs. axis-aligned box test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingBox::Intersects(const BoundingBox& box) const noexcept +{ + XMVECTOR CenterA = XMLoadFloat3(&Center); + XMVECTOR ExtentsA = XMLoadFloat3(&Extents); + + XMVECTOR CenterB = XMLoadFloat3(&box.Center); + XMVECTOR ExtentsB = XMLoadFloat3(&box.Extents); + + XMVECTOR MinA = XMVectorSubtract(CenterA, ExtentsA); + XMVECTOR MaxA = XMVectorAdd(CenterA, ExtentsA); + + XMVECTOR MinB = XMVectorSubtract(CenterB, ExtentsB); + XMVECTOR MaxB = XMVectorAdd(CenterB, ExtentsB); + + // for each i in (x, y, z) if a_min(i) > b_max(i) or b_min(i) > a_max(i) then return false + XMVECTOR Disjoint = XMVectorOrInt(XMVectorGreater(MinA, MaxB), XMVectorGreater(MinB, MaxA)); + + return !DirectX::Internal::XMVector3AnyTrue(Disjoint); +} + + +//----------------------------------------------------------------------------- +// Oriented box vs. axis-aligned box test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingBox::Intersects(const BoundingOrientedBox& box) const noexcept +{ + return box.Intersects(*this); +} + + +//----------------------------------------------------------------------------- +// Frustum vs. axis-aligned box test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingBox::Intersects(const BoundingFrustum& fr) const noexcept +{ + return fr.Intersects(*this); +} + + +//----------------------------------------------------------------------------- +// Triangle vs. axis aligned box test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool XM_CALLCONV BoundingBox::Intersects(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2) const noexcept +{ + XMVECTOR Zero = XMVectorZero(); + + // Load the box. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + + XMVECTOR BoxMin = XMVectorSubtract(vCenter, vExtents); + XMVECTOR BoxMax = XMVectorAdd(vCenter, vExtents); + + // Test the axes of the box (in effect test the AAB against the minimal AAB + // around the triangle). + XMVECTOR TriMin = XMVectorMin(XMVectorMin(V0, V1), V2); + XMVECTOR TriMax = XMVectorMax(XMVectorMax(V0, V1), V2); + + // for each i in (x, y, z) if a_min(i) > b_max(i) or b_min(i) > a_max(i) then disjoint + XMVECTOR Disjoint = XMVectorOrInt(XMVectorGreater(TriMin, BoxMax), XMVectorGreater(BoxMin, TriMax)); + if (DirectX::Internal::XMVector3AnyTrue(Disjoint)) + return false; + + // Test the plane of the triangle. + XMVECTOR Normal = XMVector3Cross(XMVectorSubtract(V1, V0), XMVectorSubtract(V2, V0)); + XMVECTOR Dist = XMVector3Dot(Normal, V0); + + // Assert that the triangle is not degenerate. + assert(!XMVector3Equal(Normal, Zero)); + + // for each i in (x, y, z) if n(i) >= 0 then v_min(i)=b_min(i), v_max(i)=b_max(i) + // else v_min(i)=b_max(i), v_max(i)=b_min(i) + XMVECTOR NormalSelect = XMVectorGreater(Normal, Zero); + XMVECTOR V_Min = XMVectorSelect(BoxMax, BoxMin, NormalSelect); + XMVECTOR V_Max = XMVectorSelect(BoxMin, BoxMax, NormalSelect); + + // if n dot v_min + d > 0 || n dot v_max + d < 0 then disjoint + XMVECTOR MinDist = XMVector3Dot(V_Min, Normal); + XMVECTOR MaxDist = XMVector3Dot(V_Max, Normal); + + XMVECTOR NoIntersection = XMVectorGreater(MinDist, Dist); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(MaxDist, Dist)); + + // Move the box center to zero to simplify the following tests. + XMVECTOR TV0 = XMVectorSubtract(V0, vCenter); + XMVECTOR TV1 = XMVectorSubtract(V1, vCenter); + XMVECTOR TV2 = XMVectorSubtract(V2, vCenter); + + // Test the edge/edge axes (3*3). + XMVECTOR e0 = XMVectorSubtract(TV1, TV0); + XMVECTOR e1 = XMVectorSubtract(TV2, TV1); + XMVECTOR e2 = XMVectorSubtract(TV0, TV2); + + // Make w zero. + e0 = XMVectorInsert<0, 0, 0, 0, 1>(e0, Zero); + e1 = XMVectorInsert<0, 0, 0, 0, 1>(e1, Zero); + e2 = XMVectorInsert<0, 0, 0, 0, 1>(e2, Zero); + + XMVECTOR Axis; + XMVECTOR p0, p1, p2; + XMVECTOR Min, Max; + XMVECTOR Radius; + + // Axis == (1,0,0) x e0 = (0, -e0.z, e0.y) + Axis = XMVectorPermute(e0, XMVectorNegate(e0)); + p0 = XMVector3Dot(TV0, Axis); + // p1 = XMVector3Dot( V1, Axis ); // p1 = p0; + p2 = XMVector3Dot(TV2, Axis); + Min = XMVectorMin(p0, p2); + Max = XMVectorMax(p0, p2); + Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); + + // Axis == (1,0,0) x e1 = (0, -e1.z, e1.y) + Axis = XMVectorPermute(e1, XMVectorNegate(e1)); + p0 = XMVector3Dot(TV0, Axis); + p1 = XMVector3Dot(TV1, Axis); + // p2 = XMVector3Dot( V2, Axis ); // p2 = p1; + Min = XMVectorMin(p0, p1); + Max = XMVectorMax(p0, p1); + Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); + + // Axis == (1,0,0) x e2 = (0, -e2.z, e2.y) + Axis = XMVectorPermute(e2, XMVectorNegate(e2)); + p0 = XMVector3Dot(TV0, Axis); + p1 = XMVector3Dot(TV1, Axis); + // p2 = XMVector3Dot( V2, Axis ); // p2 = p0; + Min = XMVectorMin(p0, p1); + Max = XMVectorMax(p0, p1); + Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); + + // Axis == (0,1,0) x e0 = (e0.z, 0, -e0.x) + Axis = XMVectorPermute(e0, XMVectorNegate(e0)); + p0 = XMVector3Dot(TV0, Axis); + // p1 = XMVector3Dot( V1, Axis ); // p1 = p0; + p2 = XMVector3Dot(TV2, Axis); + Min = XMVectorMin(p0, p2); + Max = XMVectorMax(p0, p2); + Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); + + // Axis == (0,1,0) x e1 = (e1.z, 0, -e1.x) + Axis = XMVectorPermute(e1, XMVectorNegate(e1)); + p0 = XMVector3Dot(TV0, Axis); + p1 = XMVector3Dot(TV1, Axis); + // p2 = XMVector3Dot( V2, Axis ); // p2 = p1; + Min = XMVectorMin(p0, p1); + Max = XMVectorMax(p0, p1); + Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); + + // Axis == (0,0,1) x e2 = (e2.z, 0, -e2.x) + Axis = XMVectorPermute(e2, XMVectorNegate(e2)); + p0 = XMVector3Dot(TV0, Axis); + p1 = XMVector3Dot(TV1, Axis); + // p2 = XMVector3Dot( V2, Axis ); // p2 = p0; + Min = XMVectorMin(p0, p1); + Max = XMVectorMax(p0, p1); + Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); + + // Axis == (0,0,1) x e0 = (-e0.y, e0.x, 0) + Axis = XMVectorPermute(e0, XMVectorNegate(e0)); + p0 = XMVector3Dot(TV0, Axis); + // p1 = XMVector3Dot( V1, Axis ); // p1 = p0; + p2 = XMVector3Dot(TV2, Axis); + Min = XMVectorMin(p0, p2); + Max = XMVectorMax(p0, p2); + Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); + + // Axis == (0,0,1) x e1 = (-e1.y, e1.x, 0) + Axis = XMVectorPermute(e1, XMVectorNegate(e1)); + p0 = XMVector3Dot(TV0, Axis); + p1 = XMVector3Dot(TV1, Axis); + // p2 = XMVector3Dot( V2, Axis ); // p2 = p1; + Min = XMVectorMin(p0, p1); + Max = XMVectorMax(p0, p1); + Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); + + // Axis == (0,0,1) x e2 = (-e2.y, e2.x, 0) + Axis = XMVectorPermute(e2, XMVectorNegate(e2)); + p0 = XMVector3Dot(TV0, Axis); + p1 = XMVector3Dot(TV1, Axis); + // p2 = XMVector3Dot( V2, Axis ); // p2 = p0; + Min = XMVectorMin(p0, p1); + Max = XMVectorMax(p0, p1); + Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); + + return XMVector4NotEqualInt(NoIntersection, XMVectorTrueInt()); +} + + +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline PlaneIntersectionType XM_CALLCONV BoundingBox::Intersects(FXMVECTOR Plane) const noexcept +{ + assert(DirectX::Internal::XMPlaneIsUnit(Plane)); + + // Load the box. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + + // Set w of the center to one so we can dot4 with a plane. + vCenter = XMVectorInsert<0, 0, 0, 0, 1>(vCenter, XMVectorSplatOne()); + + XMVECTOR Outside, Inside; + DirectX::Internal::FastIntersectAxisAlignedBoxPlane(vCenter, vExtents, Plane, Outside, Inside); + + // If the box is outside any plane it is outside. + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return FRONT; + + // If the box is inside all planes it is inside. + if (XMVector4EqualInt(Inside, XMVectorTrueInt())) + return BACK; + + // The box is not inside all planes or outside a plane it intersects. + return INTERSECTING; +} + + +//----------------------------------------------------------------------------- +// Compute the intersection of a ray (Origin, Direction) with an axis aligned +// box using the slabs method. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool XM_CALLCONV BoundingBox::Intersects(FXMVECTOR Origin, FXMVECTOR Direction, float& Dist) const noexcept +{ + assert(DirectX::Internal::XMVector3IsUnit(Direction)); + + // Load the box. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + + // Adjust ray origin to be relative to center of the box. + XMVECTOR TOrigin = XMVectorSubtract(vCenter, Origin); + + // Compute the dot product againt each axis of the box. + // Since the axii are (1,0,0), (0,1,0), (0,0,1) no computation is necessary. + XMVECTOR AxisDotOrigin = TOrigin; + XMVECTOR AxisDotDirection = Direction; + + // if (fabs(AxisDotDirection) <= Epsilon) the ray is nearly parallel to the slab. + XMVECTOR IsParallel = XMVectorLessOrEqual(XMVectorAbs(AxisDotDirection), g_RayEpsilon); + + // Test against all three axii simultaneously. + XMVECTOR InverseAxisDotDirection = XMVectorReciprocal(AxisDotDirection); + XMVECTOR t1 = XMVectorMultiply(XMVectorSubtract(AxisDotOrigin, vExtents), InverseAxisDotDirection); + XMVECTOR t2 = XMVectorMultiply(XMVectorAdd(AxisDotOrigin, vExtents), InverseAxisDotDirection); + + // Compute the max of min(t1,t2) and the min of max(t1,t2) ensuring we don't + // use the results from any directions parallel to the slab. + XMVECTOR t_min = XMVectorSelect(XMVectorMin(t1, t2), g_FltMin, IsParallel); + XMVECTOR t_max = XMVectorSelect(XMVectorMax(t1, t2), g_FltMax, IsParallel); + + // t_min.x = maximum( t_min.x, t_min.y, t_min.z ); + // t_max.x = minimum( t_max.x, t_max.y, t_max.z ); + t_min = XMVectorMax(t_min, XMVectorSplatY(t_min)); // x = max(x,y) + t_min = XMVectorMax(t_min, XMVectorSplatZ(t_min)); // x = max(max(x,y),z) + t_max = XMVectorMin(t_max, XMVectorSplatY(t_max)); // x = min(x,y) + t_max = XMVectorMin(t_max, XMVectorSplatZ(t_max)); // x = min(min(x,y),z) + + // if ( t_min > t_max ) return false; + XMVECTOR NoIntersection = XMVectorGreater(XMVectorSplatX(t_min), XMVectorSplatX(t_max)); + + // if ( t_max < 0.0f ) return false; + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(XMVectorSplatX(t_max), XMVectorZero())); + + // if (IsParallel && (-Extents > AxisDotOrigin || Extents < AxisDotOrigin)) return false; + XMVECTOR ParallelOverlap = XMVectorInBounds(AxisDotOrigin, vExtents); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorAndCInt(IsParallel, ParallelOverlap)); + + if (!DirectX::Internal::XMVector3AnyTrue(NoIntersection)) + { + // Store the x-component to *pDist + XMStoreFloat(&Dist, t_min); + return true; + } + + Dist = 0.f; + return false; +} + + +//----------------------------------------------------------------------------- +// Test an axis alinged box vs 6 planes (typically forming a frustum). +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType XM_CALLCONV BoundingBox::ContainedBy( + FXMVECTOR Plane0, FXMVECTOR Plane1, FXMVECTOR Plane2, + GXMVECTOR Plane3, + HXMVECTOR Plane4, HXMVECTOR Plane5) const noexcept +{ + // Load the box. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + + // Set w of the center to one so we can dot4 with a plane. + vCenter = XMVectorInsert<0, 0, 0, 0, 1>(vCenter, XMVectorSplatOne()); + + XMVECTOR Outside, Inside; + + // Test against each plane. + DirectX::Internal::FastIntersectAxisAlignedBoxPlane(vCenter, vExtents, Plane0, Outside, Inside); + + XMVECTOR AnyOutside = Outside; + XMVECTOR AllInside = Inside; + + DirectX::Internal::FastIntersectAxisAlignedBoxPlane(vCenter, vExtents, Plane1, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::Internal::FastIntersectAxisAlignedBoxPlane(vCenter, vExtents, Plane2, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::Internal::FastIntersectAxisAlignedBoxPlane(vCenter, vExtents, Plane3, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::Internal::FastIntersectAxisAlignedBoxPlane(vCenter, vExtents, Plane4, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::Internal::FastIntersectAxisAlignedBoxPlane(vCenter, vExtents, Plane5, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + // If the box is outside any plane it is outside. + if (XMVector4EqualInt(AnyOutside, XMVectorTrueInt())) + return DISJOINT; + + // If the box is inside all planes it is inside. + if (XMVector4EqualInt(AllInside, XMVectorTrueInt())) + return CONTAINS; + + // The box is not inside all planes or outside a plane, it may intersect. + return INTERSECTS; +} + + +//----------------------------------------------------------------------------- +// Create axis-aligned box that contains two other bounding boxes +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void BoundingBox::CreateMerged(BoundingBox& Out, const BoundingBox& b1, const BoundingBox& b2) noexcept +{ + XMVECTOR b1Center = XMLoadFloat3(&b1.Center); + XMVECTOR b1Extents = XMLoadFloat3(&b1.Extents); + + XMVECTOR b2Center = XMLoadFloat3(&b2.Center); + XMVECTOR b2Extents = XMLoadFloat3(&b2.Extents); + + XMVECTOR Min = XMVectorSubtract(b1Center, b1Extents); + Min = XMVectorMin(Min, XMVectorSubtract(b2Center, b2Extents)); + + XMVECTOR Max = XMVectorAdd(b1Center, b1Extents); + Max = XMVectorMax(Max, XMVectorAdd(b2Center, b2Extents)); + + assert(XMVector3LessOrEqual(Min, Max)); + + XMStoreFloat3(&Out.Center, XMVectorScale(XMVectorAdd(Min, Max), 0.5f)); + XMStoreFloat3(&Out.Extents, XMVectorScale(XMVectorSubtract(Max, Min), 0.5f)); +} + + +//----------------------------------------------------------------------------- +// Create axis-aligned box that contains a bounding sphere +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void BoundingBox::CreateFromSphere(BoundingBox& Out, const BoundingSphere& sh) noexcept +{ + XMVECTOR spCenter = XMLoadFloat3(&sh.Center); + XMVECTOR shRadius = XMVectorReplicatePtr(&sh.Radius); + + XMVECTOR Min = XMVectorSubtract(spCenter, shRadius); + XMVECTOR Max = XMVectorAdd(spCenter, shRadius); + + assert(XMVector3LessOrEqual(Min, Max)); + + XMStoreFloat3(&Out.Center, XMVectorScale(XMVectorAdd(Min, Max), 0.5f)); + XMStoreFloat3(&Out.Extents, XMVectorScale(XMVectorSubtract(Max, Min), 0.5f)); +} + + +//----------------------------------------------------------------------------- +// Create axis-aligned box from min/max points +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void XM_CALLCONV BoundingBox::CreateFromPoints(BoundingBox& Out, FXMVECTOR pt1, FXMVECTOR pt2) noexcept +{ + XMVECTOR Min = XMVectorMin(pt1, pt2); + XMVECTOR Max = XMVectorMax(pt1, pt2); + + // Store center and extents. + XMStoreFloat3(&Out.Center, XMVectorScale(XMVectorAdd(Min, Max), 0.5f)); + XMStoreFloat3(&Out.Extents, XMVectorScale(XMVectorSubtract(Max, Min), 0.5f)); +} + + +//----------------------------------------------------------------------------- +// Find the minimum axis aligned bounding box containing a set of points. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void BoundingBox::CreateFromPoints(BoundingBox& Out, size_t Count, const XMFLOAT3* pPoints, size_t Stride) noexcept +{ + assert(Count > 0); + assert(pPoints); + + // Find the minimum and maximum x, y, and z + XMVECTOR vMin, vMax; + + vMin = vMax = XMLoadFloat3(pPoints); + + for (size_t i = 1; i < Count; ++i) + { + XMVECTOR Point = XMLoadFloat3(reinterpret_cast(reinterpret_cast(pPoints) + i * Stride)); + + vMin = XMVectorMin(vMin, Point); + vMax = XMVectorMax(vMax, Point); + } + + // Store center and extents. + XMStoreFloat3(&Out.Center, XMVectorScale(XMVectorAdd(vMin, vMax), 0.5f)); + XMStoreFloat3(&Out.Extents, XMVectorScale(XMVectorSubtract(vMax, vMin), 0.5f)); +} + + +/**************************************************************************** + * + * BoundingOrientedBox + * + ****************************************************************************/ + + //----------------------------------------------------------------------------- + // Transform an oriented box by an angle preserving transform. + //----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void XM_CALLCONV BoundingOrientedBox::Transform(BoundingOrientedBox& Out, FXMMATRIX M) const noexcept +{ + // Load the box. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(vOrientation)); + + // Composite the box rotation and the transform rotation. + XMMATRIX nM; + nM.r[0] = XMVector3Normalize(M.r[0]); + nM.r[1] = XMVector3Normalize(M.r[1]); + nM.r[2] = XMVector3Normalize(M.r[2]); + nM.r[3] = g_XMIdentityR3; + XMVECTOR Rotation = XMQuaternionRotationMatrix(nM); + vOrientation = XMQuaternionMultiply(vOrientation, Rotation); + + // Transform the center. + vCenter = XMVector3Transform(vCenter, M); + + // Scale the box extents. + XMVECTOR dX = XMVector3Length(M.r[0]); + XMVECTOR dY = XMVector3Length(M.r[1]); + XMVECTOR dZ = XMVector3Length(M.r[2]); + + XMVECTOR VectorScale = XMVectorSelect(dY, dX, g_XMSelect1000); + VectorScale = XMVectorSelect(dZ, VectorScale, g_XMSelect1100); + vExtents = XMVectorMultiply(vExtents, VectorScale); + + // Store the box. + XMStoreFloat3(&Out.Center, vCenter); + XMStoreFloat3(&Out.Extents, vExtents); + XMStoreFloat4(&Out.Orientation, vOrientation); +} + +_Use_decl_annotations_ +inline void XM_CALLCONV BoundingOrientedBox::Transform(BoundingOrientedBox& Out, float Scale, FXMVECTOR Rotation, FXMVECTOR Translation) const noexcept +{ + assert(DirectX::Internal::XMQuaternionIsUnit(Rotation)); + + // Load the box. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(vOrientation)); + + // Composite the box rotation and the transform rotation. + vOrientation = XMQuaternionMultiply(vOrientation, Rotation); + + // Transform the center. + XMVECTOR VectorScale = XMVectorReplicate(Scale); + vCenter = XMVectorAdd(XMVector3Rotate(XMVectorMultiply(vCenter, VectorScale), Rotation), Translation); + + // Scale the box extents. + vExtents = XMVectorMultiply(vExtents, VectorScale); + + // Store the box. + XMStoreFloat3(&Out.Center, vCenter); + XMStoreFloat3(&Out.Extents, vExtents); + XMStoreFloat4(&Out.Orientation, vOrientation); +} + + +//----------------------------------------------------------------------------- +// Get the corner points of the box +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void BoundingOrientedBox::GetCorners(XMFLOAT3* Corners) const noexcept +{ + assert(Corners != nullptr); + + // Load the box + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(vOrientation)); + + for (size_t i = 0; i < CORNER_COUNT; ++i) + { + XMVECTOR C = XMVectorAdd(XMVector3Rotate(XMVectorMultiply(vExtents, g_BoxOffset[i]), vOrientation), vCenter); + XMStoreFloat3(&Corners[i], C); + } +} + + +//----------------------------------------------------------------------------- +// Point in oriented box test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType XM_CALLCONV BoundingOrientedBox::Contains(FXMVECTOR Point) const noexcept +{ + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + // Transform the point to be local to the box. + XMVECTOR TPoint = XMVector3InverseRotate(XMVectorSubtract(Point, vCenter), vOrientation); + + return XMVector3InBounds(TPoint, vExtents) ? CONTAINS : DISJOINT; +} + + +//----------------------------------------------------------------------------- +// Triangle in oriented bounding box +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType XM_CALLCONV BoundingOrientedBox::Contains(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2) const noexcept +{ + // Load the box center & orientation. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + // Transform the triangle vertices into the space of the box. + XMVECTOR TV0 = XMVector3InverseRotate(XMVectorSubtract(V0, vCenter), vOrientation); + XMVECTOR TV1 = XMVector3InverseRotate(XMVectorSubtract(V1, vCenter), vOrientation); + XMVECTOR TV2 = XMVector3InverseRotate(XMVectorSubtract(V2, vCenter), vOrientation); + + BoundingBox box; + box.Center = XMFLOAT3(0.0f, 0.0f, 0.0f); + box.Extents = Extents; + + // Use the triangle vs axis aligned box intersection routine. + return box.Contains(TV0, TV1, TV2); +} + + +//----------------------------------------------------------------------------- +// Sphere in oriented bounding box +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingOrientedBox::Contains(const BoundingSphere& sh) const noexcept +{ + XMVECTOR SphereCenter = XMLoadFloat3(&sh.Center); + XMVECTOR SphereRadius = XMVectorReplicatePtr(&sh.Radius); + + XMVECTOR BoxCenter = XMLoadFloat3(&Center); + XMVECTOR BoxExtents = XMLoadFloat3(&Extents); + XMVECTOR BoxOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(BoxOrientation)); + + // Transform the center of the sphere to be local to the box. + // BoxMin = -BoxExtents + // BoxMax = +BoxExtents + SphereCenter = XMVector3InverseRotate(XMVectorSubtract(SphereCenter, BoxCenter), BoxOrientation); + + // Find the distance to the nearest point on the box. + // for each i in (x, y, z) + // if (SphereCenter(i) < BoxMin(i)) d2 += (SphereCenter(i) - BoxMin(i)) ^ 2 + // else if (SphereCenter(i) > BoxMax(i)) d2 += (SphereCenter(i) - BoxMax(i)) ^ 2 + + XMVECTOR d = XMVectorZero(); + + // Compute d for each dimension. + XMVECTOR LessThanMin = XMVectorLess(SphereCenter, XMVectorNegate(BoxExtents)); + XMVECTOR GreaterThanMax = XMVectorGreater(SphereCenter, BoxExtents); + + XMVECTOR MinDelta = XMVectorAdd(SphereCenter, BoxExtents); + XMVECTOR MaxDelta = XMVectorSubtract(SphereCenter, BoxExtents); + + // Choose value for each dimension based on the comparison. + d = XMVectorSelect(d, MinDelta, LessThanMin); + d = XMVectorSelect(d, MaxDelta, GreaterThanMax); + + // Use a dot-product to square them and sum them together. + XMVECTOR d2 = XMVector3Dot(d, d); + XMVECTOR SphereRadiusSq = XMVectorMultiply(SphereRadius, SphereRadius); + + if (XMVector4Greater(d2, SphereRadiusSq)) + return DISJOINT; + + // See if we are completely inside the box + XMVECTOR SMin = XMVectorSubtract(SphereCenter, SphereRadius); + XMVECTOR SMax = XMVectorAdd(SphereCenter, SphereRadius); + + return (XMVector3InBounds(SMin, BoxExtents) && XMVector3InBounds(SMax, BoxExtents)) ? CONTAINS : INTERSECTS; +} + + +//----------------------------------------------------------------------------- +// Axis aligned box vs. oriented box. Constructs an oriented box and uses +// the oriented box vs. oriented box test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingOrientedBox::Contains(const BoundingBox& box) const noexcept +{ + // Make the axis aligned box oriented and do an OBB vs OBB test. + BoundingOrientedBox obox(box.Center, box.Extents, XMFLOAT4(0.f, 0.f, 0.f, 1.f)); + return Contains(obox); +} + + +//----------------------------------------------------------------------------- +// Oriented bounding box in oriented bounding box +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingOrientedBox::Contains(const BoundingOrientedBox& box) const noexcept +{ + if (!Intersects(box)) + return DISJOINT; + + // Load the boxes + XMVECTOR aCenter = XMLoadFloat3(&Center); + XMVECTOR aExtents = XMLoadFloat3(&Extents); + XMVECTOR aOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(aOrientation)); + + XMVECTOR bCenter = XMLoadFloat3(&box.Center); + XMVECTOR bExtents = XMLoadFloat3(&box.Extents); + XMVECTOR bOrientation = XMLoadFloat4(&box.Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(bOrientation)); + + XMVECTOR offset = XMVectorSubtract(bCenter, aCenter); + + for (size_t i = 0; i < CORNER_COUNT; ++i) + { + // Cb = rotate( bExtents * corneroffset[i], bOrientation ) + bcenter + // Ca = invrotate( Cb - aCenter, aOrientation ) + + XMVECTOR C = XMVectorAdd(XMVector3Rotate(XMVectorMultiply(bExtents, g_BoxOffset[i]), bOrientation), offset); + C = XMVector3InverseRotate(C, aOrientation); + + if (!XMVector3InBounds(C, aExtents)) + return INTERSECTS; + } + + return CONTAINS; +} + + +//----------------------------------------------------------------------------- +// Frustum in oriented bounding box +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingOrientedBox::Contains(const BoundingFrustum& fr) const noexcept +{ + if (!fr.Intersects(*this)) + return DISJOINT; + + XMFLOAT3 Corners[BoundingFrustum::CORNER_COUNT]; + fr.GetCorners(Corners); + + // Load the box + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(vOrientation)); + + for (size_t i = 0; i < BoundingFrustum::CORNER_COUNT; ++i) + { + XMVECTOR C = XMVector3InverseRotate(XMVectorSubtract(XMLoadFloat3(&Corners[i]), vCenter), vOrientation); + + if (!XMVector3InBounds(C, vExtents)) + return INTERSECTS; + } + + return CONTAINS; +} + + +//----------------------------------------------------------------------------- +// Sphere vs. oriented box test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingOrientedBox::Intersects(const BoundingSphere& sh) const noexcept +{ + XMVECTOR SphereCenter = XMLoadFloat3(&sh.Center); + XMVECTOR SphereRadius = XMVectorReplicatePtr(&sh.Radius); + + XMVECTOR BoxCenter = XMLoadFloat3(&Center); + XMVECTOR BoxExtents = XMLoadFloat3(&Extents); + XMVECTOR BoxOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(BoxOrientation)); + + // Transform the center of the sphere to be local to the box. + // BoxMin = -BoxExtents + // BoxMax = +BoxExtents + SphereCenter = XMVector3InverseRotate(XMVectorSubtract(SphereCenter, BoxCenter), BoxOrientation); + + // Find the distance to the nearest point on the box. + // for each i in (x, y, z) + // if (SphereCenter(i) < BoxMin(i)) d2 += (SphereCenter(i) - BoxMin(i)) ^ 2 + // else if (SphereCenter(i) > BoxMax(i)) d2 += (SphereCenter(i) - BoxMax(i)) ^ 2 + + XMVECTOR d = XMVectorZero(); + + // Compute d for each dimension. + XMVECTOR LessThanMin = XMVectorLess(SphereCenter, XMVectorNegate(BoxExtents)); + XMVECTOR GreaterThanMax = XMVectorGreater(SphereCenter, BoxExtents); + + XMVECTOR MinDelta = XMVectorAdd(SphereCenter, BoxExtents); + XMVECTOR MaxDelta = XMVectorSubtract(SphereCenter, BoxExtents); + + // Choose value for each dimension based on the comparison. + d = XMVectorSelect(d, MinDelta, LessThanMin); + d = XMVectorSelect(d, MaxDelta, GreaterThanMax); + + // Use a dot-product to square them and sum them together. + XMVECTOR d2 = XMVector3Dot(d, d); + + return XMVector4LessOrEqual(d2, XMVectorMultiply(SphereRadius, SphereRadius)) ? true : false; +} + + +//----------------------------------------------------------------------------- +// Axis aligned box vs. oriented box. Constructs an oriented box and uses +// the oriented box vs. oriented box test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingOrientedBox::Intersects(const BoundingBox& box) const noexcept +{ + // Make the axis aligned box oriented and do an OBB vs OBB test. + BoundingOrientedBox obox(box.Center, box.Extents, XMFLOAT4(0.f, 0.f, 0.f, 1.f)); + return Intersects(obox); +} + + +//----------------------------------------------------------------------------- +// Fast oriented box / oriented box intersection test using the separating axis +// theorem. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingOrientedBox::Intersects(const BoundingOrientedBox& box) const noexcept +{ + // Build the 3x3 rotation matrix that defines the orientation of B relative to A. + XMVECTOR A_quat = XMLoadFloat4(&Orientation); + XMVECTOR B_quat = XMLoadFloat4(&box.Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(A_quat)); + assert(DirectX::Internal::XMQuaternionIsUnit(B_quat)); + + XMVECTOR Q = XMQuaternionMultiply(A_quat, XMQuaternionConjugate(B_quat)); + XMMATRIX R = XMMatrixRotationQuaternion(Q); + + // Compute the translation of B relative to A. + XMVECTOR A_cent = XMLoadFloat3(&Center); + XMVECTOR B_cent = XMLoadFloat3(&box.Center); + XMVECTOR t = XMVector3InverseRotate(XMVectorSubtract(B_cent, A_cent), A_quat); + + // + // h(A) = extents of A. + // h(B) = extents of B. + // + // a(u) = axes of A = (1,0,0), (0,1,0), (0,0,1) + // b(u) = axes of B relative to A = (r00,r10,r20), (r01,r11,r21), (r02,r12,r22) + // + // For each possible separating axis l: + // d(A) = sum (for i = u,v,w) h(A)(i) * abs( a(i) dot l ) + // d(B) = sum (for i = u,v,w) h(B)(i) * abs( b(i) dot l ) + // if abs( t dot l ) > d(A) + d(B) then disjoint + // + + // Load extents of A and B. + XMVECTOR h_A = XMLoadFloat3(&Extents); + XMVECTOR h_B = XMLoadFloat3(&box.Extents); + + // Rows. Note R[0,1,2]X.w = 0. + XMVECTOR R0X = R.r[0]; + XMVECTOR R1X = R.r[1]; + XMVECTOR R2X = R.r[2]; + + R = XMMatrixTranspose(R); + + // Columns. Note RX[0,1,2].w = 0. + XMVECTOR RX0 = R.r[0]; + XMVECTOR RX1 = R.r[1]; + XMVECTOR RX2 = R.r[2]; + + // Absolute value of rows. + XMVECTOR AR0X = XMVectorAbs(R0X); + XMVECTOR AR1X = XMVectorAbs(R1X); + XMVECTOR AR2X = XMVectorAbs(R2X); + + // Absolute value of columns. + XMVECTOR ARX0 = XMVectorAbs(RX0); + XMVECTOR ARX1 = XMVectorAbs(RX1); + XMVECTOR ARX2 = XMVectorAbs(RX2); + + // Test each of the 15 possible seperating axii. + XMVECTOR d, d_A, d_B; + + // l = a(u) = (1, 0, 0) + // t dot l = t.x + // d(A) = h(A).x + // d(B) = h(B) dot abs(r00, r01, r02) + d = XMVectorSplatX(t); + d_A = XMVectorSplatX(h_A); + d_B = XMVector3Dot(h_B, AR0X); + XMVECTOR NoIntersection = XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B)); + + // l = a(v) = (0, 1, 0) + // t dot l = t.y + // d(A) = h(A).y + // d(B) = h(B) dot abs(r10, r11, r12) + d = XMVectorSplatY(t); + d_A = XMVectorSplatY(h_A); + d_B = XMVector3Dot(h_B, AR1X); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // l = a(w) = (0, 0, 1) + // t dot l = t.z + // d(A) = h(A).z + // d(B) = h(B) dot abs(r20, r21, r22) + d = XMVectorSplatZ(t); + d_A = XMVectorSplatZ(h_A); + d_B = XMVector3Dot(h_B, AR2X); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // l = b(u) = (r00, r10, r20) + // d(A) = h(A) dot abs(r00, r10, r20) + // d(B) = h(B).x + d = XMVector3Dot(t, RX0); + d_A = XMVector3Dot(h_A, ARX0); + d_B = XMVectorSplatX(h_B); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // l = b(v) = (r01, r11, r21) + // d(A) = h(A) dot abs(r01, r11, r21) + // d(B) = h(B).y + d = XMVector3Dot(t, RX1); + d_A = XMVector3Dot(h_A, ARX1); + d_B = XMVectorSplatY(h_B); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // l = b(w) = (r02, r12, r22) + // d(A) = h(A) dot abs(r02, r12, r22) + // d(B) = h(B).z + d = XMVector3Dot(t, RX2); + d_A = XMVector3Dot(h_A, ARX2); + d_B = XMVectorSplatZ(h_B); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // l = a(u) x b(u) = (0, -r20, r10) + // d(A) = h(A) dot abs(0, r20, r10) + // d(B) = h(B) dot abs(0, r02, r01) + d = XMVector3Dot(t, XMVectorPermute(RX0, XMVectorNegate(RX0))); + d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX0)); + d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR0X)); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // l = a(u) x b(v) = (0, -r21, r11) + // d(A) = h(A) dot abs(0, r21, r11) + // d(B) = h(B) dot abs(r02, 0, r00) + d = XMVector3Dot(t, XMVectorPermute(RX1, XMVectorNegate(RX1))); + d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX1)); + d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR0X)); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // l = a(u) x b(w) = (0, -r22, r12) + // d(A) = h(A) dot abs(0, r22, r12) + // d(B) = h(B) dot abs(r01, r00, 0) + d = XMVector3Dot(t, XMVectorPermute(RX2, XMVectorNegate(RX2))); + d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX2)); + d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR0X)); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // l = a(v) x b(u) = (r20, 0, -r00) + // d(A) = h(A) dot abs(r20, 0, r00) + // d(B) = h(B) dot abs(0, r12, r11) + d = XMVector3Dot(t, XMVectorPermute(RX0, XMVectorNegate(RX0))); + d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX0)); + d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR1X)); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // l = a(v) x b(v) = (r21, 0, -r01) + // d(A) = h(A) dot abs(r21, 0, r01) + // d(B) = h(B) dot abs(r12, 0, r10) + d = XMVector3Dot(t, XMVectorPermute(RX1, XMVectorNegate(RX1))); + d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX1)); + d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR1X)); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // l = a(v) x b(w) = (r22, 0, -r02) + // d(A) = h(A) dot abs(r22, 0, r02) + // d(B) = h(B) dot abs(r11, r10, 0) + d = XMVector3Dot(t, XMVectorPermute(RX2, XMVectorNegate(RX2))); + d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX2)); + d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR1X)); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // l = a(w) x b(u) = (-r10, r00, 0) + // d(A) = h(A) dot abs(r10, r00, 0) + // d(B) = h(B) dot abs(0, r22, r21) + d = XMVector3Dot(t, XMVectorPermute(RX0, XMVectorNegate(RX0))); + d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX0)); + d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR2X)); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // l = a(w) x b(v) = (-r11, r01, 0) + // d(A) = h(A) dot abs(r11, r01, 0) + // d(B) = h(B) dot abs(r22, 0, r20) + d = XMVector3Dot(t, XMVectorPermute(RX1, XMVectorNegate(RX1))); + d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX1)); + d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR2X)); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // l = a(w) x b(w) = (-r12, r02, 0) + // d(A) = h(A) dot abs(r12, r02, 0) + // d(B) = h(B) dot abs(r21, r20, 0) + d = XMVector3Dot(t, XMVectorPermute(RX2, XMVectorNegate(RX2))); + d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX2)); + d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR2X)); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // No seperating axis found, boxes must intersect. + return XMVector4NotEqualInt(NoIntersection, XMVectorTrueInt()) ? true : false; +} + + +//----------------------------------------------------------------------------- +// Frustum vs. oriented box test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingOrientedBox::Intersects(const BoundingFrustum& fr) const noexcept +{ + return fr.Intersects(*this); +} + + +//----------------------------------------------------------------------------- +// Triangle vs. oriented box test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool XM_CALLCONV BoundingOrientedBox::Intersects(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2) const noexcept +{ + // Load the box center & orientation. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + // Transform the triangle vertices into the space of the box. + XMVECTOR TV0 = XMVector3InverseRotate(XMVectorSubtract(V0, vCenter), vOrientation); + XMVECTOR TV1 = XMVector3InverseRotate(XMVectorSubtract(V1, vCenter), vOrientation); + XMVECTOR TV2 = XMVector3InverseRotate(XMVectorSubtract(V2, vCenter), vOrientation); + + BoundingBox box; + box.Center = XMFLOAT3(0.0f, 0.0f, 0.0f); + box.Extents = Extents; + + // Use the triangle vs axis aligned box intersection routine. + return box.Intersects(TV0, TV1, TV2); +} + + +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline PlaneIntersectionType XM_CALLCONV BoundingOrientedBox::Intersects(FXMVECTOR Plane) const noexcept +{ + assert(DirectX::Internal::XMPlaneIsUnit(Plane)); + + // Load the box. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + XMVECTOR BoxOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(BoxOrientation)); + + // Set w of the center to one so we can dot4 with a plane. + vCenter = XMVectorInsert<0, 0, 0, 0, 1>(vCenter, XMVectorSplatOne()); + + // Build the 3x3 rotation matrix that defines the box axes. + XMMATRIX R = XMMatrixRotationQuaternion(BoxOrientation); + + XMVECTOR Outside, Inside; + DirectX::Internal::FastIntersectOrientedBoxPlane(vCenter, vExtents, R.r[0], R.r[1], R.r[2], Plane, Outside, Inside); + + // If the box is outside any plane it is outside. + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return FRONT; + + // If the box is inside all planes it is inside. + if (XMVector4EqualInt(Inside, XMVectorTrueInt())) + return BACK; + + // The box is not inside all planes or outside a plane it intersects. + return INTERSECTING; +} + + +//----------------------------------------------------------------------------- +// Compute the intersection of a ray (Origin, Direction) with an oriented box +// using the slabs method. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool XM_CALLCONV BoundingOrientedBox::Intersects(FXMVECTOR Origin, FXMVECTOR Direction, float& Dist) const noexcept +{ + assert(DirectX::Internal::XMVector3IsUnit(Direction)); + + static const XMVECTORU32 SelectY = { { { XM_SELECT_0, XM_SELECT_1, XM_SELECT_0, XM_SELECT_0 } } }; + static const XMVECTORU32 SelectZ = { { { XM_SELECT_0, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0 } } }; + + // Load the box. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(vOrientation)); + + // Get the boxes normalized side directions. + XMMATRIX R = XMMatrixRotationQuaternion(vOrientation); + + // Adjust ray origin to be relative to center of the box. + XMVECTOR TOrigin = XMVectorSubtract(vCenter, Origin); + + // Compute the dot product againt each axis of the box. + XMVECTOR AxisDotOrigin = XMVector3Dot(R.r[0], TOrigin); + AxisDotOrigin = XMVectorSelect(AxisDotOrigin, XMVector3Dot(R.r[1], TOrigin), SelectY); + AxisDotOrigin = XMVectorSelect(AxisDotOrigin, XMVector3Dot(R.r[2], TOrigin), SelectZ); + + XMVECTOR AxisDotDirection = XMVector3Dot(R.r[0], Direction); + AxisDotDirection = XMVectorSelect(AxisDotDirection, XMVector3Dot(R.r[1], Direction), SelectY); + AxisDotDirection = XMVectorSelect(AxisDotDirection, XMVector3Dot(R.r[2], Direction), SelectZ); + + // if (fabs(AxisDotDirection) <= Epsilon) the ray is nearly parallel to the slab. + XMVECTOR IsParallel = XMVectorLessOrEqual(XMVectorAbs(AxisDotDirection), g_RayEpsilon); + + // Test against all three axes simultaneously. + XMVECTOR InverseAxisDotDirection = XMVectorReciprocal(AxisDotDirection); + XMVECTOR t1 = XMVectorMultiply(XMVectorSubtract(AxisDotOrigin, vExtents), InverseAxisDotDirection); + XMVECTOR t2 = XMVectorMultiply(XMVectorAdd(AxisDotOrigin, vExtents), InverseAxisDotDirection); + + // Compute the max of min(t1,t2) and the min of max(t1,t2) ensuring we don't + // use the results from any directions parallel to the slab. + XMVECTOR t_min = XMVectorSelect(XMVectorMin(t1, t2), g_FltMin, IsParallel); + XMVECTOR t_max = XMVectorSelect(XMVectorMax(t1, t2), g_FltMax, IsParallel); + + // t_min.x = maximum( t_min.x, t_min.y, t_min.z ); + // t_max.x = minimum( t_max.x, t_max.y, t_max.z ); + t_min = XMVectorMax(t_min, XMVectorSplatY(t_min)); // x = max(x,y) + t_min = XMVectorMax(t_min, XMVectorSplatZ(t_min)); // x = max(max(x,y),z) + t_max = XMVectorMin(t_max, XMVectorSplatY(t_max)); // x = min(x,y) + t_max = XMVectorMin(t_max, XMVectorSplatZ(t_max)); // x = min(min(x,y),z) + + // if ( t_min > t_max ) return false; + XMVECTOR NoIntersection = XMVectorGreater(XMVectorSplatX(t_min), XMVectorSplatX(t_max)); + + // if ( t_max < 0.0f ) return false; + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(XMVectorSplatX(t_max), XMVectorZero())); + + // if (IsParallel && (-Extents > AxisDotOrigin || Extents < AxisDotOrigin)) return false; + XMVECTOR ParallelOverlap = XMVectorInBounds(AxisDotOrigin, vExtents); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorAndCInt(IsParallel, ParallelOverlap)); + + if (!DirectX::Internal::XMVector3AnyTrue(NoIntersection)) + { + // Store the x-component to *pDist + XMStoreFloat(&Dist, t_min); + return true; + } + + Dist = 0.f; + return false; +} + + +//----------------------------------------------------------------------------- +// Test an oriented box vs 6 planes (typically forming a frustum). +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType XM_CALLCONV BoundingOrientedBox::ContainedBy( + FXMVECTOR Plane0, FXMVECTOR Plane1, FXMVECTOR Plane2, + GXMVECTOR Plane3, + HXMVECTOR Plane4, HXMVECTOR Plane5) const noexcept +{ + // Load the box. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + XMVECTOR BoxOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(BoxOrientation)); + + // Set w of the center to one so we can dot4 with a plane. + vCenter = XMVectorInsert<0, 0, 0, 0, 1>(vCenter, XMVectorSplatOne()); + + // Build the 3x3 rotation matrix that defines the box axes. + XMMATRIX R = XMMatrixRotationQuaternion(BoxOrientation); + + XMVECTOR Outside, Inside; + + // Test against each plane. + DirectX::Internal::FastIntersectOrientedBoxPlane(vCenter, vExtents, R.r[0], R.r[1], R.r[2], Plane0, Outside, Inside); + + XMVECTOR AnyOutside = Outside; + XMVECTOR AllInside = Inside; + + DirectX::Internal::FastIntersectOrientedBoxPlane(vCenter, vExtents, R.r[0], R.r[1], R.r[2], Plane1, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::Internal::FastIntersectOrientedBoxPlane(vCenter, vExtents, R.r[0], R.r[1], R.r[2], Plane2, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::Internal::FastIntersectOrientedBoxPlane(vCenter, vExtents, R.r[0], R.r[1], R.r[2], Plane3, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::Internal::FastIntersectOrientedBoxPlane(vCenter, vExtents, R.r[0], R.r[1], R.r[2], Plane4, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::Internal::FastIntersectOrientedBoxPlane(vCenter, vExtents, R.r[0], R.r[1], R.r[2], Plane5, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + // If the box is outside any plane it is outside. + if (XMVector4EqualInt(AnyOutside, XMVectorTrueInt())) + return DISJOINT; + + // If the box is inside all planes it is inside. + if (XMVector4EqualInt(AllInside, XMVectorTrueInt())) + return CONTAINS; + + // The box is not inside all planes or outside a plane, it may intersect. + return INTERSECTS; +} + + +//----------------------------------------------------------------------------- +// Create oriented bounding box from axis-aligned bounding box +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void BoundingOrientedBox::CreateFromBoundingBox(BoundingOrientedBox& Out, const BoundingBox& box) noexcept +{ + Out.Center = box.Center; + Out.Extents = box.Extents; + Out.Orientation = XMFLOAT4(0.f, 0.f, 0.f, 1.f); +} + + +//----------------------------------------------------------------------------- +// Find the approximate minimum oriented bounding box containing a set of +// points. Exact computation of minimum oriented bounding box is possible but +// is slower and requires a more complex algorithm. +// The algorithm works by computing the inertia tensor of the points and then +// using the eigenvectors of the intertia tensor as the axes of the box. +// Computing the intertia tensor of the convex hull of the points will usually +// result in better bounding box but the computation is more complex. +// Exact computation of the minimum oriented bounding box is possible but the +// best know algorithm is O(N^3) and is significanly more complex to implement. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void BoundingOrientedBox::CreateFromPoints(BoundingOrientedBox& Out, size_t Count, const XMFLOAT3* pPoints, size_t Stride) noexcept +{ + assert(Count > 0); + assert(pPoints != nullptr); + + XMVECTOR CenterOfMass = XMVectorZero(); + + // Compute the center of mass and inertia tensor of the points. + for (size_t i = 0; i < Count; ++i) + { + XMVECTOR Point = XMLoadFloat3(reinterpret_cast(reinterpret_cast(pPoints) + i * Stride)); + + CenterOfMass = XMVectorAdd(CenterOfMass, Point); + } + + CenterOfMass = XMVectorMultiply(CenterOfMass, XMVectorReciprocal(XMVectorReplicate(float(Count)))); + + // Compute the inertia tensor of the points around the center of mass. + // Using the center of mass is not strictly necessary, but will hopefully + // improve the stability of finding the eigenvectors. + XMVECTOR XX_YY_ZZ = XMVectorZero(); + XMVECTOR XY_XZ_YZ = XMVectorZero(); + + for (size_t i = 0; i < Count; ++i) + { + XMVECTOR Point = XMVectorSubtract(XMLoadFloat3(reinterpret_cast(reinterpret_cast(pPoints) + i * Stride)), CenterOfMass); + + XX_YY_ZZ = XMVectorAdd(XX_YY_ZZ, XMVectorMultiply(Point, Point)); + + XMVECTOR XXY = XMVectorSwizzle(Point); + XMVECTOR YZZ = XMVectorSwizzle(Point); + + XY_XZ_YZ = XMVectorAdd(XY_XZ_YZ, XMVectorMultiply(XXY, YZZ)); + } + + XMVECTOR v1, v2, v3; + + // Compute the eigenvectors of the inertia tensor. + DirectX::Internal::CalculateEigenVectorsFromCovarianceMatrix(XMVectorGetX(XX_YY_ZZ), XMVectorGetY(XX_YY_ZZ), + XMVectorGetZ(XX_YY_ZZ), + XMVectorGetX(XY_XZ_YZ), XMVectorGetY(XY_XZ_YZ), + XMVectorGetZ(XY_XZ_YZ), + &v1, &v2, &v3); + + // Put them in a matrix. + XMMATRIX R; + + R.r[0] = XMVectorSetW(v1, 0.f); + R.r[1] = XMVectorSetW(v2, 0.f); + R.r[2] = XMVectorSetW(v3, 0.f); + R.r[3] = g_XMIdentityR3.v; + + // Multiply by -1 to convert the matrix into a right handed coordinate + // system (Det ~= 1) in case the eigenvectors form a left handed + // coordinate system (Det ~= -1) because XMQuaternionRotationMatrix only + // works on right handed matrices. + XMVECTOR Det = XMMatrixDeterminant(R); + + if (XMVector4Less(Det, XMVectorZero())) + { + R.r[0] = XMVectorMultiply(R.r[0], g_XMNegativeOne.v); + R.r[1] = XMVectorMultiply(R.r[1], g_XMNegativeOne.v); + R.r[2] = XMVectorMultiply(R.r[2], g_XMNegativeOne.v); + } + + // Get the rotation quaternion from the matrix. + XMVECTOR vOrientation = XMQuaternionRotationMatrix(R); + + // Make sure it is normal (in case the vectors are slightly non-orthogonal). + vOrientation = XMQuaternionNormalize(vOrientation); + + // Rebuild the rotation matrix from the quaternion. + R = XMMatrixRotationQuaternion(vOrientation); + + // Build the rotation into the rotated space. + XMMATRIX InverseR = XMMatrixTranspose(R); + + // Find the minimum OBB using the eigenvectors as the axes. + XMVECTOR vMin, vMax; + + vMin = vMax = XMVector3TransformNormal(XMLoadFloat3(pPoints), InverseR); + + for (size_t i = 1; i < Count; ++i) + { + XMVECTOR Point = XMVector3TransformNormal(XMLoadFloat3(reinterpret_cast(reinterpret_cast(pPoints) + i * Stride)), + InverseR); + + vMin = XMVectorMin(vMin, Point); + vMax = XMVectorMax(vMax, Point); + } + + // Rotate the center into world space. + XMVECTOR vCenter = XMVectorScale(XMVectorAdd(vMin, vMax), 0.5f); + vCenter = XMVector3TransformNormal(vCenter, R); + + // Store center, extents, and orientation. + XMStoreFloat3(&Out.Center, vCenter); + XMStoreFloat3(&Out.Extents, XMVectorScale(XMVectorSubtract(vMax, vMin), 0.5f)); + XMStoreFloat4(&Out.Orientation, vOrientation); +} + + +/**************************************************************************** + * + * BoundingFrustum + * + ****************************************************************************/ + +_Use_decl_annotations_ +inline BoundingFrustum::BoundingFrustum(CXMMATRIX Projection, bool rhcoords) noexcept +{ + CreateFromMatrix(*this, Projection, rhcoords); +} + + +//----------------------------------------------------------------------------- +// Transform a frustum by an angle preserving transform. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void XM_CALLCONV BoundingFrustum::Transform(BoundingFrustum& Out, FXMMATRIX M) const noexcept +{ + // Load the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(vOrientation)); + + // Composite the frustum rotation and the transform rotation + XMMATRIX nM; + nM.r[0] = XMVector3Normalize(M.r[0]); + nM.r[1] = XMVector3Normalize(M.r[1]); + nM.r[2] = XMVector3Normalize(M.r[2]); + nM.r[3] = g_XMIdentityR3; + XMVECTOR Rotation = XMQuaternionRotationMatrix(nM); + vOrientation = XMQuaternionMultiply(vOrientation, Rotation); + + // Transform the center. + vOrigin = XMVector3Transform(vOrigin, M); + + // Store the frustum. + XMStoreFloat3(&Out.Origin, vOrigin); + XMStoreFloat4(&Out.Orientation, vOrientation); + + // Scale the near and far distances (the slopes remain the same). + XMVECTOR dX = XMVector3Dot(M.r[0], M.r[0]); + XMVECTOR dY = XMVector3Dot(M.r[1], M.r[1]); + XMVECTOR dZ = XMVector3Dot(M.r[2], M.r[2]); + + XMVECTOR d = XMVectorMax(dX, XMVectorMax(dY, dZ)); + float Scale = sqrtf(XMVectorGetX(d)); + + Out.Near = Near * Scale; + Out.Far = Far * Scale; + + // Copy the slopes. + Out.RightSlope = RightSlope; + Out.LeftSlope = LeftSlope; + Out.TopSlope = TopSlope; + Out.BottomSlope = BottomSlope; +} + +_Use_decl_annotations_ +inline void XM_CALLCONV BoundingFrustum::Transform(BoundingFrustum& Out, float Scale, FXMVECTOR Rotation, FXMVECTOR Translation) const noexcept +{ + assert(DirectX::Internal::XMQuaternionIsUnit(Rotation)); + + // Load the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(vOrientation)); + + // Composite the frustum rotation and the transform rotation. + vOrientation = XMQuaternionMultiply(vOrientation, Rotation); + + // Transform the origin. + vOrigin = XMVectorAdd(XMVector3Rotate(XMVectorScale(vOrigin, Scale), Rotation), Translation); + + // Store the frustum. + XMStoreFloat3(&Out.Origin, vOrigin); + XMStoreFloat4(&Out.Orientation, vOrientation); + + // Scale the near and far distances (the slopes remain the same). + Out.Near = Near * Scale; + Out.Far = Far * Scale; + + // Copy the slopes. + Out.RightSlope = RightSlope; + Out.LeftSlope = LeftSlope; + Out.TopSlope = TopSlope; + Out.BottomSlope = BottomSlope; +} + + +//----------------------------------------------------------------------------- +// Get the corner points of the frustum +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void BoundingFrustum::GetCorners(XMFLOAT3* Corners) const noexcept +{ + assert(Corners != nullptr); + + // Load origin and orientation of the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(vOrientation)); + + // Build the corners of the frustum. + XMVECTOR vRightTop = XMVectorSet(RightSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR vRightBottom = XMVectorSet(RightSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR vLeftTop = XMVectorSet(LeftSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR vLeftBottom = XMVectorSet(LeftSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR vNear = XMVectorReplicatePtr(&Near); + XMVECTOR vFar = XMVectorReplicatePtr(&Far); + + // Returns 8 corners position of bounding frustum. + // Near Far + // 0----1 4----5 + // | | | | + // | | | | + // 3----2 7----6 + + XMVECTOR vCorners[CORNER_COUNT]; + vCorners[0] = XMVectorMultiply(vLeftTop, vNear); + vCorners[1] = XMVectorMultiply(vRightTop, vNear); + vCorners[2] = XMVectorMultiply(vRightBottom, vNear); + vCorners[3] = XMVectorMultiply(vLeftBottom, vNear); + vCorners[4] = XMVectorMultiply(vLeftTop, vFar); + vCorners[5] = XMVectorMultiply(vRightTop, vFar); + vCorners[6] = XMVectorMultiply(vRightBottom, vFar); + vCorners[7] = XMVectorMultiply(vLeftBottom, vFar); + + for (size_t i = 0; i < CORNER_COUNT; ++i) + { + XMVECTOR C = XMVectorAdd(XMVector3Rotate(vCorners[i], vOrientation), vOrigin); + XMStoreFloat3(&Corners[i], C); + } +} + + +//----------------------------------------------------------------------------- +// Point in frustum test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType XM_CALLCONV BoundingFrustum::Contains(FXMVECTOR Point) const noexcept +{ + // Build frustum planes. + XMVECTOR Planes[6]; + Planes[0] = XMVectorSet(0.0f, 0.0f, -1.0f, Near); + Planes[1] = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); + Planes[2] = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); + Planes[3] = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); + Planes[4] = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); + Planes[5] = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); + + // Load origin and orientation. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(vOrientation)); + + // Transform point into local space of frustum. + XMVECTOR TPoint = XMVector3InverseRotate(XMVectorSubtract(Point, vOrigin), vOrientation); + + // Set w to one. + TPoint = XMVectorInsert<0, 0, 0, 0, 1>(TPoint, XMVectorSplatOne()); + + XMVECTOR Zero = XMVectorZero(); + XMVECTOR Outside = Zero; + + // Test point against each plane of the frustum. + for (size_t i = 0; i < 6; ++i) + { + XMVECTOR Dot = XMVector4Dot(TPoint, Planes[i]); + Outside = XMVectorOrInt(Outside, XMVectorGreater(Dot, Zero)); + } + + return XMVector4NotEqualInt(Outside, XMVectorTrueInt()) ? CONTAINS : DISJOINT; +} + + +//----------------------------------------------------------------------------- +// Triangle vs frustum test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType XM_CALLCONV BoundingFrustum::Contains(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2) const noexcept +{ + // Load origin and orientation of the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + // Create 6 planes (do it inline to encourage use of registers) + XMVECTOR NearPlane = XMVectorSet(0.0f, 0.0f, -1.0f, Near); + NearPlane = DirectX::Internal::XMPlaneTransform(NearPlane, vOrientation, vOrigin); + NearPlane = XMPlaneNormalize(NearPlane); + + XMVECTOR FarPlane = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); + FarPlane = DirectX::Internal::XMPlaneTransform(FarPlane, vOrientation, vOrigin); + FarPlane = XMPlaneNormalize(FarPlane); + + XMVECTOR RightPlane = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); + RightPlane = DirectX::Internal::XMPlaneTransform(RightPlane, vOrientation, vOrigin); + RightPlane = XMPlaneNormalize(RightPlane); + + XMVECTOR LeftPlane = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); + LeftPlane = DirectX::Internal::XMPlaneTransform(LeftPlane, vOrientation, vOrigin); + LeftPlane = XMPlaneNormalize(LeftPlane); + + XMVECTOR TopPlane = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); + TopPlane = DirectX::Internal::XMPlaneTransform(TopPlane, vOrientation, vOrigin); + TopPlane = XMPlaneNormalize(TopPlane); + + XMVECTOR BottomPlane = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); + BottomPlane = DirectX::Internal::XMPlaneTransform(BottomPlane, vOrientation, vOrigin); + BottomPlane = XMPlaneNormalize(BottomPlane); + + return TriangleTests::ContainedBy(V0, V1, V2, NearPlane, FarPlane, RightPlane, LeftPlane, TopPlane, BottomPlane); +} + + +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingFrustum::Contains(const BoundingSphere& sh) const noexcept +{ + // Load origin and orientation of the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + // Create 6 planes (do it inline to encourage use of registers) + XMVECTOR NearPlane = XMVectorSet(0.0f, 0.0f, -1.0f, Near); + NearPlane = DirectX::Internal::XMPlaneTransform(NearPlane, vOrientation, vOrigin); + NearPlane = XMPlaneNormalize(NearPlane); + + XMVECTOR FarPlane = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); + FarPlane = DirectX::Internal::XMPlaneTransform(FarPlane, vOrientation, vOrigin); + FarPlane = XMPlaneNormalize(FarPlane); + + XMVECTOR RightPlane = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); + RightPlane = DirectX::Internal::XMPlaneTransform(RightPlane, vOrientation, vOrigin); + RightPlane = XMPlaneNormalize(RightPlane); + + XMVECTOR LeftPlane = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); + LeftPlane = DirectX::Internal::XMPlaneTransform(LeftPlane, vOrientation, vOrigin); + LeftPlane = XMPlaneNormalize(LeftPlane); + + XMVECTOR TopPlane = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); + TopPlane = DirectX::Internal::XMPlaneTransform(TopPlane, vOrientation, vOrigin); + TopPlane = XMPlaneNormalize(TopPlane); + + XMVECTOR BottomPlane = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); + BottomPlane = DirectX::Internal::XMPlaneTransform(BottomPlane, vOrientation, vOrigin); + BottomPlane = XMPlaneNormalize(BottomPlane); + + return sh.ContainedBy(NearPlane, FarPlane, RightPlane, LeftPlane, TopPlane, BottomPlane); +} + + +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingFrustum::Contains(const BoundingBox& box) const noexcept +{ + // Load origin and orientation of the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + // Create 6 planes (do it inline to encourage use of registers) + XMVECTOR NearPlane = XMVectorSet(0.0f, 0.0f, -1.0f, Near); + NearPlane = DirectX::Internal::XMPlaneTransform(NearPlane, vOrientation, vOrigin); + NearPlane = XMPlaneNormalize(NearPlane); + + XMVECTOR FarPlane = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); + FarPlane = DirectX::Internal::XMPlaneTransform(FarPlane, vOrientation, vOrigin); + FarPlane = XMPlaneNormalize(FarPlane); + + XMVECTOR RightPlane = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); + RightPlane = DirectX::Internal::XMPlaneTransform(RightPlane, vOrientation, vOrigin); + RightPlane = XMPlaneNormalize(RightPlane); + + XMVECTOR LeftPlane = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); + LeftPlane = DirectX::Internal::XMPlaneTransform(LeftPlane, vOrientation, vOrigin); + LeftPlane = XMPlaneNormalize(LeftPlane); + + XMVECTOR TopPlane = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); + TopPlane = DirectX::Internal::XMPlaneTransform(TopPlane, vOrientation, vOrigin); + TopPlane = XMPlaneNormalize(TopPlane); + + XMVECTOR BottomPlane = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); + BottomPlane = DirectX::Internal::XMPlaneTransform(BottomPlane, vOrientation, vOrigin); + BottomPlane = XMPlaneNormalize(BottomPlane); + + return box.ContainedBy(NearPlane, FarPlane, RightPlane, LeftPlane, TopPlane, BottomPlane); +} + + +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingFrustum::Contains(const BoundingOrientedBox& box) const noexcept +{ + // Load origin and orientation of the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + // Create 6 planes (do it inline to encourage use of registers) + XMVECTOR NearPlane = XMVectorSet(0.0f, 0.0f, -1.0f, Near); + NearPlane = DirectX::Internal::XMPlaneTransform(NearPlane, vOrientation, vOrigin); + NearPlane = XMPlaneNormalize(NearPlane); + + XMVECTOR FarPlane = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); + FarPlane = DirectX::Internal::XMPlaneTransform(FarPlane, vOrientation, vOrigin); + FarPlane = XMPlaneNormalize(FarPlane); + + XMVECTOR RightPlane = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); + RightPlane = DirectX::Internal::XMPlaneTransform(RightPlane, vOrientation, vOrigin); + RightPlane = XMPlaneNormalize(RightPlane); + + XMVECTOR LeftPlane = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); + LeftPlane = DirectX::Internal::XMPlaneTransform(LeftPlane, vOrientation, vOrigin); + LeftPlane = XMPlaneNormalize(LeftPlane); + + XMVECTOR TopPlane = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); + TopPlane = DirectX::Internal::XMPlaneTransform(TopPlane, vOrientation, vOrigin); + TopPlane = XMPlaneNormalize(TopPlane); + + XMVECTOR BottomPlane = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); + BottomPlane = DirectX::Internal::XMPlaneTransform(BottomPlane, vOrientation, vOrigin); + BottomPlane = XMPlaneNormalize(BottomPlane); + + return box.ContainedBy(NearPlane, FarPlane, RightPlane, LeftPlane, TopPlane, BottomPlane); +} + + +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingFrustum::Contains(const BoundingFrustum& fr) const noexcept +{ + // Load origin and orientation of the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + // Create 6 planes (do it inline to encourage use of registers) + XMVECTOR NearPlane = XMVectorSet(0.0f, 0.0f, -1.0f, Near); + NearPlane = DirectX::Internal::XMPlaneTransform(NearPlane, vOrientation, vOrigin); + NearPlane = XMPlaneNormalize(NearPlane); + + XMVECTOR FarPlane = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); + FarPlane = DirectX::Internal::XMPlaneTransform(FarPlane, vOrientation, vOrigin); + FarPlane = XMPlaneNormalize(FarPlane); + + XMVECTOR RightPlane = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); + RightPlane = DirectX::Internal::XMPlaneTransform(RightPlane, vOrientation, vOrigin); + RightPlane = XMPlaneNormalize(RightPlane); + + XMVECTOR LeftPlane = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); + LeftPlane = DirectX::Internal::XMPlaneTransform(LeftPlane, vOrientation, vOrigin); + LeftPlane = XMPlaneNormalize(LeftPlane); + + XMVECTOR TopPlane = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); + TopPlane = DirectX::Internal::XMPlaneTransform(TopPlane, vOrientation, vOrigin); + TopPlane = XMPlaneNormalize(TopPlane); + + XMVECTOR BottomPlane = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); + BottomPlane = DirectX::Internal::XMPlaneTransform(BottomPlane, vOrientation, vOrigin); + BottomPlane = XMPlaneNormalize(BottomPlane); + + return fr.ContainedBy(NearPlane, FarPlane, RightPlane, LeftPlane, TopPlane, BottomPlane); +} + + +//----------------------------------------------------------------------------- +// Exact sphere vs frustum test. The algorithm first checks the sphere against +// the planes of the frustum, then if the plane checks were indeterminate finds +// the nearest feature (plane, line, point) on the frustum to the center of the +// sphere and compares the distance to the nearest feature to the radius of the +// sphere +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingFrustum::Intersects(const BoundingSphere& sh) const noexcept +{ + XMVECTOR Zero = XMVectorZero(); + + // Build the frustum planes. + XMVECTOR Planes[6]; + Planes[0] = XMVectorSet(0.0f, 0.0f, -1.0f, Near); + Planes[1] = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); + Planes[2] = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); + Planes[3] = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); + Planes[4] = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); + Planes[5] = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); + + // Normalize the planes so we can compare to the sphere radius. + Planes[2] = XMVector3Normalize(Planes[2]); + Planes[3] = XMVector3Normalize(Planes[3]); + Planes[4] = XMVector3Normalize(Planes[4]); + Planes[5] = XMVector3Normalize(Planes[5]); + + // Load origin and orientation of the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(vOrientation)); + + // Load the sphere. + XMVECTOR vCenter = XMLoadFloat3(&sh.Center); + XMVECTOR vRadius = XMVectorReplicatePtr(&sh.Radius); + + // Transform the center of the sphere into the local space of frustum. + vCenter = XMVector3InverseRotate(XMVectorSubtract(vCenter, vOrigin), vOrientation); + + // Set w of the center to one so we can dot4 with the plane. + vCenter = XMVectorInsert<0, 0, 0, 0, 1>(vCenter, XMVectorSplatOne()); + + // Check against each plane of the frustum. + XMVECTOR Outside = XMVectorFalseInt(); + XMVECTOR InsideAll = XMVectorTrueInt(); + XMVECTOR CenterInsideAll = XMVectorTrueInt(); + + XMVECTOR Dist[6]; + + for (size_t i = 0; i < 6; ++i) + { + Dist[i] = XMVector4Dot(vCenter, Planes[i]); + + // Outside the plane? + Outside = XMVectorOrInt(Outside, XMVectorGreater(Dist[i], vRadius)); + + // Fully inside the plane? + InsideAll = XMVectorAndInt(InsideAll, XMVectorLessOrEqual(Dist[i], XMVectorNegate(vRadius))); + + // Check if the center is inside the plane. + CenterInsideAll = XMVectorAndInt(CenterInsideAll, XMVectorLessOrEqual(Dist[i], Zero)); + } + + // If the sphere is outside any of the planes it is outside. + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return false; + + // If the sphere is inside all planes it is fully inside. + if (XMVector4EqualInt(InsideAll, XMVectorTrueInt())) + return true; + + // If the center of the sphere is inside all planes and the sphere intersects + // one or more planes then it must intersect. + if (XMVector4EqualInt(CenterInsideAll, XMVectorTrueInt())) + return true; + + // The sphere may be outside the frustum or intersecting the frustum. + // Find the nearest feature (face, edge, or corner) on the frustum + // to the sphere. + + // The faces adjacent to each face are: + static const size_t adjacent_faces[6][4] = + { + { 2, 3, 4, 5 }, // 0 + { 2, 3, 4, 5 }, // 1 + { 0, 1, 4, 5 }, // 2 + { 0, 1, 4, 5 }, // 3 + { 0, 1, 2, 3 }, // 4 + { 0, 1, 2, 3 } + }; // 5 + + XMVECTOR Intersects = XMVectorFalseInt(); + + // Check to see if the nearest feature is one of the planes. + for (size_t i = 0; i < 6; ++i) + { + // Find the nearest point on the plane to the center of the sphere. + XMVECTOR Point = XMVectorNegativeMultiplySubtract(Planes[i], Dist[i], vCenter); + + // Set w of the point to one. + Point = XMVectorInsert<0, 0, 0, 0, 1>(Point, XMVectorSplatOne()); + + // If the point is inside the face (inside the adjacent planes) then + // this plane is the nearest feature. + XMVECTOR InsideFace = XMVectorTrueInt(); + + for (size_t j = 0; j < 4; j++) + { + size_t plane_index = adjacent_faces[i][j]; + + InsideFace = XMVectorAndInt(InsideFace, + XMVectorLessOrEqual(XMVector4Dot(Point, Planes[plane_index]), Zero)); + } + + // Since we have already checked distance from the plane we know that the + // sphere must intersect if this plane is the nearest feature. + Intersects = XMVectorOrInt(Intersects, + XMVectorAndInt(XMVectorGreater(Dist[i], Zero), InsideFace)); + } + + if (XMVector4EqualInt(Intersects, XMVectorTrueInt())) + return true; + + // Build the corners of the frustum. + XMVECTOR vRightTop = XMVectorSet(RightSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR vRightBottom = XMVectorSet(RightSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR vLeftTop = XMVectorSet(LeftSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR vLeftBottom = XMVectorSet(LeftSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR vNear = XMVectorReplicatePtr(&Near); + XMVECTOR vFar = XMVectorReplicatePtr(&Far); + + XMVECTOR Corners[CORNER_COUNT]; + Corners[0] = XMVectorMultiply(vRightTop, vNear); + Corners[1] = XMVectorMultiply(vRightBottom, vNear); + Corners[2] = XMVectorMultiply(vLeftTop, vNear); + Corners[3] = XMVectorMultiply(vLeftBottom, vNear); + Corners[4] = XMVectorMultiply(vRightTop, vFar); + Corners[5] = XMVectorMultiply(vRightBottom, vFar); + Corners[6] = XMVectorMultiply(vLeftTop, vFar); + Corners[7] = XMVectorMultiply(vLeftBottom, vFar); + + // The Edges are: + static const size_t edges[12][2] = + { + { 0, 1 }, { 2, 3 }, { 0, 2 }, { 1, 3 }, // Near plane + { 4, 5 }, { 6, 7 }, { 4, 6 }, { 5, 7 }, // Far plane + { 0, 4 }, { 1, 5 }, { 2, 6 }, { 3, 7 }, + }; // Near to far + + XMVECTOR RadiusSq = XMVectorMultiply(vRadius, vRadius); + + // Check to see if the nearest feature is one of the edges (or corners). + for (size_t i = 0; i < 12; ++i) + { + size_t ei0 = edges[i][0]; + size_t ei1 = edges[i][1]; + + // Find the nearest point on the edge to the center of the sphere. + // The corners of the frustum are included as the endpoints of the edges. + XMVECTOR Point = DirectX::Internal::PointOnLineSegmentNearestPoint(Corners[ei0], Corners[ei1], vCenter); + + XMVECTOR Delta = XMVectorSubtract(vCenter, Point); + + XMVECTOR DistSq = XMVector3Dot(Delta, Delta); + + // If the distance to the center of the sphere to the point is less than + // the radius of the sphere then it must intersect. + Intersects = XMVectorOrInt(Intersects, XMVectorLessOrEqual(DistSq, RadiusSq)); + } + + if (XMVector4EqualInt(Intersects, XMVectorTrueInt())) + return true; + + // The sphere must be outside the frustum. + return false; +} + + +//----------------------------------------------------------------------------- +// Exact axis aligned box vs frustum test. Constructs an oriented box and uses +// the oriented box vs frustum test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingFrustum::Intersects(const BoundingBox& box) const noexcept +{ + // Make the axis aligned box oriented and do an OBB vs frustum test. + BoundingOrientedBox obox(box.Center, box.Extents, XMFLOAT4(0.f, 0.f, 0.f, 1.f)); + return Intersects(obox); +} + + +//----------------------------------------------------------------------------- +// Exact oriented box vs frustum test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingFrustum::Intersects(const BoundingOrientedBox& box) const noexcept +{ + static const XMVECTORU32 SelectY = { { { XM_SELECT_0, XM_SELECT_1, XM_SELECT_0, XM_SELECT_0 } } }; + static const XMVECTORU32 SelectZ = { { { XM_SELECT_0, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0 } } }; + + XMVECTOR Zero = XMVectorZero(); + + // Build the frustum planes. + XMVECTOR Planes[6]; + Planes[0] = XMVectorSet(0.0f, 0.0f, -1.0f, Near); + Planes[1] = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); + Planes[2] = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); + Planes[3] = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); + Planes[4] = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); + Planes[5] = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); + + // Load origin and orientation of the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR FrustumOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(FrustumOrientation)); + + // Load the box. + XMVECTOR Center = XMLoadFloat3(&box.Center); + XMVECTOR Extents = XMLoadFloat3(&box.Extents); + XMVECTOR BoxOrientation = XMLoadFloat4(&box.Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(BoxOrientation)); + + // Transform the oriented box into the space of the frustum in order to + // minimize the number of transforms we have to do. + Center = XMVector3InverseRotate(XMVectorSubtract(Center, vOrigin), FrustumOrientation); + BoxOrientation = XMQuaternionMultiply(BoxOrientation, XMQuaternionConjugate(FrustumOrientation)); + + // Set w of the center to one so we can dot4 with the plane. + Center = XMVectorInsert<0, 0, 0, 0, 1>(Center, XMVectorSplatOne()); + + // Build the 3x3 rotation matrix that defines the box axes. + XMMATRIX R = XMMatrixRotationQuaternion(BoxOrientation); + + // Check against each plane of the frustum. + XMVECTOR Outside = XMVectorFalseInt(); + XMVECTOR InsideAll = XMVectorTrueInt(); + XMVECTOR CenterInsideAll = XMVectorTrueInt(); + + for (size_t i = 0; i < 6; ++i) + { + // Compute the distance to the center of the box. + XMVECTOR Dist = XMVector4Dot(Center, Planes[i]); + + // Project the axes of the box onto the normal of the plane. Half the + // length of the projection (sometime called the "radius") is equal to + // h(u) * abs(n dot b(u))) + h(v) * abs(n dot b(v)) + h(w) * abs(n dot b(w)) + // where h(i) are extents of the box, n is the plane normal, and b(i) are the + // axes of the box. + XMVECTOR Radius = XMVector3Dot(Planes[i], R.r[0]); + Radius = XMVectorSelect(Radius, XMVector3Dot(Planes[i], R.r[1]), SelectY); + Radius = XMVectorSelect(Radius, XMVector3Dot(Planes[i], R.r[2]), SelectZ); + Radius = XMVector3Dot(Extents, XMVectorAbs(Radius)); + + // Outside the plane? + Outside = XMVectorOrInt(Outside, XMVectorGreater(Dist, Radius)); + + // Fully inside the plane? + InsideAll = XMVectorAndInt(InsideAll, XMVectorLessOrEqual(Dist, XMVectorNegate(Radius))); + + // Check if the center is inside the plane. + CenterInsideAll = XMVectorAndInt(CenterInsideAll, XMVectorLessOrEqual(Dist, Zero)); + } + + // If the box is outside any of the planes it is outside. + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return false; + + // If the box is inside all planes it is fully inside. + if (XMVector4EqualInt(InsideAll, XMVectorTrueInt())) + return true; + + // If the center of the box is inside all planes and the box intersects + // one or more planes then it must intersect. + if (XMVector4EqualInt(CenterInsideAll, XMVectorTrueInt())) + return true; + + // Build the corners of the frustum. + XMVECTOR vRightTop = XMVectorSet(RightSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR vRightBottom = XMVectorSet(RightSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR vLeftTop = XMVectorSet(LeftSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR vLeftBottom = XMVectorSet(LeftSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR vNear = XMVectorReplicatePtr(&Near); + XMVECTOR vFar = XMVectorReplicatePtr(&Far); + + XMVECTOR Corners[CORNER_COUNT]; + Corners[0] = XMVectorMultiply(vRightTop, vNear); + Corners[1] = XMVectorMultiply(vRightBottom, vNear); + Corners[2] = XMVectorMultiply(vLeftTop, vNear); + Corners[3] = XMVectorMultiply(vLeftBottom, vNear); + Corners[4] = XMVectorMultiply(vRightTop, vFar); + Corners[5] = XMVectorMultiply(vRightBottom, vFar); + Corners[6] = XMVectorMultiply(vLeftTop, vFar); + Corners[7] = XMVectorMultiply(vLeftBottom, vFar); + + // Test against box axes (3) + { + // Find the min/max values of the projection of the frustum onto each axis. + XMVECTOR FrustumMin, FrustumMax; + + FrustumMin = XMVector3Dot(Corners[0], R.r[0]); + FrustumMin = XMVectorSelect(FrustumMin, XMVector3Dot(Corners[0], R.r[1]), SelectY); + FrustumMin = XMVectorSelect(FrustumMin, XMVector3Dot(Corners[0], R.r[2]), SelectZ); + FrustumMax = FrustumMin; + + for (size_t i = 1; i < BoundingOrientedBox::CORNER_COUNT; ++i) + { + XMVECTOR Temp = XMVector3Dot(Corners[i], R.r[0]); + Temp = XMVectorSelect(Temp, XMVector3Dot(Corners[i], R.r[1]), SelectY); + Temp = XMVectorSelect(Temp, XMVector3Dot(Corners[i], R.r[2]), SelectZ); + + FrustumMin = XMVectorMin(FrustumMin, Temp); + FrustumMax = XMVectorMax(FrustumMax, Temp); + } + + // Project the center of the box onto the axes. + XMVECTOR BoxDist = XMVector3Dot(Center, R.r[0]); + BoxDist = XMVectorSelect(BoxDist, XMVector3Dot(Center, R.r[1]), SelectY); + BoxDist = XMVectorSelect(BoxDist, XMVector3Dot(Center, R.r[2]), SelectZ); + + // The projection of the box onto the axis is just its Center and Extents. + // if (min > box_max || max < box_min) reject; + XMVECTOR Result = XMVectorOrInt(XMVectorGreater(FrustumMin, XMVectorAdd(BoxDist, Extents)), + XMVectorLess(FrustumMax, XMVectorSubtract(BoxDist, Extents))); + + if (DirectX::Internal::XMVector3AnyTrue(Result)) + return false; + } + + // Test against edge/edge axes (3*6). + XMVECTOR FrustumEdgeAxis[6]; + + FrustumEdgeAxis[0] = vRightTop; + FrustumEdgeAxis[1] = vRightBottom; + FrustumEdgeAxis[2] = vLeftTop; + FrustumEdgeAxis[3] = vLeftBottom; + FrustumEdgeAxis[4] = XMVectorSubtract(vRightTop, vLeftTop); + FrustumEdgeAxis[5] = XMVectorSubtract(vLeftBottom, vLeftTop); + + for (size_t i = 0; i < 3; ++i) + { + for (size_t j = 0; j < 6; j++) + { + // Compute the axis we are going to test. + XMVECTOR Axis = XMVector3Cross(R.r[i], FrustumEdgeAxis[j]); + + // Find the min/max values of the projection of the frustum onto the axis. + XMVECTOR FrustumMin, FrustumMax; + + FrustumMin = FrustumMax = XMVector3Dot(Axis, Corners[0]); + + for (size_t k = 1; k < CORNER_COUNT; k++) + { + XMVECTOR Temp = XMVector3Dot(Axis, Corners[k]); + FrustumMin = XMVectorMin(FrustumMin, Temp); + FrustumMax = XMVectorMax(FrustumMax, Temp); + } + + // Project the center of the box onto the axis. + XMVECTOR Dist = XMVector3Dot(Center, Axis); + + // Project the axes of the box onto the axis to find the "radius" of the box. + XMVECTOR Radius = XMVector3Dot(Axis, R.r[0]); + Radius = XMVectorSelect(Radius, XMVector3Dot(Axis, R.r[1]), SelectY); + Radius = XMVectorSelect(Radius, XMVector3Dot(Axis, R.r[2]), SelectZ); + Radius = XMVector3Dot(Extents, XMVectorAbs(Radius)); + + // if (center > max + radius || center < min - radius) reject; + Outside = XMVectorOrInt(Outside, XMVectorGreater(Dist, XMVectorAdd(FrustumMax, Radius))); + Outside = XMVectorOrInt(Outside, XMVectorLess(Dist, XMVectorSubtract(FrustumMin, Radius))); + } + } + + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return false; + + // If we did not find a separating plane then the box must intersect the frustum. + return true; +} + + +//----------------------------------------------------------------------------- +// Exact frustum vs frustum test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingFrustum::Intersects(const BoundingFrustum& fr) const noexcept +{ + // Load origin and orientation of frustum B. + XMVECTOR OriginB = XMLoadFloat3(&Origin); + XMVECTOR OrientationB = XMLoadFloat4(&Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(OrientationB)); + + // Build the planes of frustum B. + XMVECTOR AxisB[6]; + AxisB[0] = XMVectorSet(0.0f, 0.0f, -1.0f, 0.0f); + AxisB[1] = XMVectorSet(0.0f, 0.0f, 1.0f, 0.0f); + AxisB[2] = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); + AxisB[3] = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); + AxisB[4] = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); + AxisB[5] = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); + + XMVECTOR PlaneDistB[6]; + PlaneDistB[0] = XMVectorNegate(XMVectorReplicatePtr(&Near)); + PlaneDistB[1] = XMVectorReplicatePtr(&Far); + PlaneDistB[2] = XMVectorZero(); + PlaneDistB[3] = XMVectorZero(); + PlaneDistB[4] = XMVectorZero(); + PlaneDistB[5] = XMVectorZero(); + + // Load origin and orientation of frustum A. + XMVECTOR OriginA = XMLoadFloat3(&fr.Origin); + XMVECTOR OrientationA = XMLoadFloat4(&fr.Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(OrientationA)); + + // Transform frustum A into the space of the frustum B in order to + // minimize the number of transforms we have to do. + OriginA = XMVector3InverseRotate(XMVectorSubtract(OriginA, OriginB), OrientationB); + OrientationA = XMQuaternionMultiply(OrientationA, XMQuaternionConjugate(OrientationB)); + + // Build the corners of frustum A (in the local space of B). + XMVECTOR RightTopA = XMVectorSet(fr.RightSlope, fr.TopSlope, 1.0f, 0.0f); + XMVECTOR RightBottomA = XMVectorSet(fr.RightSlope, fr.BottomSlope, 1.0f, 0.0f); + XMVECTOR LeftTopA = XMVectorSet(fr.LeftSlope, fr.TopSlope, 1.0f, 0.0f); + XMVECTOR LeftBottomA = XMVectorSet(fr.LeftSlope, fr.BottomSlope, 1.0f, 0.0f); + XMVECTOR NearA = XMVectorReplicatePtr(&fr.Near); + XMVECTOR FarA = XMVectorReplicatePtr(&fr.Far); + + RightTopA = XMVector3Rotate(RightTopA, OrientationA); + RightBottomA = XMVector3Rotate(RightBottomA, OrientationA); + LeftTopA = XMVector3Rotate(LeftTopA, OrientationA); + LeftBottomA = XMVector3Rotate(LeftBottomA, OrientationA); + + XMVECTOR CornersA[CORNER_COUNT]; + CornersA[0] = XMVectorMultiplyAdd(RightTopA, NearA, OriginA); + CornersA[1] = XMVectorMultiplyAdd(RightBottomA, NearA, OriginA); + CornersA[2] = XMVectorMultiplyAdd(LeftTopA, NearA, OriginA); + CornersA[3] = XMVectorMultiplyAdd(LeftBottomA, NearA, OriginA); + CornersA[4] = XMVectorMultiplyAdd(RightTopA, FarA, OriginA); + CornersA[5] = XMVectorMultiplyAdd(RightBottomA, FarA, OriginA); + CornersA[6] = XMVectorMultiplyAdd(LeftTopA, FarA, OriginA); + CornersA[7] = XMVectorMultiplyAdd(LeftBottomA, FarA, OriginA); + + // Check frustum A against each plane of frustum B. + XMVECTOR Outside = XMVectorFalseInt(); + XMVECTOR InsideAll = XMVectorTrueInt(); + + for (size_t i = 0; i < 6; ++i) + { + // Find the min/max projection of the frustum onto the plane normal. + XMVECTOR Min, Max; + + Min = Max = XMVector3Dot(AxisB[i], CornersA[0]); + + for (size_t j = 1; j < CORNER_COUNT; j++) + { + XMVECTOR Temp = XMVector3Dot(AxisB[i], CornersA[j]); + Min = XMVectorMin(Min, Temp); + Max = XMVectorMax(Max, Temp); + } + + // Outside the plane? + Outside = XMVectorOrInt(Outside, XMVectorGreater(Min, PlaneDistB[i])); + + // Fully inside the plane? + InsideAll = XMVectorAndInt(InsideAll, XMVectorLessOrEqual(Max, PlaneDistB[i])); + } + + // If the frustum A is outside any of the planes of frustum B it is outside. + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return false; + + // If frustum A is inside all planes of frustum B it is fully inside. + if (XMVector4EqualInt(InsideAll, XMVectorTrueInt())) + return true; + + // Build the corners of frustum B. + XMVECTOR RightTopB = XMVectorSet(RightSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR RightBottomB = XMVectorSet(RightSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR LeftTopB = XMVectorSet(LeftSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR LeftBottomB = XMVectorSet(LeftSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR NearB = XMVectorReplicatePtr(&Near); + XMVECTOR FarB = XMVectorReplicatePtr(&Far); + + XMVECTOR CornersB[BoundingFrustum::CORNER_COUNT]; + CornersB[0] = XMVectorMultiply(RightTopB, NearB); + CornersB[1] = XMVectorMultiply(RightBottomB, NearB); + CornersB[2] = XMVectorMultiply(LeftTopB, NearB); + CornersB[3] = XMVectorMultiply(LeftBottomB, NearB); + CornersB[4] = XMVectorMultiply(RightTopB, FarB); + CornersB[5] = XMVectorMultiply(RightBottomB, FarB); + CornersB[6] = XMVectorMultiply(LeftTopB, FarB); + CornersB[7] = XMVectorMultiply(LeftBottomB, FarB); + + // Build the planes of frustum A (in the local space of B). + XMVECTOR AxisA[6]; + XMVECTOR PlaneDistA[6]; + + AxisA[0] = XMVectorSet(0.0f, 0.0f, -1.0f, 0.0f); + AxisA[1] = XMVectorSet(0.0f, 0.0f, 1.0f, 0.0f); + AxisA[2] = XMVectorSet(1.0f, 0.0f, -fr.RightSlope, 0.0f); + AxisA[3] = XMVectorSet(-1.0f, 0.0f, fr.LeftSlope, 0.0f); + AxisA[4] = XMVectorSet(0.0f, 1.0f, -fr.TopSlope, 0.0f); + AxisA[5] = XMVectorSet(0.0f, -1.0f, fr.BottomSlope, 0.0f); + + AxisA[0] = XMVector3Rotate(AxisA[0], OrientationA); + AxisA[1] = XMVectorNegate(AxisA[0]); + AxisA[2] = XMVector3Rotate(AxisA[2], OrientationA); + AxisA[3] = XMVector3Rotate(AxisA[3], OrientationA); + AxisA[4] = XMVector3Rotate(AxisA[4], OrientationA); + AxisA[5] = XMVector3Rotate(AxisA[5], OrientationA); + + PlaneDistA[0] = XMVector3Dot(AxisA[0], CornersA[0]); // Re-use corner on near plane. + PlaneDistA[1] = XMVector3Dot(AxisA[1], CornersA[4]); // Re-use corner on far plane. + PlaneDistA[2] = XMVector3Dot(AxisA[2], OriginA); + PlaneDistA[3] = XMVector3Dot(AxisA[3], OriginA); + PlaneDistA[4] = XMVector3Dot(AxisA[4], OriginA); + PlaneDistA[5] = XMVector3Dot(AxisA[5], OriginA); + + // Check each axis of frustum A for a seperating plane (5). + for (size_t i = 0; i < 6; ++i) + { + // Find the minimum projection of the frustum onto the plane normal. + XMVECTOR Min; + + Min = XMVector3Dot(AxisA[i], CornersB[0]); + + for (size_t j = 1; j < CORNER_COUNT; j++) + { + XMVECTOR Temp = XMVector3Dot(AxisA[i], CornersB[j]); + Min = XMVectorMin(Min, Temp); + } + + // Outside the plane? + Outside = XMVectorOrInt(Outside, XMVectorGreater(Min, PlaneDistA[i])); + } + + // If the frustum B is outside any of the planes of frustum A it is outside. + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return false; + + // Check edge/edge axes (6 * 6). + XMVECTOR FrustumEdgeAxisA[6]; + FrustumEdgeAxisA[0] = RightTopA; + FrustumEdgeAxisA[1] = RightBottomA; + FrustumEdgeAxisA[2] = LeftTopA; + FrustumEdgeAxisA[3] = LeftBottomA; + FrustumEdgeAxisA[4] = XMVectorSubtract(RightTopA, LeftTopA); + FrustumEdgeAxisA[5] = XMVectorSubtract(LeftBottomA, LeftTopA); + + XMVECTOR FrustumEdgeAxisB[6]; + FrustumEdgeAxisB[0] = RightTopB; + FrustumEdgeAxisB[1] = RightBottomB; + FrustumEdgeAxisB[2] = LeftTopB; + FrustumEdgeAxisB[3] = LeftBottomB; + FrustumEdgeAxisB[4] = XMVectorSubtract(RightTopB, LeftTopB); + FrustumEdgeAxisB[5] = XMVectorSubtract(LeftBottomB, LeftTopB); + + for (size_t i = 0; i < 6; ++i) + { + for (size_t j = 0; j < 6; j++) + { + // Compute the axis we are going to test. + XMVECTOR Axis = XMVector3Cross(FrustumEdgeAxisA[i], FrustumEdgeAxisB[j]); + + // Find the min/max values of the projection of both frustums onto the axis. + XMVECTOR MinA, MaxA; + XMVECTOR MinB, MaxB; + + MinA = MaxA = XMVector3Dot(Axis, CornersA[0]); + MinB = MaxB = XMVector3Dot(Axis, CornersB[0]); + + for (size_t k = 1; k < CORNER_COUNT; k++) + { + XMVECTOR TempA = XMVector3Dot(Axis, CornersA[k]); + MinA = XMVectorMin(MinA, TempA); + MaxA = XMVectorMax(MaxA, TempA); + + XMVECTOR TempB = XMVector3Dot(Axis, CornersB[k]); + MinB = XMVectorMin(MinB, TempB); + MaxB = XMVectorMax(MaxB, TempB); + } + + // if (MinA > MaxB || MinB > MaxA) reject + Outside = XMVectorOrInt(Outside, XMVectorGreater(MinA, MaxB)); + Outside = XMVectorOrInt(Outside, XMVectorGreater(MinB, MaxA)); + } + } + + // If there is a seperating plane, then the frustums do not intersect. + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return false; + + // If we did not find a separating plane then the frustums intersect. + return true; +} + + +//----------------------------------------------------------------------------- +// Triangle vs frustum test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool XM_CALLCONV BoundingFrustum::Intersects(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2) const noexcept +{ + // Build the frustum planes (NOTE: D is negated from the usual). + XMVECTOR Planes[6]; + Planes[0] = XMVectorSet(0.0f, 0.0f, -1.0f, -Near); + Planes[1] = XMVectorSet(0.0f, 0.0f, 1.0f, Far); + Planes[2] = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); + Planes[3] = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); + Planes[4] = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); + Planes[5] = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); + + // Load origin and orientation of the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(vOrientation)); + + // Transform triangle into the local space of frustum. + XMVECTOR TV0 = XMVector3InverseRotate(XMVectorSubtract(V0, vOrigin), vOrientation); + XMVECTOR TV1 = XMVector3InverseRotate(XMVectorSubtract(V1, vOrigin), vOrientation); + XMVECTOR TV2 = XMVector3InverseRotate(XMVectorSubtract(V2, vOrigin), vOrientation); + + // Test each vertex of the triangle against the frustum planes. + XMVECTOR Outside = XMVectorFalseInt(); + XMVECTOR InsideAll = XMVectorTrueInt(); + + for (size_t i = 0; i < 6; ++i) + { + XMVECTOR Dist0 = XMVector3Dot(TV0, Planes[i]); + XMVECTOR Dist1 = XMVector3Dot(TV1, Planes[i]); + XMVECTOR Dist2 = XMVector3Dot(TV2, Planes[i]); + + XMVECTOR MinDist = XMVectorMin(Dist0, Dist1); + MinDist = XMVectorMin(MinDist, Dist2); + XMVECTOR MaxDist = XMVectorMax(Dist0, Dist1); + MaxDist = XMVectorMax(MaxDist, Dist2); + + XMVECTOR PlaneDist = XMVectorSplatW(Planes[i]); + + // Outside the plane? + Outside = XMVectorOrInt(Outside, XMVectorGreater(MinDist, PlaneDist)); + + // Fully inside the plane? + InsideAll = XMVectorAndInt(InsideAll, XMVectorLessOrEqual(MaxDist, PlaneDist)); + } + + // If the triangle is outside any of the planes it is outside. + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return false; + + // If the triangle is inside all planes it is fully inside. + if (XMVector4EqualInt(InsideAll, XMVectorTrueInt())) + return true; + + // Build the corners of the frustum. + XMVECTOR vRightTop = XMVectorSet(RightSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR vRightBottom = XMVectorSet(RightSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR vLeftTop = XMVectorSet(LeftSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR vLeftBottom = XMVectorSet(LeftSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR vNear = XMVectorReplicatePtr(&Near); + XMVECTOR vFar = XMVectorReplicatePtr(&Far); + + XMVECTOR Corners[CORNER_COUNT]; + Corners[0] = XMVectorMultiply(vRightTop, vNear); + Corners[1] = XMVectorMultiply(vRightBottom, vNear); + Corners[2] = XMVectorMultiply(vLeftTop, vNear); + Corners[3] = XMVectorMultiply(vLeftBottom, vNear); + Corners[4] = XMVectorMultiply(vRightTop, vFar); + Corners[5] = XMVectorMultiply(vRightBottom, vFar); + Corners[6] = XMVectorMultiply(vLeftTop, vFar); + Corners[7] = XMVectorMultiply(vLeftBottom, vFar); + + // Test the plane of the triangle. + XMVECTOR Normal = XMVector3Cross(XMVectorSubtract(V1, V0), XMVectorSubtract(V2, V0)); + XMVECTOR Dist = XMVector3Dot(Normal, V0); + + XMVECTOR MinDist, MaxDist; + MinDist = MaxDist = XMVector3Dot(Corners[0], Normal); + for (size_t i = 1; i < CORNER_COUNT; ++i) + { + XMVECTOR Temp = XMVector3Dot(Corners[i], Normal); + MinDist = XMVectorMin(MinDist, Temp); + MaxDist = XMVectorMax(MaxDist, Temp); + } + + Outside = XMVectorOrInt(XMVectorGreater(MinDist, Dist), XMVectorLess(MaxDist, Dist)); + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return false; + + // Check the edge/edge axes (3*6). + XMVECTOR TriangleEdgeAxis[3]; + TriangleEdgeAxis[0] = XMVectorSubtract(V1, V0); + TriangleEdgeAxis[1] = XMVectorSubtract(V2, V1); + TriangleEdgeAxis[2] = XMVectorSubtract(V0, V2); + + XMVECTOR FrustumEdgeAxis[6]; + FrustumEdgeAxis[0] = vRightTop; + FrustumEdgeAxis[1] = vRightBottom; + FrustumEdgeAxis[2] = vLeftTop; + FrustumEdgeAxis[3] = vLeftBottom; + FrustumEdgeAxis[4] = XMVectorSubtract(vRightTop, vLeftTop); + FrustumEdgeAxis[5] = XMVectorSubtract(vLeftBottom, vLeftTop); + + for (size_t i = 0; i < 3; ++i) + { + for (size_t j = 0; j < 6; j++) + { + // Compute the axis we are going to test. + XMVECTOR Axis = XMVector3Cross(TriangleEdgeAxis[i], FrustumEdgeAxis[j]); + + // Find the min/max of the projection of the triangle onto the axis. + XMVECTOR MinA, MaxA; + + XMVECTOR Dist0 = XMVector3Dot(V0, Axis); + XMVECTOR Dist1 = XMVector3Dot(V1, Axis); + XMVECTOR Dist2 = XMVector3Dot(V2, Axis); + + MinA = XMVectorMin(Dist0, Dist1); + MinA = XMVectorMin(MinA, Dist2); + MaxA = XMVectorMax(Dist0, Dist1); + MaxA = XMVectorMax(MaxA, Dist2); + + // Find the min/max of the projection of the frustum onto the axis. + XMVECTOR MinB, MaxB; + + MinB = MaxB = XMVector3Dot(Axis, Corners[0]); + + for (size_t k = 1; k < CORNER_COUNT; k++) + { + XMVECTOR Temp = XMVector3Dot(Axis, Corners[k]); + MinB = XMVectorMin(MinB, Temp); + MaxB = XMVectorMax(MaxB, Temp); + } + + // if (MinA > MaxB || MinB > MaxA) reject; + Outside = XMVectorOrInt(Outside, XMVectorGreater(MinA, MaxB)); + Outside = XMVectorOrInt(Outside, XMVectorGreater(MinB, MaxA)); + } + } + + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return false; + + // If we did not find a separating plane then the triangle must intersect the frustum. + return true; +} + + +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline PlaneIntersectionType XM_CALLCONV BoundingFrustum::Intersects(FXMVECTOR Plane) const noexcept +{ + assert(DirectX::Internal::XMPlaneIsUnit(Plane)); + + // Load origin and orientation of the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(vOrientation)); + + // Set w of the origin to one so we can dot4 with a plane. + vOrigin = XMVectorInsert<0, 0, 0, 0, 1>(vOrigin, XMVectorSplatOne()); + + // Build the corners of the frustum (in world space). + XMVECTOR RightTop = XMVectorSet(RightSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR RightBottom = XMVectorSet(RightSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR LeftTop = XMVectorSet(LeftSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR LeftBottom = XMVectorSet(LeftSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR vNear = XMVectorReplicatePtr(&Near); + XMVECTOR vFar = XMVectorReplicatePtr(&Far); + + RightTop = XMVector3Rotate(RightTop, vOrientation); + RightBottom = XMVector3Rotate(RightBottom, vOrientation); + LeftTop = XMVector3Rotate(LeftTop, vOrientation); + LeftBottom = XMVector3Rotate(LeftBottom, vOrientation); + + XMVECTOR Corners0 = XMVectorMultiplyAdd(RightTop, vNear, vOrigin); + XMVECTOR Corners1 = XMVectorMultiplyAdd(RightBottom, vNear, vOrigin); + XMVECTOR Corners2 = XMVectorMultiplyAdd(LeftTop, vNear, vOrigin); + XMVECTOR Corners3 = XMVectorMultiplyAdd(LeftBottom, vNear, vOrigin); + XMVECTOR Corners4 = XMVectorMultiplyAdd(RightTop, vFar, vOrigin); + XMVECTOR Corners5 = XMVectorMultiplyAdd(RightBottom, vFar, vOrigin); + XMVECTOR Corners6 = XMVectorMultiplyAdd(LeftTop, vFar, vOrigin); + XMVECTOR Corners7 = XMVectorMultiplyAdd(LeftBottom, vFar, vOrigin); + + XMVECTOR Outside, Inside; + DirectX::Internal::FastIntersectFrustumPlane(Corners0, Corners1, Corners2, Corners3, + Corners4, Corners5, Corners6, Corners7, + Plane, Outside, Inside); + + // If the frustum is outside any plane it is outside. + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return FRONT; + + // If the frustum is inside all planes it is inside. + if (XMVector4EqualInt(Inside, XMVectorTrueInt())) + return BACK; + + // The frustum is not inside all planes or outside a plane it intersects. + return INTERSECTING; +} + + +//----------------------------------------------------------------------------- +// Ray vs. frustum test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool XM_CALLCONV BoundingFrustum::Intersects(FXMVECTOR rayOrigin, FXMVECTOR Direction, float& Dist) const noexcept +{ + // If ray starts inside the frustum, return a distance of 0 for the hit + if (Contains(rayOrigin) == CONTAINS) + { + Dist = 0.0f; + return true; + } + + // Build the frustum planes. + XMVECTOR Planes[6]; + Planes[0] = XMVectorSet(0.0f, 0.0f, -1.0f, Near); + Planes[1] = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); + Planes[2] = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); + Planes[3] = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); + Planes[4] = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); + Planes[5] = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); + + // Load origin and orientation of the frustum. + XMVECTOR frOrigin = XMLoadFloat3(&Origin); + XMVECTOR frOrientation = XMLoadFloat4(&Orientation); + + // This algorithm based on "Fast Ray-Convex Polyhedron Intersectin," in James Arvo, ed., Graphics Gems II pp. 247-250 + float tnear = -FLT_MAX; + float tfar = FLT_MAX; + + for (size_t i = 0; i < 6; ++i) + { + XMVECTOR Plane = DirectX::Internal::XMPlaneTransform(Planes[i], frOrientation, frOrigin); + Plane = XMPlaneNormalize(Plane); + + XMVECTOR AxisDotOrigin = XMPlaneDotCoord(Plane, rayOrigin); + XMVECTOR AxisDotDirection = XMVector3Dot(Plane, Direction); + + if (XMVector3LessOrEqual(XMVectorAbs(AxisDotDirection), g_RayEpsilon)) + { + // Ray is parallel to plane - check if ray origin is inside plane's + if (XMVector3Greater(AxisDotOrigin, g_XMZero)) + { + // Ray origin is outside half-space. + Dist = 0.f; + return false; + } + } + else + { + // Ray not parallel - get distance to plane. + float vd = XMVectorGetX(AxisDotDirection); + float vn = XMVectorGetX(AxisDotOrigin); + float t = -vn / vd; + if (vd < 0.0f) + { + // Front face - T is a near point. + if (t > tfar) + { + Dist = 0.f; + return false; + } + if (t > tnear) + { + // Hit near face. + tnear = t; + } + } + else + { + // back face - T is far point. + if (t < tnear) + { + Dist = 0.f; + return false; + } + if (t < tfar) + { + // Hit far face. + tfar = t; + } + } + } + } + + // Survived all tests. + // Note: if ray originates on polyhedron, may want to change 0.0f to some + // epsilon to avoid intersecting the originating face. + float distance = (tnear >= 0.0f) ? tnear : tfar; + if (distance >= 0.0f) + { + Dist = distance; + return true; + } + + Dist = 0.f; + return false; +} + + +//----------------------------------------------------------------------------- +// Test a frustum vs 6 planes (typically forming another frustum). +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType XM_CALLCONV BoundingFrustum::ContainedBy( + FXMVECTOR Plane0, FXMVECTOR Plane1, FXMVECTOR Plane2, + GXMVECTOR Plane3, + HXMVECTOR Plane4, HXMVECTOR Plane5) const noexcept +{ + // Load origin and orientation of the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::Internal::XMQuaternionIsUnit(vOrientation)); + + // Set w of the origin to one so we can dot4 with a plane. + vOrigin = XMVectorInsert<0, 0, 0, 0, 1>(vOrigin, XMVectorSplatOne()); + + // Build the corners of the frustum (in world space). + XMVECTOR RightTop = XMVectorSet(RightSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR RightBottom = XMVectorSet(RightSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR LeftTop = XMVectorSet(LeftSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR LeftBottom = XMVectorSet(LeftSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR vNear = XMVectorReplicatePtr(&Near); + XMVECTOR vFar = XMVectorReplicatePtr(&Far); + + RightTop = XMVector3Rotate(RightTop, vOrientation); + RightBottom = XMVector3Rotate(RightBottom, vOrientation); + LeftTop = XMVector3Rotate(LeftTop, vOrientation); + LeftBottom = XMVector3Rotate(LeftBottom, vOrientation); + + XMVECTOR Corners0 = XMVectorMultiplyAdd(RightTop, vNear, vOrigin); + XMVECTOR Corners1 = XMVectorMultiplyAdd(RightBottom, vNear, vOrigin); + XMVECTOR Corners2 = XMVectorMultiplyAdd(LeftTop, vNear, vOrigin); + XMVECTOR Corners3 = XMVectorMultiplyAdd(LeftBottom, vNear, vOrigin); + XMVECTOR Corners4 = XMVectorMultiplyAdd(RightTop, vFar, vOrigin); + XMVECTOR Corners5 = XMVectorMultiplyAdd(RightBottom, vFar, vOrigin); + XMVECTOR Corners6 = XMVectorMultiplyAdd(LeftTop, vFar, vOrigin); + XMVECTOR Corners7 = XMVectorMultiplyAdd(LeftBottom, vFar, vOrigin); + + XMVECTOR Outside, Inside; + + // Test against each plane. + DirectX::Internal::FastIntersectFrustumPlane(Corners0, Corners1, Corners2, Corners3, + Corners4, Corners5, Corners6, Corners7, + Plane0, Outside, Inside); + + XMVECTOR AnyOutside = Outside; + XMVECTOR AllInside = Inside; + + DirectX::Internal::FastIntersectFrustumPlane(Corners0, Corners1, Corners2, Corners3, + Corners4, Corners5, Corners6, Corners7, + Plane1, Outside, Inside); + + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::Internal::FastIntersectFrustumPlane(Corners0, Corners1, Corners2, Corners3, + Corners4, Corners5, Corners6, Corners7, + Plane2, Outside, Inside); + + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::Internal::FastIntersectFrustumPlane(Corners0, Corners1, Corners2, Corners3, + Corners4, Corners5, Corners6, Corners7, + Plane3, Outside, Inside); + + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::Internal::FastIntersectFrustumPlane(Corners0, Corners1, Corners2, Corners3, + Corners4, Corners5, Corners6, Corners7, + Plane4, Outside, Inside); + + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::Internal::FastIntersectFrustumPlane(Corners0, Corners1, Corners2, Corners3, + Corners4, Corners5, Corners6, Corners7, + Plane5, Outside, Inside); + + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + // If the frustum is outside any plane it is outside. + if (XMVector4EqualInt(AnyOutside, XMVectorTrueInt())) + return DISJOINT; + + // If the frustum is inside all planes it is inside. + if (XMVector4EqualInt(AllInside, XMVectorTrueInt())) + return CONTAINS; + + // The frustum is not inside all planes or outside a plane, it may intersect. + return INTERSECTS; +} + + +//----------------------------------------------------------------------------- +// Build the 6 frustum planes from a frustum. +// +// The intended use for these routines is for fast culling to a view frustum. +// When the volume being tested against a view frustum is small relative to the +// view frustum it is usually either inside all six planes of the frustum +// (CONTAINS) or outside one of the planes of the frustum (DISJOINT). If neither +// of these cases is true then it may or may not be intersecting the frustum +// (INTERSECTS) +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void BoundingFrustum::GetPlanes(XMVECTOR* NearPlane, XMVECTOR* FarPlane, XMVECTOR* RightPlane, + XMVECTOR* LeftPlane, XMVECTOR* TopPlane, XMVECTOR* BottomPlane) const noexcept +{ + // Load origin and orientation of the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + if (NearPlane) + { + XMVECTOR vNearPlane = XMVectorSet(0.0f, 0.0f, -1.0f, Near); + vNearPlane = DirectX::Internal::XMPlaneTransform(vNearPlane, vOrientation, vOrigin); + *NearPlane = XMPlaneNormalize(vNearPlane); + } + + if (FarPlane) + { + XMVECTOR vFarPlane = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); + vFarPlane = DirectX::Internal::XMPlaneTransform(vFarPlane, vOrientation, vOrigin); + *FarPlane = XMPlaneNormalize(vFarPlane); + } + + if (RightPlane) + { + XMVECTOR vRightPlane = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); + vRightPlane = DirectX::Internal::XMPlaneTransform(vRightPlane, vOrientation, vOrigin); + *RightPlane = XMPlaneNormalize(vRightPlane); + } + + if (LeftPlane) + { + XMVECTOR vLeftPlane = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); + vLeftPlane = DirectX::Internal::XMPlaneTransform(vLeftPlane, vOrientation, vOrigin); + *LeftPlane = XMPlaneNormalize(vLeftPlane); + } + + if (TopPlane) + { + XMVECTOR vTopPlane = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); + vTopPlane = DirectX::Internal::XMPlaneTransform(vTopPlane, vOrientation, vOrigin); + *TopPlane = XMPlaneNormalize(vTopPlane); + } + + if (BottomPlane) + { + XMVECTOR vBottomPlane = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); + vBottomPlane = DirectX::Internal::XMPlaneTransform(vBottomPlane, vOrientation, vOrigin); + *BottomPlane = XMPlaneNormalize(vBottomPlane); + } +} + + +//----------------------------------------------------------------------------- +// Build a frustum from a persepective projection matrix. The matrix may only +// contain a projection; any rotation, translation or scale will cause the +// constructed frustum to be incorrect. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void XM_CALLCONV BoundingFrustum::CreateFromMatrix(BoundingFrustum& Out, FXMMATRIX Projection, bool rhcoords) noexcept +{ + // Corners of the projection frustum in homogenous space. + static XMVECTORF32 HomogenousPoints[6] = + { + { { { 1.0f, 0.0f, 1.0f, 1.0f } } }, // right (at far plane) + { { { -1.0f, 0.0f, 1.0f, 1.0f } } }, // left + { { { 0.0f, 1.0f, 1.0f, 1.0f } } }, // top + { { { 0.0f, -1.0f, 1.0f, 1.0f } } }, // bottom + + { { { 0.0f, 0.0f, 0.0f, 1.0f } } }, // near + { { { 0.0f, 0.0f, 1.0f, 1.0f } } } // far + }; + + XMVECTOR Determinant; + XMMATRIX matInverse = XMMatrixInverse(&Determinant, Projection); + + // Compute the frustum corners in world space. + XMVECTOR Points[6]; + + for (size_t i = 0; i < 6; ++i) + { + // Transform point. + Points[i] = XMVector4Transform(HomogenousPoints[i], matInverse); + } + + Out.Origin = XMFLOAT3(0.0f, 0.0f, 0.0f); + Out.Orientation = XMFLOAT4(0.0f, 0.0f, 0.0f, 1.0f); + + // Compute the slopes. + Points[0] = XMVectorMultiply(Points[0], XMVectorReciprocal(XMVectorSplatZ(Points[0]))); + Points[1] = XMVectorMultiply(Points[1], XMVectorReciprocal(XMVectorSplatZ(Points[1]))); + Points[2] = XMVectorMultiply(Points[2], XMVectorReciprocal(XMVectorSplatZ(Points[2]))); + Points[3] = XMVectorMultiply(Points[3], XMVectorReciprocal(XMVectorSplatZ(Points[3]))); + + Out.RightSlope = XMVectorGetX(Points[0]); + Out.LeftSlope = XMVectorGetX(Points[1]); + Out.TopSlope = XMVectorGetY(Points[2]); + Out.BottomSlope = XMVectorGetY(Points[3]); + + // Compute near and far. + Points[4] = XMVectorMultiply(Points[4], XMVectorReciprocal(XMVectorSplatW(Points[4]))); + Points[5] = XMVectorMultiply(Points[5], XMVectorReciprocal(XMVectorSplatW(Points[5]))); + + if (rhcoords) + { + Out.Near = XMVectorGetZ(Points[5]); + Out.Far = XMVectorGetZ(Points[4]); + } + else + { + Out.Near = XMVectorGetZ(Points[4]); + Out.Far = XMVectorGetZ(Points[5]); + } +} + + +/**************************************************************************** + * + * TriangleTests + * + ****************************************************************************/ + +namespace TriangleTests +{ + + //----------------------------------------------------------------------------- + // Compute the intersection of a ray (Origin, Direction) with a triangle + // (V0, V1, V2). Return true if there is an intersection and also set *pDist + // to the distance along the ray to the intersection. + // + // The algorithm is based on Moller, Tomas and Trumbore, "Fast, Minimum Storage + // Ray-Triangle Intersection", Journal of Graphics Tools, vol. 2, no. 1, + // pp 21-28, 1997. + //----------------------------------------------------------------------------- + _Use_decl_annotations_ + inline bool XM_CALLCONV Intersects( + FXMVECTOR Origin, FXMVECTOR Direction, FXMVECTOR V0, + GXMVECTOR V1, + HXMVECTOR V2, float& Dist) noexcept + { + assert(DirectX::Internal::XMVector3IsUnit(Direction)); + + XMVECTOR Zero = XMVectorZero(); + + XMVECTOR e1 = XMVectorSubtract(V1, V0); + XMVECTOR e2 = XMVectorSubtract(V2, V0); + + // p = Direction ^ e2; + XMVECTOR p = XMVector3Cross(Direction, e2); + + // det = e1 * p; + XMVECTOR det = XMVector3Dot(e1, p); + + XMVECTOR u, v, t; + + if (XMVector3GreaterOrEqual(det, g_RayEpsilon)) + { + // Determinate is positive (front side of the triangle). + XMVECTOR s = XMVectorSubtract(Origin, V0); + + // u = s * p; + u = XMVector3Dot(s, p); + + XMVECTOR NoIntersection = XMVectorLess(u, Zero); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(u, det)); + + // q = s ^ e1; + XMVECTOR q = XMVector3Cross(s, e1); + + // v = Direction * q; + v = XMVector3Dot(Direction, q); + + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(v, Zero)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(XMVectorAdd(u, v), det)); + + // t = e2 * q; + t = XMVector3Dot(e2, q); + + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(t, Zero)); + + if (XMVector4EqualInt(NoIntersection, XMVectorTrueInt())) + { + Dist = 0.f; + return false; + } + } + else if (XMVector3LessOrEqual(det, g_RayNegEpsilon)) + { + // Determinate is negative (back side of the triangle). + XMVECTOR s = XMVectorSubtract(Origin, V0); + + // u = s * p; + u = XMVector3Dot(s, p); + + XMVECTOR NoIntersection = XMVectorGreater(u, Zero); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(u, det)); + + // q = s ^ e1; + XMVECTOR q = XMVector3Cross(s, e1); + + // v = Direction * q; + v = XMVector3Dot(Direction, q); + + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(v, Zero)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(XMVectorAdd(u, v), det)); + + // t = e2 * q; + t = XMVector3Dot(e2, q); + + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(t, Zero)); + + if (XMVector4EqualInt(NoIntersection, XMVectorTrueInt())) + { + Dist = 0.f; + return false; + } + } + else + { + // Parallel ray. + Dist = 0.f; + return false; + } + + t = XMVectorDivide(t, det); + + // (u / det) and (v / dev) are the barycentric cooridinates of the intersection. + + // Store the x-component to *pDist + XMStoreFloat(&Dist, t); + + return true; + } + + + //----------------------------------------------------------------------------- + // Test if two triangles intersect. + // + // The final test of algorithm is based on Shen, Heng, and Tang, "A Fast + // Triangle-Triangle Overlap Test Using Signed Distances", Journal of Graphics + // Tools, vol. 8, no. 1, pp 17-23, 2003 and Guigue and Devillers, "Fast and + // Robust Triangle-Triangle Overlap Test Using Orientation Predicates", Journal + // of Graphics Tools, vol. 8, no. 1, pp 25-32, 2003. + // + // The final test could be considered an edge-edge separating plane test with + // the 9 possible cases narrowed down to the only two pairs of edges that can + // actaully result in a seperation. + //----------------------------------------------------------------------------- + _Use_decl_annotations_ + inline bool XM_CALLCONV Intersects(FXMVECTOR A0, FXMVECTOR A1, FXMVECTOR A2, GXMVECTOR B0, HXMVECTOR B1, HXMVECTOR B2) noexcept + { + static const XMVECTORU32 SelectY = { { { XM_SELECT_0, XM_SELECT_1, XM_SELECT_0, XM_SELECT_0 } } }; + static const XMVECTORU32 SelectZ = { { { XM_SELECT_0, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0 } } }; + static const XMVECTORU32 Select0111 = { { { XM_SELECT_0, XM_SELECT_1, XM_SELECT_1, XM_SELECT_1 } } }; + static const XMVECTORU32 Select1011 = { { { XM_SELECT_1, XM_SELECT_0, XM_SELECT_1, XM_SELECT_1 } } }; + static const XMVECTORU32 Select1101 = { { { XM_SELECT_1, XM_SELECT_1, XM_SELECT_0, XM_SELECT_1 } } }; + + XMVECTOR Zero = XMVectorZero(); + + // Compute the normal of triangle A. + XMVECTOR N1 = XMVector3Cross(XMVectorSubtract(A1, A0), XMVectorSubtract(A2, A0)); + + // Assert that the triangle is not degenerate. + assert(!XMVector3Equal(N1, Zero)); + + // Test points of B against the plane of A. + XMVECTOR BDist = XMVector3Dot(N1, XMVectorSubtract(B0, A0)); + BDist = XMVectorSelect(BDist, XMVector3Dot(N1, XMVectorSubtract(B1, A0)), SelectY); + BDist = XMVectorSelect(BDist, XMVector3Dot(N1, XMVectorSubtract(B2, A0)), SelectZ); + + // Ensure robustness with co-planar triangles by zeroing small distances. + uint32_t BDistIsZeroCR; + XMVECTOR BDistIsZero = XMVectorGreaterR(&BDistIsZeroCR, g_RayEpsilon, XMVectorAbs(BDist)); + BDist = XMVectorSelect(BDist, Zero, BDistIsZero); + + uint32_t BDistIsLessCR; + XMVECTOR BDistIsLess = XMVectorGreaterR(&BDistIsLessCR, Zero, BDist); + + uint32_t BDistIsGreaterCR; + XMVECTOR BDistIsGreater = XMVectorGreaterR(&BDistIsGreaterCR, BDist, Zero); + + // If all the points are on the same side we don't intersect. + if (XMComparisonAllTrue(BDistIsLessCR) || XMComparisonAllTrue(BDistIsGreaterCR)) + return false; + + // Compute the normal of triangle B. + XMVECTOR N2 = XMVector3Cross(XMVectorSubtract(B1, B0), XMVectorSubtract(B2, B0)); + + // Assert that the triangle is not degenerate. + assert(!XMVector3Equal(N2, Zero)); + + // Test points of A against the plane of B. + XMVECTOR ADist = XMVector3Dot(N2, XMVectorSubtract(A0, B0)); + ADist = XMVectorSelect(ADist, XMVector3Dot(N2, XMVectorSubtract(A1, B0)), SelectY); + ADist = XMVectorSelect(ADist, XMVector3Dot(N2, XMVectorSubtract(A2, B0)), SelectZ); + + // Ensure robustness with co-planar triangles by zeroing small distances. + uint32_t ADistIsZeroCR; + XMVECTOR ADistIsZero = XMVectorGreaterR(&ADistIsZeroCR, g_RayEpsilon, XMVectorAbs(BDist)); + ADist = XMVectorSelect(ADist, Zero, ADistIsZero); + + uint32_t ADistIsLessCR; + XMVECTOR ADistIsLess = XMVectorGreaterR(&ADistIsLessCR, Zero, ADist); + + uint32_t ADistIsGreaterCR; + XMVECTOR ADistIsGreater = XMVectorGreaterR(&ADistIsGreaterCR, ADist, Zero); + + // If all the points are on the same side we don't intersect. + if (XMComparisonAllTrue(ADistIsLessCR) || XMComparisonAllTrue(ADistIsGreaterCR)) + return false; + + // Special case for co-planar triangles. + if (XMComparisonAllTrue(ADistIsZeroCR) || XMComparisonAllTrue(BDistIsZeroCR)) + { + XMVECTOR Axis, Dist, MinDist; + + // Compute an axis perpindicular to the edge (points out). + Axis = XMVector3Cross(N1, XMVectorSubtract(A1, A0)); + Dist = XMVector3Dot(Axis, A0); + + // Test points of B against the axis. + MinDist = XMVector3Dot(B0, Axis); + MinDist = XMVectorMin(MinDist, XMVector3Dot(B1, Axis)); + MinDist = XMVectorMin(MinDist, XMVector3Dot(B2, Axis)); + if (XMVector4GreaterOrEqual(MinDist, Dist)) + return false; + + // Edge (A1, A2) + Axis = XMVector3Cross(N1, XMVectorSubtract(A2, A1)); + Dist = XMVector3Dot(Axis, A1); + + MinDist = XMVector3Dot(B0, Axis); + MinDist = XMVectorMin(MinDist, XMVector3Dot(B1, Axis)); + MinDist = XMVectorMin(MinDist, XMVector3Dot(B2, Axis)); + if (XMVector4GreaterOrEqual(MinDist, Dist)) + return false; + + // Edge (A2, A0) + Axis = XMVector3Cross(N1, XMVectorSubtract(A0, A2)); + Dist = XMVector3Dot(Axis, A2); + + MinDist = XMVector3Dot(B0, Axis); + MinDist = XMVectorMin(MinDist, XMVector3Dot(B1, Axis)); + MinDist = XMVectorMin(MinDist, XMVector3Dot(B2, Axis)); + if (XMVector4GreaterOrEqual(MinDist, Dist)) + return false; + + // Edge (B0, B1) + Axis = XMVector3Cross(N2, XMVectorSubtract(B1, B0)); + Dist = XMVector3Dot(Axis, B0); + + MinDist = XMVector3Dot(A0, Axis); + MinDist = XMVectorMin(MinDist, XMVector3Dot(A1, Axis)); + MinDist = XMVectorMin(MinDist, XMVector3Dot(A2, Axis)); + if (XMVector4GreaterOrEqual(MinDist, Dist)) + return false; + + // Edge (B1, B2) + Axis = XMVector3Cross(N2, XMVectorSubtract(B2, B1)); + Dist = XMVector3Dot(Axis, B1); + + MinDist = XMVector3Dot(A0, Axis); + MinDist = XMVectorMin(MinDist, XMVector3Dot(A1, Axis)); + MinDist = XMVectorMin(MinDist, XMVector3Dot(A2, Axis)); + if (XMVector4GreaterOrEqual(MinDist, Dist)) + return false; + + // Edge (B2,B0) + Axis = XMVector3Cross(N2, XMVectorSubtract(B0, B2)); + Dist = XMVector3Dot(Axis, B2); + + MinDist = XMVector3Dot(A0, Axis); + MinDist = XMVectorMin(MinDist, XMVector3Dot(A1, Axis)); + MinDist = XMVectorMin(MinDist, XMVector3Dot(A2, Axis)); + if (XMVector4GreaterOrEqual(MinDist, Dist)) + return false; + + return true; + } + + // + // Find the single vertex of A and B (ie the vertex on the opposite side + // of the plane from the other two) and reorder the edges so we can compute + // the signed edge/edge distances. + // + // if ( (V0 >= 0 && V1 < 0 && V2 < 0) || + // (V0 > 0 && V1 <= 0 && V2 <= 0) || + // (V0 <= 0 && V1 > 0 && V2 > 0) || + // (V0 < 0 && V1 >= 0 && V2 >= 0) ) then V0 is singular; + // + // If our singular vertex is not on the positive side of the plane we reverse + // the triangle winding so that the overlap comparisons will compare the + // correct edges with the correct signs. + // + XMVECTOR ADistIsLessEqual = XMVectorOrInt(ADistIsLess, ADistIsZero); + XMVECTOR ADistIsGreaterEqual = XMVectorOrInt(ADistIsGreater, ADistIsZero); + + XMVECTOR AA0, AA1, AA2; + bool bPositiveA; + + if (DirectX::Internal::XMVector3AllTrue(XMVectorSelect(ADistIsGreaterEqual, ADistIsLess, Select0111)) || + DirectX::Internal::XMVector3AllTrue(XMVectorSelect(ADistIsGreater, ADistIsLessEqual, Select0111))) + { + // A0 is singular, crossing from positive to negative. + AA0 = A0; AA1 = A1; AA2 = A2; + bPositiveA = true; + } + else if (DirectX::Internal::XMVector3AllTrue(XMVectorSelect(ADistIsLessEqual, ADistIsGreater, Select0111)) || + DirectX::Internal::XMVector3AllTrue(XMVectorSelect(ADistIsLess, ADistIsGreaterEqual, Select0111))) + { + // A0 is singular, crossing from negative to positive. + AA0 = A0; AA1 = A2; AA2 = A1; + bPositiveA = false; + } + else if (DirectX::Internal::XMVector3AllTrue(XMVectorSelect(ADistIsGreaterEqual, ADistIsLess, Select1011)) || + DirectX::Internal::XMVector3AllTrue(XMVectorSelect(ADistIsGreater, ADistIsLessEqual, Select1011))) + { + // A1 is singular, crossing from positive to negative. + AA0 = A1; AA1 = A2; AA2 = A0; + bPositiveA = true; + } + else if (DirectX::Internal::XMVector3AllTrue(XMVectorSelect(ADistIsLessEqual, ADistIsGreater, Select1011)) || + DirectX::Internal::XMVector3AllTrue(XMVectorSelect(ADistIsLess, ADistIsGreaterEqual, Select1011))) + { + // A1 is singular, crossing from negative to positive. + AA0 = A1; AA1 = A0; AA2 = A2; + bPositiveA = false; + } + else if (DirectX::Internal::XMVector3AllTrue(XMVectorSelect(ADistIsGreaterEqual, ADistIsLess, Select1101)) || + DirectX::Internal::XMVector3AllTrue(XMVectorSelect(ADistIsGreater, ADistIsLessEqual, Select1101))) + { + // A2 is singular, crossing from positive to negative. + AA0 = A2; AA1 = A0; AA2 = A1; + bPositiveA = true; + } + else if (DirectX::Internal::XMVector3AllTrue(XMVectorSelect(ADistIsLessEqual, ADistIsGreater, Select1101)) || + DirectX::Internal::XMVector3AllTrue(XMVectorSelect(ADistIsLess, ADistIsGreaterEqual, Select1101))) + { + // A2 is singular, crossing from negative to positive. + AA0 = A2; AA1 = A1; AA2 = A0; + bPositiveA = false; + } + else + { + assert(false); + return false; + } + + XMVECTOR BDistIsLessEqual = XMVectorOrInt(BDistIsLess, BDistIsZero); + XMVECTOR BDistIsGreaterEqual = XMVectorOrInt(BDistIsGreater, BDistIsZero); + + XMVECTOR BB0, BB1, BB2; + bool bPositiveB; + + if (DirectX::Internal::XMVector3AllTrue(XMVectorSelect(BDistIsGreaterEqual, BDistIsLess, Select0111)) || + DirectX::Internal::XMVector3AllTrue(XMVectorSelect(BDistIsGreater, BDistIsLessEqual, Select0111))) + { + // B0 is singular, crossing from positive to negative. + BB0 = B0; BB1 = B1; BB2 = B2; + bPositiveB = true; + } + else if (DirectX::Internal::XMVector3AllTrue(XMVectorSelect(BDistIsLessEqual, BDistIsGreater, Select0111)) || + DirectX::Internal::XMVector3AllTrue(XMVectorSelect(BDistIsLess, BDistIsGreaterEqual, Select0111))) + { + // B0 is singular, crossing from negative to positive. + BB0 = B0; BB1 = B2; BB2 = B1; + bPositiveB = false; + } + else if (DirectX::Internal::XMVector3AllTrue(XMVectorSelect(BDistIsGreaterEqual, BDistIsLess, Select1011)) || + DirectX::Internal::XMVector3AllTrue(XMVectorSelect(BDistIsGreater, BDistIsLessEqual, Select1011))) + { + // B1 is singular, crossing from positive to negative. + BB0 = B1; BB1 = B2; BB2 = B0; + bPositiveB = true; + } + else if (DirectX::Internal::XMVector3AllTrue(XMVectorSelect(BDistIsLessEqual, BDistIsGreater, Select1011)) || + DirectX::Internal::XMVector3AllTrue(XMVectorSelect(BDistIsLess, BDistIsGreaterEqual, Select1011))) + { + // B1 is singular, crossing from negative to positive. + BB0 = B1; BB1 = B0; BB2 = B2; + bPositiveB = false; + } + else if (DirectX::Internal::XMVector3AllTrue(XMVectorSelect(BDistIsGreaterEqual, BDistIsLess, Select1101)) || + DirectX::Internal::XMVector3AllTrue(XMVectorSelect(BDistIsGreater, BDistIsLessEqual, Select1101))) + { + // B2 is singular, crossing from positive to negative. + BB0 = B2; BB1 = B0; BB2 = B1; + bPositiveB = true; + } + else if (DirectX::Internal::XMVector3AllTrue(XMVectorSelect(BDistIsLessEqual, BDistIsGreater, Select1101)) || + DirectX::Internal::XMVector3AllTrue(XMVectorSelect(BDistIsLess, BDistIsGreaterEqual, Select1101))) + { + // B2 is singular, crossing from negative to positive. + BB0 = B2; BB1 = B1; BB2 = B0; + bPositiveB = false; + } + else + { + assert(false); + return false; + } + + XMVECTOR Delta0, Delta1; + + // Reverse the direction of the test depending on whether the singular vertices are + // the same sign or different signs. + if (bPositiveA ^ bPositiveB) + { + Delta0 = XMVectorSubtract(BB0, AA0); + Delta1 = XMVectorSubtract(AA0, BB0); + } + else + { + Delta0 = XMVectorSubtract(AA0, BB0); + Delta1 = XMVectorSubtract(BB0, AA0); + } + + // Check if the triangles overlap on the line of intersection between the + // planes of the two triangles by finding the signed line distances. + XMVECTOR Dist0 = XMVector3Dot(Delta0, XMVector3Cross(XMVectorSubtract(BB2, BB0), XMVectorSubtract(AA2, AA0))); + if (XMVector4Greater(Dist0, Zero)) + return false; + + XMVECTOR Dist1 = XMVector3Dot(Delta1, XMVector3Cross(XMVectorSubtract(BB1, BB0), XMVectorSubtract(AA1, AA0))); + if (XMVector4Greater(Dist1, Zero)) + return false; + + return true; + } + + + //----------------------------------------------------------------------------- + // Ray-triangle test + //----------------------------------------------------------------------------- + _Use_decl_annotations_ + inline PlaneIntersectionType XM_CALLCONV Intersects(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2, GXMVECTOR Plane) noexcept + { + XMVECTOR One = XMVectorSplatOne(); + + assert(DirectX::Internal::XMPlaneIsUnit(Plane)); + + // Set w of the points to one so we can dot4 with a plane. + XMVECTOR TV0 = XMVectorInsert<0, 0, 0, 0, 1>(V0, One); + XMVECTOR TV1 = XMVectorInsert<0, 0, 0, 0, 1>(V1, One); + XMVECTOR TV2 = XMVectorInsert<0, 0, 0, 0, 1>(V2, One); + + XMVECTOR Outside, Inside; + DirectX::Internal::FastIntersectTrianglePlane(TV0, TV1, TV2, Plane, Outside, Inside); + + // If the triangle is outside any plane it is outside. + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return FRONT; + + // If the triangle is inside all planes it is inside. + if (XMVector4EqualInt(Inside, XMVectorTrueInt())) + return BACK; + + // The triangle is not inside all planes or outside a plane it intersects. + return INTERSECTING; + } + + + //----------------------------------------------------------------------------- + // Test a triangle vs 6 planes (typically forming a frustum). + //----------------------------------------------------------------------------- + _Use_decl_annotations_ + inline ContainmentType XM_CALLCONV ContainedBy( + FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2, + GXMVECTOR Plane0, + HXMVECTOR Plane1, HXMVECTOR Plane2, + CXMVECTOR Plane3, CXMVECTOR Plane4, CXMVECTOR Plane5) noexcept + { + XMVECTOR One = XMVectorSplatOne(); + + // Set w of the points to one so we can dot4 with a plane. + XMVECTOR TV0 = XMVectorInsert<0, 0, 0, 0, 1>(V0, One); + XMVECTOR TV1 = XMVectorInsert<0, 0, 0, 0, 1>(V1, One); + XMVECTOR TV2 = XMVectorInsert<0, 0, 0, 0, 1>(V2, One); + + XMVECTOR Outside, Inside; + + // Test against each plane. + DirectX::Internal::FastIntersectTrianglePlane(TV0, TV1, TV2, Plane0, Outside, Inside); + + XMVECTOR AnyOutside = Outside; + XMVECTOR AllInside = Inside; + + DirectX::Internal::FastIntersectTrianglePlane(TV0, TV1, TV2, Plane1, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::Internal::FastIntersectTrianglePlane(TV0, TV1, TV2, Plane2, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::Internal::FastIntersectTrianglePlane(TV0, TV1, TV2, Plane3, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::Internal::FastIntersectTrianglePlane(TV0, TV1, TV2, Plane4, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::Internal::FastIntersectTrianglePlane(TV0, TV1, TV2, Plane5, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + // If the triangle is outside any plane it is outside. + if (XMVector4EqualInt(AnyOutside, XMVectorTrueInt())) + return DISJOINT; + + // If the triangle is inside all planes it is inside. + if (XMVector4EqualInt(AllInside, XMVectorTrueInt())) + return CONTAINS; + + // The triangle is not inside all planes or outside a plane, it may intersect. + return INTERSECTS; + } + +} // namespace TriangleTests + diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXColors.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXColors.h new file mode 100644 index 0000000..83fa210 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXColors.h @@ -0,0 +1,312 @@ +//------------------------------------------------------------------------------------- +// DirectXColors.h -- C++ Color Math library +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +// +// http://go.microsoft.com/fwlink/?LinkID=615560 +//------------------------------------------------------------------------------------- + +#pragma once + +#include "DirectXMath.h" + +namespace DirectX +{ + + namespace Colors + { + // Standard colors (Red/Green/Blue/Alpha) in sRGB colorspace + XMGLOBALCONST XMVECTORF32 AliceBlue = { { { 0.941176534f, 0.972549081f, 1.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 AntiqueWhite = { { { 0.980392218f, 0.921568692f, 0.843137324f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Aqua = { { { 0.f, 1.f, 1.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Aquamarine = { { { 0.498039246f, 1.f, 0.831372619f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Azure = { { { 0.941176534f, 1.f, 1.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Beige = { { { 0.960784376f, 0.960784376f, 0.862745166f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Bisque = { { { 1.f, 0.894117713f, 0.768627524f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Black = { { { 0.f, 0.f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 BlanchedAlmond = { { { 1.f, 0.921568692f, 0.803921640f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Blue = { { { 0.f, 0.f, 1.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 BlueViolet = { { { 0.541176498f, 0.168627456f, 0.886274576f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Brown = { { { 0.647058845f, 0.164705887f, 0.164705887f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 BurlyWood = { { { 0.870588303f, 0.721568644f, 0.529411793f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 CadetBlue = { { { 0.372549027f, 0.619607866f, 0.627451003f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Chartreuse = { { { 0.498039246f, 1.f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Chocolate = { { { 0.823529482f, 0.411764741f, 0.117647067f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Coral = { { { 1.f, 0.498039246f, 0.313725501f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 CornflowerBlue = { { { 0.392156899f, 0.584313750f, 0.929411829f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Cornsilk = { { { 1.f, 0.972549081f, 0.862745166f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Crimson = { { { 0.862745166f, 0.078431375f, 0.235294133f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Cyan = { { { 0.f, 1.f, 1.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkBlue = { { { 0.f, 0.f, 0.545098066f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkCyan = { { { 0.f, 0.545098066f, 0.545098066f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkGoldenrod = { { { 0.721568644f, 0.525490224f, 0.043137256f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkGray = { { { 0.662745118f, 0.662745118f, 0.662745118f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkGreen = { { { 0.f, 0.392156899f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkKhaki = { { { 0.741176486f, 0.717647076f, 0.419607878f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkMagenta = { { { 0.545098066f, 0.f, 0.545098066f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkOliveGreen = { { { 0.333333343f, 0.419607878f, 0.184313729f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkOrange = { { { 1.f, 0.549019635f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkOrchid = { { { 0.600000024f, 0.196078449f, 0.800000072f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkRed = { { { 0.545098066f, 0.f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkSalmon = { { { 0.913725555f, 0.588235319f, 0.478431404f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkSeaGreen = { { { 0.560784340f, 0.737254918f, 0.545098066f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkSlateBlue = { { { 0.282352954f, 0.239215702f, 0.545098066f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkSlateGray = { { { 0.184313729f, 0.309803933f, 0.309803933f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkTurquoise = { { { 0.f, 0.807843208f, 0.819607913f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkViolet = { { { 0.580392182f, 0.f, 0.827451050f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DeepPink = { { { 1.f, 0.078431375f, 0.576470613f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DeepSkyBlue = { { { 0.f, 0.749019623f, 1.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DimGray = { { { 0.411764741f, 0.411764741f, 0.411764741f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DodgerBlue = { { { 0.117647067f, 0.564705908f, 1.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Firebrick = { { { 0.698039234f, 0.133333340f, 0.133333340f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 FloralWhite = { { { 1.f, 0.980392218f, 0.941176534f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 ForestGreen = { { { 0.133333340f, 0.545098066f, 0.133333340f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Fuchsia = { { { 1.f, 0.f, 1.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Gainsboro = { { { 0.862745166f, 0.862745166f, 0.862745166f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 GhostWhite = { { { 0.972549081f, 0.972549081f, 1.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Gold = { { { 1.f, 0.843137324f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Goldenrod = { { { 0.854902029f, 0.647058845f, 0.125490203f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Gray = { { { 0.501960814f, 0.501960814f, 0.501960814f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Green = { { { 0.f, 0.501960814f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 GreenYellow = { { { 0.678431392f, 1.f, 0.184313729f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Honeydew = { { { 0.941176534f, 1.f, 0.941176534f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 HotPink = { { { 1.f, 0.411764741f, 0.705882370f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 IndianRed = { { { 0.803921640f, 0.360784322f, 0.360784322f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Indigo = { { { 0.294117659f, 0.f, 0.509803951f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Ivory = { { { 1.f, 1.f, 0.941176534f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Khaki = { { { 0.941176534f, 0.901960850f, 0.549019635f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Lavender = { { { 0.901960850f, 0.901960850f, 0.980392218f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LavenderBlush = { { { 1.f, 0.941176534f, 0.960784376f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LawnGreen = { { { 0.486274540f, 0.988235354f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LemonChiffon = { { { 1.f, 0.980392218f, 0.803921640f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LightBlue = { { { 0.678431392f, 0.847058892f, 0.901960850f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LightCoral = { { { 0.941176534f, 0.501960814f, 0.501960814f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LightCyan = { { { 0.878431439f, 1.f, 1.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LightGoldenrodYellow = { { { 0.980392218f, 0.980392218f, 0.823529482f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LightGray = { { { 0.827451050f, 0.827451050f, 0.827451050f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LightGreen = { { { 0.564705908f, 0.933333397f, 0.564705908f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LightPink = { { { 1.f, 0.713725507f, 0.756862819f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LightSalmon = { { { 1.f, 0.627451003f, 0.478431404f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LightSeaGreen = { { { 0.125490203f, 0.698039234f, 0.666666687f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LightSkyBlue = { { { 0.529411793f, 0.807843208f, 0.980392218f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LightSlateGray = { { { 0.466666698f, 0.533333361f, 0.600000024f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LightSteelBlue = { { { 0.690196097f, 0.768627524f, 0.870588303f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LightYellow = { { { 1.f, 1.f, 0.878431439f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Lime = { { { 0.f, 1.f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LimeGreen = { { { 0.196078449f, 0.803921640f, 0.196078449f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Linen = { { { 0.980392218f, 0.941176534f, 0.901960850f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Magenta = { { { 1.f, 0.f, 1.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Maroon = { { { 0.501960814f, 0.f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 MediumAquamarine = { { { 0.400000036f, 0.803921640f, 0.666666687f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 MediumBlue = { { { 0.f, 0.f, 0.803921640f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 MediumOrchid = { { { 0.729411781f, 0.333333343f, 0.827451050f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 MediumPurple = { { { 0.576470613f, 0.439215720f, 0.858823597f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 MediumSeaGreen = { { { 0.235294133f, 0.701960802f, 0.443137288f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 MediumSlateBlue = { { { 0.482352972f, 0.407843173f, 0.933333397f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 MediumSpringGreen = { { { 0.f, 0.980392218f, 0.603921592f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 MediumTurquoise = { { { 0.282352954f, 0.819607913f, 0.800000072f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 MediumVioletRed = { { { 0.780392230f, 0.082352944f, 0.521568656f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 MidnightBlue = { { { 0.098039225f, 0.098039225f, 0.439215720f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 MintCream = { { { 0.960784376f, 1.f, 0.980392218f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 MistyRose = { { { 1.f, 0.894117713f, 0.882353008f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Moccasin = { { { 1.f, 0.894117713f, 0.709803939f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 NavajoWhite = { { { 1.f, 0.870588303f, 0.678431392f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Navy = { { { 0.f, 0.f, 0.501960814f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 OldLace = { { { 0.992156923f, 0.960784376f, 0.901960850f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Olive = { { { 0.501960814f, 0.501960814f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 OliveDrab = { { { 0.419607878f, 0.556862772f, 0.137254909f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Orange = { { { 1.f, 0.647058845f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 OrangeRed = { { { 1.f, 0.270588249f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Orchid = { { { 0.854902029f, 0.439215720f, 0.839215755f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 PaleGoldenrod = { { { 0.933333397f, 0.909803987f, 0.666666687f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 PaleGreen = { { { 0.596078455f, 0.984313786f, 0.596078455f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 PaleTurquoise = { { { 0.686274529f, 0.933333397f, 0.933333397f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 PaleVioletRed = { { { 0.858823597f, 0.439215720f, 0.576470613f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 PapayaWhip = { { { 1.f, 0.937254965f, 0.835294187f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 PeachPuff = { { { 1.f, 0.854902029f, 0.725490212f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Peru = { { { 0.803921640f, 0.521568656f, 0.247058839f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Pink = { { { 1.f, 0.752941251f, 0.796078503f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Plum = { { { 0.866666734f, 0.627451003f, 0.866666734f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 PowderBlue = { { { 0.690196097f, 0.878431439f, 0.901960850f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Purple = { { { 0.501960814f, 0.f, 0.501960814f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Red = { { { 1.f, 0.f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 RosyBrown = { { { 0.737254918f, 0.560784340f, 0.560784340f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 RoyalBlue = { { { 0.254901975f, 0.411764741f, 0.882353008f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 SaddleBrown = { { { 0.545098066f, 0.270588249f, 0.074509807f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Salmon = { { { 0.980392218f, 0.501960814f, 0.447058856f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 SandyBrown = { { { 0.956862807f, 0.643137276f, 0.376470625f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 SeaGreen = { { { 0.180392161f, 0.545098066f, 0.341176480f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 SeaShell = { { { 1.f, 0.960784376f, 0.933333397f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Sienna = { { { 0.627451003f, 0.321568638f, 0.176470593f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Silver = { { { 0.752941251f, 0.752941251f, 0.752941251f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 SkyBlue = { { { 0.529411793f, 0.807843208f, 0.921568692f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 SlateBlue = { { { 0.415686309f, 0.352941185f, 0.803921640f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 SlateGray = { { { 0.439215720f, 0.501960814f, 0.564705908f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Snow = { { { 1.f, 0.980392218f, 0.980392218f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 SpringGreen = { { { 0.f, 1.f, 0.498039246f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 SteelBlue = { { { 0.274509817f, 0.509803951f, 0.705882370f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Tan = { { { 0.823529482f, 0.705882370f, 0.549019635f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Teal = { { { 0.f, 0.501960814f, 0.501960814f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Thistle = { { { 0.847058892f, 0.749019623f, 0.847058892f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Tomato = { { { 1.f, 0.388235331f, 0.278431386f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Transparent = { { { 0.f, 0.f, 0.f, 0.f } } }; + XMGLOBALCONST XMVECTORF32 Turquoise = { { { 0.250980407f, 0.878431439f, 0.815686345f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Violet = { { { 0.933333397f, 0.509803951f, 0.933333397f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Wheat = { { { 0.960784376f, 0.870588303f, 0.701960802f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 White = { { { 1.f, 1.f, 1.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 WhiteSmoke = { { { 0.960784376f, 0.960784376f, 0.960784376f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Yellow = { { { 1.f, 1.f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 YellowGreen = { { { 0.603921592f, 0.803921640f, 0.196078449f, 1.f } } }; + + } // namespace Colors + + namespace ColorsLinear + { + // Standard colors (Red/Green/Blue/Alpha) in linear colorspace + XMGLOBALCONST XMVECTORF32 AliceBlue = { { { 0.871367335f, 0.938685894f, 1.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 AntiqueWhite = { { { 0.955973506f, 0.830770075f, 0.679542601f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Aqua = { { { 0.f, 1.f, 1.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Aquamarine = { { { 0.212230787f, 1.f, 0.658374965f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Azure = { { { 0.871367335f, 1.f, 1.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Beige = { { { 0.913098991f, 0.913098991f, 0.715693772f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Bisque = { { { 1.f, 0.775822461f, 0.552011609f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Black = { { { 0.f, 0.f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 BlanchedAlmond = { { { 1.f, 0.830770075f, 0.610495746f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Blue = { { { 0.f, 0.f, 1.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 BlueViolet = { { { 0.254152179f, 0.024157630f, 0.760524750f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Brown = { { { 0.376262218f, 0.023153365f, 0.023153365f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 BurlyWood = { { { 0.730461001f, 0.479320228f, 0.242281199f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 CadetBlue = { { { 0.114435382f, 0.341914445f, 0.351532698f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Chartreuse = { { { 0.212230787f, 1.f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Chocolate = { { { 0.644479871f, 0.141263321f, 0.012983031f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Coral = { { { 1.f, 0.212230787f, 0.080219828f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 CornflowerBlue = { { { 0.127437726f, 0.300543845f, 0.846873462f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Cornsilk = { { { 1.f, 0.938685894f, 0.715693772f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Crimson = { { { 0.715693772f, 0.006995410f, 0.045186214f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Cyan = { { { 0.f, 1.f, 1.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkBlue = { { { 0.f, 0.f, 0.258182913f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkCyan = { { { 0.f, 0.258182913f, 0.258182913f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkGoldenrod = { { { 0.479320228f, 0.238397658f, 0.003346536f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkGray = { { { 0.396755308f, 0.396755308f, 0.396755308f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkGreen = { { { 0.f, 0.127437726f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkKhaki = { { { 0.508881450f, 0.473531544f, 0.147027299f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkMagenta = { { { 0.258182913f, 0.f, 0.258182913f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkOliveGreen = { { { 0.090841733f, 0.147027299f, 0.028426038f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkOrange = { { { 1.f, 0.262250721f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkOrchid = { { { 0.318546832f, 0.031896040f, 0.603827536f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkRed = { { { 0.258182913f, 0.f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkSalmon = { { { 0.814846814f, 0.304987371f, 0.194617867f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkSeaGreen = { { { 0.274677366f, 0.502886593f, 0.258182913f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkSlateBlue = { { { 0.064803280f, 0.046665095f, 0.258182913f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkSlateGray = { { { 0.028426038f, 0.078187428f, 0.078187428f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkTurquoise = { { { 0.f, 0.617206752f, 0.637597024f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DarkViolet = { { { 0.296138316f, 0.f, 0.651405811f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DeepPink = { { { 1.f, 0.006995410f, 0.291770697f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DeepSkyBlue = { { { 0.f, 0.520995677f, 1.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DimGray = { { { 0.141263321f, 0.141263321f, 0.141263321f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 DodgerBlue = { { { 0.012983031f, 0.278894335f, 1.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Firebrick = { { { 0.445201248f, 0.015996292f, 0.015996292f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 FloralWhite = { { { 1.f, 0.955973506f, 0.871367335f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 ForestGreen = { { { 0.015996292f, 0.258182913f, 0.015996292f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Fuchsia = { { { 1.f, 0.f, 1.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Gainsboro = { { { 0.715693772f, 0.715693772f, 0.715693772f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 GhostWhite = { { { 0.938685894f, 0.938685894f, 1.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Gold = { { { 1.f, 0.679542601f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Goldenrod = { { { 0.701102138f, 0.376262218f, 0.014443844f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Gray = { { { 0.215860531f, 0.215860531f, 0.215860531f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Green = { { { 0.f, 0.215860531f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 GreenYellow = { { { 0.417885154f, 1.f, 0.028426038f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Honeydew = { { { 0.871367335f, 1.f, 0.871367335f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 HotPink = { { { 1.f, 0.141263321f, 0.456411064f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 IndianRed = { { { 0.610495746f, 0.107023112f, 0.107023112f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Indigo = { { { 0.070360109f, 0.f, 0.223227978f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Ivory = { { { 1.f, 1.f, 0.871367335f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Khaki = { { { 0.871367335f, 0.791298151f, 0.262250721f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Lavender = { { { 0.791298151f, 0.791298151f, 0.955973506f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LavenderBlush = { { { 1.f, 0.871367335f, 0.913098991f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LawnGreen = { { { 0.201556295f, 0.973445475f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LemonChiffon = { { { 1.f, 0.955973506f, 0.610495746f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LightBlue = { { { 0.417885154f, 0.686685443f, 0.791298151f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LightCoral = { { { 0.871367335f, 0.215860531f, 0.215860531f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LightCyan = { { { 0.745404482f, 1.f, 1.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LightGoldenrodYellow = { { { 0.955973506f, 0.955973506f, 0.644479871f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LightGray = { { { 0.651405811f, 0.651405811f, 0.651405811f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LightGreen = { { { 0.278894335f, 0.854992807f, 0.278894335f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LightPink = { { { 1.f, 0.467783839f, 0.533276618f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LightSalmon = { { { 1.f, 0.351532698f, 0.194617867f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LightSeaGreen = { { { 0.014443844f, 0.445201248f, 0.401977867f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LightSkyBlue = { { { 0.242281199f, 0.617206752f, 0.955973506f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LightSlateGray = { { { 0.184475034f, 0.246201396f, 0.318546832f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LightSteelBlue = { { { 0.434153706f, 0.552011609f, 0.730461001f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LightYellow = { { { 1.f, 1.f, 0.745404482f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Lime = { { { 0.f, 1.f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 LimeGreen = { { { 0.031896040f, 0.610495746f, 0.031896040f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Linen = { { { 0.955973506f, 0.871367335f, 0.791298151f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Magenta = { { { 1.f, 0.f, 1.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Maroon = { { { 0.215860531f, 0.f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 MediumAquamarine = { { { 0.132868364f, 0.610495746f, 0.401977867f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 MediumBlue = { { { 0.f, 0.f, 0.610495746f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 MediumOrchid = { { { 0.491020888f, 0.090841733f, 0.651405811f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 MediumPurple = { { { 0.291770697f, 0.162029430f, 0.708376050f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 MediumSeaGreen = { { { 0.045186214f, 0.450785846f, 0.165132239f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 MediumSlateBlue = { { { 0.198069349f, 0.138431653f, 0.854992807f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 MediumSpringGreen = { { { 0.f, 0.955973506f, 0.323143244f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 MediumTurquoise = { { { 0.064803280f, 0.637597024f, 0.603827536f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 MediumVioletRed = { { { 0.571125031f, 0.007499032f, 0.234550655f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 MidnightBlue = { { { 0.009721218f, 0.009721218f, 0.162029430f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 MintCream = { { { 0.913098991f, 1.f, 0.955973506f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 MistyRose = { { { 1.f, 0.775822461f, 0.752942443f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Moccasin = { { { 1.f, 0.775822461f, 0.462077051f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 NavajoWhite = { { { 1.f, 0.730461001f, 0.417885154f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Navy = { { { 0.f, 0.f, 0.215860531f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 OldLace = { { { 0.982250869f, 0.913098991f, 0.791298151f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Olive = { { { 0.215860531f, 0.215860531f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 OliveDrab = { { { 0.147027299f, 0.270497859f, 0.016807375f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Orange = { { { 1.f, 0.376262218f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 OrangeRed = { { { 1.f, 0.059511241f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Orchid = { { { 0.701102138f, 0.162029430f, 0.672443330f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 PaleGoldenrod = { { { 0.854992807f, 0.806952477f, 0.401977867f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 PaleGreen = { { { 0.313988745f, 0.964686573f, 0.313988745f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 PaleTurquoise = { { { 0.428690553f, 0.854992807f, 0.854992807f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 PaleVioletRed = { { { 0.708376050f, 0.162029430f, 0.291770697f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 PapayaWhip = { { { 1.f, 0.863157392f, 0.665387452f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 PeachPuff = { { { 1.f, 0.701102138f, 0.485149980f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Peru = { { { 0.610495746f, 0.234550655f, 0.049706575f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Pink = { { { 1.f, 0.527115345f, 0.597202003f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Plum = { { { 0.723055363f, 0.351532698f, 0.723055363f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 PowderBlue = { { { 0.434153706f, 0.745404482f, 0.791298151f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Purple = { { { 0.215860531f, 0.f, 0.215860531f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Red = { { { 1.f, 0.f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 RosyBrown = { { { 0.502886593f, 0.274677366f, 0.274677366f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 RoyalBlue = { { { 0.052860655f, 0.141263321f, 0.752942443f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 SaddleBrown = { { { 0.258182913f, 0.059511241f, 0.006512091f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Salmon = { { { 0.955973506f, 0.215860531f, 0.168269455f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 SandyBrown = { { { 0.904661357f, 0.371237785f, 0.116970696f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 SeaGreen = { { { 0.027320892f, 0.258182913f, 0.095307484f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 SeaShell = { { { 1.f, 0.913098991f, 0.854992807f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Sienna = { { { 0.351532698f, 0.084376216f, 0.026241222f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Silver = { { { 0.527115345f, 0.527115345f, 0.527115345f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 SkyBlue = { { { 0.242281199f, 0.617206752f, 0.830770075f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 SlateBlue = { { { 0.144128501f, 0.102241747f, 0.610495746f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 SlateGray = { { { 0.162029430f, 0.215860531f, 0.278894335f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Snow = { { { 1.f, 0.955973506f, 0.955973506f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 SpringGreen = { { { 0.f, 1.f, 0.212230787f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 SteelBlue = { { { 0.061246071f, 0.223227978f, 0.456411064f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Tan = { { { 0.644479871f, 0.456411064f, 0.262250721f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Teal = { { { 0.f, 0.215860531f, 0.215860531f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Thistle = { { { 0.686685443f, 0.520995677f, 0.686685443f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Tomato = { { { 1.f, 0.124771863f, 0.063010029f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Transparent = { { { 0.f, 0.f, 0.f, 0.f } } }; + XMGLOBALCONST XMVECTORF32 Turquoise = { { { 0.051269468f, 0.745404482f, 0.630757332f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Violet = { { { 0.854992807f, 0.223227978f, 0.854992807f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Wheat = { { { 0.913098991f, 0.730461001f, 0.450785846f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 White = { { { 1.f, 1.f, 1.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 WhiteSmoke = { { { 0.913098991f, 0.913098991f, 0.913098991f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 Yellow = { { { 1.f, 1.f, 0.f, 1.f } } }; + XMGLOBALCONST XMVECTORF32 YellowGreen = { { { 0.323143244f, 0.610495746f, 0.031896040f, 1.f } } }; + + } // namespace ColorsLinear + +} // namespace DirectX + diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXMath.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXMath.h new file mode 100644 index 0000000..593aead --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXMath.h @@ -0,0 +1,2280 @@ +//------------------------------------------------------------------------------------- +// DirectXMath.h -- SIMD C++ Math library +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +// +// http://go.microsoft.com/fwlink/?LinkID=615560 +//------------------------------------------------------------------------------------- + +#pragma once + +#ifndef __cplusplus +#error DirectX Math requires C++ +#endif + +#define DIRECTX_MATH_VERSION 318 + +#if defined(_MSC_VER) && (_MSC_VER < 1910) +#error DirectX Math requires Visual C++ 2017 or later. +#endif + +#if defined(_MSC_VER) && !defined(_M_ARM) && !defined(_M_ARM64) && !defined(_M_HYBRID_X86_ARM64) && !defined(_M_ARM64EC) && (!_MANAGED) && (!_M_CEE) && (!defined(_M_IX86_FP) || (_M_IX86_FP > 1)) && !defined(_XM_NO_INTRINSICS_) && !defined(_XM_VECTORCALL_) +#define _XM_VECTORCALL_ 1 +#endif + +#if _XM_VECTORCALL_ +#define XM_CALLCONV __vectorcall +#elif defined(__GNUC__) +#define XM_CALLCONV +#else +#define XM_CALLCONV __fastcall +#endif + +#ifndef XM_DEPRECATED +#ifdef __GNUC__ +#define XM_DEPRECATED __attribute__ ((deprecated)) +#else +#define XM_DEPRECATED __declspec(deprecated("This is deprecated and will be removed in a future version.")) +#endif +#endif + +#if !defined(_XM_AVX2_INTRINSICS_) && defined(__AVX2__) && !defined(_XM_NO_INTRINSICS_) +#define _XM_AVX2_INTRINSICS_ +#endif + +#if !defined(_XM_FMA3_INTRINSICS_) && defined(_XM_AVX2_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) +#define _XM_FMA3_INTRINSICS_ +#endif + +#if !defined(_XM_F16C_INTRINSICS_) && defined(_XM_AVX2_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) +#define _XM_F16C_INTRINSICS_ +#endif + +#if !defined(_XM_F16C_INTRINSICS_) && defined(__F16C__) && !defined(_XM_NO_INTRINSICS_) +#define _XM_F16C_INTRINSICS_ +#endif + +#if defined(_XM_FMA3_INTRINSICS_) && !defined(_XM_AVX_INTRINSICS_) +#define _XM_AVX_INTRINSICS_ +#endif + +#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_AVX_INTRINSICS_) +#define _XM_AVX_INTRINSICS_ +#endif + +#if !defined(_XM_AVX_INTRINSICS_) && defined(__AVX__) && !defined(_XM_NO_INTRINSICS_) +#define _XM_AVX_INTRINSICS_ +#endif + +#if defined(_XM_AVX_INTRINSICS_) && !defined(_XM_SSE4_INTRINSICS_) +#define _XM_SSE4_INTRINSICS_ +#endif + +#if defined(_XM_SSE4_INTRINSICS_) && !defined(_XM_SSE3_INTRINSICS_) +#define _XM_SSE3_INTRINSICS_ +#endif + +#if defined(_XM_SSE3_INTRINSICS_) && !defined(_XM_SSE_INTRINSICS_) +#define _XM_SSE_INTRINSICS_ +#endif + +#if !defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) +#if (defined(_M_IX86) || defined(_M_X64) || __i386__ || __x86_64__) && !defined(_M_HYBRID_X86_ARM64) && !defined(_M_ARM64EC) +#define _XM_SSE_INTRINSICS_ +#elif defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__ +#define _XM_ARM_NEON_INTRINSICS_ +#elif !defined(_XM_NO_INTRINSICS_) +#error DirectX Math does not support this target +#endif +#endif // !_XM_ARM_NEON_INTRINSICS_ && !_XM_SSE_INTRINSICS_ && !_XM_NO_INTRINSICS_ + +#if defined(_XM_SSE_INTRINSICS_) && defined(_MSC_VER) && (_MSC_VER >= 1920) && !defined(__clang__) && !defined(_XM_SVML_INTRINSICS_) && !defined(_XM_DISABLE_INTEL_SVML_) +#define _XM_SVML_INTRINSICS_ +#endif + +#if !defined(_XM_NO_XMVECTOR_OVERLOADS_) && (defined(__clang__) || defined(__GNUC__)) && !defined(_XM_NO_INTRINSICS_) +#define _XM_NO_XMVECTOR_OVERLOADS_ +#endif + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4514 4820) +// C4514/4820: Off by default noise +#endif +#include +#include +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +#ifndef _XM_NO_INTRINSICS_ + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4987) +// C4987: Off by default noise +#include +#pragma warning(pop) +#endif + +#if (defined(__clang__) || defined(__GNUC__)) && (__x86_64__ || __i386__) +#include +#endif + +#ifdef _XM_SSE_INTRINSICS_ +#include +#include + +#ifdef _XM_SSE3_INTRINSICS_ +#include +#endif + +#ifdef _XM_SSE4_INTRINSICS_ +#include +#endif + +#ifdef _XM_AVX_INTRINSICS_ +#include +#endif + +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_MSC_VER) && !defined(__clang__) && (defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC)) +#include +#else +#include +#endif +#endif +#endif // !_XM_NO_INTRINSICS_ + +#include "sal.h" +#include + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4005 4668) +// C4005/4668: Old header issue +#endif +#include +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +#if __cplusplus >= 201703L +#define XM_ALIGNED_DATA(x) alignas(x) +#define XM_ALIGNED_STRUCT(x) struct alignas(x) +#elif defined(__GNUC__) +#define XM_ALIGNED_DATA(x) __attribute__ ((aligned(x))) +#define XM_ALIGNED_STRUCT(x) struct __attribute__ ((aligned(x))) +#else +#define XM_ALIGNED_DATA(x) __declspec(align(x)) +#define XM_ALIGNED_STRUCT(x) __declspec(align(x)) struct +#endif + +#if (__cplusplus >= 202002L) +#include +#endif + +/**************************************************************************** + * + * Conditional intrinsics + * + ****************************************************************************/ + +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + +#if defined(_XM_NO_MOVNT_) +#define XM_STREAM_PS( p, a ) _mm_store_ps((p), (a)) +#define XM256_STREAM_PS( p, a ) _mm256_store_ps((p), (a)) +#define XM_SFENCE() +#else +#define XM_STREAM_PS( p, a ) _mm_stream_ps((p), (a)) +#define XM256_STREAM_PS( p, a ) _mm256_stream_ps((p), (a)) +#define XM_SFENCE() _mm_sfence() +#endif + +#if defined(_XM_FMA3_INTRINSICS_) +#define XM_FMADD_PS( a, b, c ) _mm_fmadd_ps((a), (b), (c)) +#define XM_FNMADD_PS( a, b, c ) _mm_fnmadd_ps((a), (b), (c)) +#else +#define XM_FMADD_PS( a, b, c ) _mm_add_ps(_mm_mul_ps((a), (b)), (c)) +#define XM_FNMADD_PS( a, b, c ) _mm_sub_ps((c), _mm_mul_ps((a), (b))) +#endif + +#if defined(_XM_AVX_INTRINSICS_) && defined(_XM_FAVOR_INTEL_) +#define XM_PERMUTE_PS( v, c ) _mm_permute_ps((v), c ) +#else +#define XM_PERMUTE_PS( v, c ) _mm_shuffle_ps((v), (v), c ) +#endif + +#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 11) +#define XM_LOADU_SI16( p ) _mm_cvtsi32_si128(*reinterpret_cast(p)) +#else +#define XM_LOADU_SI16( p ) _mm_loadu_si16(p) +#endif + +#endif // _XM_SSE_INTRINSICS_ && !_XM_NO_INTRINSICS_ + +#if defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + +#if defined(__clang__) || defined(__GNUC__) +#define XM_PREFETCH( a ) __builtin_prefetch(a) +#elif defined(_MSC_VER) +#define XM_PREFETCH( a ) __prefetch(a) +#else +#define XM_PREFETCH( a ) +#endif + +#endif // _XM_ARM_NEON_INTRINSICS_ && !_XM_NO_INTRINSICS_ + +namespace DirectX +{ + + /**************************************************************************** + * + * Constant definitions + * + ****************************************************************************/ + +#if defined(__XNAMATH_H__) && defined(XM_PI) +#undef XM_PI +#undef XM_2PI +#undef XM_1DIVPI +#undef XM_1DIV2PI +#undef XM_PIDIV2 +#undef XM_PIDIV4 +#undef XM_SELECT_0 +#undef XM_SELECT_1 +#undef XM_PERMUTE_0X +#undef XM_PERMUTE_0Y +#undef XM_PERMUTE_0Z +#undef XM_PERMUTE_0W +#undef XM_PERMUTE_1X +#undef XM_PERMUTE_1Y +#undef XM_PERMUTE_1Z +#undef XM_PERMUTE_1W +#undef XM_CRMASK_CR6 +#undef XM_CRMASK_CR6TRUE +#undef XM_CRMASK_CR6FALSE +#undef XM_CRMASK_CR6BOUNDS +#undef XM_CACHE_LINE_SIZE +#endif + + constexpr float XM_PI = 3.141592654f; + constexpr float XM_2PI = 6.283185307f; + constexpr float XM_1DIVPI = 0.318309886f; + constexpr float XM_1DIV2PI = 0.159154943f; + constexpr float XM_PIDIV2 = 1.570796327f; + constexpr float XM_PIDIV4 = 0.785398163f; + + constexpr uint32_t XM_SELECT_0 = 0x00000000; + constexpr uint32_t XM_SELECT_1 = 0xFFFFFFFF; + + constexpr uint32_t XM_PERMUTE_0X = 0; + constexpr uint32_t XM_PERMUTE_0Y = 1; + constexpr uint32_t XM_PERMUTE_0Z = 2; + constexpr uint32_t XM_PERMUTE_0W = 3; + constexpr uint32_t XM_PERMUTE_1X = 4; + constexpr uint32_t XM_PERMUTE_1Y = 5; + constexpr uint32_t XM_PERMUTE_1Z = 6; + constexpr uint32_t XM_PERMUTE_1W = 7; + + constexpr uint32_t XM_SWIZZLE_X = 0; + constexpr uint32_t XM_SWIZZLE_Y = 1; + constexpr uint32_t XM_SWIZZLE_Z = 2; + constexpr uint32_t XM_SWIZZLE_W = 3; + + constexpr uint32_t XM_CRMASK_CR6 = 0x000000F0; + constexpr uint32_t XM_CRMASK_CR6TRUE = 0x00000080; + constexpr uint32_t XM_CRMASK_CR6FALSE = 0x00000020; + constexpr uint32_t XM_CRMASK_CR6BOUNDS = XM_CRMASK_CR6FALSE; + +#if defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__ + constexpr size_t XM_CACHE_LINE_SIZE = 128; +#else + constexpr size_t XM_CACHE_LINE_SIZE = 64; +#endif + + + /**************************************************************************** + * + * Macros + * + ****************************************************************************/ + +#if defined(__XNAMATH_H__) && defined(XMComparisonAllTrue) +#undef XMComparisonAllTrue +#undef XMComparisonAnyTrue +#undef XMComparisonAllFalse +#undef XMComparisonAnyFalse +#undef XMComparisonMixed +#undef XMComparisonAllInBounds +#undef XMComparisonAnyOutOfBounds +#endif + + // Unit conversion + + constexpr float XMConvertToRadians(float fDegrees) noexcept { return fDegrees * (XM_PI / 180.0f); } + constexpr float XMConvertToDegrees(float fRadians) noexcept { return fRadians * (180.0f / XM_PI); } + + // Condition register evaluation proceeding a recording (R) comparison + + constexpr bool XMComparisonAllTrue(uint32_t CR) noexcept { return (CR & XM_CRMASK_CR6TRUE) == XM_CRMASK_CR6TRUE; } + constexpr bool XMComparisonAnyTrue(uint32_t CR) noexcept { return (CR & XM_CRMASK_CR6FALSE) != XM_CRMASK_CR6FALSE; } + constexpr bool XMComparisonAllFalse(uint32_t CR) noexcept { return (CR & XM_CRMASK_CR6FALSE) == XM_CRMASK_CR6FALSE; } + constexpr bool XMComparisonAnyFalse(uint32_t CR) noexcept { return (CR & XM_CRMASK_CR6TRUE) != XM_CRMASK_CR6TRUE; } + constexpr bool XMComparisonMixed(uint32_t CR) noexcept { return (CR & XM_CRMASK_CR6) == 0; } + constexpr bool XMComparisonAllInBounds(uint32_t CR) noexcept { return (CR & XM_CRMASK_CR6BOUNDS) == XM_CRMASK_CR6BOUNDS; } + constexpr bool XMComparisonAnyOutOfBounds(uint32_t CR) noexcept { return (CR & XM_CRMASK_CR6BOUNDS) != XM_CRMASK_CR6BOUNDS; } + + + /**************************************************************************** + * + * Data types + * + ****************************************************************************/ + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4068 4201 4365 4324 4820) + // C4068: ignore unknown pragmas + // C4201: nonstandard extension used : nameless struct/union + // C4365: Off by default noise + // C4324/4820: padding warnings +#endif + +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable : 25000, "FXMVECTOR is 16 bytes") +#endif + +//------------------------------------------------------------------------------ +#if defined(_XM_NO_INTRINSICS_) + struct __vector4 + { + union + { + float vector4_f32[4]; + uint32_t vector4_u32[4]; + }; + }; +#endif // _XM_NO_INTRINSICS_ + + //------------------------------------------------------------------------------ + // Vector intrinsic: Four 32 bit floating point components aligned on a 16 byte + // boundary and mapped to hardware vector registers +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + using XMVECTOR = __m128; +#elif defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + using XMVECTOR = float32x4_t; +#else + using XMVECTOR = __vector4; +#endif + + // Fix-up for (1st-3rd) XMVECTOR parameters that are pass-in-register for x86, ARM, ARM64, and vector call; by reference otherwise +#if ( defined(_M_IX86) || defined(_M_ARM) || defined(_M_ARM64) || _XM_VECTORCALL_ || __i386__ || __arm__ || __aarch64__ ) && !defined(_XM_NO_INTRINSICS_) + typedef const XMVECTOR FXMVECTOR; +#else + typedef const XMVECTOR& FXMVECTOR; +#endif + + // Fix-up for (4th) XMVECTOR parameter to pass in-register for ARM, ARM64, and vector call; by reference otherwise +#if ( defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || _XM_VECTORCALL_ || __arm__ || __aarch64__ ) && !defined(_XM_NO_INTRINSICS_) + typedef const XMVECTOR GXMVECTOR; +#else + typedef const XMVECTOR& GXMVECTOR; +#endif + + // Fix-up for (5th & 6th) XMVECTOR parameter to pass in-register for ARM64 and vector call; by reference otherwise +#if ( defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || _XM_VECTORCALL_ || __aarch64__ ) && !defined(_XM_NO_INTRINSICS_) + typedef const XMVECTOR HXMVECTOR; +#else + typedef const XMVECTOR& HXMVECTOR; +#endif + + // Fix-up for (7th+) XMVECTOR parameters to pass by reference + typedef const XMVECTOR& CXMVECTOR; + + //------------------------------------------------------------------------------ + // Conversion types for constants + XM_ALIGNED_STRUCT(16) XMVECTORF32 + { + union + { + float f[4]; + XMVECTOR v; + }; + + inline operator XMVECTOR() const noexcept { return v; } + inline operator const float* () const noexcept { return f; } +#ifdef _XM_NO_INTRINSICS_ +#elif defined(_XM_SSE_INTRINSICS_) + inline operator __m128i() const noexcept { return _mm_castps_si128(v); } + inline operator __m128d() const noexcept { return _mm_castps_pd(v); } +#elif defined(_XM_ARM_NEON_INTRINSICS_) && (defined(__GNUC__) || defined(_ARM64_DISTINCT_NEON_TYPES)) + inline operator int32x4_t() const noexcept { return vreinterpretq_s32_f32(v); } + inline operator uint32x4_t() const noexcept { return vreinterpretq_u32_f32(v); } +#endif + }; + + XM_ALIGNED_STRUCT(16) XMVECTORI32 + { + union + { + int32_t i[4]; + XMVECTOR v; + }; + + inline operator XMVECTOR() const noexcept { return v; } +#ifdef _XM_NO_INTRINSICS_ +#elif defined(_XM_SSE_INTRINSICS_) + inline operator __m128i() const noexcept { return _mm_castps_si128(v); } + inline operator __m128d() const noexcept { return _mm_castps_pd(v); } +#elif defined(_XM_ARM_NEON_INTRINSICS_) && (defined(__GNUC__) || defined(_ARM64_DISTINCT_NEON_TYPES)) + inline operator int32x4_t() const noexcept { return vreinterpretq_s32_f32(v); } + inline operator uint32x4_t() const noexcept { return vreinterpretq_u32_f32(v); } +#endif + }; + + XM_ALIGNED_STRUCT(16) XMVECTORU8 + { + union + { + uint8_t u[16]; + XMVECTOR v; + }; + + inline operator XMVECTOR() const noexcept { return v; } +#ifdef _XM_NO_INTRINSICS_ +#elif defined(_XM_SSE_INTRINSICS_) + inline operator __m128i() const noexcept { return _mm_castps_si128(v); } + inline operator __m128d() const noexcept { return _mm_castps_pd(v); } +#elif defined(_XM_ARM_NEON_INTRINSICS_) && (defined(__GNUC__) || defined(_ARM64_DISTINCT_NEON_TYPES)) + inline operator int32x4_t() const noexcept { return vreinterpretq_s32_f32(v); } + inline operator uint32x4_t() const noexcept { return vreinterpretq_u32_f32(v); } +#endif + }; + + XM_ALIGNED_STRUCT(16) XMVECTORU32 + { + union + { + uint32_t u[4]; + XMVECTOR v; + }; + + inline operator XMVECTOR() const noexcept { return v; } +#ifdef _XM_NO_INTRINSICS_ +#elif defined(_XM_SSE_INTRINSICS_) + inline operator __m128i() const noexcept { return _mm_castps_si128(v); } + inline operator __m128d() const noexcept { return _mm_castps_pd(v); } +#elif defined(_XM_ARM_NEON_INTRINSICS_) && (defined(__GNUC__) || defined(_ARM64_DISTINCT_NEON_TYPES)) + inline operator int32x4_t() const noexcept { return vreinterpretq_s32_f32(v); } + inline operator uint32x4_t() const noexcept { return vreinterpretq_u32_f32(v); } +#endif + }; + + //------------------------------------------------------------------------------ + // Vector operators + +#ifndef _XM_NO_XMVECTOR_OVERLOADS_ + XMVECTOR XM_CALLCONV operator+ (FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV operator- (FXMVECTOR V) noexcept; + + XMVECTOR& XM_CALLCONV operator+= (XMVECTOR& V1, FXMVECTOR V2) noexcept; + XMVECTOR& XM_CALLCONV operator-= (XMVECTOR& V1, FXMVECTOR V2) noexcept; + XMVECTOR& XM_CALLCONV operator*= (XMVECTOR& V1, FXMVECTOR V2) noexcept; + XMVECTOR& XM_CALLCONV operator/= (XMVECTOR& V1, FXMVECTOR V2) noexcept; + + XMVECTOR& operator*= (XMVECTOR& V, float S) noexcept; + XMVECTOR& operator/= (XMVECTOR& V, float S) noexcept; + + XMVECTOR XM_CALLCONV operator+ (FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV operator- (FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV operator* (FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV operator/ (FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV operator* (FXMVECTOR V, float S) noexcept; + XMVECTOR XM_CALLCONV operator* (float S, FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV operator/ (FXMVECTOR V, float S) noexcept; +#endif /* !_XM_NO_XMVECTOR_OVERLOADS_ */ + + //------------------------------------------------------------------------------ + // Matrix type: Sixteen 32 bit floating point components aligned on a + // 16 byte boundary and mapped to four hardware vector registers + + struct XMMATRIX; + + // Fix-up for (1st) XMMATRIX parameter to pass in-register for ARM64 and vector call; by reference otherwise +#if ( defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || _XM_VECTORCALL_ || __aarch64__ ) && !defined(_XM_NO_INTRINSICS_) + typedef const XMMATRIX FXMMATRIX; +#else + typedef const XMMATRIX& FXMMATRIX; +#endif + + // Fix-up for (2nd+) XMMATRIX parameters to pass by reference + typedef const XMMATRIX& CXMMATRIX; + +#ifdef _XM_NO_INTRINSICS_ + struct XMMATRIX +#else + XM_ALIGNED_STRUCT(16) XMMATRIX +#endif + { +#ifdef _XM_NO_INTRINSICS_ + union + { + XMVECTOR r[4]; + struct + { + float _11, _12, _13, _14; + float _21, _22, _23, _24; + float _31, _32, _33, _34; + float _41, _42, _43, _44; + }; + float m[4][4]; + }; +#else + XMVECTOR r[4]; +#endif + + XMMATRIX() = default; + + XMMATRIX(const XMMATRIX&) = default; + +#if defined(_MSC_VER) && (_MSC_FULL_VER < 191426431) + XMMATRIX& operator= (const XMMATRIX& M) noexcept { r[0] = M.r[0]; r[1] = M.r[1]; r[2] = M.r[2]; r[3] = M.r[3]; return *this; } +#else + XMMATRIX& operator=(const XMMATRIX&) = default; + + XMMATRIX(XMMATRIX&&) = default; + XMMATRIX& operator=(XMMATRIX&&) = default; +#endif + + constexpr XMMATRIX(FXMVECTOR R0, FXMVECTOR R1, FXMVECTOR R2, CXMVECTOR R3) noexcept : r{ R0,R1,R2,R3 } {} + XMMATRIX(float m00, float m01, float m02, float m03, + float m10, float m11, float m12, float m13, + float m20, float m21, float m22, float m23, + float m30, float m31, float m32, float m33) noexcept; + explicit XMMATRIX(_In_reads_(16) const float* pArray) noexcept; + +#ifdef _XM_NO_INTRINSICS_ + float operator() (size_t Row, size_t Column) const noexcept { return m[Row][Column]; } + float& operator() (size_t Row, size_t Column) noexcept { return m[Row][Column]; } +#endif + + XMMATRIX operator+ () const noexcept { return *this; } + XMMATRIX operator- () const noexcept; + + XMMATRIX& XM_CALLCONV operator+= (FXMMATRIX M) noexcept; + XMMATRIX& XM_CALLCONV operator-= (FXMMATRIX M) noexcept; + XMMATRIX& XM_CALLCONV operator*= (FXMMATRIX M) noexcept; + XMMATRIX& operator*= (float S) noexcept; + XMMATRIX& operator/= (float S) noexcept; + + XMMATRIX XM_CALLCONV operator+ (FXMMATRIX M) const noexcept; + XMMATRIX XM_CALLCONV operator- (FXMMATRIX M) const noexcept; + XMMATRIX XM_CALLCONV operator* (FXMMATRIX M) const noexcept; + XMMATRIX operator* (float S) const noexcept; + XMMATRIX operator/ (float S) const noexcept; + + friend XMMATRIX XM_CALLCONV operator* (float S, FXMMATRIX M) noexcept; + }; + + //------------------------------------------------------------------------------ + // 2D Vector; 32 bit floating point components + struct XMFLOAT2 + { + float x; + float y; + + XMFLOAT2() = default; + + XMFLOAT2(const XMFLOAT2&) = default; + XMFLOAT2& operator=(const XMFLOAT2&) = default; + + XMFLOAT2(XMFLOAT2&&) = default; + XMFLOAT2& operator=(XMFLOAT2&&) = default; + + constexpr XMFLOAT2(float _x, float _y) noexcept : x(_x), y(_y) {} + explicit XMFLOAT2(_In_reads_(2) const float* pArray) noexcept : x(pArray[0]), y(pArray[1]) {} + +#if (__cplusplus >= 202002L) + bool operator == (const XMFLOAT2&) const = default; + auto operator <=> (const XMFLOAT2&) const = default; +#endif + }; + + // 2D Vector; 32 bit floating point components aligned on a 16 byte boundary + XM_ALIGNED_STRUCT(16) XMFLOAT2A : public XMFLOAT2 + { + using XMFLOAT2::XMFLOAT2; + }; + + //------------------------------------------------------------------------------ + // 2D Vector; 32 bit signed integer components + struct XMINT2 + { + int32_t x; + int32_t y; + + XMINT2() = default; + + XMINT2(const XMINT2&) = default; + XMINT2& operator=(const XMINT2&) = default; + + XMINT2(XMINT2&&) = default; + XMINT2& operator=(XMINT2&&) = default; + + constexpr XMINT2(int32_t _x, int32_t _y) noexcept : x(_x), y(_y) {} + explicit XMINT2(_In_reads_(2) const int32_t* pArray) noexcept : x(pArray[0]), y(pArray[1]) {} + +#if (__cplusplus >= 202002L) + bool operator == (const XMINT2&) const = default; + auto operator <=> (const XMINT2&) const = default; +#endif + }; + + // 2D Vector; 32 bit unsigned integer components + struct XMUINT2 + { + uint32_t x; + uint32_t y; + + XMUINT2() = default; + + XMUINT2(const XMUINT2&) = default; + XMUINT2& operator=(const XMUINT2&) = default; + + XMUINT2(XMUINT2&&) = default; + XMUINT2& operator=(XMUINT2&&) = default; + + constexpr XMUINT2(uint32_t _x, uint32_t _y) noexcept : x(_x), y(_y) {} + explicit XMUINT2(_In_reads_(2) const uint32_t* pArray) noexcept : x(pArray[0]), y(pArray[1]) {} + +#if (__cplusplus >= 202002L) + bool operator == (const XMUINT2&) const = default; + auto operator <=> (const XMUINT2&) const = default; +#endif + }; + + //------------------------------------------------------------------------------ + // 3D Vector; 32 bit floating point components + struct XMFLOAT3 + { + float x; + float y; + float z; + + XMFLOAT3() = default; + + XMFLOAT3(const XMFLOAT3&) = default; + XMFLOAT3& operator=(const XMFLOAT3&) = default; + + XMFLOAT3(XMFLOAT3&&) = default; + XMFLOAT3& operator=(XMFLOAT3&&) = default; + + constexpr XMFLOAT3(float _x, float _y, float _z) noexcept : x(_x), y(_y), z(_z) {} + explicit XMFLOAT3(_In_reads_(3) const float* pArray) noexcept : x(pArray[0]), y(pArray[1]), z(pArray[2]) {} + }; + + // 3D Vector; 32 bit floating point components aligned on a 16 byte boundary + XM_ALIGNED_STRUCT(16) XMFLOAT3A : public XMFLOAT3 + { + using XMFLOAT3::XMFLOAT3; + }; + + //------------------------------------------------------------------------------ + // 3D Vector; 32 bit signed integer components + struct XMINT3 + { + int32_t x; + int32_t y; + int32_t z; + + XMINT3() = default; + + XMINT3(const XMINT3&) = default; + XMINT3& operator=(const XMINT3&) = default; + + XMINT3(XMINT3&&) = default; + XMINT3& operator=(XMINT3&&) = default; + + constexpr XMINT3(int32_t _x, int32_t _y, int32_t _z) noexcept : x(_x), y(_y), z(_z) {} + explicit XMINT3(_In_reads_(3) const int32_t* pArray) noexcept : x(pArray[0]), y(pArray[1]), z(pArray[2]) {} + +#if (__cplusplus >= 202002L) + bool operator == (const XMINT3&) const = default; + auto operator <=> (const XMINT3&) const = default; +#endif + }; + + // 3D Vector; 32 bit unsigned integer components + struct XMUINT3 + { + uint32_t x; + uint32_t y; + uint32_t z; + + XMUINT3() = default; + + XMUINT3(const XMUINT3&) = default; + XMUINT3& operator=(const XMUINT3&) = default; + + XMUINT3(XMUINT3&&) = default; + XMUINT3& operator=(XMUINT3&&) = default; + + constexpr XMUINT3(uint32_t _x, uint32_t _y, uint32_t _z) noexcept : x(_x), y(_y), z(_z) {} + explicit XMUINT3(_In_reads_(3) const uint32_t* pArray) noexcept : x(pArray[0]), y(pArray[1]), z(pArray[2]) {} + +#if (__cplusplus >= 202002L) + bool operator == (const XMUINT3&) const = default; + auto operator <=> (const XMUINT3&) const = default; +#endif + }; + + //------------------------------------------------------------------------------ + // 4D Vector; 32 bit floating point components + struct XMFLOAT4 + { + float x; + float y; + float z; + float w; + + XMFLOAT4() = default; + + XMFLOAT4(const XMFLOAT4&) = default; + XMFLOAT4& operator=(const XMFLOAT4&) = default; + + XMFLOAT4(XMFLOAT4&&) = default; + XMFLOAT4& operator=(XMFLOAT4&&) = default; + + constexpr XMFLOAT4(float _x, float _y, float _z, float _w) noexcept : x(_x), y(_y), z(_z), w(_w) {} + explicit XMFLOAT4(_In_reads_(4) const float* pArray) noexcept : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} + +#if (__cplusplus >= 202002L) + bool operator == (const XMFLOAT4&) const = default; + auto operator <=> (const XMFLOAT4&) const = default; +#endif + }; + + // 4D Vector; 32 bit floating point components aligned on a 16 byte boundary + XM_ALIGNED_STRUCT(16) XMFLOAT4A : public XMFLOAT4 + { + using XMFLOAT4::XMFLOAT4; + }; + + //------------------------------------------------------------------------------ + // 4D Vector; 32 bit signed integer components + struct XMINT4 + { + int32_t x; + int32_t y; + int32_t z; + int32_t w; + + XMINT4() = default; + + XMINT4(const XMINT4&) = default; + XMINT4& operator=(const XMINT4&) = default; + + XMINT4(XMINT4&&) = default; + XMINT4& operator=(XMINT4&&) = default; + + constexpr XMINT4(int32_t _x, int32_t _y, int32_t _z, int32_t _w) noexcept : x(_x), y(_y), z(_z), w(_w) {} + explicit XMINT4(_In_reads_(4) const int32_t* pArray) noexcept : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} + +#if (__cplusplus >= 202002L) + bool operator == (const XMINT4&) const = default; + auto operator <=> (const XMINT4&) const = default; +#endif + }; + + // 4D Vector; 32 bit unsigned integer components + struct XMUINT4 + { + uint32_t x; + uint32_t y; + uint32_t z; + uint32_t w; + + XMUINT4() = default; + + XMUINT4(const XMUINT4&) = default; + XMUINT4& operator=(const XMUINT4&) = default; + + XMUINT4(XMUINT4&&) = default; + XMUINT4& operator=(XMUINT4&&) = default; + + constexpr XMUINT4(uint32_t _x, uint32_t _y, uint32_t _z, uint32_t _w) noexcept : x(_x), y(_y), z(_z), w(_w) {} + explicit XMUINT4(_In_reads_(4) const uint32_t* pArray) noexcept : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} + +#if (__cplusplus >= 202002L) + bool operator == (const XMUINT4&) const = default; + auto operator <=> (const XMUINT4&) const = default; +#endif + }; + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu-anonymous-struct" +#pragma clang diagnostic ignored "-Wnested-anon-types" +#endif + + //------------------------------------------------------------------------------ + // 3x3 Matrix: 32 bit floating point components + struct XMFLOAT3X3 + { + union + { + struct + { + float _11, _12, _13; + float _21, _22, _23; + float _31, _32, _33; + }; + float m[3][3]; + }; + + XMFLOAT3X3() = default; + + XMFLOAT3X3(const XMFLOAT3X3&) = default; + XMFLOAT3X3& operator=(const XMFLOAT3X3&) = default; + + XMFLOAT3X3(XMFLOAT3X3&&) = default; + XMFLOAT3X3& operator=(XMFLOAT3X3&&) = default; + + constexpr XMFLOAT3X3(float m00, float m01, float m02, + float m10, float m11, float m12, + float m20, float m21, float m22) noexcept + : _11(m00), _12(m01), _13(m02), + _21(m10), _22(m11), _23(m12), + _31(m20), _32(m21), _33(m22) {} + explicit XMFLOAT3X3(_In_reads_(9) const float* pArray) noexcept; + + float operator() (size_t Row, size_t Column) const noexcept { return m[Row][Column]; } + float& operator() (size_t Row, size_t Column) noexcept { return m[Row][Column]; } + +#if (__cplusplus >= 202002L) + bool operator == (const XMFLOAT3X3&) const = default; + auto operator <=> (const XMFLOAT3X3&) const = default; +#endif + }; + + //------------------------------------------------------------------------------ + // 4x3 Row-major Matrix: 32 bit floating point components + struct XMFLOAT4X3 + { + union + { + struct + { + float _11, _12, _13; + float _21, _22, _23; + float _31, _32, _33; + float _41, _42, _43; + }; + float m[4][3]; + float f[12]; + }; + + XMFLOAT4X3() = default; + + XMFLOAT4X3(const XMFLOAT4X3&) = default; + XMFLOAT4X3& operator=(const XMFLOAT4X3&) = default; + + XMFLOAT4X3(XMFLOAT4X3&&) = default; + XMFLOAT4X3& operator=(XMFLOAT4X3&&) = default; + + constexpr XMFLOAT4X3(float m00, float m01, float m02, + float m10, float m11, float m12, + float m20, float m21, float m22, + float m30, float m31, float m32) noexcept + : _11(m00), _12(m01), _13(m02), + _21(m10), _22(m11), _23(m12), + _31(m20), _32(m21), _33(m22), + _41(m30), _42(m31), _43(m32) {} + explicit XMFLOAT4X3(_In_reads_(12) const float* pArray) noexcept; + + float operator() (size_t Row, size_t Column) const noexcept { return m[Row][Column]; } + float& operator() (size_t Row, size_t Column) noexcept { return m[Row][Column]; } + +#if (__cplusplus >= 202002L) + bool operator == (const XMFLOAT4X3&) const = default; + auto operator <=> (const XMFLOAT4X3&) const = default; +#endif + }; + + // 4x3 Row-major Matrix: 32 bit floating point components aligned on a 16 byte boundary + XM_ALIGNED_STRUCT(16) XMFLOAT4X3A : public XMFLOAT4X3 + { + using XMFLOAT4X3::XMFLOAT4X3; + }; + + //------------------------------------------------------------------------------ + // 3x4 Column-major Matrix: 32 bit floating point components + struct XMFLOAT3X4 + { + union + { + struct + { + float _11, _12, _13, _14; + float _21, _22, _23, _24; + float _31, _32, _33, _34; + }; + float m[3][4]; + float f[12]; + }; + + XMFLOAT3X4() = default; + + XMFLOAT3X4(const XMFLOAT3X4&) = default; + XMFLOAT3X4& operator=(const XMFLOAT3X4&) = default; + + XMFLOAT3X4(XMFLOAT3X4&&) = default; + XMFLOAT3X4& operator=(XMFLOAT3X4&&) = default; + + constexpr XMFLOAT3X4(float m00, float m01, float m02, float m03, + float m10, float m11, float m12, float m13, + float m20, float m21, float m22, float m23) noexcept + : _11(m00), _12(m01), _13(m02), _14(m03), + _21(m10), _22(m11), _23(m12), _24(m13), + _31(m20), _32(m21), _33(m22), _34(m23) {} + explicit XMFLOAT3X4(_In_reads_(12) const float* pArray) noexcept; + + float operator() (size_t Row, size_t Column) const noexcept { return m[Row][Column]; } + float& operator() (size_t Row, size_t Column) noexcept { return m[Row][Column]; } + +#if (__cplusplus >= 202002L) + bool operator == (const XMFLOAT3X4&) const = default; + auto operator <=> (const XMFLOAT3X4&) const = default; +#endif + }; + + // 3x4 Column-major Matrix: 32 bit floating point components aligned on a 16 byte boundary + XM_ALIGNED_STRUCT(16) XMFLOAT3X4A : public XMFLOAT3X4 + { + using XMFLOAT3X4::XMFLOAT3X4; + }; + + //------------------------------------------------------------------------------ + // 4x4 Matrix: 32 bit floating point components + struct XMFLOAT4X4 + { + union + { + struct + { + float _11, _12, _13, _14; + float _21, _22, _23, _24; + float _31, _32, _33, _34; + float _41, _42, _43, _44; + }; + float m[4][4]; + }; + + XMFLOAT4X4() = default; + + XMFLOAT4X4(const XMFLOAT4X4&) = default; + XMFLOAT4X4& operator=(const XMFLOAT4X4&) = default; + + XMFLOAT4X4(XMFLOAT4X4&&) = default; + XMFLOAT4X4& operator=(XMFLOAT4X4&&) = default; + + constexpr XMFLOAT4X4(float m00, float m01, float m02, float m03, + float m10, float m11, float m12, float m13, + float m20, float m21, float m22, float m23, + float m30, float m31, float m32, float m33) noexcept + : _11(m00), _12(m01), _13(m02), _14(m03), + _21(m10), _22(m11), _23(m12), _24(m13), + _31(m20), _32(m21), _33(m22), _34(m23), + _41(m30), _42(m31), _43(m32), _44(m33) {} + explicit XMFLOAT4X4(_In_reads_(16) const float* pArray) noexcept; + + float operator() (size_t Row, size_t Column) const noexcept { return m[Row][Column]; } + float& operator() (size_t Row, size_t Column) noexcept { return m[Row][Column]; } + +#if (__cplusplus >= 202002L) + bool operator == (const XMFLOAT4X4&) const = default; + auto operator <=> (const XMFLOAT4X4&) const = default; +#endif + }; + + // 4x4 Matrix: 32 bit floating point components aligned on a 16 byte boundary + XM_ALIGNED_STRUCT(16) XMFLOAT4X4A : public XMFLOAT4X4 + { + using XMFLOAT4X4::XMFLOAT4X4; + }; + + //////////////////////////////////////////////////////////////////////////////// + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +/**************************************************************************** + * + * Data conversion operations + * + ****************************************************************************/ + + XMVECTOR XM_CALLCONV XMConvertVectorIntToFloat(FXMVECTOR VInt, uint32_t DivExponent) noexcept; + XMVECTOR XM_CALLCONV XMConvertVectorFloatToInt(FXMVECTOR VFloat, uint32_t MulExponent) noexcept; + XMVECTOR XM_CALLCONV XMConvertVectorUIntToFloat(FXMVECTOR VUInt, uint32_t DivExponent) noexcept; + XMVECTOR XM_CALLCONV XMConvertVectorFloatToUInt(FXMVECTOR VFloat, uint32_t MulExponent) noexcept; + +#if defined(__XNAMATH_H__) && defined(XMVectorSetBinaryConstant) +#undef XMVectorSetBinaryConstant +#undef XMVectorSplatConstant +#undef XMVectorSplatConstantInt +#endif + + XMVECTOR XM_CALLCONV XMVectorSetBinaryConstant(uint32_t C0, uint32_t C1, uint32_t C2, uint32_t C3) noexcept; + XMVECTOR XM_CALLCONV XMVectorSplatConstant(int32_t IntConstant, uint32_t DivExponent) noexcept; + XMVECTOR XM_CALLCONV XMVectorSplatConstantInt(int32_t IntConstant) noexcept; + + /**************************************************************************** + * + * Load operations + * + ****************************************************************************/ + + XMVECTOR XM_CALLCONV XMLoadInt(_In_ const uint32_t* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadFloat(_In_ const float* pSource) noexcept; + + XMVECTOR XM_CALLCONV XMLoadInt2(_In_reads_(2) const uint32_t* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadInt2A(_In_reads_(2) const uint32_t* PSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadFloat2(_In_ const XMFLOAT2* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadFloat2A(_In_ const XMFLOAT2A* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadSInt2(_In_ const XMINT2* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadUInt2(_In_ const XMUINT2* pSource) noexcept; + + XMVECTOR XM_CALLCONV XMLoadInt3(_In_reads_(3) const uint32_t* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadInt3A(_In_reads_(3) const uint32_t* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadFloat3(_In_ const XMFLOAT3* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadFloat3A(_In_ const XMFLOAT3A* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadSInt3(_In_ const XMINT3* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadUInt3(_In_ const XMUINT3* pSource) noexcept; + + XMVECTOR XM_CALLCONV XMLoadInt4(_In_reads_(4) const uint32_t* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadInt4A(_In_reads_(4) const uint32_t* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadFloat4(_In_ const XMFLOAT4* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadFloat4A(_In_ const XMFLOAT4A* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadSInt4(_In_ const XMINT4* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadUInt4(_In_ const XMUINT4* pSource) noexcept; + + XMMATRIX XM_CALLCONV XMLoadFloat3x3(_In_ const XMFLOAT3X3* pSource) noexcept; + XMMATRIX XM_CALLCONV XMLoadFloat4x3(_In_ const XMFLOAT4X3* pSource) noexcept; + XMMATRIX XM_CALLCONV XMLoadFloat4x3A(_In_ const XMFLOAT4X3A* pSource) noexcept; + XMMATRIX XM_CALLCONV XMLoadFloat3x4(_In_ const XMFLOAT3X4* pSource) noexcept; + XMMATRIX XM_CALLCONV XMLoadFloat3x4A(_In_ const XMFLOAT3X4A* pSource) noexcept; + XMMATRIX XM_CALLCONV XMLoadFloat4x4(_In_ const XMFLOAT4X4* pSource) noexcept; + XMMATRIX XM_CALLCONV XMLoadFloat4x4A(_In_ const XMFLOAT4X4A* pSource) noexcept; + + /**************************************************************************** + * + * Store operations + * + ****************************************************************************/ + + void XM_CALLCONV XMStoreInt(_Out_ uint32_t* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreFloat(_Out_ float* pDestination, _In_ FXMVECTOR V) noexcept; + + void XM_CALLCONV XMStoreInt2(_Out_writes_(2) uint32_t* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreInt2A(_Out_writes_(2) uint32_t* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreFloat2(_Out_ XMFLOAT2* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreFloat2A(_Out_ XMFLOAT2A* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreSInt2(_Out_ XMINT2* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreUInt2(_Out_ XMUINT2* pDestination, _In_ FXMVECTOR V) noexcept; + + void XM_CALLCONV XMStoreInt3(_Out_writes_(3) uint32_t* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreInt3A(_Out_writes_(3) uint32_t* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreFloat3(_Out_ XMFLOAT3* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreFloat3A(_Out_ XMFLOAT3A* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreSInt3(_Out_ XMINT3* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreUInt3(_Out_ XMUINT3* pDestination, _In_ FXMVECTOR V) noexcept; + + void XM_CALLCONV XMStoreInt4(_Out_writes_(4) uint32_t* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreInt4A(_Out_writes_(4) uint32_t* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreFloat4(_Out_ XMFLOAT4* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreFloat4A(_Out_ XMFLOAT4A* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreSInt4(_Out_ XMINT4* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreUInt4(_Out_ XMUINT4* pDestination, _In_ FXMVECTOR V) noexcept; + + void XM_CALLCONV XMStoreFloat3x3(_Out_ XMFLOAT3X3* pDestination, _In_ FXMMATRIX M) noexcept; + void XM_CALLCONV XMStoreFloat4x3(_Out_ XMFLOAT4X3* pDestination, _In_ FXMMATRIX M) noexcept; + void XM_CALLCONV XMStoreFloat4x3A(_Out_ XMFLOAT4X3A* pDestination, _In_ FXMMATRIX M) noexcept; + void XM_CALLCONV XMStoreFloat3x4(_Out_ XMFLOAT3X4* pDestination, _In_ FXMMATRIX M) noexcept; + void XM_CALLCONV XMStoreFloat3x4A(_Out_ XMFLOAT3X4A* pDestination, _In_ FXMMATRIX M) noexcept; + void XM_CALLCONV XMStoreFloat4x4(_Out_ XMFLOAT4X4* pDestination, _In_ FXMMATRIX M) noexcept; + void XM_CALLCONV XMStoreFloat4x4A(_Out_ XMFLOAT4X4A* pDestination, _In_ FXMMATRIX M) noexcept; + + /**************************************************************************** + * + * General vector operations + * + ****************************************************************************/ + + XMVECTOR XM_CALLCONV XMVectorZero() noexcept; + XMVECTOR XM_CALLCONV XMVectorSet(float x, float y, float z, float w) noexcept; + XMVECTOR XM_CALLCONV XMVectorSetInt(uint32_t x, uint32_t y, uint32_t z, uint32_t w) noexcept; + XMVECTOR XM_CALLCONV XMVectorReplicate(float Value) noexcept; + XMVECTOR XM_CALLCONV XMVectorReplicatePtr(_In_ const float* pValue) noexcept; + XMVECTOR XM_CALLCONV XMVectorReplicateInt(uint32_t Value) noexcept; + XMVECTOR XM_CALLCONV XMVectorReplicateIntPtr(_In_ const uint32_t* pValue) noexcept; + XMVECTOR XM_CALLCONV XMVectorTrueInt() noexcept; + XMVECTOR XM_CALLCONV XMVectorFalseInt() noexcept; + XMVECTOR XM_CALLCONV XMVectorSplatX(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorSplatY(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorSplatZ(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorSplatW(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorSplatOne() noexcept; + XMVECTOR XM_CALLCONV XMVectorSplatInfinity() noexcept; + XMVECTOR XM_CALLCONV XMVectorSplatQNaN() noexcept; + XMVECTOR XM_CALLCONV XMVectorSplatEpsilon() noexcept; + XMVECTOR XM_CALLCONV XMVectorSplatSignMask() noexcept; + + float XM_CALLCONV XMVectorGetByIndex(FXMVECTOR V, size_t i) noexcept; + float XM_CALLCONV XMVectorGetX(FXMVECTOR V) noexcept; + float XM_CALLCONV XMVectorGetY(FXMVECTOR V) noexcept; + float XM_CALLCONV XMVectorGetZ(FXMVECTOR V) noexcept; + float XM_CALLCONV XMVectorGetW(FXMVECTOR V) noexcept; + + void XM_CALLCONV XMVectorGetByIndexPtr(_Out_ float* f, _In_ FXMVECTOR V, _In_ size_t i) noexcept; + void XM_CALLCONV XMVectorGetXPtr(_Out_ float* x, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMVectorGetYPtr(_Out_ float* y, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMVectorGetZPtr(_Out_ float* z, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMVectorGetWPtr(_Out_ float* w, _In_ FXMVECTOR V) noexcept; + + uint32_t XM_CALLCONV XMVectorGetIntByIndex(FXMVECTOR V, size_t i) noexcept; + uint32_t XM_CALLCONV XMVectorGetIntX(FXMVECTOR V) noexcept; + uint32_t XM_CALLCONV XMVectorGetIntY(FXMVECTOR V) noexcept; + uint32_t XM_CALLCONV XMVectorGetIntZ(FXMVECTOR V) noexcept; + uint32_t XM_CALLCONV XMVectorGetIntW(FXMVECTOR V) noexcept; + + void XM_CALLCONV XMVectorGetIntByIndexPtr(_Out_ uint32_t* x, _In_ FXMVECTOR V, _In_ size_t i) noexcept; + void XM_CALLCONV XMVectorGetIntXPtr(_Out_ uint32_t* x, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMVectorGetIntYPtr(_Out_ uint32_t* y, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMVectorGetIntZPtr(_Out_ uint32_t* z, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMVectorGetIntWPtr(_Out_ uint32_t* w, _In_ FXMVECTOR V) noexcept; + + XMVECTOR XM_CALLCONV XMVectorSetByIndex(FXMVECTOR V, float f, size_t i) noexcept; + XMVECTOR XM_CALLCONV XMVectorSetX(FXMVECTOR V, float x) noexcept; + XMVECTOR XM_CALLCONV XMVectorSetY(FXMVECTOR V, float y) noexcept; + XMVECTOR XM_CALLCONV XMVectorSetZ(FXMVECTOR V, float z) noexcept; + XMVECTOR XM_CALLCONV XMVectorSetW(FXMVECTOR V, float w) noexcept; + + XMVECTOR XM_CALLCONV XMVectorSetByIndexPtr(_In_ FXMVECTOR V, _In_ const float* f, _In_ size_t i) noexcept; + XMVECTOR XM_CALLCONV XMVectorSetXPtr(_In_ FXMVECTOR V, _In_ const float* x) noexcept; + XMVECTOR XM_CALLCONV XMVectorSetYPtr(_In_ FXMVECTOR V, _In_ const float* y) noexcept; + XMVECTOR XM_CALLCONV XMVectorSetZPtr(_In_ FXMVECTOR V, _In_ const float* z) noexcept; + XMVECTOR XM_CALLCONV XMVectorSetWPtr(_In_ FXMVECTOR V, _In_ const float* w) noexcept; + + XMVECTOR XM_CALLCONV XMVectorSetIntByIndex(FXMVECTOR V, uint32_t x, size_t i) noexcept; + XMVECTOR XM_CALLCONV XMVectorSetIntX(FXMVECTOR V, uint32_t x) noexcept; + XMVECTOR XM_CALLCONV XMVectorSetIntY(FXMVECTOR V, uint32_t y) noexcept; + XMVECTOR XM_CALLCONV XMVectorSetIntZ(FXMVECTOR V, uint32_t z) noexcept; + XMVECTOR XM_CALLCONV XMVectorSetIntW(FXMVECTOR V, uint32_t w) noexcept; + + XMVECTOR XM_CALLCONV XMVectorSetIntByIndexPtr(_In_ FXMVECTOR V, _In_ const uint32_t* x, _In_ size_t i) noexcept; + XMVECTOR XM_CALLCONV XMVectorSetIntXPtr(_In_ FXMVECTOR V, _In_ const uint32_t* x) noexcept; + XMVECTOR XM_CALLCONV XMVectorSetIntYPtr(_In_ FXMVECTOR V, _In_ const uint32_t* y) noexcept; + XMVECTOR XM_CALLCONV XMVectorSetIntZPtr(_In_ FXMVECTOR V, _In_ const uint32_t* z) noexcept; + XMVECTOR XM_CALLCONV XMVectorSetIntWPtr(_In_ FXMVECTOR V, _In_ const uint32_t* w) noexcept; + +#if defined(__XNAMATH_H__) && defined(XMVectorSwizzle) +#undef XMVectorSwizzle +#endif + + XMVECTOR XM_CALLCONV XMVectorSwizzle(FXMVECTOR V, uint32_t E0, uint32_t E1, uint32_t E2, uint32_t E3) noexcept; + XMVECTOR XM_CALLCONV XMVectorPermute(FXMVECTOR V1, FXMVECTOR V2, uint32_t PermuteX, uint32_t PermuteY, uint32_t PermuteZ, uint32_t PermuteW) noexcept; + XMVECTOR XM_CALLCONV XMVectorSelectControl(uint32_t VectorIndex0, uint32_t VectorIndex1, uint32_t VectorIndex2, uint32_t VectorIndex3) noexcept; + XMVECTOR XM_CALLCONV XMVectorSelect(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Control) noexcept; + XMVECTOR XM_CALLCONV XMVectorMergeXY(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorMergeZW(FXMVECTOR V1, FXMVECTOR V2) noexcept; + +#if defined(__XNAMATH_H__) && defined(XMVectorShiftLeft) +#undef XMVectorShiftLeft +#undef XMVectorRotateLeft +#undef XMVectorRotateRight +#undef XMVectorInsert +#endif + + XMVECTOR XM_CALLCONV XMVectorShiftLeft(FXMVECTOR V1, FXMVECTOR V2, uint32_t Elements) noexcept; + XMVECTOR XM_CALLCONV XMVectorRotateLeft(FXMVECTOR V, uint32_t Elements) noexcept; + XMVECTOR XM_CALLCONV XMVectorRotateRight(FXMVECTOR V, uint32_t Elements) noexcept; + XMVECTOR XM_CALLCONV XMVectorInsert(FXMVECTOR VD, FXMVECTOR VS, uint32_t VSLeftRotateElements, + uint32_t Select0, uint32_t Select1, uint32_t Select2, uint32_t Select3) noexcept; + + XMVECTOR XM_CALLCONV XMVectorEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorEqualR(_Out_ uint32_t* pCR, _In_ FXMVECTOR V1, _In_ FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorEqualInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorEqualIntR(_Out_ uint32_t* pCR, _In_ FXMVECTOR V, _In_ FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorNearEqual(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Epsilon) noexcept; + XMVECTOR XM_CALLCONV XMVectorNotEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorNotEqualInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorGreater(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorGreaterR(_Out_ uint32_t* pCR, _In_ FXMVECTOR V1, _In_ FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorGreaterOrEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorGreaterOrEqualR(_Out_ uint32_t* pCR, _In_ FXMVECTOR V1, _In_ FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorLess(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorLessOrEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorInBounds(FXMVECTOR V, FXMVECTOR Bounds) noexcept; + XMVECTOR XM_CALLCONV XMVectorInBoundsR(_Out_ uint32_t* pCR, _In_ FXMVECTOR V, _In_ FXMVECTOR Bounds) noexcept; + + XMVECTOR XM_CALLCONV XMVectorIsNaN(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorIsInfinite(FXMVECTOR V) noexcept; + + XMVECTOR XM_CALLCONV XMVectorMin(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorMax(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorRound(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorTruncate(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorFloor(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorCeiling(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorClamp(FXMVECTOR V, FXMVECTOR Min, FXMVECTOR Max) noexcept; + XMVECTOR XM_CALLCONV XMVectorSaturate(FXMVECTOR V) noexcept; + + XMVECTOR XM_CALLCONV XMVectorAndInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorAndCInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorOrInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorNorInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorXorInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; + + XMVECTOR XM_CALLCONV XMVectorNegate(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorAdd(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorSum(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorAddAngles(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorSubtract(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorSubtractAngles(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorMultiply(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorMultiplyAdd(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR V3) noexcept; + XMVECTOR XM_CALLCONV XMVectorDivide(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorNegativeMultiplySubtract(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR V3) noexcept; + XMVECTOR XM_CALLCONV XMVectorScale(FXMVECTOR V, float ScaleFactor) noexcept; + XMVECTOR XM_CALLCONV XMVectorReciprocalEst(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorReciprocal(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorSqrtEst(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorSqrt(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorReciprocalSqrtEst(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorReciprocalSqrt(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorExp2(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorExp10(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorExpE(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorExp(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorLog2(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorLog10(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorLogE(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorLog(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorPow(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorAbs(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorMod(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVectorModAngles(FXMVECTOR Angles) noexcept; + XMVECTOR XM_CALLCONV XMVectorSin(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorSinEst(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorCos(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorCosEst(FXMVECTOR V) noexcept; + void XM_CALLCONV XMVectorSinCos(_Out_ XMVECTOR* pSin, _Out_ XMVECTOR* pCos, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMVectorSinCosEst(_Out_ XMVECTOR* pSin, _Out_ XMVECTOR* pCos, _In_ FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorTan(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorTanEst(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorSinH(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorCosH(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorTanH(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorASin(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorASinEst(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorACos(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorACosEst(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorATan(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorATanEst(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVectorATan2(FXMVECTOR Y, FXMVECTOR X) noexcept; + XMVECTOR XM_CALLCONV XMVectorATan2Est(FXMVECTOR Y, FXMVECTOR X) noexcept; + XMVECTOR XM_CALLCONV XMVectorLerp(FXMVECTOR V0, FXMVECTOR V1, float t) noexcept; + XMVECTOR XM_CALLCONV XMVectorLerpV(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR T) noexcept; + XMVECTOR XM_CALLCONV XMVectorHermite(FXMVECTOR Position0, FXMVECTOR Tangent0, FXMVECTOR Position1, GXMVECTOR Tangent1, float t) noexcept; + XMVECTOR XM_CALLCONV XMVectorHermiteV(FXMVECTOR Position0, FXMVECTOR Tangent0, FXMVECTOR Position1, GXMVECTOR Tangent1, HXMVECTOR T) noexcept; + XMVECTOR XM_CALLCONV XMVectorCatmullRom(FXMVECTOR Position0, FXMVECTOR Position1, FXMVECTOR Position2, GXMVECTOR Position3, float t) noexcept; + XMVECTOR XM_CALLCONV XMVectorCatmullRomV(FXMVECTOR Position0, FXMVECTOR Position1, FXMVECTOR Position2, GXMVECTOR Position3, HXMVECTOR T) noexcept; + XMVECTOR XM_CALLCONV XMVectorBaryCentric(FXMVECTOR Position0, FXMVECTOR Position1, FXMVECTOR Position2, float f, float g) noexcept; + XMVECTOR XM_CALLCONV XMVectorBaryCentricV(FXMVECTOR Position0, FXMVECTOR Position1, FXMVECTOR Position2, GXMVECTOR F, HXMVECTOR G) noexcept; + + /**************************************************************************** + * + * 2D vector operations + * + ****************************************************************************/ + + bool XM_CALLCONV XMVector2Equal(FXMVECTOR V1, FXMVECTOR V2) noexcept; + uint32_t XM_CALLCONV XMVector2EqualR(FXMVECTOR V1, FXMVECTOR V2) noexcept; + bool XM_CALLCONV XMVector2EqualInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; + uint32_t XM_CALLCONV XMVector2EqualIntR(FXMVECTOR V1, FXMVECTOR V2) noexcept; + bool XM_CALLCONV XMVector2NearEqual(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Epsilon) noexcept; + bool XM_CALLCONV XMVector2NotEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; + bool XM_CALLCONV XMVector2NotEqualInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; + bool XM_CALLCONV XMVector2Greater(FXMVECTOR V1, FXMVECTOR V2) noexcept; + uint32_t XM_CALLCONV XMVector2GreaterR(FXMVECTOR V1, FXMVECTOR V2) noexcept; + bool XM_CALLCONV XMVector2GreaterOrEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; + uint32_t XM_CALLCONV XMVector2GreaterOrEqualR(FXMVECTOR V1, FXMVECTOR V2) noexcept; + bool XM_CALLCONV XMVector2Less(FXMVECTOR V1, FXMVECTOR V2) noexcept; + bool XM_CALLCONV XMVector2LessOrEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; + bool XM_CALLCONV XMVector2InBounds(FXMVECTOR V, FXMVECTOR Bounds) noexcept; + + bool XM_CALLCONV XMVector2IsNaN(FXMVECTOR V) noexcept; + bool XM_CALLCONV XMVector2IsInfinite(FXMVECTOR V) noexcept; + + XMVECTOR XM_CALLCONV XMVector2Dot(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVector2Cross(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVector2LengthSq(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVector2ReciprocalLengthEst(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVector2ReciprocalLength(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVector2LengthEst(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVector2Length(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVector2NormalizeEst(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVector2Normalize(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVector2ClampLength(FXMVECTOR V, float LengthMin, float LengthMax) noexcept; + XMVECTOR XM_CALLCONV XMVector2ClampLengthV(FXMVECTOR V, FXMVECTOR LengthMin, FXMVECTOR LengthMax) noexcept; + XMVECTOR XM_CALLCONV XMVector2Reflect(FXMVECTOR Incident, FXMVECTOR Normal) noexcept; + XMVECTOR XM_CALLCONV XMVector2Refract(FXMVECTOR Incident, FXMVECTOR Normal, float RefractionIndex) noexcept; + XMVECTOR XM_CALLCONV XMVector2RefractV(FXMVECTOR Incident, FXMVECTOR Normal, FXMVECTOR RefractionIndex) noexcept; + XMVECTOR XM_CALLCONV XMVector2Orthogonal(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVector2AngleBetweenNormalsEst(FXMVECTOR N1, FXMVECTOR N2) noexcept; + XMVECTOR XM_CALLCONV XMVector2AngleBetweenNormals(FXMVECTOR N1, FXMVECTOR N2) noexcept; + XMVECTOR XM_CALLCONV XMVector2AngleBetweenVectors(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVector2LinePointDistance(FXMVECTOR LinePoint1, FXMVECTOR LinePoint2, FXMVECTOR Point) noexcept; + XMVECTOR XM_CALLCONV XMVector2IntersectLine(FXMVECTOR Line1Point1, FXMVECTOR Line1Point2, FXMVECTOR Line2Point1, GXMVECTOR Line2Point2) noexcept; + XMVECTOR XM_CALLCONV XMVector2Transform(FXMVECTOR V, FXMMATRIX M) noexcept; + XMFLOAT4* XM_CALLCONV XMVector2TransformStream(_Out_writes_bytes_(sizeof(XMFLOAT4) + OutputStride * (VectorCount - 1)) XMFLOAT4* pOutputStream, + _In_ size_t OutputStride, + _In_reads_bytes_(sizeof(XMFLOAT2) + InputStride * (VectorCount - 1)) const XMFLOAT2* pInputStream, + _In_ size_t InputStride, _In_ size_t VectorCount, _In_ FXMMATRIX M) noexcept; + XMVECTOR XM_CALLCONV XMVector2TransformCoord(FXMVECTOR V, FXMMATRIX M) noexcept; + XMFLOAT2* XM_CALLCONV XMVector2TransformCoordStream(_Out_writes_bytes_(sizeof(XMFLOAT2) + OutputStride * (VectorCount - 1)) XMFLOAT2* pOutputStream, + _In_ size_t OutputStride, + _In_reads_bytes_(sizeof(XMFLOAT2) + InputStride * (VectorCount - 1)) const XMFLOAT2* pInputStream, + _In_ size_t InputStride, _In_ size_t VectorCount, _In_ FXMMATRIX M) noexcept; + XMVECTOR XM_CALLCONV XMVector2TransformNormal(FXMVECTOR V, FXMMATRIX M) noexcept; + XMFLOAT2* XM_CALLCONV XMVector2TransformNormalStream(_Out_writes_bytes_(sizeof(XMFLOAT2) + OutputStride * (VectorCount - 1)) XMFLOAT2* pOutputStream, + _In_ size_t OutputStride, + _In_reads_bytes_(sizeof(XMFLOAT2) + InputStride * (VectorCount - 1)) const XMFLOAT2* pInputStream, + _In_ size_t InputStride, _In_ size_t VectorCount, _In_ FXMMATRIX M) noexcept; + + /**************************************************************************** + * + * 3D vector operations + * + ****************************************************************************/ + + bool XM_CALLCONV XMVector3Equal(FXMVECTOR V1, FXMVECTOR V2) noexcept; + uint32_t XM_CALLCONV XMVector3EqualR(FXMVECTOR V1, FXMVECTOR V2) noexcept; + bool XM_CALLCONV XMVector3EqualInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; + uint32_t XM_CALLCONV XMVector3EqualIntR(FXMVECTOR V1, FXMVECTOR V2) noexcept; + bool XM_CALLCONV XMVector3NearEqual(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Epsilon) noexcept; + bool XM_CALLCONV XMVector3NotEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; + bool XM_CALLCONV XMVector3NotEqualInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; + bool XM_CALLCONV XMVector3Greater(FXMVECTOR V1, FXMVECTOR V2) noexcept; + uint32_t XM_CALLCONV XMVector3GreaterR(FXMVECTOR V1, FXMVECTOR V2) noexcept; + bool XM_CALLCONV XMVector3GreaterOrEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; + uint32_t XM_CALLCONV XMVector3GreaterOrEqualR(FXMVECTOR V1, FXMVECTOR V2) noexcept; + bool XM_CALLCONV XMVector3Less(FXMVECTOR V1, FXMVECTOR V2) noexcept; + bool XM_CALLCONV XMVector3LessOrEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; + bool XM_CALLCONV XMVector3InBounds(FXMVECTOR V, FXMVECTOR Bounds) noexcept; + + bool XM_CALLCONV XMVector3IsNaN(FXMVECTOR V) noexcept; + bool XM_CALLCONV XMVector3IsInfinite(FXMVECTOR V) noexcept; + + XMVECTOR XM_CALLCONV XMVector3Dot(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVector3Cross(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVector3LengthSq(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVector3ReciprocalLengthEst(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVector3ReciprocalLength(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVector3LengthEst(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVector3Length(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVector3NormalizeEst(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVector3Normalize(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVector3ClampLength(FXMVECTOR V, float LengthMin, float LengthMax) noexcept; + XMVECTOR XM_CALLCONV XMVector3ClampLengthV(FXMVECTOR V, FXMVECTOR LengthMin, FXMVECTOR LengthMax) noexcept; + XMVECTOR XM_CALLCONV XMVector3Reflect(FXMVECTOR Incident, FXMVECTOR Normal) noexcept; + XMVECTOR XM_CALLCONV XMVector3Refract(FXMVECTOR Incident, FXMVECTOR Normal, float RefractionIndex) noexcept; + XMVECTOR XM_CALLCONV XMVector3RefractV(FXMVECTOR Incident, FXMVECTOR Normal, FXMVECTOR RefractionIndex) noexcept; + XMVECTOR XM_CALLCONV XMVector3Orthogonal(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVector3AngleBetweenNormalsEst(FXMVECTOR N1, FXMVECTOR N2) noexcept; + XMVECTOR XM_CALLCONV XMVector3AngleBetweenNormals(FXMVECTOR N1, FXMVECTOR N2) noexcept; + XMVECTOR XM_CALLCONV XMVector3AngleBetweenVectors(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVector3LinePointDistance(FXMVECTOR LinePoint1, FXMVECTOR LinePoint2, FXMVECTOR Point) noexcept; + void XM_CALLCONV XMVector3ComponentsFromNormal(_Out_ XMVECTOR* pParallel, _Out_ XMVECTOR* pPerpendicular, _In_ FXMVECTOR V, _In_ FXMVECTOR Normal) noexcept; + XMVECTOR XM_CALLCONV XMVector3Rotate(FXMVECTOR V, FXMVECTOR RotationQuaternion) noexcept; + XMVECTOR XM_CALLCONV XMVector3InverseRotate(FXMVECTOR V, FXMVECTOR RotationQuaternion) noexcept; + XMVECTOR XM_CALLCONV XMVector3Transform(FXMVECTOR V, FXMMATRIX M) noexcept; + XMFLOAT4* XM_CALLCONV XMVector3TransformStream(_Out_writes_bytes_(sizeof(XMFLOAT4) + OutputStride * (VectorCount - 1)) XMFLOAT4* pOutputStream, + _In_ size_t OutputStride, + _In_reads_bytes_(sizeof(XMFLOAT3) + InputStride * (VectorCount - 1)) const XMFLOAT3* pInputStream, + _In_ size_t InputStride, _In_ size_t VectorCount, _In_ FXMMATRIX M) noexcept; + XMVECTOR XM_CALLCONV XMVector3TransformCoord(FXMVECTOR V, FXMMATRIX M) noexcept; + XMFLOAT3* XM_CALLCONV XMVector3TransformCoordStream(_Out_writes_bytes_(sizeof(XMFLOAT3) + OutputStride * (VectorCount - 1)) XMFLOAT3* pOutputStream, + _In_ size_t OutputStride, + _In_reads_bytes_(sizeof(XMFLOAT3) + InputStride * (VectorCount - 1)) const XMFLOAT3* pInputStream, + _In_ size_t InputStride, _In_ size_t VectorCount, _In_ FXMMATRIX M) noexcept; + XMVECTOR XM_CALLCONV XMVector3TransformNormal(FXMVECTOR V, FXMMATRIX M) noexcept; + XMFLOAT3* XM_CALLCONV XMVector3TransformNormalStream(_Out_writes_bytes_(sizeof(XMFLOAT3) + OutputStride * (VectorCount - 1)) XMFLOAT3* pOutputStream, + _In_ size_t OutputStride, + _In_reads_bytes_(sizeof(XMFLOAT3) + InputStride * (VectorCount - 1)) const XMFLOAT3* pInputStream, + _In_ size_t InputStride, _In_ size_t VectorCount, _In_ FXMMATRIX M) noexcept; + XMVECTOR XM_CALLCONV XMVector3Project(FXMVECTOR V, float ViewportX, float ViewportY, float ViewportWidth, float ViewportHeight, float ViewportMinZ, float ViewportMaxZ, + FXMMATRIX Projection, CXMMATRIX View, CXMMATRIX World) noexcept; + XMFLOAT3* XM_CALLCONV XMVector3ProjectStream(_Out_writes_bytes_(sizeof(XMFLOAT3) + OutputStride * (VectorCount - 1)) XMFLOAT3* pOutputStream, + _In_ size_t OutputStride, + _In_reads_bytes_(sizeof(XMFLOAT3) + InputStride * (VectorCount - 1)) const XMFLOAT3* pInputStream, + _In_ size_t InputStride, _In_ size_t VectorCount, + _In_ float ViewportX, _In_ float ViewportY, _In_ float ViewportWidth, _In_ float ViewportHeight, _In_ float ViewportMinZ, _In_ float ViewportMaxZ, + _In_ FXMMATRIX Projection, _In_ CXMMATRIX View, _In_ CXMMATRIX World) noexcept; + XMVECTOR XM_CALLCONV XMVector3Unproject(FXMVECTOR V, float ViewportX, float ViewportY, float ViewportWidth, float ViewportHeight, float ViewportMinZ, float ViewportMaxZ, + FXMMATRIX Projection, CXMMATRIX View, CXMMATRIX World) noexcept; + XMFLOAT3* XM_CALLCONV XMVector3UnprojectStream(_Out_writes_bytes_(sizeof(XMFLOAT3) + OutputStride * (VectorCount - 1)) XMFLOAT3* pOutputStream, + _In_ size_t OutputStride, + _In_reads_bytes_(sizeof(XMFLOAT3) + InputStride * (VectorCount - 1)) const XMFLOAT3* pInputStream, + _In_ size_t InputStride, _In_ size_t VectorCount, + _In_ float ViewportX, _In_ float ViewportY, _In_ float ViewportWidth, _In_ float ViewportHeight, _In_ float ViewportMinZ, _In_ float ViewportMaxZ, + _In_ FXMMATRIX Projection, _In_ CXMMATRIX View, _In_ CXMMATRIX World) noexcept; + + /**************************************************************************** + * + * 4D vector operations + * + ****************************************************************************/ + + bool XM_CALLCONV XMVector4Equal(FXMVECTOR V1, FXMVECTOR V2) noexcept; + uint32_t XM_CALLCONV XMVector4EqualR(FXMVECTOR V1, FXMVECTOR V2) noexcept; + bool XM_CALLCONV XMVector4EqualInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; + uint32_t XM_CALLCONV XMVector4EqualIntR(FXMVECTOR V1, FXMVECTOR V2) noexcept; + bool XM_CALLCONV XMVector4NearEqual(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Epsilon) noexcept; + bool XM_CALLCONV XMVector4NotEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; + bool XM_CALLCONV XMVector4NotEqualInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; + bool XM_CALLCONV XMVector4Greater(FXMVECTOR V1, FXMVECTOR V2) noexcept; + uint32_t XM_CALLCONV XMVector4GreaterR(FXMVECTOR V1, FXMVECTOR V2) noexcept; + bool XM_CALLCONV XMVector4GreaterOrEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; + uint32_t XM_CALLCONV XMVector4GreaterOrEqualR(FXMVECTOR V1, FXMVECTOR V2) noexcept; + bool XM_CALLCONV XMVector4Less(FXMVECTOR V1, FXMVECTOR V2) noexcept; + bool XM_CALLCONV XMVector4LessOrEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; + bool XM_CALLCONV XMVector4InBounds(FXMVECTOR V, FXMVECTOR Bounds) noexcept; + + bool XM_CALLCONV XMVector4IsNaN(FXMVECTOR V) noexcept; + bool XM_CALLCONV XMVector4IsInfinite(FXMVECTOR V) noexcept; + + XMVECTOR XM_CALLCONV XMVector4Dot(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVector4Cross(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR V3) noexcept; + XMVECTOR XM_CALLCONV XMVector4LengthSq(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVector4ReciprocalLengthEst(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVector4ReciprocalLength(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVector4LengthEst(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVector4Length(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVector4NormalizeEst(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVector4Normalize(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVector4ClampLength(FXMVECTOR V, float LengthMin, float LengthMax) noexcept; + XMVECTOR XM_CALLCONV XMVector4ClampLengthV(FXMVECTOR V, FXMVECTOR LengthMin, FXMVECTOR LengthMax) noexcept; + XMVECTOR XM_CALLCONV XMVector4Reflect(FXMVECTOR Incident, FXMVECTOR Normal) noexcept; + XMVECTOR XM_CALLCONV XMVector4Refract(FXMVECTOR Incident, FXMVECTOR Normal, float RefractionIndex) noexcept; + XMVECTOR XM_CALLCONV XMVector4RefractV(FXMVECTOR Incident, FXMVECTOR Normal, FXMVECTOR RefractionIndex) noexcept; + XMVECTOR XM_CALLCONV XMVector4Orthogonal(FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMVector4AngleBetweenNormalsEst(FXMVECTOR N1, FXMVECTOR N2) noexcept; + XMVECTOR XM_CALLCONV XMVector4AngleBetweenNormals(FXMVECTOR N1, FXMVECTOR N2) noexcept; + XMVECTOR XM_CALLCONV XMVector4AngleBetweenVectors(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMVector4Transform(FXMVECTOR V, FXMMATRIX M) noexcept; + XMFLOAT4* XM_CALLCONV XMVector4TransformStream(_Out_writes_bytes_(sizeof(XMFLOAT4) + OutputStride * (VectorCount - 1)) XMFLOAT4* pOutputStream, + _In_ size_t OutputStride, + _In_reads_bytes_(sizeof(XMFLOAT4) + InputStride * (VectorCount - 1)) const XMFLOAT4* pInputStream, + _In_ size_t InputStride, _In_ size_t VectorCount, _In_ FXMMATRIX M) noexcept; + + /**************************************************************************** + * + * Matrix operations + * + ****************************************************************************/ + + bool XM_CALLCONV XMMatrixIsNaN(FXMMATRIX M) noexcept; + bool XM_CALLCONV XMMatrixIsInfinite(FXMMATRIX M) noexcept; + bool XM_CALLCONV XMMatrixIsIdentity(FXMMATRIX M) noexcept; + + XMMATRIX XM_CALLCONV XMMatrixMultiply(FXMMATRIX M1, CXMMATRIX M2) noexcept; + XMMATRIX XM_CALLCONV XMMatrixMultiplyTranspose(FXMMATRIX M1, CXMMATRIX M2) noexcept; + XMMATRIX XM_CALLCONV XMMatrixTranspose(FXMMATRIX M) noexcept; + XMMATRIX XM_CALLCONV XMMatrixInverse(_Out_opt_ XMVECTOR* pDeterminant, _In_ FXMMATRIX M) noexcept; + XMMATRIX XM_CALLCONV XMMatrixVectorTensorProduct(FXMVECTOR V1, FXMVECTOR V2) noexcept; + XMVECTOR XM_CALLCONV XMMatrixDeterminant(FXMMATRIX M) noexcept; + + _Success_(return) + bool XM_CALLCONV XMMatrixDecompose(_Out_ XMVECTOR* outScale, _Out_ XMVECTOR* outRotQuat, _Out_ XMVECTOR* outTrans, _In_ FXMMATRIX M) noexcept; + + XMMATRIX XM_CALLCONV XMMatrixIdentity() noexcept; + XMMATRIX XM_CALLCONV XMMatrixSet(float m00, float m01, float m02, float m03, + float m10, float m11, float m12, float m13, + float m20, float m21, float m22, float m23, + float m30, float m31, float m32, float m33) noexcept; + XMMATRIX XM_CALLCONV XMMatrixTranslation(float OffsetX, float OffsetY, float OffsetZ) noexcept; + XMMATRIX XM_CALLCONV XMMatrixTranslationFromVector(FXMVECTOR Offset) noexcept; + XMMATRIX XM_CALLCONV XMMatrixScaling(float ScaleX, float ScaleY, float ScaleZ) noexcept; + XMMATRIX XM_CALLCONV XMMatrixScalingFromVector(FXMVECTOR Scale) noexcept; + XMMATRIX XM_CALLCONV XMMatrixRotationX(float Angle) noexcept; + XMMATRIX XM_CALLCONV XMMatrixRotationY(float Angle) noexcept; + XMMATRIX XM_CALLCONV XMMatrixRotationZ(float Angle) noexcept; + + // Rotates about y-axis (Yaw), then x-axis (Pitch), then z-axis (Roll) + XMMATRIX XM_CALLCONV XMMatrixRotationRollPitchYaw(float Pitch, float Yaw, float Roll) noexcept; + + // Rotates about y-axis (Angles.y), then x-axis (Angles.x), then z-axis (Angles.z) + XMMATRIX XM_CALLCONV XMMatrixRotationRollPitchYawFromVector(FXMVECTOR Angles) noexcept; + + XMMATRIX XM_CALLCONV XMMatrixRotationNormal(FXMVECTOR NormalAxis, float Angle) noexcept; + XMMATRIX XM_CALLCONV XMMatrixRotationAxis(FXMVECTOR Axis, float Angle) noexcept; + XMMATRIX XM_CALLCONV XMMatrixRotationQuaternion(FXMVECTOR Quaternion) noexcept; + XMMATRIX XM_CALLCONV XMMatrixTransformation2D(FXMVECTOR ScalingOrigin, float ScalingOrientation, FXMVECTOR Scaling, + FXMVECTOR RotationOrigin, float Rotation, GXMVECTOR Translation) noexcept; + XMMATRIX XM_CALLCONV XMMatrixTransformation(FXMVECTOR ScalingOrigin, FXMVECTOR ScalingOrientationQuaternion, FXMVECTOR Scaling, + GXMVECTOR RotationOrigin, HXMVECTOR RotationQuaternion, HXMVECTOR Translation) noexcept; + XMMATRIX XM_CALLCONV XMMatrixAffineTransformation2D(FXMVECTOR Scaling, FXMVECTOR RotationOrigin, float Rotation, FXMVECTOR Translation) noexcept; + XMMATRIX XM_CALLCONV XMMatrixAffineTransformation(FXMVECTOR Scaling, FXMVECTOR RotationOrigin, FXMVECTOR RotationQuaternion, GXMVECTOR Translation) noexcept; + XMMATRIX XM_CALLCONV XMMatrixReflect(FXMVECTOR ReflectionPlane) noexcept; + XMMATRIX XM_CALLCONV XMMatrixShadow(FXMVECTOR ShadowPlane, FXMVECTOR LightPosition) noexcept; + + XMMATRIX XM_CALLCONV XMMatrixLookAtLH(FXMVECTOR EyePosition, FXMVECTOR FocusPosition, FXMVECTOR UpDirection) noexcept; + XMMATRIX XM_CALLCONV XMMatrixLookAtRH(FXMVECTOR EyePosition, FXMVECTOR FocusPosition, FXMVECTOR UpDirection) noexcept; + XMMATRIX XM_CALLCONV XMMatrixLookToLH(FXMVECTOR EyePosition, FXMVECTOR EyeDirection, FXMVECTOR UpDirection) noexcept; + XMMATRIX XM_CALLCONV XMMatrixLookToRH(FXMVECTOR EyePosition, FXMVECTOR EyeDirection, FXMVECTOR UpDirection) noexcept; + XMMATRIX XM_CALLCONV XMMatrixPerspectiveLH(float ViewWidth, float ViewHeight, float NearZ, float FarZ) noexcept; + XMMATRIX XM_CALLCONV XMMatrixPerspectiveRH(float ViewWidth, float ViewHeight, float NearZ, float FarZ) noexcept; + XMMATRIX XM_CALLCONV XMMatrixPerspectiveFovLH(float FovAngleY, float AspectRatio, float NearZ, float FarZ) noexcept; + XMMATRIX XM_CALLCONV XMMatrixPerspectiveFovRH(float FovAngleY, float AspectRatio, float NearZ, float FarZ) noexcept; + XMMATRIX XM_CALLCONV XMMatrixPerspectiveOffCenterLH(float ViewLeft, float ViewRight, float ViewBottom, float ViewTop, float NearZ, float FarZ) noexcept; + XMMATRIX XM_CALLCONV XMMatrixPerspectiveOffCenterRH(float ViewLeft, float ViewRight, float ViewBottom, float ViewTop, float NearZ, float FarZ) noexcept; + XMMATRIX XM_CALLCONV XMMatrixOrthographicLH(float ViewWidth, float ViewHeight, float NearZ, float FarZ) noexcept; + XMMATRIX XM_CALLCONV XMMatrixOrthographicRH(float ViewWidth, float ViewHeight, float NearZ, float FarZ) noexcept; + XMMATRIX XM_CALLCONV XMMatrixOrthographicOffCenterLH(float ViewLeft, float ViewRight, float ViewBottom, float ViewTop, float NearZ, float FarZ) noexcept; + XMMATRIX XM_CALLCONV XMMatrixOrthographicOffCenterRH(float ViewLeft, float ViewRight, float ViewBottom, float ViewTop, float NearZ, float FarZ) noexcept; + + + /**************************************************************************** + * + * Quaternion operations + * + ****************************************************************************/ + + bool XM_CALLCONV XMQuaternionEqual(FXMVECTOR Q1, FXMVECTOR Q2) noexcept; + bool XM_CALLCONV XMQuaternionNotEqual(FXMVECTOR Q1, FXMVECTOR Q2) noexcept; + + bool XM_CALLCONV XMQuaternionIsNaN(FXMVECTOR Q) noexcept; + bool XM_CALLCONV XMQuaternionIsInfinite(FXMVECTOR Q) noexcept; + bool XM_CALLCONV XMQuaternionIsIdentity(FXMVECTOR Q) noexcept; + + XMVECTOR XM_CALLCONV XMQuaternionDot(FXMVECTOR Q1, FXMVECTOR Q2) noexcept; + XMVECTOR XM_CALLCONV XMQuaternionMultiply(FXMVECTOR Q1, FXMVECTOR Q2) noexcept; + XMVECTOR XM_CALLCONV XMQuaternionLengthSq(FXMVECTOR Q) noexcept; + XMVECTOR XM_CALLCONV XMQuaternionReciprocalLength(FXMVECTOR Q) noexcept; + XMVECTOR XM_CALLCONV XMQuaternionLength(FXMVECTOR Q) noexcept; + XMVECTOR XM_CALLCONV XMQuaternionNormalizeEst(FXMVECTOR Q) noexcept; + XMVECTOR XM_CALLCONV XMQuaternionNormalize(FXMVECTOR Q) noexcept; + XMVECTOR XM_CALLCONV XMQuaternionConjugate(FXMVECTOR Q) noexcept; + XMVECTOR XM_CALLCONV XMQuaternionInverse(FXMVECTOR Q) noexcept; + XMVECTOR XM_CALLCONV XMQuaternionLn(FXMVECTOR Q) noexcept; + XMVECTOR XM_CALLCONV XMQuaternionExp(FXMVECTOR Q) noexcept; + XMVECTOR XM_CALLCONV XMQuaternionSlerp(FXMVECTOR Q0, FXMVECTOR Q1, float t) noexcept; + XMVECTOR XM_CALLCONV XMQuaternionSlerpV(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR T) noexcept; + XMVECTOR XM_CALLCONV XMQuaternionSquad(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR Q2, GXMVECTOR Q3, float t) noexcept; + XMVECTOR XM_CALLCONV XMQuaternionSquadV(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR Q2, GXMVECTOR Q3, HXMVECTOR T) noexcept; + void XM_CALLCONV XMQuaternionSquadSetup(_Out_ XMVECTOR* pA, _Out_ XMVECTOR* pB, _Out_ XMVECTOR* pC, _In_ FXMVECTOR Q0, _In_ FXMVECTOR Q1, _In_ FXMVECTOR Q2, _In_ GXMVECTOR Q3) noexcept; + XMVECTOR XM_CALLCONV XMQuaternionBaryCentric(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR Q2, float f, float g) noexcept; + XMVECTOR XM_CALLCONV XMQuaternionBaryCentricV(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR Q2, GXMVECTOR F, HXMVECTOR G) noexcept; + + XMVECTOR XM_CALLCONV XMQuaternionIdentity() noexcept; + + // Rotates about y-axis (Yaw), then x-axis (Pitch), then z-axis (Roll) + XMVECTOR XM_CALLCONV XMQuaternionRotationRollPitchYaw(float Pitch, float Yaw, float Roll) noexcept; + + // Rotates about y-axis (Angles.y), then x-axis (Angles.x), then z-axis (Angles.z) + XMVECTOR XM_CALLCONV XMQuaternionRotationRollPitchYawFromVector(FXMVECTOR Angles) noexcept; + + XMVECTOR XM_CALLCONV XMQuaternionRotationNormal(FXMVECTOR NormalAxis, float Angle) noexcept; + XMVECTOR XM_CALLCONV XMQuaternionRotationAxis(FXMVECTOR Axis, float Angle) noexcept; + XMVECTOR XM_CALLCONV XMQuaternionRotationMatrix(FXMMATRIX M) noexcept; + + void XM_CALLCONV XMQuaternionToAxisAngle(_Out_ XMVECTOR* pAxis, _Out_ float* pAngle, _In_ FXMVECTOR Q) noexcept; + + /**************************************************************************** + * + * Plane operations + * + ****************************************************************************/ + + bool XM_CALLCONV XMPlaneEqual(FXMVECTOR P1, FXMVECTOR P2) noexcept; + bool XM_CALLCONV XMPlaneNearEqual(FXMVECTOR P1, FXMVECTOR P2, FXMVECTOR Epsilon) noexcept; + bool XM_CALLCONV XMPlaneNotEqual(FXMVECTOR P1, FXMVECTOR P2) noexcept; + + bool XM_CALLCONV XMPlaneIsNaN(FXMVECTOR P) noexcept; + bool XM_CALLCONV XMPlaneIsInfinite(FXMVECTOR P) noexcept; + + XMVECTOR XM_CALLCONV XMPlaneDot(FXMVECTOR P, FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMPlaneDotCoord(FXMVECTOR P, FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMPlaneDotNormal(FXMVECTOR P, FXMVECTOR V) noexcept; + XMVECTOR XM_CALLCONV XMPlaneNormalizeEst(FXMVECTOR P) noexcept; + XMVECTOR XM_CALLCONV XMPlaneNormalize(FXMVECTOR P) noexcept; + XMVECTOR XM_CALLCONV XMPlaneIntersectLine(FXMVECTOR P, FXMVECTOR LinePoint1, FXMVECTOR LinePoint2) noexcept; + void XM_CALLCONV XMPlaneIntersectPlane(_Out_ XMVECTOR* pLinePoint1, _Out_ XMVECTOR* pLinePoint2, _In_ FXMVECTOR P1, _In_ FXMVECTOR P2) noexcept; + + // Transforms a plane given an inverse transpose matrix + XMVECTOR XM_CALLCONV XMPlaneTransform(FXMVECTOR P, FXMMATRIX ITM) noexcept; + + // Transforms an array of planes given an inverse transpose matrix + XMFLOAT4* XM_CALLCONV XMPlaneTransformStream(_Out_writes_bytes_(sizeof(XMFLOAT4) + OutputStride * (PlaneCount - 1)) XMFLOAT4* pOutputStream, + _In_ size_t OutputStride, + _In_reads_bytes_(sizeof(XMFLOAT4) + InputStride * (PlaneCount - 1)) const XMFLOAT4* pInputStream, + _In_ size_t InputStride, _In_ size_t PlaneCount, _In_ FXMMATRIX ITM) noexcept; + + XMVECTOR XM_CALLCONV XMPlaneFromPointNormal(FXMVECTOR Point, FXMVECTOR Normal) noexcept; + XMVECTOR XM_CALLCONV XMPlaneFromPoints(FXMVECTOR Point1, FXMVECTOR Point2, FXMVECTOR Point3) noexcept; + + /**************************************************************************** + * + * Color operations + * + ****************************************************************************/ + + bool XM_CALLCONV XMColorEqual(FXMVECTOR C1, FXMVECTOR C2) noexcept; + bool XM_CALLCONV XMColorNotEqual(FXMVECTOR C1, FXMVECTOR C2) noexcept; + bool XM_CALLCONV XMColorGreater(FXMVECTOR C1, FXMVECTOR C2) noexcept; + bool XM_CALLCONV XMColorGreaterOrEqual(FXMVECTOR C1, FXMVECTOR C2) noexcept; + bool XM_CALLCONV XMColorLess(FXMVECTOR C1, FXMVECTOR C2) noexcept; + bool XM_CALLCONV XMColorLessOrEqual(FXMVECTOR C1, FXMVECTOR C2) noexcept; + + bool XM_CALLCONV XMColorIsNaN(FXMVECTOR C) noexcept; + bool XM_CALLCONV XMColorIsInfinite(FXMVECTOR C) noexcept; + + XMVECTOR XM_CALLCONV XMColorNegative(FXMVECTOR C) noexcept; + XMVECTOR XM_CALLCONV XMColorModulate(FXMVECTOR C1, FXMVECTOR C2) noexcept; + XMVECTOR XM_CALLCONV XMColorAdjustSaturation(FXMVECTOR C, float Saturation) noexcept; + XMVECTOR XM_CALLCONV XMColorAdjustContrast(FXMVECTOR C, float Contrast) noexcept; + + XMVECTOR XM_CALLCONV XMColorRGBToHSL(FXMVECTOR rgb) noexcept; + XMVECTOR XM_CALLCONV XMColorHSLToRGB(FXMVECTOR hsl) noexcept; + + XMVECTOR XM_CALLCONV XMColorRGBToHSV(FXMVECTOR rgb) noexcept; + XMVECTOR XM_CALLCONV XMColorHSVToRGB(FXMVECTOR hsv) noexcept; + + XMVECTOR XM_CALLCONV XMColorRGBToYUV(FXMVECTOR rgb) noexcept; + XMVECTOR XM_CALLCONV XMColorYUVToRGB(FXMVECTOR yuv) noexcept; + + XMVECTOR XM_CALLCONV XMColorRGBToYUV_HD(FXMVECTOR rgb) noexcept; + XMVECTOR XM_CALLCONV XMColorYUVToRGB_HD(FXMVECTOR yuv) noexcept; + + XMVECTOR XM_CALLCONV XMColorRGBToYUV_UHD(FXMVECTOR rgb) noexcept; + XMVECTOR XM_CALLCONV XMColorYUVToRGB_UHD(FXMVECTOR yuv) noexcept; + + XMVECTOR XM_CALLCONV XMColorRGBToXYZ(FXMVECTOR rgb) noexcept; + XMVECTOR XM_CALLCONV XMColorXYZToRGB(FXMVECTOR xyz) noexcept; + + XMVECTOR XM_CALLCONV XMColorXYZToSRGB(FXMVECTOR xyz) noexcept; + XMVECTOR XM_CALLCONV XMColorSRGBToXYZ(FXMVECTOR srgb) noexcept; + + XMVECTOR XM_CALLCONV XMColorRGBToSRGB(FXMVECTOR rgb) noexcept; + XMVECTOR XM_CALLCONV XMColorSRGBToRGB(FXMVECTOR srgb) noexcept; + + + /**************************************************************************** + * + * Miscellaneous operations + * + ****************************************************************************/ + + bool XMVerifyCPUSupport() noexcept; + + XMVECTOR XM_CALLCONV XMFresnelTerm(FXMVECTOR CosIncidentAngle, FXMVECTOR RefractionIndex) noexcept; + + bool XMScalarNearEqual(float S1, float S2, float Epsilon) noexcept; + float XMScalarModAngle(float Value) noexcept; + + float XMScalarSin(float Value) noexcept; + float XMScalarSinEst(float Value) noexcept; + + float XMScalarCos(float Value) noexcept; + float XMScalarCosEst(float Value) noexcept; + + void XMScalarSinCos(_Out_ float* pSin, _Out_ float* pCos, float Value) noexcept; + void XMScalarSinCosEst(_Out_ float* pSin, _Out_ float* pCos, float Value) noexcept; + + float XMScalarASin(float Value) noexcept; + float XMScalarASinEst(float Value) noexcept; + + float XMScalarACos(float Value) noexcept; + float XMScalarACosEst(float Value) noexcept; + + /**************************************************************************** + * + * Templates + * + ****************************************************************************/ + +#if defined(__XNAMATH_H__) && defined(XMMin) +#undef XMMin +#undef XMMax +#endif + + template inline T XMMin(T a, T b) noexcept { return (a < b) ? a : b; } + template inline T XMMax(T a, T b) noexcept { return (a > b) ? a : b; } + + //------------------------------------------------------------------------------ + +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + +// PermuteHelper internal template (SSE only) + namespace Internal + { + // Slow path fallback for permutes that do not map to a single SSE shuffle opcode. + template struct PermuteHelper + { + static XMVECTOR XM_CALLCONV Permute(FXMVECTOR v1, FXMVECTOR v2) noexcept + { + static const XMVECTORU32 selectMask = + { { { + WhichX ? 0xFFFFFFFF : 0, + WhichY ? 0xFFFFFFFF : 0, + WhichZ ? 0xFFFFFFFF : 0, + WhichW ? 0xFFFFFFFF : 0, + } } }; + + XMVECTOR shuffled1 = XM_PERMUTE_PS(v1, Shuffle); + XMVECTOR shuffled2 = XM_PERMUTE_PS(v2, Shuffle); + + XMVECTOR masked1 = _mm_andnot_ps(selectMask, shuffled1); + XMVECTOR masked2 = _mm_and_ps(selectMask, shuffled2); + + return _mm_or_ps(masked1, masked2); + } + }; + + // Fast path for permutes that only read from the first vector. + template struct PermuteHelper + { + static XMVECTOR XM_CALLCONV Permute(FXMVECTOR v1, FXMVECTOR) noexcept { return XM_PERMUTE_PS(v1, Shuffle); } + }; + + // Fast path for permutes that only read from the second vector. + template struct PermuteHelper + { + static XMVECTOR XM_CALLCONV Permute(FXMVECTOR, FXMVECTOR v2) noexcept { return XM_PERMUTE_PS(v2, Shuffle); } + }; + + // Fast path for permutes that read XY from the first vector, ZW from the second. + template struct PermuteHelper + { + static XMVECTOR XM_CALLCONV Permute(FXMVECTOR v1, FXMVECTOR v2) noexcept { return _mm_shuffle_ps(v1, v2, Shuffle); } + }; + + // Fast path for permutes that read XY from the second vector, ZW from the first. + template struct PermuteHelper + { + static XMVECTOR XM_CALLCONV Permute(FXMVECTOR v1, FXMVECTOR v2) noexcept { return _mm_shuffle_ps(v2, v1, Shuffle); } + }; + } + +#endif // _XM_SSE_INTRINSICS_ && !_XM_NO_INTRINSICS_ + + // General permute template + template + inline XMVECTOR XM_CALLCONV XMVectorPermute(FXMVECTOR V1, FXMVECTOR V2) noexcept + { + static_assert(PermuteX <= 7, "PermuteX template parameter out of range"); + static_assert(PermuteY <= 7, "PermuteY template parameter out of range"); + static_assert(PermuteZ <= 7, "PermuteZ template parameter out of range"); + static_assert(PermuteW <= 7, "PermuteW template parameter out of range"); + +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + constexpr uint32_t Shuffle = _MM_SHUFFLE(PermuteW & 3, PermuteZ & 3, PermuteY & 3, PermuteX & 3); + + constexpr bool WhichX = PermuteX > 3; + constexpr bool WhichY = PermuteY > 3; + constexpr bool WhichZ = PermuteZ > 3; + constexpr bool WhichW = PermuteW > 3; + + return Internal::PermuteHelper::Permute(V1, V2); +#else + + return XMVectorPermute(V1, V2, PermuteX, PermuteY, PermuteZ, PermuteW); + +#endif + } + + // Special-case permute templates + template<> constexpr XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 2, 3>(FXMVECTOR V1, FXMVECTOR) noexcept { return V1; } + template<> constexpr XMVECTOR XM_CALLCONV XMVectorPermute<4, 5, 6, 7>(FXMVECTOR, FXMVECTOR V2) noexcept { return V2; } + +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 4, 5>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return _mm_movelh_ps(V1, V2); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<6, 7, 2, 3>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return _mm_movehl_ps(V1, V2); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 4, 1, 5>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return _mm_unpacklo_ps(V1, V2); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<2, 6, 3, 7>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return _mm_unpackhi_ps(V1, V2); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<2, 3, 6, 7>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return _mm_castpd_ps(_mm_unpackhi_pd(_mm_castps_pd(V1), _mm_castps_pd(V2))); } +#endif + +#if defined(_XM_SSE4_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<4, 1, 2, 3>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return _mm_blend_ps(V1, V2, 0x1); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 5, 2, 3>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return _mm_blend_ps(V1, V2, 0x2); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<4, 5, 2, 3>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return _mm_blend_ps(V1, V2, 0x3); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 6, 3>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return _mm_blend_ps(V1, V2, 0x4); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<4, 1, 6, 3>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return _mm_blend_ps(V1, V2, 0x5); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 5, 6, 3>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return _mm_blend_ps(V1, V2, 0x6); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<4, 5, 6, 3>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return _mm_blend_ps(V1, V2, 0x7); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 2, 7>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return _mm_blend_ps(V1, V2, 0x8); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<4, 1, 2, 7>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return _mm_blend_ps(V1, V2, 0x9); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 5, 2, 7>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return _mm_blend_ps(V1, V2, 0xA); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<4, 5, 2, 7>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return _mm_blend_ps(V1, V2, 0xB); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 6, 7>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return _mm_blend_ps(V1, V2, 0xC); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<4, 1, 6, 7>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return _mm_blend_ps(V1, V2, 0xD); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 5, 6, 7>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return _mm_blend_ps(V1, V2, 0xE); } +#endif + +#if defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + + // If the indices are all in the range 0-3 or 4-7, then use XMVectorSwizzle instead + // The mirror cases are not spelled out here as the programmer can always swap the arguments + // (i.e. prefer permutes where the X element comes from the V1 vector instead of the V2 vector) + + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 4, 5>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return vcombine_f32(vget_low_f32(V1), vget_low_f32(V2)); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<1, 0, 4, 5>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return vcombine_f32(vrev64_f32(vget_low_f32(V1)), vget_low_f32(V2)); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 5, 4>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return vcombine_f32(vget_low_f32(V1), vrev64_f32(vget_low_f32(V2))); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<1, 0, 5, 4>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return vcombine_f32(vrev64_f32(vget_low_f32(V1)), vrev64_f32(vget_low_f32(V2))); } + + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<2, 3, 6, 7>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return vcombine_f32(vget_high_f32(V1), vget_high_f32(V2)); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<3, 2, 6, 7>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return vcombine_f32(vrev64_f32(vget_high_f32(V1)), vget_high_f32(V2)); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<2, 3, 7, 6>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return vcombine_f32(vget_high_f32(V1), vrev64_f32(vget_high_f32(V2))); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<3, 2, 7, 6>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return vcombine_f32(vrev64_f32(vget_high_f32(V1)), vrev64_f32(vget_high_f32(V2))); } + + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 6, 7>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return vcombine_f32(vget_low_f32(V1), vget_high_f32(V2)); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<1, 0, 6, 7>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return vcombine_f32(vrev64_f32(vget_low_f32(V1)), vget_high_f32(V2)); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 7, 6>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return vcombine_f32(vget_low_f32(V1), vrev64_f32(vget_high_f32(V2))); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<1, 0, 7, 6>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return vcombine_f32(vrev64_f32(vget_low_f32(V1)), vrev64_f32(vget_high_f32(V2))); } + + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<3, 2, 4, 5>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return vcombine_f32(vrev64_f32(vget_high_f32(V1)), vget_low_f32(V2)); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<2, 3, 5, 4>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return vcombine_f32(vget_high_f32(V1), vrev64_f32(vget_low_f32(V2))); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<3, 2, 5, 4>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return vcombine_f32(vrev64_f32(vget_high_f32(V1)), vrev64_f32(vget_low_f32(V2))); } + + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 4, 2, 6>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return vtrnq_f32(V1, V2).val[0]; } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<1, 5, 3, 7>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return vtrnq_f32(V1, V2).val[1]; } + + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 4, 1, 5>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return vzipq_f32(V1, V2).val[0]; } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<2, 6, 3, 7>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return vzipq_f32(V1, V2).val[1]; } + + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 2, 4, 6>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return vuzpq_f32(V1, V2).val[0]; } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<1, 3, 5, 7>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return vuzpq_f32(V1, V2).val[1]; } + + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<1, 2, 3, 4>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return vextq_f32(V1, V2, 1); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<2, 3, 4, 5>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return vextq_f32(V1, V2, 2); } + template<> inline XMVECTOR XM_CALLCONV XMVectorPermute<3, 4, 5, 6>(FXMVECTOR V1, FXMVECTOR V2) noexcept { return vextq_f32(V1, V2, 3); } + +#endif // _XM_ARM_NEON_INTRINSICS_ && !_XM_NO_INTRINSICS_ + + //------------------------------------------------------------------------------ + + // General swizzle template + template + inline XMVECTOR XM_CALLCONV XMVectorSwizzle(FXMVECTOR V) noexcept + { + static_assert(SwizzleX <= 3, "SwizzleX template parameter out of range"); + static_assert(SwizzleY <= 3, "SwizzleY template parameter out of range"); + static_assert(SwizzleZ <= 3, "SwizzleZ template parameter out of range"); + static_assert(SwizzleW <= 3, "SwizzleW template parameter out of range"); + +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + return XM_PERMUTE_PS(V, _MM_SHUFFLE(SwizzleW, SwizzleZ, SwizzleY, SwizzleX)); +#else + + return XMVectorSwizzle(V, SwizzleX, SwizzleY, SwizzleZ, SwizzleW); + +#endif + } + + // Specialized swizzles + template<> constexpr XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 1, 2, 3>(FXMVECTOR V) noexcept { return V; } + +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 1, 0, 1>(FXMVECTOR V) noexcept { return _mm_movelh_ps(V, V); } + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<2, 3, 2, 3>(FXMVECTOR V) noexcept { return _mm_movehl_ps(V, V); } + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 0, 1, 1>(FXMVECTOR V) noexcept { return _mm_unpacklo_ps(V, V); } + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<2, 2, 3, 3>(FXMVECTOR V) noexcept { return _mm_unpackhi_ps(V, V); } +#endif + +#if defined(_XM_SSE3_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 0, 2, 2>(FXMVECTOR V) noexcept { return _mm_moveldup_ps(V); } + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<1, 1, 3, 3>(FXMVECTOR V) noexcept { return _mm_movehdup_ps(V); } +#endif + +#if defined(_XM_AVX2_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) && defined(_XM_FAVOR_INTEL_) + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 0, 0, 0>(FXMVECTOR V) noexcept { return _mm_broadcastss_ps(V); } +#endif + +#if defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 0, 0, 0>(FXMVECTOR V) noexcept { return vdupq_lane_f32(vget_low_f32(V), 0); } + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<1, 1, 1, 1>(FXMVECTOR V) noexcept { return vdupq_lane_f32(vget_low_f32(V), 1); } + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<2, 2, 2, 2>(FXMVECTOR V) noexcept { return vdupq_lane_f32(vget_high_f32(V), 0); } + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<3, 3, 3, 3>(FXMVECTOR V) noexcept { return vdupq_lane_f32(vget_high_f32(V), 1); } + + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<1, 0, 3, 2>(FXMVECTOR V) noexcept { return vrev64q_f32(V); } + + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 1, 0, 1>(FXMVECTOR V) noexcept { float32x2_t vt = vget_low_f32(V); return vcombine_f32(vt, vt); } + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<2, 3, 2, 3>(FXMVECTOR V) noexcept { float32x2_t vt = vget_high_f32(V); return vcombine_f32(vt, vt); } + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<1, 0, 1, 0>(FXMVECTOR V) noexcept { float32x2_t vt = vrev64_f32(vget_low_f32(V)); return vcombine_f32(vt, vt); } + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<3, 2, 3, 2>(FXMVECTOR V) noexcept { float32x2_t vt = vrev64_f32(vget_high_f32(V)); return vcombine_f32(vt, vt); } + + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 1, 3, 2>(FXMVECTOR V) noexcept { return vcombine_f32(vget_low_f32(V), vrev64_f32(vget_high_f32(V))); } + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<1, 0, 2, 3>(FXMVECTOR V) noexcept { return vcombine_f32(vrev64_f32(vget_low_f32(V)), vget_high_f32(V)); } + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<2, 3, 1, 0>(FXMVECTOR V) noexcept { return vcombine_f32(vget_high_f32(V), vrev64_f32(vget_low_f32(V))); } + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<3, 2, 0, 1>(FXMVECTOR V) noexcept { return vcombine_f32(vrev64_f32(vget_high_f32(V)), vget_low_f32(V)); } + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<3, 2, 1, 0>(FXMVECTOR V) noexcept { return vcombine_f32(vrev64_f32(vget_high_f32(V)), vrev64_f32(vget_low_f32(V))); } + + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 0, 2, 2>(FXMVECTOR V) noexcept { return vtrnq_f32(V, V).val[0]; } + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<1, 1, 3, 3>(FXMVECTOR V) noexcept { return vtrnq_f32(V, V).val[1]; } + + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 0, 1, 1>(FXMVECTOR V) noexcept { return vzipq_f32(V, V).val[0]; } + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<2, 2, 3, 3>(FXMVECTOR V) noexcept { return vzipq_f32(V, V).val[1]; } + + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 2, 0, 2>(FXMVECTOR V) noexcept { return vuzpq_f32(V, V).val[0]; } + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<1, 3, 1, 3>(FXMVECTOR V) noexcept { return vuzpq_f32(V, V).val[1]; } + + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<1, 2, 3, 0>(FXMVECTOR V) noexcept { return vextq_f32(V, V, 1); } + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<2, 3, 0, 1>(FXMVECTOR V) noexcept { return vextq_f32(V, V, 2); } + template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<3, 0, 1, 2>(FXMVECTOR V) noexcept { return vextq_f32(V, V, 3); } + +#endif // _XM_ARM_NEON_INTRINSICS_ && !_XM_NO_INTRINSICS_ + + //------------------------------------------------------------------------------ + + template + inline XMVECTOR XM_CALLCONV XMVectorShiftLeft(FXMVECTOR V1, FXMVECTOR V2) noexcept + { + static_assert(Elements < 4, "Elements template parameter out of range"); + return XMVectorPermute(V1, V2); + } + + template + inline XMVECTOR XM_CALLCONV XMVectorRotateLeft(FXMVECTOR V) noexcept + { + static_assert(Elements < 4, "Elements template parameter out of range"); + return XMVectorSwizzle(V); + } + + template + inline XMVECTOR XM_CALLCONV XMVectorRotateRight(FXMVECTOR V) noexcept + { + static_assert(Elements < 4, "Elements template parameter out of range"); + return XMVectorSwizzle<(4 - Elements) & 3, (5 - Elements) & 3, (6 - Elements) & 3, (7 - Elements) & 3>(V); + } + + template + inline XMVECTOR XM_CALLCONV XMVectorInsert(FXMVECTOR VD, FXMVECTOR VS) noexcept + { + XMVECTOR Control = XMVectorSelectControl(Select0 & 1, Select1 & 1, Select2 & 1, Select3 & 1); + return XMVectorSelect(VD, XMVectorRotateLeft(VS), Control); + } + + /**************************************************************************** + * + * Globals + * + ****************************************************************************/ + + // The purpose of the following global constants is to prevent redundant + // reloading of the constants when they are referenced by more than one + // separate inline math routine called within the same function. Declaring + // a constant locally within a routine is sufficient to prevent redundant + // reloads of that constant when that single routine is called multiple + // times in a function, but if the constant is used (and declared) in a + // separate math routine it would be reloaded. + +#ifndef XMGLOBALCONST +#if defined(__GNUC__) && !defined(__MINGW32__) +#define XMGLOBALCONST extern const __attribute__((weak)) +#else +#define XMGLOBALCONST extern const __declspec(selectany) +#endif +#endif + + XMGLOBALCONST XMVECTORF32 g_XMSinCoefficients0 = { { { -0.16666667f, +0.0083333310f, -0.00019840874f, +2.7525562e-06f } } }; + XMGLOBALCONST XMVECTORF32 g_XMSinCoefficients1 = { { { -2.3889859e-08f, -0.16665852f /*Est1*/, +0.0083139502f /*Est2*/, -0.00018524670f /*Est3*/ } } }; + XMGLOBALCONST XMVECTORF32 g_XMCosCoefficients0 = { { { -0.5f, +0.041666638f, -0.0013888378f, +2.4760495e-05f } } }; + XMGLOBALCONST XMVECTORF32 g_XMCosCoefficients1 = { { { -2.6051615e-07f, -0.49992746f /*Est1*/, +0.041493919f /*Est2*/, -0.0012712436f /*Est3*/ } } }; + XMGLOBALCONST XMVECTORF32 g_XMTanCoefficients0 = { { { 1.0f, 0.333333333f, 0.133333333f, 5.396825397e-2f } } }; + XMGLOBALCONST XMVECTORF32 g_XMTanCoefficients1 = { { { 2.186948854e-2f, 8.863235530e-3f, 3.592128167e-3f, 1.455834485e-3f } } }; + XMGLOBALCONST XMVECTORF32 g_XMTanCoefficients2 = { { { 5.900274264e-4f, 2.391290764e-4f, 9.691537707e-5f, 3.927832950e-5f } } }; + XMGLOBALCONST XMVECTORF32 g_XMArcCoefficients0 = { { { +1.5707963050f, -0.2145988016f, +0.0889789874f, -0.0501743046f } } }; + XMGLOBALCONST XMVECTORF32 g_XMArcCoefficients1 = { { { +0.0308918810f, -0.0170881256f, +0.0066700901f, -0.0012624911f } } }; + XMGLOBALCONST XMVECTORF32 g_XMATanCoefficients0 = { { { -0.3333314528f, +0.1999355085f, -0.1420889944f, +0.1065626393f } } }; + XMGLOBALCONST XMVECTORF32 g_XMATanCoefficients1 = { { { -0.0752896400f, +0.0429096138f, -0.0161657367f, +0.0028662257f } } }; + XMGLOBALCONST XMVECTORF32 g_XMATanEstCoefficients0 = { { { +0.999866f, +0.999866f, +0.999866f, +0.999866f } } }; + XMGLOBALCONST XMVECTORF32 g_XMATanEstCoefficients1 = { { { -0.3302995f, +0.180141f, -0.085133f, +0.0208351f } } }; + XMGLOBALCONST XMVECTORF32 g_XMTanEstCoefficients = { { { 2.484f, -1.954923183e-1f, 2.467401101f, XM_1DIVPI } } }; + XMGLOBALCONST XMVECTORF32 g_XMArcEstCoefficients = { { { +1.5707288f, -0.2121144f, +0.0742610f, -0.0187293f } } }; + XMGLOBALCONST XMVECTORF32 g_XMPiConstants0 = { { { XM_PI, XM_2PI, XM_1DIVPI, XM_1DIV2PI } } }; + XMGLOBALCONST XMVECTORF32 g_XMIdentityR0 = { { { 1.0f, 0.0f, 0.0f, 0.0f } } }; + XMGLOBALCONST XMVECTORF32 g_XMIdentityR1 = { { { 0.0f, 1.0f, 0.0f, 0.0f } } }; + XMGLOBALCONST XMVECTORF32 g_XMIdentityR2 = { { { 0.0f, 0.0f, 1.0f, 0.0f } } }; + XMGLOBALCONST XMVECTORF32 g_XMIdentityR3 = { { { 0.0f, 0.0f, 0.0f, 1.0f } } }; + XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR0 = { { { -1.0f, 0.0f, 0.0f, 0.0f } } }; + XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR1 = { { { 0.0f, -1.0f, 0.0f, 0.0f } } }; + XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR2 = { { { 0.0f, 0.0f, -1.0f, 0.0f } } }; + XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR3 = { { { 0.0f, 0.0f, 0.0f, -1.0f } } }; + XMGLOBALCONST XMVECTORU32 g_XMNegativeZero = { { { 0x80000000, 0x80000000, 0x80000000, 0x80000000 } } }; + XMGLOBALCONST XMVECTORU32 g_XMNegate3 = { { { 0x80000000, 0x80000000, 0x80000000, 0x00000000 } } }; + XMGLOBALCONST XMVECTORU32 g_XMMaskXY = { { { 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x00000000 } } }; + XMGLOBALCONST XMVECTORU32 g_XMMask3 = { { { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000 } } }; + XMGLOBALCONST XMVECTORU32 g_XMMaskX = { { { 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000 } } }; + XMGLOBALCONST XMVECTORU32 g_XMMaskY = { { { 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000000 } } }; + XMGLOBALCONST XMVECTORU32 g_XMMaskZ = { { { 0x00000000, 0x00000000, 0xFFFFFFFF, 0x00000000 } } }; + XMGLOBALCONST XMVECTORU32 g_XMMaskW = { { { 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF } } }; + XMGLOBALCONST XMVECTORF32 g_XMOne = { { { 1.0f, 1.0f, 1.0f, 1.0f } } }; + XMGLOBALCONST XMVECTORF32 g_XMOne3 = { { { 1.0f, 1.0f, 1.0f, 0.0f } } }; + XMGLOBALCONST XMVECTORF32 g_XMZero = { { { 0.0f, 0.0f, 0.0f, 0.0f } } }; + XMGLOBALCONST XMVECTORF32 g_XMTwo = { { { 2.f, 2.f, 2.f, 2.f } } }; + XMGLOBALCONST XMVECTORF32 g_XMFour = { { { 4.f, 4.f, 4.f, 4.f } } }; + XMGLOBALCONST XMVECTORF32 g_XMSix = { { { 6.f, 6.f, 6.f, 6.f } } }; + XMGLOBALCONST XMVECTORF32 g_XMNegativeOne = { { { -1.0f, -1.0f, -1.0f, -1.0f } } }; + XMGLOBALCONST XMVECTORF32 g_XMOneHalf = { { { 0.5f, 0.5f, 0.5f, 0.5f } } }; + XMGLOBALCONST XMVECTORF32 g_XMNegativeOneHalf = { { { -0.5f, -0.5f, -0.5f, -0.5f } } }; + XMGLOBALCONST XMVECTORF32 g_XMNegativeTwoPi = { { { -XM_2PI, -XM_2PI, -XM_2PI, -XM_2PI } } }; + XMGLOBALCONST XMVECTORF32 g_XMNegativePi = { { { -XM_PI, -XM_PI, -XM_PI, -XM_PI } } }; + XMGLOBALCONST XMVECTORF32 g_XMHalfPi = { { { XM_PIDIV2, XM_PIDIV2, XM_PIDIV2, XM_PIDIV2 } } }; + XMGLOBALCONST XMVECTORF32 g_XMPi = { { { XM_PI, XM_PI, XM_PI, XM_PI } } }; + XMGLOBALCONST XMVECTORF32 g_XMReciprocalPi = { { { XM_1DIVPI, XM_1DIVPI, XM_1DIVPI, XM_1DIVPI } } }; + XMGLOBALCONST XMVECTORF32 g_XMTwoPi = { { { XM_2PI, XM_2PI, XM_2PI, XM_2PI } } }; + XMGLOBALCONST XMVECTORF32 g_XMReciprocalTwoPi = { { { XM_1DIV2PI, XM_1DIV2PI, XM_1DIV2PI, XM_1DIV2PI } } }; + XMGLOBALCONST XMVECTORF32 g_XMEpsilon = { { { 1.192092896e-7f, 1.192092896e-7f, 1.192092896e-7f, 1.192092896e-7f } } }; + XMGLOBALCONST XMVECTORI32 g_XMInfinity = { { { 0x7F800000, 0x7F800000, 0x7F800000, 0x7F800000 } } }; + XMGLOBALCONST XMVECTORI32 g_XMQNaN = { { { 0x7FC00000, 0x7FC00000, 0x7FC00000, 0x7FC00000 } } }; + XMGLOBALCONST XMVECTORI32 g_XMQNaNTest = { { { 0x007FFFFF, 0x007FFFFF, 0x007FFFFF, 0x007FFFFF } } }; + XMGLOBALCONST XMVECTORI32 g_XMAbsMask = { { { 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF } } }; + XMGLOBALCONST XMVECTORI32 g_XMFltMin = { { { 0x00800000, 0x00800000, 0x00800000, 0x00800000 } } }; + XMGLOBALCONST XMVECTORI32 g_XMFltMax = { { { 0x7F7FFFFF, 0x7F7FFFFF, 0x7F7FFFFF, 0x7F7FFFFF } } }; + XMGLOBALCONST XMVECTORU32 g_XMNegOneMask = { { { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF } } }; + XMGLOBALCONST XMVECTORU32 g_XMMaskA8R8G8B8 = { { { 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000 } } }; + XMGLOBALCONST XMVECTORU32 g_XMFlipA8R8G8B8 = { { { 0x00000000, 0x00000000, 0x00000000, 0x80000000 } } }; + XMGLOBALCONST XMVECTORF32 g_XMFixAA8R8G8B8 = { { { 0.0f, 0.0f, 0.0f, float(0x80000000U) } } }; + XMGLOBALCONST XMVECTORF32 g_XMNormalizeA8R8G8B8 = { { { 1.0f / (255.0f * float(0x10000)), 1.0f / (255.0f * float(0x100)), 1.0f / 255.0f, 1.0f / (255.0f * float(0x1000000)) } } }; + XMGLOBALCONST XMVECTORU32 g_XMMaskA2B10G10R10 = { { { 0x000003FF, 0x000FFC00, 0x3FF00000, 0xC0000000 } } }; + XMGLOBALCONST XMVECTORU32 g_XMFlipA2B10G10R10 = { { { 0x00000200, 0x00080000, 0x20000000, 0x80000000 } } }; + XMGLOBALCONST XMVECTORF32 g_XMFixAA2B10G10R10 = { { { -512.0f, -512.0f * float(0x400), -512.0f * float(0x100000), float(0x80000000U) } } }; + XMGLOBALCONST XMVECTORF32 g_XMNormalizeA2B10G10R10 = { { { 1.0f / 511.0f, 1.0f / (511.0f * float(0x400)), 1.0f / (511.0f * float(0x100000)), 1.0f / (3.0f * float(0x40000000)) } } }; + XMGLOBALCONST XMVECTORU32 g_XMMaskX16Y16 = { { { 0x0000FFFF, 0xFFFF0000, 0x00000000, 0x00000000 } } }; + XMGLOBALCONST XMVECTORI32 g_XMFlipX16Y16 = { { { 0x00008000, 0x00000000, 0x00000000, 0x00000000 } } }; + XMGLOBALCONST XMVECTORF32 g_XMFixX16Y16 = { { { -32768.0f, 0.0f, 0.0f, 0.0f } } }; + XMGLOBALCONST XMVECTORF32 g_XMNormalizeX16Y16 = { { { 1.0f / 32767.0f, 1.0f / (32767.0f * 65536.0f), 0.0f, 0.0f } } }; + XMGLOBALCONST XMVECTORU32 g_XMMaskX16Y16Z16W16 = { { { 0x0000FFFF, 0x0000FFFF, 0xFFFF0000, 0xFFFF0000 } } }; + XMGLOBALCONST XMVECTORI32 g_XMFlipX16Y16Z16W16 = { { { 0x00008000, 0x00008000, 0x00000000, 0x00000000 } } }; + XMGLOBALCONST XMVECTORF32 g_XMFixX16Y16Z16W16 = { { { -32768.0f, -32768.0f, 0.0f, 0.0f } } }; + XMGLOBALCONST XMVECTORF32 g_XMNormalizeX16Y16Z16W16 = { { { 1.0f / 32767.0f, 1.0f / 32767.0f, 1.0f / (32767.0f * 65536.0f), 1.0f / (32767.0f * 65536.0f) } } }; + XMGLOBALCONST XMVECTORF32 g_XMNoFraction = { { { 8388608.0f, 8388608.0f, 8388608.0f, 8388608.0f } } }; + XMGLOBALCONST XMVECTORI32 g_XMMaskByte = { { { 0x000000FF, 0x000000FF, 0x000000FF, 0x000000FF } } }; + XMGLOBALCONST XMVECTORF32 g_XMNegateX = { { { -1.0f, 1.0f, 1.0f, 1.0f } } }; + XMGLOBALCONST XMVECTORF32 g_XMNegateY = { { { 1.0f, -1.0f, 1.0f, 1.0f } } }; + XMGLOBALCONST XMVECTORF32 g_XMNegateZ = { { { 1.0f, 1.0f, -1.0f, 1.0f } } }; + XMGLOBALCONST XMVECTORF32 g_XMNegateW = { { { 1.0f, 1.0f, 1.0f, -1.0f } } }; + XMGLOBALCONST XMVECTORU32 g_XMSelect0101 = { { { XM_SELECT_0, XM_SELECT_1, XM_SELECT_0, XM_SELECT_1 } } }; + XMGLOBALCONST XMVECTORU32 g_XMSelect1010 = { { { XM_SELECT_1, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0 } } }; + XMGLOBALCONST XMVECTORI32 g_XMOneHalfMinusEpsilon = { { { 0x3EFFFFFD, 0x3EFFFFFD, 0x3EFFFFFD, 0x3EFFFFFD } } }; + XMGLOBALCONST XMVECTORU32 g_XMSelect1000 = { { { XM_SELECT_1, XM_SELECT_0, XM_SELECT_0, XM_SELECT_0 } } }; + XMGLOBALCONST XMVECTORU32 g_XMSelect1100 = { { { XM_SELECT_1, XM_SELECT_1, XM_SELECT_0, XM_SELECT_0 } } }; + XMGLOBALCONST XMVECTORU32 g_XMSelect1110 = { { { XM_SELECT_1, XM_SELECT_1, XM_SELECT_1, XM_SELECT_0 } } }; + XMGLOBALCONST XMVECTORU32 g_XMSelect1011 = { { { XM_SELECT_1, XM_SELECT_0, XM_SELECT_1, XM_SELECT_1 } } }; + XMGLOBALCONST XMVECTORF32 g_XMFixupY16 = { { { 1.0f, 1.0f / 65536.0f, 0.0f, 0.0f } } }; + XMGLOBALCONST XMVECTORF32 g_XMFixupY16W16 = { { { 1.0f, 1.0f, 1.0f / 65536.0f, 1.0f / 65536.0f } } }; + XMGLOBALCONST XMVECTORU32 g_XMFlipY = { { { 0, 0x80000000, 0, 0 } } }; + XMGLOBALCONST XMVECTORU32 g_XMFlipZ = { { { 0, 0, 0x80000000, 0 } } }; + XMGLOBALCONST XMVECTORU32 g_XMFlipW = { { { 0, 0, 0, 0x80000000 } } }; + XMGLOBALCONST XMVECTORU32 g_XMFlipYZ = { { { 0, 0x80000000, 0x80000000, 0 } } }; + XMGLOBALCONST XMVECTORU32 g_XMFlipZW = { { { 0, 0, 0x80000000, 0x80000000 } } }; + XMGLOBALCONST XMVECTORU32 g_XMFlipYW = { { { 0, 0x80000000, 0, 0x80000000 } } }; + XMGLOBALCONST XMVECTORI32 g_XMMaskDec4 = { { { 0x3FF, 0x3FF << 10, 0x3FF << 20, static_cast(0xC0000000) } } }; + XMGLOBALCONST XMVECTORI32 g_XMXorDec4 = { { { 0x200, 0x200 << 10, 0x200 << 20, 0 } } }; + XMGLOBALCONST XMVECTORF32 g_XMAddUDec4 = { { { 0, 0, 0, 32768.0f * 65536.0f } } }; + XMGLOBALCONST XMVECTORF32 g_XMAddDec4 = { { { -512.0f, -512.0f * 1024.0f, -512.0f * 1024.0f * 1024.0f, 0 } } }; + XMGLOBALCONST XMVECTORF32 g_XMMulDec4 = { { { 1.0f, 1.0f / 1024.0f, 1.0f / (1024.0f * 1024.0f), 1.0f / (1024.0f * 1024.0f * 1024.0f) } } }; + XMGLOBALCONST XMVECTORU32 g_XMMaskByte4 = { { { 0xFF, 0xFF00, 0xFF0000, 0xFF000000 } } }; + XMGLOBALCONST XMVECTORI32 g_XMXorByte4 = { { { 0x80, 0x8000, 0x800000, 0x00000000 } } }; + XMGLOBALCONST XMVECTORF32 g_XMAddByte4 = { { { -128.0f, -128.0f * 256.0f, -128.0f * 65536.0f, 0 } } }; + XMGLOBALCONST XMVECTORF32 g_XMFixUnsigned = { { { 32768.0f * 65536.0f, 32768.0f * 65536.0f, 32768.0f * 65536.0f, 32768.0f * 65536.0f } } }; + XMGLOBALCONST XMVECTORF32 g_XMMaxInt = { { { 65536.0f * 32768.0f - 128.0f, 65536.0f * 32768.0f - 128.0f, 65536.0f * 32768.0f - 128.0f, 65536.0f * 32768.0f - 128.0f } } }; + XMGLOBALCONST XMVECTORF32 g_XMMaxUInt = { { { 65536.0f * 65536.0f - 256.0f, 65536.0f * 65536.0f - 256.0f, 65536.0f * 65536.0f - 256.0f, 65536.0f * 65536.0f - 256.0f } } }; + XMGLOBALCONST XMVECTORF32 g_XMUnsignedFix = { { { 32768.0f * 65536.0f, 32768.0f * 65536.0f, 32768.0f * 65536.0f, 32768.0f * 65536.0f } } }; + XMGLOBALCONST XMVECTORF32 g_XMsrgbScale = { { { 12.92f, 12.92f, 12.92f, 1.0f } } }; + XMGLOBALCONST XMVECTORF32 g_XMsrgbA = { { { 0.055f, 0.055f, 0.055f, 0.0f } } }; + XMGLOBALCONST XMVECTORF32 g_XMsrgbA1 = { { { 1.055f, 1.055f, 1.055f, 1.0f } } }; + XMGLOBALCONST XMVECTORI32 g_XMExponentBias = { { { 127, 127, 127, 127 } } }; + XMGLOBALCONST XMVECTORI32 g_XMSubnormalExponent = { { { -126, -126, -126, -126 } } }; + XMGLOBALCONST XMVECTORI32 g_XMNumTrailing = { { { 23, 23, 23, 23 } } }; + XMGLOBALCONST XMVECTORI32 g_XMMinNormal = { { { 0x00800000, 0x00800000, 0x00800000, 0x00800000 } } }; + XMGLOBALCONST XMVECTORU32 g_XMNegInfinity = { { { 0xFF800000, 0xFF800000, 0xFF800000, 0xFF800000 } } }; + XMGLOBALCONST XMVECTORU32 g_XMNegQNaN = { { { 0xFFC00000, 0xFFC00000, 0xFFC00000, 0xFFC00000 } } }; + XMGLOBALCONST XMVECTORI32 g_XMBin128 = { { { 0x43000000, 0x43000000, 0x43000000, 0x43000000 } } }; + XMGLOBALCONST XMVECTORU32 g_XMBinNeg150 = { { { 0xC3160000, 0xC3160000, 0xC3160000, 0xC3160000 } } }; + XMGLOBALCONST XMVECTORI32 g_XM253 = { { { 253, 253, 253, 253 } } }; + XMGLOBALCONST XMVECTORF32 g_XMExpEst1 = { { { -6.93147182e-1f, -6.93147182e-1f, -6.93147182e-1f, -6.93147182e-1f } } }; + XMGLOBALCONST XMVECTORF32 g_XMExpEst2 = { { { +2.40226462e-1f, +2.40226462e-1f, +2.40226462e-1f, +2.40226462e-1f } } }; + XMGLOBALCONST XMVECTORF32 g_XMExpEst3 = { { { -5.55036440e-2f, -5.55036440e-2f, -5.55036440e-2f, -5.55036440e-2f } } }; + XMGLOBALCONST XMVECTORF32 g_XMExpEst4 = { { { +9.61597636e-3f, +9.61597636e-3f, +9.61597636e-3f, +9.61597636e-3f } } }; + XMGLOBALCONST XMVECTORF32 g_XMExpEst5 = { { { -1.32823968e-3f, -1.32823968e-3f, -1.32823968e-3f, -1.32823968e-3f } } }; + XMGLOBALCONST XMVECTORF32 g_XMExpEst6 = { { { +1.47491097e-4f, +1.47491097e-4f, +1.47491097e-4f, +1.47491097e-4f } } }; + XMGLOBALCONST XMVECTORF32 g_XMExpEst7 = { { { -1.08635004e-5f, -1.08635004e-5f, -1.08635004e-5f, -1.08635004e-5f } } }; + XMGLOBALCONST XMVECTORF32 g_XMLogEst0 = { { { +1.442693f, +1.442693f, +1.442693f, +1.442693f } } }; + XMGLOBALCONST XMVECTORF32 g_XMLogEst1 = { { { -0.721242f, -0.721242f, -0.721242f, -0.721242f } } }; + XMGLOBALCONST XMVECTORF32 g_XMLogEst2 = { { { +0.479384f, +0.479384f, +0.479384f, +0.479384f } } }; + XMGLOBALCONST XMVECTORF32 g_XMLogEst3 = { { { -0.350295f, -0.350295f, -0.350295f, -0.350295f } } }; + XMGLOBALCONST XMVECTORF32 g_XMLogEst4 = { { { +0.248590f, +0.248590f, +0.248590f, +0.248590f } } }; + XMGLOBALCONST XMVECTORF32 g_XMLogEst5 = { { { -0.145700f, -0.145700f, -0.145700f, -0.145700f } } }; + XMGLOBALCONST XMVECTORF32 g_XMLogEst6 = { { { +0.057148f, +0.057148f, +0.057148f, +0.057148f } } }; + XMGLOBALCONST XMVECTORF32 g_XMLogEst7 = { { { -0.010578f, -0.010578f, -0.010578f, -0.010578f } } }; + XMGLOBALCONST XMVECTORF32 g_XMLgE = { { { +1.442695f, +1.442695f, +1.442695f, +1.442695f } } }; + XMGLOBALCONST XMVECTORF32 g_XMInvLgE = { { { +6.93147182e-1f, +6.93147182e-1f, +6.93147182e-1f, +6.93147182e-1f } } }; + XMGLOBALCONST XMVECTORF32 g_XMLg10 = { { { +3.321928f, +3.321928f, +3.321928f, +3.321928f } } }; + XMGLOBALCONST XMVECTORF32 g_XMInvLg10 = { { { +3.010299956e-1f, +3.010299956e-1f, +3.010299956e-1f, +3.010299956e-1f } } }; + XMGLOBALCONST XMVECTORF32 g_UByteMax = { { { 255.0f, 255.0f, 255.0f, 255.0f } } }; + XMGLOBALCONST XMVECTORF32 g_ByteMin = { { { -127.0f, -127.0f, -127.0f, -127.0f } } }; + XMGLOBALCONST XMVECTORF32 g_ByteMax = { { { 127.0f, 127.0f, 127.0f, 127.0f } } }; + XMGLOBALCONST XMVECTORF32 g_ShortMin = { { { -32767.0f, -32767.0f, -32767.0f, -32767.0f } } }; + XMGLOBALCONST XMVECTORF32 g_ShortMax = { { { 32767.0f, 32767.0f, 32767.0f, 32767.0f } } }; + XMGLOBALCONST XMVECTORF32 g_UShortMax = { { { 65535.0f, 65535.0f, 65535.0f, 65535.0f } } }; + + /**************************************************************************** + * + * Implementation + * + ****************************************************************************/ + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4068 4214 4204 4365 4616 4640 6001 6101) + // C4068/4616: ignore unknown pragmas + // C4214/4204: nonstandard extension used + // C4365/4640: Off by default noise + // C6001/6101: False positives +#endif + +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable : 25000, "FXMVECTOR is 16 bytes") +#pragma prefast(disable : 26495, "Union initialization confuses /analyze") +#endif + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wundefined-reinterpret-cast" +#endif + +//------------------------------------------------------------------------------ + + inline XMVECTOR XM_CALLCONV XMVectorSetBinaryConstant(uint32_t C0, uint32_t C1, uint32_t C2, uint32_t C3) noexcept + { +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 vResult; + vResult.u[0] = (0 - (C0 & 1)) & 0x3F800000; + vResult.u[1] = (0 - (C1 & 1)) & 0x3F800000; + vResult.u[2] = (0 - (C2 & 1)) & 0x3F800000; + vResult.u[3] = (0 - (C3 & 1)) & 0x3F800000; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMVECTORU32 vResult; + vResult.u[0] = (0 - (C0 & 1)) & 0x3F800000; + vResult.u[1] = (0 - (C1 & 1)) & 0x3F800000; + vResult.u[2] = (0 - (C2 & 1)) & 0x3F800000; + vResult.u[3] = (0 - (C3 & 1)) & 0x3F800000; + return vResult.v; +#else // XM_SSE_INTRINSICS_ + static const XMVECTORU32 g_vMask1 = { { { 1, 1, 1, 1 } } }; + // Move the parms to a vector + __m128i vTemp = _mm_set_epi32(static_cast(C3), static_cast(C2), static_cast(C1), static_cast(C0)); + // Mask off the low bits + vTemp = _mm_and_si128(vTemp, g_vMask1); + // 0xFFFFFFFF on true bits + vTemp = _mm_cmpeq_epi32(vTemp, g_vMask1); + // 0xFFFFFFFF -> 1.0f, 0x00000000 -> 0.0f + vTemp = _mm_and_si128(vTemp, g_XMOne); + return _mm_castsi128_ps(vTemp); +#endif + } + + //------------------------------------------------------------------------------ + + inline XMVECTOR XM_CALLCONV XMVectorSplatConstant(int32_t IntConstant, uint32_t DivExponent) noexcept + { + assert(IntConstant >= -16 && IntConstant <= 15); + assert(DivExponent < 32); +#if defined(_XM_NO_INTRINSICS_) + + using DirectX::XMConvertVectorIntToFloat; + + XMVECTORI32 V = { { { IntConstant, IntConstant, IntConstant, IntConstant } } }; + return XMConvertVectorIntToFloat(V.v, DivExponent); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Splat the int + int32x4_t vScale = vdupq_n_s32(IntConstant); + // Convert to a float + XMVECTOR vResult = vcvtq_f32_s32(vScale); + // Convert DivExponent into 1.0f/(1<(&vScale)[0]); + return vResult; +#else // XM_SSE_INTRINSICS_ + // Splat the int + __m128i vScale = _mm_set1_epi32(IntConstant); + // Convert to a float + XMVECTOR vResult = _mm_cvtepi32_ps(vScale); + // Convert DivExponent into 1.0f/(1<(uScale)); + // Multiply by the reciprocal (Perform a right shift by DivExponent) + vResult = _mm_mul_ps(vResult, _mm_castsi128_ps(vScale)); + return vResult; +#endif + } + + //------------------------------------------------------------------------------ + + inline XMVECTOR XM_CALLCONV XMVectorSplatConstantInt(int32_t IntConstant) noexcept + { + assert(IntConstant >= -16 && IntConstant <= 15); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORI32 V = { { { IntConstant, IntConstant, IntConstant, IntConstant } } }; + return V.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + int32x4_t V = vdupq_n_s32(IntConstant); + return reinterpret_cast(&V)[0]; +#else // XM_SSE_INTRINSICS_ + __m128i V = _mm_set1_epi32(IntConstant); + return _mm_castsi128_ps(V); +#endif + } + +#include "DirectXMathConvert.inl" +#include "DirectXMathVector.inl" +#include "DirectXMathMatrix.inl" +#include "DirectXMathMisc.inl" + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +} // namespace DirectX + diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXMathConvert.inl b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXMathConvert.inl new file mode 100644 index 0000000..3ca86d5 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXMathConvert.inl @@ -0,0 +1,2191 @@ +//------------------------------------------------------------------------------------- +// DirectXMathConvert.inl -- SIMD C++ Math library +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +// +// http://go.microsoft.com/fwlink/?LinkID=615560 +//------------------------------------------------------------------------------------- + +#pragma once + +/**************************************************************************** + * + * Data conversion + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4701) +// C4701: false positives +#endif + +inline XMVECTOR XM_CALLCONV XMConvertVectorIntToFloat +( + FXMVECTOR VInt, + uint32_t DivExponent +) noexcept +{ + assert(DivExponent < 32); +#if defined(_XM_NO_INTRINSICS_) + float fScale = 1.0f / static_cast(1U << DivExponent); + uint32_t ElementIndex = 0; + XMVECTOR Result; + do { + auto iTemp = static_cast(VInt.vector4_u32[ElementIndex]); + Result.vector4_f32[ElementIndex] = static_cast(iTemp)* fScale; + } while (++ElementIndex < 4); + return Result; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float fScale = 1.0f / static_cast(1U << DivExponent); + float32x4_t vResult = vcvtq_f32_s32(vreinterpretq_s32_f32(VInt)); + return vmulq_n_f32(vResult, fScale); +#else // _XM_SSE_INTRINSICS_ + // Convert to floats + XMVECTOR vResult = _mm_cvtepi32_ps(_mm_castps_si128(VInt)); + // Convert DivExponent into 1.0f/(1<(uScale)); + vResult = _mm_mul_ps(vResult, _mm_castsi128_ps(vScale)); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMConvertVectorFloatToInt +( + FXMVECTOR VFloat, + uint32_t MulExponent +) noexcept +{ + assert(MulExponent < 32); +#if defined(_XM_NO_INTRINSICS_) + // Get the scalar factor. + auto fScale = static_cast(1U << MulExponent); + uint32_t ElementIndex = 0; + XMVECTOR Result; + do { + int32_t iResult; + float fTemp = VFloat.vector4_f32[ElementIndex] * fScale; + if (fTemp <= -(65536.0f * 32768.0f)) + { + iResult = (-0x7FFFFFFF) - 1; + } + else if (fTemp > (65536.0f * 32768.0f) - 128.0f) + { + iResult = 0x7FFFFFFF; + } + else { + iResult = static_cast(fTemp); + } + Result.vector4_u32[ElementIndex] = static_cast(iResult); + } while (++ElementIndex < 4); + return Result; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t vResult = vmulq_n_f32(VFloat, static_cast(1U << MulExponent)); + // In case of positive overflow, detect it + uint32x4_t vOverflow = vcgtq_f32(vResult, g_XMMaxInt); + // Float to int conversion + int32x4_t vResulti = vcvtq_s32_f32(vResult); + // If there was positive overflow, set to 0x7FFFFFFF + vResult = vreinterpretq_f32_u32(vandq_u32(vOverflow, g_XMAbsMask)); + vOverflow = vbicq_u32(vreinterpretq_u32_s32(vResulti), vOverflow); + vOverflow = vorrq_u32(vOverflow, vreinterpretq_u32_f32(vResult)); + return vreinterpretq_f32_u32(vOverflow); +#else // _XM_SSE_INTRINSICS_ + XMVECTOR vResult = _mm_set_ps1(static_cast(1U << MulExponent)); + vResult = _mm_mul_ps(vResult, VFloat); + // In case of positive overflow, detect it + XMVECTOR vOverflow = _mm_cmpgt_ps(vResult, g_XMMaxInt); + // Float to int conversion + __m128i vResulti = _mm_cvttps_epi32(vResult); + // If there was positive overflow, set to 0x7FFFFFFF + vResult = _mm_and_ps(vOverflow, g_XMAbsMask); + vOverflow = _mm_andnot_ps(vOverflow, _mm_castsi128_ps(vResulti)); + vOverflow = _mm_or_ps(vOverflow, vResult); + return vOverflow; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMConvertVectorUIntToFloat +( + FXMVECTOR VUInt, + uint32_t DivExponent +) noexcept +{ + assert(DivExponent < 32); +#if defined(_XM_NO_INTRINSICS_) + float fScale = 1.0f / static_cast(1U << DivExponent); + uint32_t ElementIndex = 0; + XMVECTOR Result; + do { + Result.vector4_f32[ElementIndex] = static_cast(VUInt.vector4_u32[ElementIndex])* fScale; + } while (++ElementIndex < 4); + return Result; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float fScale = 1.0f / static_cast(1U << DivExponent); + float32x4_t vResult = vcvtq_f32_u32(vreinterpretq_u32_f32(VUInt)); + return vmulq_n_f32(vResult, fScale); +#else // _XM_SSE_INTRINSICS_ + // For the values that are higher than 0x7FFFFFFF, a fixup is needed + // Determine which ones need the fix. + XMVECTOR vMask = _mm_and_ps(VUInt, g_XMNegativeZero); + // Force all values positive + XMVECTOR vResult = _mm_xor_ps(VUInt, vMask); + // Convert to floats + vResult = _mm_cvtepi32_ps(_mm_castps_si128(vResult)); + // Convert 0x80000000 -> 0xFFFFFFFF + __m128i iMask = _mm_srai_epi32(_mm_castps_si128(vMask), 31); + // For only the ones that are too big, add the fixup + vMask = _mm_and_ps(_mm_castsi128_ps(iMask), g_XMFixUnsigned); + vResult = _mm_add_ps(vResult, vMask); + // Convert DivExponent into 1.0f/(1<(uScale)); + vResult = _mm_mul_ps(vResult, _mm_castsi128_ps(iMask)); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMConvertVectorFloatToUInt +( + FXMVECTOR VFloat, + uint32_t MulExponent +) noexcept +{ + assert(MulExponent < 32); +#if defined(_XM_NO_INTRINSICS_) + // Get the scalar factor. + auto fScale = static_cast(1U << MulExponent); + uint32_t ElementIndex = 0; + XMVECTOR Result; + do { + uint32_t uResult; + float fTemp = VFloat.vector4_f32[ElementIndex] * fScale; + if (fTemp <= 0.0f) + { + uResult = 0; + } + else if (fTemp >= (65536.0f * 65536.0f)) + { + uResult = 0xFFFFFFFFU; + } + else { + uResult = static_cast(fTemp); + } + Result.vector4_u32[ElementIndex] = uResult; + } while (++ElementIndex < 4); + return Result; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t vResult = vmulq_n_f32(VFloat, static_cast(1U << MulExponent)); + // In case of overflow, detect it + uint32x4_t vOverflow = vcgtq_f32(vResult, g_XMMaxUInt); + // Float to int conversion + uint32x4_t vResulti = vcvtq_u32_f32(vResult); + // If there was overflow, set to 0xFFFFFFFFU + vResult = vreinterpretq_f32_u32(vbicq_u32(vResulti, vOverflow)); + vOverflow = vorrq_u32(vOverflow, vreinterpretq_u32_f32(vResult)); + return vreinterpretq_f32_u32(vOverflow); +#else // _XM_SSE_INTRINSICS_ + XMVECTOR vResult = _mm_set_ps1(static_cast(1U << MulExponent)); + vResult = _mm_mul_ps(vResult, VFloat); + // Clamp to >=0 + vResult = _mm_max_ps(vResult, g_XMZero); + // Any numbers that are too big, set to 0xFFFFFFFFU + XMVECTOR vOverflow = _mm_cmpgt_ps(vResult, g_XMMaxUInt); + XMVECTOR vValue = g_XMUnsignedFix; + // Too large for a signed integer? + XMVECTOR vMask = _mm_cmpge_ps(vResult, vValue); + // Zero for number's lower than 0x80000000, 32768.0f*65536.0f otherwise + vValue = _mm_and_ps(vValue, vMask); + // Perform fixup only on numbers too large (Keeps low bit precision) + vResult = _mm_sub_ps(vResult, vValue); + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Convert from signed to unsigned pnly if greater than 0x80000000 + vMask = _mm_and_ps(vMask, g_XMNegativeZero); + vResult = _mm_xor_ps(_mm_castsi128_ps(vResulti), vMask); + // On those that are too large, set to 0xFFFFFFFF + vResult = _mm_or_ps(vResult, vOverflow); + return vResult; +#endif +} + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +/**************************************************************************** + * + * Vector and matrix load operations + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadInt(const uint32_t* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_u32[0] = *pSource; + V.vector4_u32[1] = 0; + V.vector4_u32[2] = 0; + V.vector4_u32[3] = 0; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t zero = vdupq_n_u32(0); + return vreinterpretq_f32_u32(vld1q_lane_u32(pSource, zero, 0)); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_load_ss(reinterpret_cast(pSource)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadFloat(const float* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_f32[0] = *pSource; + V.vector4_f32[1] = 0.f; + V.vector4_f32[2] = 0.f; + V.vector4_f32[3] = 0.f; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t zero = vdupq_n_f32(0); + return vld1q_lane_f32(pSource, zero, 0); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_load_ss(pSource); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadInt2(const uint32_t* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_u32[0] = pSource[0]; + V.vector4_u32[1] = pSource[1]; + V.vector4_u32[2] = 0; + V.vector4_u32[3] = 0; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t x = vld1_u32(pSource); + uint32x2_t zero = vdup_n_u32(0); + return vreinterpretq_f32_u32(vcombine_u32(x, zero)); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadInt2A(const uint32_t* pSource) noexcept +{ + assert(pSource); + assert((reinterpret_cast(pSource) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_u32[0] = pSource[0]; + V.vector4_u32[1] = pSource[1]; + V.vector4_u32[2] = 0; + V.vector4_u32[3] = 0; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + uint32x2_t x = vld1_u32_ex(pSource, 64); +#else + uint32x2_t x = vld1_u32(pSource); +#endif + uint32x2_t zero = vdup_n_u32(0); + return vreinterpretq_f32_u32(vcombine_u32(x, zero)); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadFloat2(const XMFLOAT2* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_f32[0] = pSource->x; + V.vector4_f32[1] = pSource->y; + V.vector4_f32[2] = 0.f; + V.vector4_f32[3] = 0.f; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t x = vld1_f32(reinterpret_cast(pSource)); + float32x2_t zero = vdup_n_f32(0); + return vcombine_f32(x, zero); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadFloat2A(const XMFLOAT2A* pSource) noexcept +{ + assert(pSource); + assert((reinterpret_cast(pSource) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_f32[0] = pSource->x; + V.vector4_f32[1] = pSource->y; + V.vector4_f32[2] = 0.f; + V.vector4_f32[3] = 0.f; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + float32x2_t x = vld1_f32_ex(reinterpret_cast(pSource), 64); +#else + float32x2_t x = vld1_f32(reinterpret_cast(pSource)); +#endif + float32x2_t zero = vdup_n_f32(0); + return vcombine_f32(x, zero); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadSInt2(const XMINT2* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_f32[0] = static_cast(pSource->x); + V.vector4_f32[1] = static_cast(pSource->y); + V.vector4_f32[2] = 0.f; + V.vector4_f32[3] = 0.f; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + int32x2_t x = vld1_s32(reinterpret_cast(pSource)); + float32x2_t v = vcvt_f32_s32(x); + float32x2_t zero = vdup_n_f32(0); + return vcombine_f32(v, zero); +#elif defined(_XM_SSE_INTRINSICS_) + __m128 V = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); + return _mm_cvtepi32_ps(_mm_castps_si128(V)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUInt2(const XMUINT2* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_f32[0] = static_cast(pSource->x); + V.vector4_f32[1] = static_cast(pSource->y); + V.vector4_f32[2] = 0.f; + V.vector4_f32[3] = 0.f; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t x = vld1_u32(reinterpret_cast(pSource)); + float32x2_t v = vcvt_f32_u32(x); + float32x2_t zero = vdup_n_f32(0); + return vcombine_f32(v, zero); +#elif defined(_XM_SSE_INTRINSICS_) + __m128 V = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); + // For the values that are higher than 0x7FFFFFFF, a fixup is needed + // Determine which ones need the fix. + XMVECTOR vMask = _mm_and_ps(V, g_XMNegativeZero); + // Force all values positive + XMVECTOR vResult = _mm_xor_ps(V, vMask); + // Convert to floats + vResult = _mm_cvtepi32_ps(_mm_castps_si128(vResult)); + // Convert 0x80000000 -> 0xFFFFFFFF + __m128i iMask = _mm_srai_epi32(_mm_castps_si128(vMask), 31); + // For only the ones that are too big, add the fixup + vMask = _mm_and_ps(_mm_castsi128_ps(iMask), g_XMFixUnsigned); + vResult = _mm_add_ps(vResult, vMask); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadInt3(const uint32_t* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_u32[0] = pSource[0]; + V.vector4_u32[1] = pSource[1]; + V.vector4_u32[2] = pSource[2]; + V.vector4_u32[3] = 0; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t x = vld1_u32(pSource); + uint32x2_t zero = vdup_n_u32(0); + uint32x2_t y = vld1_lane_u32(pSource + 2, zero, 0); + return vreinterpretq_f32_u32(vcombine_u32(x, y)); +#elif defined(_XM_SSE4_INTRINSICS_) + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); + __m128 z = _mm_load_ss(reinterpret_cast(pSource + 2)); + return _mm_insert_ps(xy, z, 0x20); +#elif defined(_XM_SSE_INTRINSICS_) + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); + __m128 z = _mm_load_ss(reinterpret_cast(pSource + 2)); + return _mm_movelh_ps(xy, z); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadInt3A(const uint32_t* pSource) noexcept +{ + assert(pSource); + assert((reinterpret_cast(pSource) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_u32[0] = pSource[0]; + V.vector4_u32[1] = pSource[1]; + V.vector4_u32[2] = pSource[2]; + V.vector4_u32[3] = 0; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Reads an extra integer which is zero'd +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + uint32x4_t V = vld1q_u32_ex(pSource, 128); +#else + uint32x4_t V = vld1q_u32(pSource); +#endif + return vreinterpretq_f32_u32(vsetq_lane_u32(0, V, 3)); +#elif defined(_XM_SSE4_INTRINSICS_) + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); + __m128 z = _mm_load_ss(reinterpret_cast(pSource + 2)); + return _mm_insert_ps(xy, z, 0x20); +#elif defined(_XM_SSE_INTRINSICS_) + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); + __m128 z = _mm_load_ss(reinterpret_cast(pSource + 2)); + return _mm_movelh_ps(xy, z); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadFloat3(const XMFLOAT3* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_f32[0] = pSource->x; + V.vector4_f32[1] = pSource->y; + V.vector4_f32[2] = pSource->z; + V.vector4_f32[3] = 0.f; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t x = vld1_f32(reinterpret_cast(pSource)); + float32x2_t zero = vdup_n_f32(0); + float32x2_t y = vld1_lane_f32(reinterpret_cast(pSource) + 2, zero, 0); + return vcombine_f32(x, y); +#elif defined(_XM_SSE4_INTRINSICS_) + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); + __m128 z = _mm_load_ss(&pSource->z); + return _mm_insert_ps(xy, z, 0x20); +#elif defined(_XM_SSE_INTRINSICS_) + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); + __m128 z = _mm_load_ss(&pSource->z); + return _mm_movelh_ps(xy, z); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadFloat3A(const XMFLOAT3A* pSource) noexcept +{ + assert(pSource); + assert((reinterpret_cast(pSource) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_f32[0] = pSource->x; + V.vector4_f32[1] = pSource->y; + V.vector4_f32[2] = pSource->z; + V.vector4_f32[3] = 0.f; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Reads an extra float which is zero'd +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + float32x4_t V = vld1q_f32_ex(reinterpret_cast(pSource), 128); +#else + float32x4_t V = vld1q_f32(reinterpret_cast(pSource)); +#endif + return vsetq_lane_f32(0, V, 3); +#elif defined(_XM_SSE_INTRINSICS_) + // Reads an extra float which is zero'd + __m128 V = _mm_load_ps(&pSource->x); + return _mm_and_ps(V, g_XMMask3); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadSInt3(const XMINT3* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + V.vector4_f32[0] = static_cast(pSource->x); + V.vector4_f32[1] = static_cast(pSource->y); + V.vector4_f32[2] = static_cast(pSource->z); + V.vector4_f32[3] = 0.f; + return V; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + int32x2_t x = vld1_s32(reinterpret_cast(pSource)); + int32x2_t zero = vdup_n_s32(0); + int32x2_t y = vld1_lane_s32(reinterpret_cast(pSource) + 2, zero, 0); + int32x4_t v = vcombine_s32(x, y); + return vcvtq_f32_s32(v); +#elif defined(_XM_SSE_INTRINSICS_) + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); + __m128 z = _mm_load_ss(reinterpret_cast(&pSource->z)); + __m128 V = _mm_movelh_ps(xy, z); + return _mm_cvtepi32_ps(_mm_castps_si128(V)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUInt3(const XMUINT3* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_f32[0] = static_cast(pSource->x); + V.vector4_f32[1] = static_cast(pSource->y); + V.vector4_f32[2] = static_cast(pSource->z); + V.vector4_f32[3] = 0.f; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t x = vld1_u32(reinterpret_cast(pSource)); + uint32x2_t zero = vdup_n_u32(0); + uint32x2_t y = vld1_lane_u32(reinterpret_cast(pSource) + 2, zero, 0); + uint32x4_t v = vcombine_u32(x, y); + return vcvtq_f32_u32(v); +#elif defined(_XM_SSE_INTRINSICS_) + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); + __m128 z = _mm_load_ss(reinterpret_cast(&pSource->z)); + __m128 V = _mm_movelh_ps(xy, z); + // For the values that are higher than 0x7FFFFFFF, a fixup is needed + // Determine which ones need the fix. + XMVECTOR vMask = _mm_and_ps(V, g_XMNegativeZero); + // Force all values positive + XMVECTOR vResult = _mm_xor_ps(V, vMask); + // Convert to floats + vResult = _mm_cvtepi32_ps(_mm_castps_si128(vResult)); + // Convert 0x80000000 -> 0xFFFFFFFF + __m128i iMask = _mm_srai_epi32(_mm_castps_si128(vMask), 31); + // For only the ones that are too big, add the fixup + vMask = _mm_and_ps(_mm_castsi128_ps(iMask), g_XMFixUnsigned); + vResult = _mm_add_ps(vResult, vMask); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadInt4(const uint32_t* pSource) noexcept +{ + assert(pSource); + +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_u32[0] = pSource[0]; + V.vector4_u32[1] = pSource[1]; + V.vector4_u32[2] = pSource[2]; + V.vector4_u32[3] = pSource[3]; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vld1q_u32(pSource)); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_loadu_si128(reinterpret_cast(pSource)); + return _mm_castsi128_ps(V); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadInt4A(const uint32_t* pSource) noexcept +{ + assert(pSource); + assert((reinterpret_cast(pSource) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_u32[0] = pSource[0]; + V.vector4_u32[1] = pSource[1]; + V.vector4_u32[2] = pSource[2]; + V.vector4_u32[3] = pSource[3]; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + return vld1q_u32_ex(pSource, 128); +#else + return vreinterpretq_f32_u32(vld1q_u32(pSource)); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_load_si128(reinterpret_cast(pSource)); + return _mm_castsi128_ps(V); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadFloat4(const XMFLOAT4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_f32[0] = pSource->x; + V.vector4_f32[1] = pSource->y; + V.vector4_f32[2] = pSource->z; + V.vector4_f32[3] = pSource->w; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vld1q_f32(reinterpret_cast(pSource)); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_loadu_ps(&pSource->x); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadFloat4A(const XMFLOAT4A* pSource) noexcept +{ + assert(pSource); + assert((reinterpret_cast(pSource) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_f32[0] = pSource->x; + V.vector4_f32[1] = pSource->y; + V.vector4_f32[2] = pSource->z; + V.vector4_f32[3] = pSource->w; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + return vld1q_f32_ex(reinterpret_cast(pSource), 128); +#else + return vld1q_f32(reinterpret_cast(pSource)); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_load_ps(&pSource->x); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadSInt4(const XMINT4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + V.vector4_f32[0] = static_cast(pSource->x); + V.vector4_f32[1] = static_cast(pSource->y); + V.vector4_f32[2] = static_cast(pSource->z); + V.vector4_f32[3] = static_cast(pSource->w); + return V; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + int32x4_t v = vld1q_s32(reinterpret_cast(pSource)); + return vcvtq_f32_s32(v); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_loadu_si128(reinterpret_cast(pSource)); + return _mm_cvtepi32_ps(V); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUInt4(const XMUINT4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_f32[0] = static_cast(pSource->x); + V.vector4_f32[1] = static_cast(pSource->y); + V.vector4_f32[2] = static_cast(pSource->z); + V.vector4_f32[3] = static_cast(pSource->w); + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t v = vld1q_u32(reinterpret_cast(pSource)); + return vcvtq_f32_u32(v); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_loadu_si128(reinterpret_cast(pSource)); + // For the values that are higher than 0x7FFFFFFF, a fixup is needed + // Determine which ones need the fix. + XMVECTOR vMask = _mm_and_ps(_mm_castsi128_ps(V), g_XMNegativeZero); + // Force all values positive + XMVECTOR vResult = _mm_xor_ps(_mm_castsi128_ps(V), vMask); + // Convert to floats + vResult = _mm_cvtepi32_ps(_mm_castps_si128(vResult)); + // Convert 0x80000000 -> 0xFFFFFFFF + __m128i iMask = _mm_srai_epi32(_mm_castps_si128(vMask), 31); + // For only the ones that are too big, add the fixup + vMask = _mm_and_ps(_mm_castsi128_ps(iMask), g_XMFixUnsigned); + vResult = _mm_add_ps(vResult, vMask); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMMATRIX XM_CALLCONV XMLoadFloat3x3(const XMFLOAT3X3* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + M.r[0].vector4_f32[0] = pSource->m[0][0]; + M.r[0].vector4_f32[1] = pSource->m[0][1]; + M.r[0].vector4_f32[2] = pSource->m[0][2]; + M.r[0].vector4_f32[3] = 0.0f; + + M.r[1].vector4_f32[0] = pSource->m[1][0]; + M.r[1].vector4_f32[1] = pSource->m[1][1]; + M.r[1].vector4_f32[2] = pSource->m[1][2]; + M.r[1].vector4_f32[3] = 0.0f; + + M.r[2].vector4_f32[0] = pSource->m[2][0]; + M.r[2].vector4_f32[1] = pSource->m[2][1]; + M.r[2].vector4_f32[2] = pSource->m[2][2]; + M.r[2].vector4_f32[3] = 0.0f; + M.r[3].vector4_f32[0] = 0.0f; + M.r[3].vector4_f32[1] = 0.0f; + M.r[3].vector4_f32[2] = 0.0f; + M.r[3].vector4_f32[3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t v0 = vld1q_f32(&pSource->m[0][0]); + float32x4_t v1 = vld1q_f32(&pSource->m[1][1]); + float32x2_t v2 = vcreate_f32(static_cast(*reinterpret_cast(&pSource->m[2][2]))); + float32x4_t T = vextq_f32(v0, v1, 3); + + XMMATRIX M; + M.r[0] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(v0), g_XMMask3)); + M.r[1] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T), g_XMMask3)); + M.r[2] = vcombine_f32(vget_high_f32(v1), v2); + M.r[3] = g_XMIdentityR3; + return M; +#elif defined(_XM_SSE_INTRINSICS_) + __m128 Z = _mm_setzero_ps(); + + __m128 V1 = _mm_loadu_ps(&pSource->m[0][0]); + __m128 V2 = _mm_loadu_ps(&pSource->m[1][1]); + __m128 V3 = _mm_load_ss(&pSource->m[2][2]); + + __m128 T1 = _mm_unpackhi_ps(V1, Z); + __m128 T2 = _mm_unpacklo_ps(V2, Z); + __m128 T3 = _mm_shuffle_ps(V3, T2, _MM_SHUFFLE(0, 1, 0, 0)); + __m128 T4 = _mm_movehl_ps(T2, T3); + __m128 T5 = _mm_movehl_ps(Z, T1); + + XMMATRIX M; + M.r[0] = _mm_movelh_ps(V1, T1); + M.r[1] = _mm_add_ps(T4, T5); + M.r[2] = _mm_shuffle_ps(V2, V3, _MM_SHUFFLE(1, 0, 3, 2)); + M.r[3] = g_XMIdentityR3; + return M; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMMATRIX XM_CALLCONV XMLoadFloat4x3(const XMFLOAT4X3* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + M.r[0].vector4_f32[0] = pSource->m[0][0]; + M.r[0].vector4_f32[1] = pSource->m[0][1]; + M.r[0].vector4_f32[2] = pSource->m[0][2]; + M.r[0].vector4_f32[3] = 0.0f; + + M.r[1].vector4_f32[0] = pSource->m[1][0]; + M.r[1].vector4_f32[1] = pSource->m[1][1]; + M.r[1].vector4_f32[2] = pSource->m[1][2]; + M.r[1].vector4_f32[3] = 0.0f; + + M.r[2].vector4_f32[0] = pSource->m[2][0]; + M.r[2].vector4_f32[1] = pSource->m[2][1]; + M.r[2].vector4_f32[2] = pSource->m[2][2]; + M.r[2].vector4_f32[3] = 0.0f; + + M.r[3].vector4_f32[0] = pSource->m[3][0]; + M.r[3].vector4_f32[1] = pSource->m[3][1]; + M.r[3].vector4_f32[2] = pSource->m[3][2]; + M.r[3].vector4_f32[3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t v0 = vld1q_f32(&pSource->m[0][0]); + float32x4_t v1 = vld1q_f32(&pSource->m[1][1]); + float32x4_t v2 = vld1q_f32(&pSource->m[2][2]); + + float32x4_t T1 = vextq_f32(v0, v1, 3); + float32x4_t T2 = vcombine_f32(vget_high_f32(v1), vget_low_f32(v2)); + float32x4_t T3 = vextq_f32(v2, v2, 1); + + XMMATRIX M; + M.r[0] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(v0), g_XMMask3)); + M.r[1] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T1), g_XMMask3)); + M.r[2] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T2), g_XMMask3)); + M.r[3] = vsetq_lane_f32(1.f, T3, 3); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + // Use unaligned load instructions to + // load the 12 floats + // vTemp1 = x1,y1,z1,x2 + XMVECTOR vTemp1 = _mm_loadu_ps(&pSource->m[0][0]); + // vTemp2 = y2,z2,x3,y3 + XMVECTOR vTemp2 = _mm_loadu_ps(&pSource->m[1][1]); + // vTemp4 = z3,x4,y4,z4 + XMVECTOR vTemp4 = _mm_loadu_ps(&pSource->m[2][2]); + // vTemp3 = x3,y3,z3,z3 + XMVECTOR vTemp3 = _mm_shuffle_ps(vTemp2, vTemp4, _MM_SHUFFLE(0, 0, 3, 2)); + // vTemp2 = y2,z2,x2,x2 + vTemp2 = _mm_shuffle_ps(vTemp2, vTemp1, _MM_SHUFFLE(3, 3, 1, 0)); + // vTemp2 = x2,y2,z2,z2 + vTemp2 = XM_PERMUTE_PS(vTemp2, _MM_SHUFFLE(1, 1, 0, 2)); + // vTemp1 = x1,y1,z1,0 + vTemp1 = _mm_and_ps(vTemp1, g_XMMask3); + // vTemp2 = x2,y2,z2,0 + vTemp2 = _mm_and_ps(vTemp2, g_XMMask3); + // vTemp3 = x3,y3,z3,0 + vTemp3 = _mm_and_ps(vTemp3, g_XMMask3); + // vTemp4i = x4,y4,z4,0 + __m128i vTemp4i = _mm_srli_si128(_mm_castps_si128(vTemp4), 32 / 8); + // vTemp4i = x4,y4,z4,1.0f + vTemp4i = _mm_or_si128(vTemp4i, g_XMIdentityR3); + XMMATRIX M(vTemp1, + vTemp2, + vTemp3, + _mm_castsi128_ps(vTemp4i)); + return M; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMMATRIX XM_CALLCONV XMLoadFloat4x3A(const XMFLOAT4X3A* pSource) noexcept +{ + assert(pSource); + assert((reinterpret_cast(pSource) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + M.r[0].vector4_f32[0] = pSource->m[0][0]; + M.r[0].vector4_f32[1] = pSource->m[0][1]; + M.r[0].vector4_f32[2] = pSource->m[0][2]; + M.r[0].vector4_f32[3] = 0.0f; + + M.r[1].vector4_f32[0] = pSource->m[1][0]; + M.r[1].vector4_f32[1] = pSource->m[1][1]; + M.r[1].vector4_f32[2] = pSource->m[1][2]; + M.r[1].vector4_f32[3] = 0.0f; + + M.r[2].vector4_f32[0] = pSource->m[2][0]; + M.r[2].vector4_f32[1] = pSource->m[2][1]; + M.r[2].vector4_f32[2] = pSource->m[2][2]; + M.r[2].vector4_f32[3] = 0.0f; + + M.r[3].vector4_f32[0] = pSource->m[3][0]; + M.r[3].vector4_f32[1] = pSource->m[3][1]; + M.r[3].vector4_f32[2] = pSource->m[3][2]; + M.r[3].vector4_f32[3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + float32x4_t v0 = vld1q_f32_ex(&pSource->m[0][0], 128); + float32x4_t v1 = vld1q_f32_ex(&pSource->m[1][1], 128); + float32x4_t v2 = vld1q_f32_ex(&pSource->m[2][2], 128); +#else + float32x4_t v0 = vld1q_f32(&pSource->m[0][0]); + float32x4_t v1 = vld1q_f32(&pSource->m[1][1]); + float32x4_t v2 = vld1q_f32(&pSource->m[2][2]); +#endif + + float32x4_t T1 = vextq_f32(v0, v1, 3); + float32x4_t T2 = vcombine_f32(vget_high_f32(v1), vget_low_f32(v2)); + float32x4_t T3 = vextq_f32(v2, v2, 1); + + XMMATRIX M; + M.r[0] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(v0), g_XMMask3)); + M.r[1] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T1), g_XMMask3)); + M.r[2] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T2), g_XMMask3)); + M.r[3] = vsetq_lane_f32(1.f, T3, 3); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + // Use aligned load instructions to + // load the 12 floats + // vTemp1 = x1,y1,z1,x2 + XMVECTOR vTemp1 = _mm_load_ps(&pSource->m[0][0]); + // vTemp2 = y2,z2,x3,y3 + XMVECTOR vTemp2 = _mm_load_ps(&pSource->m[1][1]); + // vTemp4 = z3,x4,y4,z4 + XMVECTOR vTemp4 = _mm_load_ps(&pSource->m[2][2]); + // vTemp3 = x3,y3,z3,z3 + XMVECTOR vTemp3 = _mm_shuffle_ps(vTemp2, vTemp4, _MM_SHUFFLE(0, 0, 3, 2)); + // vTemp2 = y2,z2,x2,x2 + vTemp2 = _mm_shuffle_ps(vTemp2, vTemp1, _MM_SHUFFLE(3, 3, 1, 0)); + // vTemp2 = x2,y2,z2,z2 + vTemp2 = XM_PERMUTE_PS(vTemp2, _MM_SHUFFLE(1, 1, 0, 2)); + // vTemp1 = x1,y1,z1,0 + vTemp1 = _mm_and_ps(vTemp1, g_XMMask3); + // vTemp2 = x2,y2,z2,0 + vTemp2 = _mm_and_ps(vTemp2, g_XMMask3); + // vTemp3 = x3,y3,z3,0 + vTemp3 = _mm_and_ps(vTemp3, g_XMMask3); + // vTemp4i = x4,y4,z4,0 + __m128i vTemp4i = _mm_srli_si128(_mm_castps_si128(vTemp4), 32 / 8); + // vTemp4i = x4,y4,z4,1.0f + vTemp4i = _mm_or_si128(vTemp4i, g_XMIdentityR3); + XMMATRIX M(vTemp1, + vTemp2, + vTemp3, + _mm_castsi128_ps(vTemp4i)); + return M; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMMATRIX XM_CALLCONV XMLoadFloat3x4(const XMFLOAT3X4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + M.r[0].vector4_f32[0] = pSource->m[0][0]; + M.r[0].vector4_f32[1] = pSource->m[1][0]; + M.r[0].vector4_f32[2] = pSource->m[2][0]; + M.r[0].vector4_f32[3] = 0.0f; + + M.r[1].vector4_f32[0] = pSource->m[0][1]; + M.r[1].vector4_f32[1] = pSource->m[1][1]; + M.r[1].vector4_f32[2] = pSource->m[2][1]; + M.r[1].vector4_f32[3] = 0.0f; + + M.r[2].vector4_f32[0] = pSource->m[0][2]; + M.r[2].vector4_f32[1] = pSource->m[1][2]; + M.r[2].vector4_f32[2] = pSource->m[2][2]; + M.r[2].vector4_f32[3] = 0.0f; + + M.r[3].vector4_f32[0] = pSource->m[0][3]; + M.r[3].vector4_f32[1] = pSource->m[1][3]; + M.r[3].vector4_f32[2] = pSource->m[2][3]; + M.r[3].vector4_f32[3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2x4_t vTemp0 = vld4_f32(&pSource->_11); + float32x4_t vTemp1 = vld1q_f32(&pSource->_31); + + float32x2_t l = vget_low_f32(vTemp1); + float32x4_t T0 = vcombine_f32(vTemp0.val[0], l); + float32x2_t rl = vrev64_f32(l); + float32x4_t T1 = vcombine_f32(vTemp0.val[1], rl); + + float32x2_t h = vget_high_f32(vTemp1); + float32x4_t T2 = vcombine_f32(vTemp0.val[2], h); + float32x2_t rh = vrev64_f32(h); + float32x4_t T3 = vcombine_f32(vTemp0.val[3], rh); + + XMMATRIX M = {}; + M.r[0] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T0), g_XMMask3)); + M.r[1] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T1), g_XMMask3)); + M.r[2] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T2), g_XMMask3)); + M.r[3] = vsetq_lane_f32(1.f, T3, 3); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + M.r[0] = _mm_loadu_ps(&pSource->_11); + M.r[1] = _mm_loadu_ps(&pSource->_21); + M.r[2] = _mm_loadu_ps(&pSource->_31); + M.r[3] = g_XMIdentityR3; + + // x.x,x.y,y.x,y.y + XMVECTOR vTemp1 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(1, 0, 1, 0)); + // x.z,x.w,y.z,y.w + XMVECTOR vTemp3 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(3, 2, 3, 2)); + // z.x,z.y,w.x,w.y + XMVECTOR vTemp2 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(1, 0, 1, 0)); + // z.z,z.w,w.z,w.w + XMVECTOR vTemp4 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(3, 2, 3, 2)); + XMMATRIX mResult; + + // x.x,y.x,z.x,w.x + mResult.r[0] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(2, 0, 2, 0)); + // x.y,y.y,z.y,w.y + mResult.r[1] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(3, 1, 3, 1)); + // x.z,y.z,z.z,w.z + mResult.r[2] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 0, 2, 0)); + // x.w,y.w,z.w,w.w + mResult.r[3] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(3, 1, 3, 1)); + return mResult; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMMATRIX XM_CALLCONV XMLoadFloat3x4A(const XMFLOAT3X4A* pSource) noexcept +{ + assert(pSource); + assert((reinterpret_cast(pSource) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + M.r[0].vector4_f32[0] = pSource->m[0][0]; + M.r[0].vector4_f32[1] = pSource->m[1][0]; + M.r[0].vector4_f32[2] = pSource->m[2][0]; + M.r[0].vector4_f32[3] = 0.0f; + + M.r[1].vector4_f32[0] = pSource->m[0][1]; + M.r[1].vector4_f32[1] = pSource->m[1][1]; + M.r[1].vector4_f32[2] = pSource->m[2][1]; + M.r[1].vector4_f32[3] = 0.0f; + + M.r[2].vector4_f32[0] = pSource->m[0][2]; + M.r[2].vector4_f32[1] = pSource->m[1][2]; + M.r[2].vector4_f32[2] = pSource->m[2][2]; + M.r[2].vector4_f32[3] = 0.0f; + + M.r[3].vector4_f32[0] = pSource->m[0][3]; + M.r[3].vector4_f32[1] = pSource->m[1][3]; + M.r[3].vector4_f32[2] = pSource->m[2][3]; + M.r[3].vector4_f32[3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + float32x2x4_t vTemp0 = vld4_f32_ex(&pSource->_11, 128); + float32x4_t vTemp1 = vld1q_f32_ex(&pSource->_31, 128); +#else + float32x2x4_t vTemp0 = vld4_f32(&pSource->_11); + float32x4_t vTemp1 = vld1q_f32(&pSource->_31); +#endif + + float32x2_t l = vget_low_f32(vTemp1); + float32x4_t T0 = vcombine_f32(vTemp0.val[0], l); + float32x2_t rl = vrev64_f32(l); + float32x4_t T1 = vcombine_f32(vTemp0.val[1], rl); + + float32x2_t h = vget_high_f32(vTemp1); + float32x4_t T2 = vcombine_f32(vTemp0.val[2], h); + float32x2_t rh = vrev64_f32(h); + float32x4_t T3 = vcombine_f32(vTemp0.val[3], rh); + + XMMATRIX M = {}; + M.r[0] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T0), g_XMMask3)); + M.r[1] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T1), g_XMMask3)); + M.r[2] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T2), g_XMMask3)); + M.r[3] = vsetq_lane_f32(1.f, T3, 3); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + M.r[0] = _mm_load_ps(&pSource->_11); + M.r[1] = _mm_load_ps(&pSource->_21); + M.r[2] = _mm_load_ps(&pSource->_31); + M.r[3] = g_XMIdentityR3; + + // x.x,x.y,y.x,y.y + XMVECTOR vTemp1 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(1, 0, 1, 0)); + // x.z,x.w,y.z,y.w + XMVECTOR vTemp3 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(3, 2, 3, 2)); + // z.x,z.y,w.x,w.y + XMVECTOR vTemp2 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(1, 0, 1, 0)); + // z.z,z.w,w.z,w.w + XMVECTOR vTemp4 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(3, 2, 3, 2)); + XMMATRIX mResult; + + // x.x,y.x,z.x,w.x + mResult.r[0] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(2, 0, 2, 0)); + // x.y,y.y,z.y,w.y + mResult.r[1] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(3, 1, 3, 1)); + // x.z,y.z,z.z,w.z + mResult.r[2] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 0, 2, 0)); + // x.w,y.w,z.w,w.w + mResult.r[3] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(3, 1, 3, 1)); + return mResult; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMMATRIX XM_CALLCONV XMLoadFloat4x4(const XMFLOAT4X4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + M.r[0].vector4_f32[0] = pSource->m[0][0]; + M.r[0].vector4_f32[1] = pSource->m[0][1]; + M.r[0].vector4_f32[2] = pSource->m[0][2]; + M.r[0].vector4_f32[3] = pSource->m[0][3]; + + M.r[1].vector4_f32[0] = pSource->m[1][0]; + M.r[1].vector4_f32[1] = pSource->m[1][1]; + M.r[1].vector4_f32[2] = pSource->m[1][2]; + M.r[1].vector4_f32[3] = pSource->m[1][3]; + + M.r[2].vector4_f32[0] = pSource->m[2][0]; + M.r[2].vector4_f32[1] = pSource->m[2][1]; + M.r[2].vector4_f32[2] = pSource->m[2][2]; + M.r[2].vector4_f32[3] = pSource->m[2][3]; + + M.r[3].vector4_f32[0] = pSource->m[3][0]; + M.r[3].vector4_f32[1] = pSource->m[3][1]; + M.r[3].vector4_f32[2] = pSource->m[3][2]; + M.r[3].vector4_f32[3] = pSource->m[3][3]; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMMATRIX M; + M.r[0] = vld1q_f32(reinterpret_cast(&pSource->_11)); + M.r[1] = vld1q_f32(reinterpret_cast(&pSource->_21)); + M.r[2] = vld1q_f32(reinterpret_cast(&pSource->_31)); + M.r[3] = vld1q_f32(reinterpret_cast(&pSource->_41)); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + M.r[0] = _mm_loadu_ps(&pSource->_11); + M.r[1] = _mm_loadu_ps(&pSource->_21); + M.r[2] = _mm_loadu_ps(&pSource->_31); + M.r[3] = _mm_loadu_ps(&pSource->_41); + return M; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMMATRIX XM_CALLCONV XMLoadFloat4x4A(const XMFLOAT4X4A* pSource) noexcept +{ + assert(pSource); + assert((reinterpret_cast(pSource) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + M.r[0].vector4_f32[0] = pSource->m[0][0]; + M.r[0].vector4_f32[1] = pSource->m[0][1]; + M.r[0].vector4_f32[2] = pSource->m[0][2]; + M.r[0].vector4_f32[3] = pSource->m[0][3]; + + M.r[1].vector4_f32[0] = pSource->m[1][0]; + M.r[1].vector4_f32[1] = pSource->m[1][1]; + M.r[1].vector4_f32[2] = pSource->m[1][2]; + M.r[1].vector4_f32[3] = pSource->m[1][3]; + + M.r[2].vector4_f32[0] = pSource->m[2][0]; + M.r[2].vector4_f32[1] = pSource->m[2][1]; + M.r[2].vector4_f32[2] = pSource->m[2][2]; + M.r[2].vector4_f32[3] = pSource->m[2][3]; + + M.r[3].vector4_f32[0] = pSource->m[3][0]; + M.r[3].vector4_f32[1] = pSource->m[3][1]; + M.r[3].vector4_f32[2] = pSource->m[3][2]; + M.r[3].vector4_f32[3] = pSource->m[3][3]; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMMATRIX M; +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + M.r[0] = vld1q_f32_ex(reinterpret_cast(&pSource->_11), 128); + M.r[1] = vld1q_f32_ex(reinterpret_cast(&pSource->_21), 128); + M.r[2] = vld1q_f32_ex(reinterpret_cast(&pSource->_31), 128); + M.r[3] = vld1q_f32_ex(reinterpret_cast(&pSource->_41), 128); +#else + M.r[0] = vld1q_f32(reinterpret_cast(&pSource->_11)); + M.r[1] = vld1q_f32(reinterpret_cast(&pSource->_21)); + M.r[2] = vld1q_f32(reinterpret_cast(&pSource->_31)); + M.r[3] = vld1q_f32(reinterpret_cast(&pSource->_41)); +#endif + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + M.r[0] = _mm_load_ps(&pSource->_11); + M.r[1] = _mm_load_ps(&pSource->_21); + M.r[2] = _mm_load_ps(&pSource->_31); + M.r[3] = _mm_load_ps(&pSource->_41); + return M; +#endif +} + +/**************************************************************************** + * + * Vector and matrix store operations + * + ****************************************************************************/ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreInt +( + uint32_t* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + *pDestination = XMVectorGetIntX(V); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + vst1q_lane_u32(pDestination, *reinterpret_cast(&V), 0); +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_ss(reinterpret_cast(pDestination), V); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat +( + float* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + *pDestination = XMVectorGetX(V); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + vst1q_lane_f32(pDestination, V, 0); +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_ss(pDestination, V); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreInt2 +( + uint32_t* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + pDestination[0] = V.vector4_u32[0]; + pDestination[1] = V.vector4_u32[1]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t VL = vget_low_u32(vreinterpretq_u32_f32(V)); + vst1_u32(pDestination, VL); +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreInt2A +( + uint32_t* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + assert((reinterpret_cast(pDestination) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + pDestination[0] = V.vector4_u32[0]; + pDestination[1] = V.vector4_u32[1]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t VL = vget_low_u32(vreinterpretq_u32_f32(V)); +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + vst1_u32_ex(pDestination, VL, 64); +#else + vst1_u32(pDestination, VL); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat2 +( + XMFLOAT2* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + pDestination->x = V.vector4_f32[0]; + pDestination->y = V.vector4_f32[1]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + vst1_f32(reinterpret_cast(pDestination), VL); +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat2A +( + XMFLOAT2A* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + assert((reinterpret_cast(pDestination) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + pDestination->x = V.vector4_f32[0]; + pDestination->y = V.vector4_f32[1]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + vst1_f32_ex(reinterpret_cast(pDestination), VL, 64); +#else + vst1_f32(reinterpret_cast(pDestination), VL); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreSInt2 +( + XMINT2* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + pDestination->x = static_cast(V.vector4_f32[0]); + pDestination->y = static_cast(V.vector4_f32[1]); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t v = vget_low_f32(V); + int32x2_t iv = vcvt_s32_f32(v); + vst1_s32(reinterpret_cast(pDestination), iv); +#elif defined(_XM_SSE_INTRINSICS_) + // In case of positive overflow, detect it + XMVECTOR vOverflow = _mm_cmpgt_ps(V, g_XMMaxInt); + // Float to int conversion + __m128i vResulti = _mm_cvttps_epi32(V); + // If there was positive overflow, set to 0x7FFFFFFF + XMVECTOR vResult = _mm_and_ps(vOverflow, g_XMAbsMask); + vOverflow = _mm_andnot_ps(vOverflow, _mm_castsi128_ps(vResulti)); + vOverflow = _mm_or_ps(vOverflow, vResult); + // Write two ints + _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(vOverflow)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUInt2 +( + XMUINT2* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + pDestination->x = static_cast(V.vector4_f32[0]); + pDestination->y = static_cast(V.vector4_f32[1]); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t v = vget_low_f32(V); + uint32x2_t iv = vcvt_u32_f32(v); + vst1_u32(reinterpret_cast(pDestination), iv); +#elif defined(_XM_SSE_INTRINSICS_) + // Clamp to >=0 + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + // Any numbers that are too big, set to 0xFFFFFFFFU + XMVECTOR vOverflow = _mm_cmpgt_ps(vResult, g_XMMaxUInt); + XMVECTOR vValue = g_XMUnsignedFix; + // Too large for a signed integer? + XMVECTOR vMask = _mm_cmpge_ps(vResult, vValue); + // Zero for number's lower than 0x80000000, 32768.0f*65536.0f otherwise + vValue = _mm_and_ps(vValue, vMask); + // Perform fixup only on numbers too large (Keeps low bit precision) + vResult = _mm_sub_ps(vResult, vValue); + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Convert from signed to unsigned pnly if greater than 0x80000000 + vMask = _mm_and_ps(vMask, g_XMNegativeZero); + vResult = _mm_xor_ps(_mm_castsi128_ps(vResulti), vMask); + // On those that are too large, set to 0xFFFFFFFF + vResult = _mm_or_ps(vResult, vOverflow); + // Write two uints + _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(vResult)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreInt3 +( + uint32_t* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + pDestination[0] = V.vector4_u32[0]; + pDestination[1] = V.vector4_u32[1]; + pDestination[2] = V.vector4_u32[2]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t VL = vget_low_u32(vreinterpretq_u32_f32(V)); + vst1_u32(pDestination, VL); + vst1q_lane_u32(pDestination + 2, *reinterpret_cast(&V), 2); +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); + __m128 z = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + _mm_store_ss(reinterpret_cast(&pDestination[2]), z); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreInt3A +( + uint32_t* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + assert((reinterpret_cast(pDestination) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + pDestination[0] = V.vector4_u32[0]; + pDestination[1] = V.vector4_u32[1]; + pDestination[2] = V.vector4_u32[2]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t VL = vget_low_u32(vreinterpretq_u32_f32(V)); +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + vst1_u32_ex(pDestination, VL, 64); +#else + vst1_u32(pDestination, VL); +#endif + vst1q_lane_u32(pDestination + 2, *reinterpret_cast(&V), 2); +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); + __m128 z = _mm_movehl_ps(V, V); + _mm_store_ss(reinterpret_cast(&pDestination[2]), z); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat3 +( + XMFLOAT3* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + pDestination->x = V.vector4_f32[0]; + pDestination->y = V.vector4_f32[1]; + pDestination->z = V.vector4_f32[2]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + vst1_f32(reinterpret_cast(pDestination), VL); + vst1q_lane_f32(reinterpret_cast(pDestination) + 2, V, 2); +#elif defined(_XM_SSE4_INTRINSICS_) + * reinterpret_cast(&pDestination->x) = _mm_extract_ps(V, 0); + *reinterpret_cast(&pDestination->y) = _mm_extract_ps(V, 1); + *reinterpret_cast(&pDestination->z) = _mm_extract_ps(V, 2); +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); + __m128 z = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + _mm_store_ss(&pDestination->z, z); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat3A +( + XMFLOAT3A* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + assert((reinterpret_cast(pDestination) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + pDestination->x = V.vector4_f32[0]; + pDestination->y = V.vector4_f32[1]; + pDestination->z = V.vector4_f32[2]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + vst1_f32_ex(reinterpret_cast(pDestination), VL, 64); +#else + vst1_f32(reinterpret_cast(pDestination), VL); +#endif + vst1q_lane_f32(reinterpret_cast(pDestination) + 2, V, 2); +#elif defined(_XM_SSE4_INTRINSICS_) + _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); + *reinterpret_cast(&pDestination->z) = _mm_extract_ps(V, 2); +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); + __m128 z = _mm_movehl_ps(V, V); + _mm_store_ss(&pDestination->z, z); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreSInt3 +( + XMINT3* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + pDestination->x = static_cast(V.vector4_f32[0]); + pDestination->y = static_cast(V.vector4_f32[1]); + pDestination->z = static_cast(V.vector4_f32[2]); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + int32x4_t v = vcvtq_s32_f32(V); + int32x2_t vL = vget_low_s32(v); + vst1_s32(reinterpret_cast(pDestination), vL); + vst1q_lane_s32(reinterpret_cast(pDestination) + 2, v, 2); +#elif defined(_XM_SSE_INTRINSICS_) + // In case of positive overflow, detect it + XMVECTOR vOverflow = _mm_cmpgt_ps(V, g_XMMaxInt); + // Float to int conversion + __m128i vResulti = _mm_cvttps_epi32(V); + // If there was positive overflow, set to 0x7FFFFFFF + XMVECTOR vResult = _mm_and_ps(vOverflow, g_XMAbsMask); + vOverflow = _mm_andnot_ps(vOverflow, _mm_castsi128_ps(vResulti)); + vOverflow = _mm_or_ps(vOverflow, vResult); + // Write 3 uints + _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(vOverflow)); + __m128 z = XM_PERMUTE_PS(vOverflow, _MM_SHUFFLE(2, 2, 2, 2)); + _mm_store_ss(reinterpret_cast(&pDestination->z), z); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUInt3 +( + XMUINT3* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + pDestination->x = static_cast(V.vector4_f32[0]); + pDestination->y = static_cast(V.vector4_f32[1]); + pDestination->z = static_cast(V.vector4_f32[2]); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t v = vcvtq_u32_f32(V); + uint32x2_t vL = vget_low_u32(v); + vst1_u32(reinterpret_cast(pDestination), vL); + vst1q_lane_u32(reinterpret_cast(pDestination) + 2, v, 2); +#elif defined(_XM_SSE_INTRINSICS_) + // Clamp to >=0 + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + // Any numbers that are too big, set to 0xFFFFFFFFU + XMVECTOR vOverflow = _mm_cmpgt_ps(vResult, g_XMMaxUInt); + XMVECTOR vValue = g_XMUnsignedFix; + // Too large for a signed integer? + XMVECTOR vMask = _mm_cmpge_ps(vResult, vValue); + // Zero for number's lower than 0x80000000, 32768.0f*65536.0f otherwise + vValue = _mm_and_ps(vValue, vMask); + // Perform fixup only on numbers too large (Keeps low bit precision) + vResult = _mm_sub_ps(vResult, vValue); + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Convert from signed to unsigned pnly if greater than 0x80000000 + vMask = _mm_and_ps(vMask, g_XMNegativeZero); + vResult = _mm_xor_ps(_mm_castsi128_ps(vResulti), vMask); + // On those that are too large, set to 0xFFFFFFFF + vResult = _mm_or_ps(vResult, vOverflow); + // Write 3 uints + _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(vResult)); + __m128 z = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(2, 2, 2, 2)); + _mm_store_ss(reinterpret_cast(&pDestination->z), z); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreInt4 +( + uint32_t* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + pDestination[0] = V.vector4_u32[0]; + pDestination[1] = V.vector4_u32[1]; + pDestination[2] = V.vector4_u32[2]; + pDestination[3] = V.vector4_u32[3]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + vst1q_u32(pDestination, vreinterpretq_u32_f32(V)); +#elif defined(_XM_SSE_INTRINSICS_) + _mm_storeu_si128(reinterpret_cast<__m128i*>(pDestination), _mm_castps_si128(V)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreInt4A +( + uint32_t* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + assert((reinterpret_cast(pDestination) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + pDestination[0] = V.vector4_u32[0]; + pDestination[1] = V.vector4_u32[1]; + pDestination[2] = V.vector4_u32[2]; + pDestination[3] = V.vector4_u32[3]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + vst1q_u32_ex(pDestination, V, 128); +#else + vst1q_u32(pDestination, vreinterpretq_u32_f32(V)); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_si128(reinterpret_cast<__m128i*>(pDestination), _mm_castps_si128(V)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat4 +( + XMFLOAT4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + pDestination->x = V.vector4_f32[0]; + pDestination->y = V.vector4_f32[1]; + pDestination->z = V.vector4_f32[2]; + pDestination->w = V.vector4_f32[3]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + vst1q_f32(reinterpret_cast(pDestination), V); +#elif defined(_XM_SSE_INTRINSICS_) + _mm_storeu_ps(&pDestination->x, V); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat4A +( + XMFLOAT4A* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + assert((reinterpret_cast(pDestination) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + pDestination->x = V.vector4_f32[0]; + pDestination->y = V.vector4_f32[1]; + pDestination->z = V.vector4_f32[2]; + pDestination->w = V.vector4_f32[3]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + vst1q_f32_ex(reinterpret_cast(pDestination), V, 128); +#else + vst1q_f32(reinterpret_cast(pDestination), V); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_ps(&pDestination->x, V); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreSInt4 +( + XMINT4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + pDestination->x = static_cast(V.vector4_f32[0]); + pDestination->y = static_cast(V.vector4_f32[1]); + pDestination->z = static_cast(V.vector4_f32[2]); + pDestination->w = static_cast(V.vector4_f32[3]); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + int32x4_t v = vcvtq_s32_f32(V); + vst1q_s32(reinterpret_cast(pDestination), v); +#elif defined(_XM_SSE_INTRINSICS_) + // In case of positive overflow, detect it + XMVECTOR vOverflow = _mm_cmpgt_ps(V, g_XMMaxInt); + // Float to int conversion + __m128i vResulti = _mm_cvttps_epi32(V); + // If there was positive overflow, set to 0x7FFFFFFF + XMVECTOR vResult = _mm_and_ps(vOverflow, g_XMAbsMask); + vOverflow = _mm_andnot_ps(vOverflow, _mm_castsi128_ps(vResulti)); + vOverflow = _mm_or_ps(vOverflow, vResult); + _mm_storeu_si128(reinterpret_cast<__m128i*>(pDestination), _mm_castps_si128(vOverflow)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUInt4 +( + XMUINT4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + pDestination->x = static_cast(V.vector4_f32[0]); + pDestination->y = static_cast(V.vector4_f32[1]); + pDestination->z = static_cast(V.vector4_f32[2]); + pDestination->w = static_cast(V.vector4_f32[3]); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t v = vcvtq_u32_f32(V); + vst1q_u32(reinterpret_cast(pDestination), v); +#elif defined(_XM_SSE_INTRINSICS_) + // Clamp to >=0 + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + // Any numbers that are too big, set to 0xFFFFFFFFU + XMVECTOR vOverflow = _mm_cmpgt_ps(vResult, g_XMMaxUInt); + XMVECTOR vValue = g_XMUnsignedFix; + // Too large for a signed integer? + XMVECTOR vMask = _mm_cmpge_ps(vResult, vValue); + // Zero for number's lower than 0x80000000, 32768.0f*65536.0f otherwise + vValue = _mm_and_ps(vValue, vMask); + // Perform fixup only on numbers too large (Keeps low bit precision) + vResult = _mm_sub_ps(vResult, vValue); + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Convert from signed to unsigned pnly if greater than 0x80000000 + vMask = _mm_and_ps(vMask, g_XMNegativeZero); + vResult = _mm_xor_ps(_mm_castsi128_ps(vResulti), vMask); + // On those that are too large, set to 0xFFFFFFFF + vResult = _mm_or_ps(vResult, vOverflow); + _mm_storeu_si128(reinterpret_cast<__m128i*>(pDestination), _mm_castps_si128(vResult)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat3x3 +( + XMFLOAT3X3* pDestination, + FXMMATRIX M +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + pDestination->m[0][0] = M.r[0].vector4_f32[0]; + pDestination->m[0][1] = M.r[0].vector4_f32[1]; + pDestination->m[0][2] = M.r[0].vector4_f32[2]; + + pDestination->m[1][0] = M.r[1].vector4_f32[0]; + pDestination->m[1][1] = M.r[1].vector4_f32[1]; + pDestination->m[1][2] = M.r[1].vector4_f32[2]; + + pDestination->m[2][0] = M.r[2].vector4_f32[0]; + pDestination->m[2][1] = M.r[2].vector4_f32[1]; + pDestination->m[2][2] = M.r[2].vector4_f32[2]; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t T1 = vextq_f32(M.r[0], M.r[1], 1); + float32x4_t T2 = vbslq_f32(g_XMMask3, M.r[0], T1); + vst1q_f32(&pDestination->m[0][0], T2); + + T1 = vextq_f32(M.r[1], M.r[1], 1); + T2 = vcombine_f32(vget_low_f32(T1), vget_low_f32(M.r[2])); + vst1q_f32(&pDestination->m[1][1], T2); + + vst1q_lane_f32(&pDestination->m[2][2], M.r[2], 2); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp1 = M.r[0]; + XMVECTOR vTemp2 = M.r[1]; + XMVECTOR vTemp3 = M.r[2]; + XMVECTOR vWork = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(0, 0, 2, 2)); + vTemp1 = _mm_shuffle_ps(vTemp1, vWork, _MM_SHUFFLE(2, 0, 1, 0)); + _mm_storeu_ps(&pDestination->m[0][0], vTemp1); + vTemp2 = _mm_shuffle_ps(vTemp2, vTemp3, _MM_SHUFFLE(1, 0, 2, 1)); + _mm_storeu_ps(&pDestination->m[1][1], vTemp2); + vTemp3 = XM_PERMUTE_PS(vTemp3, _MM_SHUFFLE(2, 2, 2, 2)); + _mm_store_ss(&pDestination->m[2][2], vTemp3); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat4x3 +( + XMFLOAT4X3* pDestination, + FXMMATRIX M +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + pDestination->m[0][0] = M.r[0].vector4_f32[0]; + pDestination->m[0][1] = M.r[0].vector4_f32[1]; + pDestination->m[0][2] = M.r[0].vector4_f32[2]; + + pDestination->m[1][0] = M.r[1].vector4_f32[0]; + pDestination->m[1][1] = M.r[1].vector4_f32[1]; + pDestination->m[1][2] = M.r[1].vector4_f32[2]; + + pDestination->m[2][0] = M.r[2].vector4_f32[0]; + pDestination->m[2][1] = M.r[2].vector4_f32[1]; + pDestination->m[2][2] = M.r[2].vector4_f32[2]; + + pDestination->m[3][0] = M.r[3].vector4_f32[0]; + pDestination->m[3][1] = M.r[3].vector4_f32[1]; + pDestination->m[3][2] = M.r[3].vector4_f32[2]; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t T1 = vextq_f32(M.r[0], M.r[1], 1); + float32x4_t T2 = vbslq_f32(g_XMMask3, M.r[0], T1); + vst1q_f32(&pDestination->m[0][0], T2); + + T1 = vextq_f32(M.r[1], M.r[1], 1); + T2 = vcombine_f32(vget_low_f32(T1), vget_low_f32(M.r[2])); + vst1q_f32(&pDestination->m[1][1], T2); + + T1 = vdupq_lane_f32(vget_high_f32(M.r[2]), 0); + T2 = vextq_f32(T1, M.r[3], 3); + vst1q_f32(&pDestination->m[2][2], T2); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp1 = M.r[0]; + XMVECTOR vTemp2 = M.r[1]; + XMVECTOR vTemp3 = M.r[2]; + XMVECTOR vTemp4 = M.r[3]; + XMVECTOR vTemp2x = _mm_shuffle_ps(vTemp2, vTemp3, _MM_SHUFFLE(1, 0, 2, 1)); + vTemp2 = _mm_shuffle_ps(vTemp2, vTemp1, _MM_SHUFFLE(2, 2, 0, 0)); + vTemp1 = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(0, 2, 1, 0)); + vTemp3 = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(0, 0, 2, 2)); + vTemp3 = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 1, 2, 0)); + _mm_storeu_ps(&pDestination->m[0][0], vTemp1); + _mm_storeu_ps(&pDestination->m[1][1], vTemp2x); + _mm_storeu_ps(&pDestination->m[2][2], vTemp3); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat4x3A +( + XMFLOAT4X3A* pDestination, + FXMMATRIX M +) noexcept +{ + assert(pDestination); + assert((reinterpret_cast(pDestination) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + + pDestination->m[0][0] = M.r[0].vector4_f32[0]; + pDestination->m[0][1] = M.r[0].vector4_f32[1]; + pDestination->m[0][2] = M.r[0].vector4_f32[2]; + + pDestination->m[1][0] = M.r[1].vector4_f32[0]; + pDestination->m[1][1] = M.r[1].vector4_f32[1]; + pDestination->m[1][2] = M.r[1].vector4_f32[2]; + + pDestination->m[2][0] = M.r[2].vector4_f32[0]; + pDestination->m[2][1] = M.r[2].vector4_f32[1]; + pDestination->m[2][2] = M.r[2].vector4_f32[2]; + + pDestination->m[3][0] = M.r[3].vector4_f32[0]; + pDestination->m[3][1] = M.r[3].vector4_f32[1]; + pDestination->m[3][2] = M.r[3].vector4_f32[2]; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + float32x4_t T1 = vextq_f32(M.r[0], M.r[1], 1); + float32x4_t T2 = vbslq_f32(g_XMMask3, M.r[0], T1); + vst1q_f32_ex(&pDestination->m[0][0], T2, 128); + + T1 = vextq_f32(M.r[1], M.r[1], 1); + T2 = vcombine_f32(vget_low_f32(T1), vget_low_f32(M.r[2])); + vst1q_f32_ex(&pDestination->m[1][1], T2, 128); + + T1 = vdupq_lane_f32(vget_high_f32(M.r[2]), 0); + T2 = vextq_f32(T1, M.r[3], 3); + vst1q_f32_ex(&pDestination->m[2][2], T2, 128); +#else + float32x4_t T1 = vextq_f32(M.r[0], M.r[1], 1); + float32x4_t T2 = vbslq_f32(g_XMMask3, M.r[0], T1); + vst1q_f32(&pDestination->m[0][0], T2); + + T1 = vextq_f32(M.r[1], M.r[1], 1); + T2 = vcombine_f32(vget_low_f32(T1), vget_low_f32(M.r[2])); + vst1q_f32(&pDestination->m[1][1], T2); + + T1 = vdupq_lane_f32(vget_high_f32(M.r[2]), 0); + T2 = vextq_f32(T1, M.r[3], 3); + vst1q_f32(&pDestination->m[2][2], T2); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + // x1,y1,z1,w1 + XMVECTOR vTemp1 = M.r[0]; + // x2,y2,z2,w2 + XMVECTOR vTemp2 = M.r[1]; + // x3,y3,z3,w3 + XMVECTOR vTemp3 = M.r[2]; + // x4,y4,z4,w4 + XMVECTOR vTemp4 = M.r[3]; + // z1,z1,x2,y2 + XMVECTOR vTemp = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(1, 0, 2, 2)); + // y2,z2,x3,y3 (Final) + vTemp2 = _mm_shuffle_ps(vTemp2, vTemp3, _MM_SHUFFLE(1, 0, 2, 1)); + // x1,y1,z1,x2 (Final) + vTemp1 = _mm_shuffle_ps(vTemp1, vTemp, _MM_SHUFFLE(2, 0, 1, 0)); + // z3,z3,x4,x4 + vTemp3 = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(0, 0, 2, 2)); + // z3,x4,y4,z4 (Final) + vTemp3 = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 1, 2, 0)); + // Store in 3 operations + _mm_store_ps(&pDestination->m[0][0], vTemp1); + _mm_store_ps(&pDestination->m[1][1], vTemp2); + _mm_store_ps(&pDestination->m[2][2], vTemp3); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat3x4 +( + XMFLOAT3X4* pDestination, + FXMMATRIX M +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + pDestination->m[0][0] = M.r[0].vector4_f32[0]; + pDestination->m[0][1] = M.r[1].vector4_f32[0]; + pDestination->m[0][2] = M.r[2].vector4_f32[0]; + pDestination->m[0][3] = M.r[3].vector4_f32[0]; + + pDestination->m[1][0] = M.r[0].vector4_f32[1]; + pDestination->m[1][1] = M.r[1].vector4_f32[1]; + pDestination->m[1][2] = M.r[2].vector4_f32[1]; + pDestination->m[1][3] = M.r[3].vector4_f32[1]; + + pDestination->m[2][0] = M.r[0].vector4_f32[2]; + pDestination->m[2][1] = M.r[1].vector4_f32[2]; + pDestination->m[2][2] = M.r[2].vector4_f32[2]; + pDestination->m[2][3] = M.r[3].vector4_f32[2]; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4x2_t P0 = vzipq_f32(M.r[0], M.r[2]); + float32x4x2_t P1 = vzipq_f32(M.r[1], M.r[3]); + + float32x4x2_t T0 = vzipq_f32(P0.val[0], P1.val[0]); + float32x4x2_t T1 = vzipq_f32(P0.val[1], P1.val[1]); + + vst1q_f32(&pDestination->m[0][0], T0.val[0]); + vst1q_f32(&pDestination->m[1][0], T0.val[1]); + vst1q_f32(&pDestination->m[2][0], T1.val[0]); +#elif defined(_XM_SSE_INTRINSICS_) + // x.x,x.y,y.x,y.y + XMVECTOR vTemp1 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(1, 0, 1, 0)); + // x.z,x.w,y.z,y.w + XMVECTOR vTemp3 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(3, 2, 3, 2)); + // z.x,z.y,w.x,w.y + XMVECTOR vTemp2 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(1, 0, 1, 0)); + // z.z,z.w,w.z,w.w + XMVECTOR vTemp4 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(3, 2, 3, 2)); + + // x.x,y.x,z.x,w.x + XMVECTOR r0 = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(2, 0, 2, 0)); + // x.y,y.y,z.y,w.y + XMVECTOR r1 = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(3, 1, 3, 1)); + // x.z,y.z,z.z,w.z + XMVECTOR r2 = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 0, 2, 0)); + + _mm_storeu_ps(&pDestination->m[0][0], r0); + _mm_storeu_ps(&pDestination->m[1][0], r1); + _mm_storeu_ps(&pDestination->m[2][0], r2); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat3x4A +( + XMFLOAT3X4A* pDestination, + FXMMATRIX M +) noexcept +{ + assert(pDestination); + assert((reinterpret_cast(pDestination) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + + pDestination->m[0][0] = M.r[0].vector4_f32[0]; + pDestination->m[0][1] = M.r[1].vector4_f32[0]; + pDestination->m[0][2] = M.r[2].vector4_f32[0]; + pDestination->m[0][3] = M.r[3].vector4_f32[0]; + + pDestination->m[1][0] = M.r[0].vector4_f32[1]; + pDestination->m[1][1] = M.r[1].vector4_f32[1]; + pDestination->m[1][2] = M.r[2].vector4_f32[1]; + pDestination->m[1][3] = M.r[3].vector4_f32[1]; + + pDestination->m[2][0] = M.r[0].vector4_f32[2]; + pDestination->m[2][1] = M.r[1].vector4_f32[2]; + pDestination->m[2][2] = M.r[2].vector4_f32[2]; + pDestination->m[2][3] = M.r[3].vector4_f32[2]; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4x2_t P0 = vzipq_f32(M.r[0], M.r[2]); + float32x4x2_t P1 = vzipq_f32(M.r[1], M.r[3]); + + float32x4x2_t T0 = vzipq_f32(P0.val[0], P1.val[0]); + float32x4x2_t T1 = vzipq_f32(P0.val[1], P1.val[1]); + +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + vst1q_f32_ex(&pDestination->m[0][0], T0.val[0], 128); + vst1q_f32_ex(&pDestination->m[1][0], T0.val[1], 128); + vst1q_f32_ex(&pDestination->m[2][0], T1.val[0], 128); +#else + vst1q_f32(&pDestination->m[0][0], T0.val[0]); + vst1q_f32(&pDestination->m[1][0], T0.val[1]); + vst1q_f32(&pDestination->m[2][0], T1.val[0]); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + // x.x,x.y,y.x,y.y + XMVECTOR vTemp1 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(1, 0, 1, 0)); + // x.z,x.w,y.z,y.w + XMVECTOR vTemp3 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(3, 2, 3, 2)); + // z.x,z.y,w.x,w.y + XMVECTOR vTemp2 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(1, 0, 1, 0)); + // z.z,z.w,w.z,w.w + XMVECTOR vTemp4 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(3, 2, 3, 2)); + + // x.x,y.x,z.x,w.x + XMVECTOR r0 = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(2, 0, 2, 0)); + // x.y,y.y,z.y,w.y + XMVECTOR r1 = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(3, 1, 3, 1)); + // x.z,y.z,z.z,w.z + XMVECTOR r2 = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 0, 2, 0)); + + _mm_store_ps(&pDestination->m[0][0], r0); + _mm_store_ps(&pDestination->m[1][0], r1); + _mm_store_ps(&pDestination->m[2][0], r2); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat4x4 +( + XMFLOAT4X4* pDestination, + FXMMATRIX M +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + pDestination->m[0][0] = M.r[0].vector4_f32[0]; + pDestination->m[0][1] = M.r[0].vector4_f32[1]; + pDestination->m[0][2] = M.r[0].vector4_f32[2]; + pDestination->m[0][3] = M.r[0].vector4_f32[3]; + + pDestination->m[1][0] = M.r[1].vector4_f32[0]; + pDestination->m[1][1] = M.r[1].vector4_f32[1]; + pDestination->m[1][2] = M.r[1].vector4_f32[2]; + pDestination->m[1][3] = M.r[1].vector4_f32[3]; + + pDestination->m[2][0] = M.r[2].vector4_f32[0]; + pDestination->m[2][1] = M.r[2].vector4_f32[1]; + pDestination->m[2][2] = M.r[2].vector4_f32[2]; + pDestination->m[2][3] = M.r[2].vector4_f32[3]; + + pDestination->m[3][0] = M.r[3].vector4_f32[0]; + pDestination->m[3][1] = M.r[3].vector4_f32[1]; + pDestination->m[3][2] = M.r[3].vector4_f32[2]; + pDestination->m[3][3] = M.r[3].vector4_f32[3]; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + vst1q_f32(reinterpret_cast(&pDestination->_11), M.r[0]); + vst1q_f32(reinterpret_cast(&pDestination->_21), M.r[1]); + vst1q_f32(reinterpret_cast(&pDestination->_31), M.r[2]); + vst1q_f32(reinterpret_cast(&pDestination->_41), M.r[3]); +#elif defined(_XM_SSE_INTRINSICS_) + _mm_storeu_ps(&pDestination->_11, M.r[0]); + _mm_storeu_ps(&pDestination->_21, M.r[1]); + _mm_storeu_ps(&pDestination->_31, M.r[2]); + _mm_storeu_ps(&pDestination->_41, M.r[3]); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat4x4A +( + XMFLOAT4X4A* pDestination, + FXMMATRIX M +) noexcept +{ + assert(pDestination); + assert((reinterpret_cast(pDestination) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + + pDestination->m[0][0] = M.r[0].vector4_f32[0]; + pDestination->m[0][1] = M.r[0].vector4_f32[1]; + pDestination->m[0][2] = M.r[0].vector4_f32[2]; + pDestination->m[0][3] = M.r[0].vector4_f32[3]; + + pDestination->m[1][0] = M.r[1].vector4_f32[0]; + pDestination->m[1][1] = M.r[1].vector4_f32[1]; + pDestination->m[1][2] = M.r[1].vector4_f32[2]; + pDestination->m[1][3] = M.r[1].vector4_f32[3]; + + pDestination->m[2][0] = M.r[2].vector4_f32[0]; + pDestination->m[2][1] = M.r[2].vector4_f32[1]; + pDestination->m[2][2] = M.r[2].vector4_f32[2]; + pDestination->m[2][3] = M.r[2].vector4_f32[3]; + + pDestination->m[3][0] = M.r[3].vector4_f32[0]; + pDestination->m[3][1] = M.r[3].vector4_f32[1]; + pDestination->m[3][2] = M.r[3].vector4_f32[2]; + pDestination->m[3][3] = M.r[3].vector4_f32[3]; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + vst1q_f32_ex(reinterpret_cast(&pDestination->_11), M.r[0], 128); + vst1q_f32_ex(reinterpret_cast(&pDestination->_21), M.r[1], 128); + vst1q_f32_ex(reinterpret_cast(&pDestination->_31), M.r[2], 128); + vst1q_f32_ex(reinterpret_cast(&pDestination->_41), M.r[3], 128); +#else + vst1q_f32(reinterpret_cast(&pDestination->_11), M.r[0]); + vst1q_f32(reinterpret_cast(&pDestination->_21), M.r[1]); + vst1q_f32(reinterpret_cast(&pDestination->_31), M.r[2]); + vst1q_f32(reinterpret_cast(&pDestination->_41), M.r[3]); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_ps(&pDestination->_11, M.r[0]); + _mm_store_ps(&pDestination->_21, M.r[1]); + _mm_store_ps(&pDestination->_31, M.r[2]); + _mm_store_ps(&pDestination->_41, M.r[3]); +#endif +} + diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXMathMatrix.inl b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXMathMatrix.inl new file mode 100644 index 0000000..1c579a1 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXMathMatrix.inl @@ -0,0 +1,3550 @@ +//------------------------------------------------------------------------------------- +// DirectXMathMatrix.inl -- SIMD C++ Math library +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +// +// http://go.microsoft.com/fwlink/?LinkID=615560 +//------------------------------------------------------------------------------------- + +#pragma once + +/**************************************************************************** + * + * Matrix + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + // Comparison operations + //------------------------------------------------------------------------------ + + //------------------------------------------------------------------------------ + +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) +#pragma float_control(push) +#pragma float_control(precise, on) +#endif + +// Return true if any entry in the matrix is NaN +inline bool XM_CALLCONV XMMatrixIsNaN(FXMMATRIX M) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + size_t i = 16; + auto pWork = reinterpret_cast(&M.m[0][0]); + do { + // Fetch value into integer unit + uint32_t uTest = pWork[0]; + // Remove sign + uTest &= 0x7FFFFFFFU; + // NaN is 0x7F800001 through 0x7FFFFFFF inclusive + uTest -= 0x7F800001U; + if (uTest < 0x007FFFFFU) + { + break; // NaN found + } + ++pWork; // Next entry + } while (--i); + return (i != 0); // i == 0 if nothing matched +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Load in registers + float32x4_t vX = M.r[0]; + float32x4_t vY = M.r[1]; + float32x4_t vZ = M.r[2]; + float32x4_t vW = M.r[3]; + // Test themselves to check for NaN + uint32x4_t xmask = vmvnq_u32(vceqq_f32(vX, vX)); + uint32x4_t ymask = vmvnq_u32(vceqq_f32(vY, vY)); + uint32x4_t zmask = vmvnq_u32(vceqq_f32(vZ, vZ)); + uint32x4_t wmask = vmvnq_u32(vceqq_f32(vW, vW)); + // Or all the results + xmask = vorrq_u32(xmask, zmask); + ymask = vorrq_u32(ymask, wmask); + xmask = vorrq_u32(xmask, ymask); + // If any tested true, return true + uint8x8x2_t vTemp = vzip_u8( + vget_low_u8(vreinterpretq_u8_u32(xmask)), + vget_high_u8(vreinterpretq_u8_u32(xmask))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); + return (r != 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Load in registers + XMVECTOR vX = M.r[0]; + XMVECTOR vY = M.r[1]; + XMVECTOR vZ = M.r[2]; + XMVECTOR vW = M.r[3]; + // Test themselves to check for NaN + vX = _mm_cmpneq_ps(vX, vX); + vY = _mm_cmpneq_ps(vY, vY); + vZ = _mm_cmpneq_ps(vZ, vZ); + vW = _mm_cmpneq_ps(vW, vW); + // Or all the results + vX = _mm_or_ps(vX, vZ); + vY = _mm_or_ps(vY, vW); + vX = _mm_or_ps(vX, vY); + // If any tested true, return true + return (_mm_movemask_ps(vX) != 0); +#else +#endif +} + +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) +#pragma float_control(pop) +#endif + +//------------------------------------------------------------------------------ + +// Return true if any entry in the matrix is +/-INF +inline bool XM_CALLCONV XMMatrixIsInfinite(FXMMATRIX M) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + size_t i = 16; + auto pWork = reinterpret_cast(&M.m[0][0]); + do { + // Fetch value into integer unit + uint32_t uTest = pWork[0]; + // Remove sign + uTest &= 0x7FFFFFFFU; + // INF is 0x7F800000 + if (uTest == 0x7F800000U) + { + break; // INF found + } + ++pWork; // Next entry + } while (--i); + return (i != 0); // i == 0 if nothing matched +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Load in registers + float32x4_t vX = M.r[0]; + float32x4_t vY = M.r[1]; + float32x4_t vZ = M.r[2]; + float32x4_t vW = M.r[3]; + // Mask off the sign bits + vX = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(vX), g_XMAbsMask)); + vY = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(vY), g_XMAbsMask)); + vZ = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(vZ), g_XMAbsMask)); + vW = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(vW), g_XMAbsMask)); + // Compare to infinity + uint32x4_t xmask = vceqq_f32(vX, g_XMInfinity); + uint32x4_t ymask = vceqq_f32(vY, g_XMInfinity); + uint32x4_t zmask = vceqq_f32(vZ, g_XMInfinity); + uint32x4_t wmask = vceqq_f32(vW, g_XMInfinity); + // Or the answers together + xmask = vorrq_u32(xmask, zmask); + ymask = vorrq_u32(ymask, wmask); + xmask = vorrq_u32(xmask, ymask); + // If any tested true, return true + uint8x8x2_t vTemp = vzip_u8( + vget_low_u8(vreinterpretq_u8_u32(xmask)), + vget_high_u8(vreinterpretq_u8_u32(xmask))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); + return (r != 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Mask off the sign bits + XMVECTOR vTemp1 = _mm_and_ps(M.r[0], g_XMAbsMask); + XMVECTOR vTemp2 = _mm_and_ps(M.r[1], g_XMAbsMask); + XMVECTOR vTemp3 = _mm_and_ps(M.r[2], g_XMAbsMask); + XMVECTOR vTemp4 = _mm_and_ps(M.r[3], g_XMAbsMask); + // Compare to infinity + vTemp1 = _mm_cmpeq_ps(vTemp1, g_XMInfinity); + vTemp2 = _mm_cmpeq_ps(vTemp2, g_XMInfinity); + vTemp3 = _mm_cmpeq_ps(vTemp3, g_XMInfinity); + vTemp4 = _mm_cmpeq_ps(vTemp4, g_XMInfinity); + // Or the answers together + vTemp1 = _mm_or_ps(vTemp1, vTemp2); + vTemp3 = _mm_or_ps(vTemp3, vTemp4); + vTemp1 = _mm_or_ps(vTemp1, vTemp3); + // If any are infinity, the signs are true. + return (_mm_movemask_ps(vTemp1) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +// Return true if the XMMatrix is equal to identity +inline bool XM_CALLCONV XMMatrixIsIdentity(FXMMATRIX M) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + // Use the integer pipeline to reduce branching to a minimum + auto pWork = reinterpret_cast(&M.m[0][0]); + // Convert 1.0f to zero and or them together + uint32_t uOne = pWork[0] ^ 0x3F800000U; + // Or all the 0.0f entries together + uint32_t uZero = pWork[1]; + uZero |= pWork[2]; + uZero |= pWork[3]; + // 2nd row + uZero |= pWork[4]; + uOne |= pWork[5] ^ 0x3F800000U; + uZero |= pWork[6]; + uZero |= pWork[7]; + // 3rd row + uZero |= pWork[8]; + uZero |= pWork[9]; + uOne |= pWork[10] ^ 0x3F800000U; + uZero |= pWork[11]; + // 4th row + uZero |= pWork[12]; + uZero |= pWork[13]; + uZero |= pWork[14]; + uOne |= pWork[15] ^ 0x3F800000U; + // If all zero entries are zero, the uZero==0 + uZero &= 0x7FFFFFFF; // Allow -0.0f + // If all 1.0f entries are 1.0f, then uOne==0 + uOne |= uZero; + return (uOne == 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t xmask = vceqq_f32(M.r[0], g_XMIdentityR0); + uint32x4_t ymask = vceqq_f32(M.r[1], g_XMIdentityR1); + uint32x4_t zmask = vceqq_f32(M.r[2], g_XMIdentityR2); + uint32x4_t wmask = vceqq_f32(M.r[3], g_XMIdentityR3); + xmask = vandq_u32(xmask, zmask); + ymask = vandq_u32(ymask, wmask); + xmask = vandq_u32(xmask, ymask); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(xmask)), vget_high_u8(vreinterpretq_u8_u32(xmask))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); + return (r == 0xFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp1 = _mm_cmpeq_ps(M.r[0], g_XMIdentityR0); + XMVECTOR vTemp2 = _mm_cmpeq_ps(M.r[1], g_XMIdentityR1); + XMVECTOR vTemp3 = _mm_cmpeq_ps(M.r[2], g_XMIdentityR2); + XMVECTOR vTemp4 = _mm_cmpeq_ps(M.r[3], g_XMIdentityR3); + vTemp1 = _mm_and_ps(vTemp1, vTemp2); + vTemp3 = _mm_and_ps(vTemp3, vTemp4); + vTemp1 = _mm_and_ps(vTemp1, vTemp3); + return (_mm_movemask_ps(vTemp1) == 0x0f); +#endif +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +// Perform a 4x4 matrix multiply by a 4x4 matrix +inline XMMATRIX XM_CALLCONV XMMatrixMultiply +( + FXMMATRIX M1, + CXMMATRIX M2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMMATRIX mResult; + // Cache the invariants in registers + float x = M1.m[0][0]; + float y = M1.m[0][1]; + float z = M1.m[0][2]; + float w = M1.m[0][3]; + // Perform the operation on the first row + mResult.m[0][0] = (M2.m[0][0] * x) + (M2.m[1][0] * y) + (M2.m[2][0] * z) + (M2.m[3][0] * w); + mResult.m[0][1] = (M2.m[0][1] * x) + (M2.m[1][1] * y) + (M2.m[2][1] * z) + (M2.m[3][1] * w); + mResult.m[0][2] = (M2.m[0][2] * x) + (M2.m[1][2] * y) + (M2.m[2][2] * z) + (M2.m[3][2] * w); + mResult.m[0][3] = (M2.m[0][3] * x) + (M2.m[1][3] * y) + (M2.m[2][3] * z) + (M2.m[3][3] * w); + // Repeat for all the other rows + x = M1.m[1][0]; + y = M1.m[1][1]; + z = M1.m[1][2]; + w = M1.m[1][3]; + mResult.m[1][0] = (M2.m[0][0] * x) + (M2.m[1][0] * y) + (M2.m[2][0] * z) + (M2.m[3][0] * w); + mResult.m[1][1] = (M2.m[0][1] * x) + (M2.m[1][1] * y) + (M2.m[2][1] * z) + (M2.m[3][1] * w); + mResult.m[1][2] = (M2.m[0][2] * x) + (M2.m[1][2] * y) + (M2.m[2][2] * z) + (M2.m[3][2] * w); + mResult.m[1][3] = (M2.m[0][3] * x) + (M2.m[1][3] * y) + (M2.m[2][3] * z) + (M2.m[3][3] * w); + x = M1.m[2][0]; + y = M1.m[2][1]; + z = M1.m[2][2]; + w = M1.m[2][3]; + mResult.m[2][0] = (M2.m[0][0] * x) + (M2.m[1][0] * y) + (M2.m[2][0] * z) + (M2.m[3][0] * w); + mResult.m[2][1] = (M2.m[0][1] * x) + (M2.m[1][1] * y) + (M2.m[2][1] * z) + (M2.m[3][1] * w); + mResult.m[2][2] = (M2.m[0][2] * x) + (M2.m[1][2] * y) + (M2.m[2][2] * z) + (M2.m[3][2] * w); + mResult.m[2][3] = (M2.m[0][3] * x) + (M2.m[1][3] * y) + (M2.m[2][3] * z) + (M2.m[3][3] * w); + x = M1.m[3][0]; + y = M1.m[3][1]; + z = M1.m[3][2]; + w = M1.m[3][3]; + mResult.m[3][0] = (M2.m[0][0] * x) + (M2.m[1][0] * y) + (M2.m[2][0] * z) + (M2.m[3][0] * w); + mResult.m[3][1] = (M2.m[0][1] * x) + (M2.m[1][1] * y) + (M2.m[2][1] * z) + (M2.m[3][1] * w); + mResult.m[3][2] = (M2.m[0][2] * x) + (M2.m[1][2] * y) + (M2.m[2][2] * z) + (M2.m[3][2] * w); + mResult.m[3][3] = (M2.m[0][3] * x) + (M2.m[1][3] * y) + (M2.m[2][3] * z) + (M2.m[3][3] * w); + return mResult; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMMATRIX mResult; + float32x2_t VL = vget_low_f32(M1.r[0]); + float32x2_t VH = vget_high_f32(M1.r[0]); + // Perform the operation on the first row + float32x4_t vX = vmulq_lane_f32(M2.r[0], VL, 0); + float32x4_t vY = vmulq_lane_f32(M2.r[1], VL, 1); + float32x4_t vZ = vmlaq_lane_f32(vX, M2.r[2], VH, 0); + float32x4_t vW = vmlaq_lane_f32(vY, M2.r[3], VH, 1); + mResult.r[0] = vaddq_f32(vZ, vW); + // Repeat for the other 3 rows + VL = vget_low_f32(M1.r[1]); + VH = vget_high_f32(M1.r[1]); + vX = vmulq_lane_f32(M2.r[0], VL, 0); + vY = vmulq_lane_f32(M2.r[1], VL, 1); + vZ = vmlaq_lane_f32(vX, M2.r[2], VH, 0); + vW = vmlaq_lane_f32(vY, M2.r[3], VH, 1); + mResult.r[1] = vaddq_f32(vZ, vW); + VL = vget_low_f32(M1.r[2]); + VH = vget_high_f32(M1.r[2]); + vX = vmulq_lane_f32(M2.r[0], VL, 0); + vY = vmulq_lane_f32(M2.r[1], VL, 1); + vZ = vmlaq_lane_f32(vX, M2.r[2], VH, 0); + vW = vmlaq_lane_f32(vY, M2.r[3], VH, 1); + mResult.r[2] = vaddq_f32(vZ, vW); + VL = vget_low_f32(M1.r[3]); + VH = vget_high_f32(M1.r[3]); + vX = vmulq_lane_f32(M2.r[0], VL, 0); + vY = vmulq_lane_f32(M2.r[1], VL, 1); + vZ = vmlaq_lane_f32(vX, M2.r[2], VH, 0); + vW = vmlaq_lane_f32(vY, M2.r[3], VH, 1); + mResult.r[3] = vaddq_f32(vZ, vW); + return mResult; +#elif defined(_XM_AVX2_INTRINSICS_) + __m256 t0 = _mm256_castps128_ps256(M1.r[0]); + t0 = _mm256_insertf128_ps(t0, M1.r[1], 1); + __m256 t1 = _mm256_castps128_ps256(M1.r[2]); + t1 = _mm256_insertf128_ps(t1, M1.r[3], 1); + + __m256 u0 = _mm256_castps128_ps256(M2.r[0]); + u0 = _mm256_insertf128_ps(u0, M2.r[1], 1); + __m256 u1 = _mm256_castps128_ps256(M2.r[2]); + u1 = _mm256_insertf128_ps(u1, M2.r[3], 1); + + __m256 a0 = _mm256_shuffle_ps(t0, t0, _MM_SHUFFLE(0, 0, 0, 0)); + __m256 a1 = _mm256_shuffle_ps(t1, t1, _MM_SHUFFLE(0, 0, 0, 0)); + __m256 b0 = _mm256_permute2f128_ps(u0, u0, 0x00); + __m256 c0 = _mm256_mul_ps(a0, b0); + __m256 c1 = _mm256_mul_ps(a1, b0); + + a0 = _mm256_shuffle_ps(t0, t0, _MM_SHUFFLE(1, 1, 1, 1)); + a1 = _mm256_shuffle_ps(t1, t1, _MM_SHUFFLE(1, 1, 1, 1)); + b0 = _mm256_permute2f128_ps(u0, u0, 0x11); + __m256 c2 = _mm256_fmadd_ps(a0, b0, c0); + __m256 c3 = _mm256_fmadd_ps(a1, b0, c1); + + a0 = _mm256_shuffle_ps(t0, t0, _MM_SHUFFLE(2, 2, 2, 2)); + a1 = _mm256_shuffle_ps(t1, t1, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 b1 = _mm256_permute2f128_ps(u1, u1, 0x00); + __m256 c4 = _mm256_mul_ps(a0, b1); + __m256 c5 = _mm256_mul_ps(a1, b1); + + a0 = _mm256_shuffle_ps(t0, t0, _MM_SHUFFLE(3, 3, 3, 3)); + a1 = _mm256_shuffle_ps(t1, t1, _MM_SHUFFLE(3, 3, 3, 3)); + b1 = _mm256_permute2f128_ps(u1, u1, 0x11); + __m256 c6 = _mm256_fmadd_ps(a0, b1, c4); + __m256 c7 = _mm256_fmadd_ps(a1, b1, c5); + + t0 = _mm256_add_ps(c2, c6); + t1 = _mm256_add_ps(c3, c7); + + XMMATRIX mResult; + mResult.r[0] = _mm256_castps256_ps128(t0); + mResult.r[1] = _mm256_extractf128_ps(t0, 1); + mResult.r[2] = _mm256_castps256_ps128(t1); + mResult.r[3] = _mm256_extractf128_ps(t1, 1); + return mResult; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX mResult; + // Splat the component X,Y,Z then W +#if defined(_XM_AVX_INTRINSICS_) + XMVECTOR vX = _mm_broadcast_ss(reinterpret_cast(&M1.r[0]) + 0); + XMVECTOR vY = _mm_broadcast_ss(reinterpret_cast(&M1.r[0]) + 1); + XMVECTOR vZ = _mm_broadcast_ss(reinterpret_cast(&M1.r[0]) + 2); + XMVECTOR vW = _mm_broadcast_ss(reinterpret_cast(&M1.r[0]) + 3); +#else + // Use vW to hold the original row + XMVECTOR vW = M1.r[0]; + XMVECTOR vX = XM_PERMUTE_PS(vW, _MM_SHUFFLE(0, 0, 0, 0)); + XMVECTOR vY = XM_PERMUTE_PS(vW, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR vZ = XM_PERMUTE_PS(vW, _MM_SHUFFLE(2, 2, 2, 2)); + vW = XM_PERMUTE_PS(vW, _MM_SHUFFLE(3, 3, 3, 3)); +#endif + // Perform the operation on the first row + vX = _mm_mul_ps(vX, M2.r[0]); + vY = _mm_mul_ps(vY, M2.r[1]); + vZ = _mm_mul_ps(vZ, M2.r[2]); + vW = _mm_mul_ps(vW, M2.r[3]); + // Perform a binary add to reduce cumulative errors + vX = _mm_add_ps(vX, vZ); + vY = _mm_add_ps(vY, vW); + vX = _mm_add_ps(vX, vY); + mResult.r[0] = vX; + // Repeat for the other 3 rows +#if defined(_XM_AVX_INTRINSICS_) + vX = _mm_broadcast_ss(reinterpret_cast(&M1.r[1]) + 0); + vY = _mm_broadcast_ss(reinterpret_cast(&M1.r[1]) + 1); + vZ = _mm_broadcast_ss(reinterpret_cast(&M1.r[1]) + 2); + vW = _mm_broadcast_ss(reinterpret_cast(&M1.r[1]) + 3); +#else + vW = M1.r[1]; + vX = XM_PERMUTE_PS(vW, _MM_SHUFFLE(0, 0, 0, 0)); + vY = XM_PERMUTE_PS(vW, _MM_SHUFFLE(1, 1, 1, 1)); + vZ = XM_PERMUTE_PS(vW, _MM_SHUFFLE(2, 2, 2, 2)); + vW = XM_PERMUTE_PS(vW, _MM_SHUFFLE(3, 3, 3, 3)); +#endif + vX = _mm_mul_ps(vX, M2.r[0]); + vY = _mm_mul_ps(vY, M2.r[1]); + vZ = _mm_mul_ps(vZ, M2.r[2]); + vW = _mm_mul_ps(vW, M2.r[3]); + vX = _mm_add_ps(vX, vZ); + vY = _mm_add_ps(vY, vW); + vX = _mm_add_ps(vX, vY); + mResult.r[1] = vX; +#if defined(_XM_AVX_INTRINSICS_) + vX = _mm_broadcast_ss(reinterpret_cast(&M1.r[2]) + 0); + vY = _mm_broadcast_ss(reinterpret_cast(&M1.r[2]) + 1); + vZ = _mm_broadcast_ss(reinterpret_cast(&M1.r[2]) + 2); + vW = _mm_broadcast_ss(reinterpret_cast(&M1.r[2]) + 3); +#else + vW = M1.r[2]; + vX = XM_PERMUTE_PS(vW, _MM_SHUFFLE(0, 0, 0, 0)); + vY = XM_PERMUTE_PS(vW, _MM_SHUFFLE(1, 1, 1, 1)); + vZ = XM_PERMUTE_PS(vW, _MM_SHUFFLE(2, 2, 2, 2)); + vW = XM_PERMUTE_PS(vW, _MM_SHUFFLE(3, 3, 3, 3)); +#endif + vX = _mm_mul_ps(vX, M2.r[0]); + vY = _mm_mul_ps(vY, M2.r[1]); + vZ = _mm_mul_ps(vZ, M2.r[2]); + vW = _mm_mul_ps(vW, M2.r[3]); + vX = _mm_add_ps(vX, vZ); + vY = _mm_add_ps(vY, vW); + vX = _mm_add_ps(vX, vY); + mResult.r[2] = vX; +#if defined(_XM_AVX_INTRINSICS_) + vX = _mm_broadcast_ss(reinterpret_cast(&M1.r[3]) + 0); + vY = _mm_broadcast_ss(reinterpret_cast(&M1.r[3]) + 1); + vZ = _mm_broadcast_ss(reinterpret_cast(&M1.r[3]) + 2); + vW = _mm_broadcast_ss(reinterpret_cast(&M1.r[3]) + 3); +#else + vW = M1.r[3]; + vX = XM_PERMUTE_PS(vW, _MM_SHUFFLE(0, 0, 0, 0)); + vY = XM_PERMUTE_PS(vW, _MM_SHUFFLE(1, 1, 1, 1)); + vZ = XM_PERMUTE_PS(vW, _MM_SHUFFLE(2, 2, 2, 2)); + vW = XM_PERMUTE_PS(vW, _MM_SHUFFLE(3, 3, 3, 3)); +#endif + vX = _mm_mul_ps(vX, M2.r[0]); + vY = _mm_mul_ps(vY, M2.r[1]); + vZ = _mm_mul_ps(vZ, M2.r[2]); + vW = _mm_mul_ps(vW, M2.r[3]); + vX = _mm_add_ps(vX, vZ); + vY = _mm_add_ps(vY, vW); + vX = _mm_add_ps(vX, vY); + mResult.r[3] = vX; + return mResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixMultiplyTranspose +( + FXMMATRIX M1, + CXMMATRIX M2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMMATRIX mResult; + // Cache the invariants in registers + float x = M2.m[0][0]; + float y = M2.m[1][0]; + float z = M2.m[2][0]; + float w = M2.m[3][0]; + // Perform the operation on the first row + mResult.m[0][0] = (M1.m[0][0] * x) + (M1.m[0][1] * y) + (M1.m[0][2] * z) + (M1.m[0][3] * w); + mResult.m[0][1] = (M1.m[1][0] * x) + (M1.m[1][1] * y) + (M1.m[1][2] * z) + (M1.m[1][3] * w); + mResult.m[0][2] = (M1.m[2][0] * x) + (M1.m[2][1] * y) + (M1.m[2][2] * z) + (M1.m[2][3] * w); + mResult.m[0][3] = (M1.m[3][0] * x) + (M1.m[3][1] * y) + (M1.m[3][2] * z) + (M1.m[3][3] * w); + // Repeat for all the other rows + x = M2.m[0][1]; + y = M2.m[1][1]; + z = M2.m[2][1]; + w = M2.m[3][1]; + mResult.m[1][0] = (M1.m[0][0] * x) + (M1.m[0][1] * y) + (M1.m[0][2] * z) + (M1.m[0][3] * w); + mResult.m[1][1] = (M1.m[1][0] * x) + (M1.m[1][1] * y) + (M1.m[1][2] * z) + (M1.m[1][3] * w); + mResult.m[1][2] = (M1.m[2][0] * x) + (M1.m[2][1] * y) + (M1.m[2][2] * z) + (M1.m[2][3] * w); + mResult.m[1][3] = (M1.m[3][0] * x) + (M1.m[3][1] * y) + (M1.m[3][2] * z) + (M1.m[3][3] * w); + x = M2.m[0][2]; + y = M2.m[1][2]; + z = M2.m[2][2]; + w = M2.m[3][2]; + mResult.m[2][0] = (M1.m[0][0] * x) + (M1.m[0][1] * y) + (M1.m[0][2] * z) + (M1.m[0][3] * w); + mResult.m[2][1] = (M1.m[1][0] * x) + (M1.m[1][1] * y) + (M1.m[1][2] * z) + (M1.m[1][3] * w); + mResult.m[2][2] = (M1.m[2][0] * x) + (M1.m[2][1] * y) + (M1.m[2][2] * z) + (M1.m[2][3] * w); + mResult.m[2][3] = (M1.m[3][0] * x) + (M1.m[3][1] * y) + (M1.m[3][2] * z) + (M1.m[3][3] * w); + x = M2.m[0][3]; + y = M2.m[1][3]; + z = M2.m[2][3]; + w = M2.m[3][3]; + mResult.m[3][0] = (M1.m[0][0] * x) + (M1.m[0][1] * y) + (M1.m[0][2] * z) + (M1.m[0][3] * w); + mResult.m[3][1] = (M1.m[1][0] * x) + (M1.m[1][1] * y) + (M1.m[1][2] * z) + (M1.m[1][3] * w); + mResult.m[3][2] = (M1.m[2][0] * x) + (M1.m[2][1] * y) + (M1.m[2][2] * z) + (M1.m[2][3] * w); + mResult.m[3][3] = (M1.m[3][0] * x) + (M1.m[3][1] * y) + (M1.m[3][2] * z) + (M1.m[3][3] * w); + return mResult; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(M1.r[0]); + float32x2_t VH = vget_high_f32(M1.r[0]); + // Perform the operation on the first row + float32x4_t vX = vmulq_lane_f32(M2.r[0], VL, 0); + float32x4_t vY = vmulq_lane_f32(M2.r[1], VL, 1); + float32x4_t vZ = vmlaq_lane_f32(vX, M2.r[2], VH, 0); + float32x4_t vW = vmlaq_lane_f32(vY, M2.r[3], VH, 1); + float32x4_t r0 = vaddq_f32(vZ, vW); + // Repeat for the other 3 rows + VL = vget_low_f32(M1.r[1]); + VH = vget_high_f32(M1.r[1]); + vX = vmulq_lane_f32(M2.r[0], VL, 0); + vY = vmulq_lane_f32(M2.r[1], VL, 1); + vZ = vmlaq_lane_f32(vX, M2.r[2], VH, 0); + vW = vmlaq_lane_f32(vY, M2.r[3], VH, 1); + float32x4_t r1 = vaddq_f32(vZ, vW); + VL = vget_low_f32(M1.r[2]); + VH = vget_high_f32(M1.r[2]); + vX = vmulq_lane_f32(M2.r[0], VL, 0); + vY = vmulq_lane_f32(M2.r[1], VL, 1); + vZ = vmlaq_lane_f32(vX, M2.r[2], VH, 0); + vW = vmlaq_lane_f32(vY, M2.r[3], VH, 1); + float32x4_t r2 = vaddq_f32(vZ, vW); + VL = vget_low_f32(M1.r[3]); + VH = vget_high_f32(M1.r[3]); + vX = vmulq_lane_f32(M2.r[0], VL, 0); + vY = vmulq_lane_f32(M2.r[1], VL, 1); + vZ = vmlaq_lane_f32(vX, M2.r[2], VH, 0); + vW = vmlaq_lane_f32(vY, M2.r[3], VH, 1); + float32x4_t r3 = vaddq_f32(vZ, vW); + + // Transpose result + float32x4x2_t P0 = vzipq_f32(r0, r2); + float32x4x2_t P1 = vzipq_f32(r1, r3); + + float32x4x2_t T0 = vzipq_f32(P0.val[0], P1.val[0]); + float32x4x2_t T1 = vzipq_f32(P0.val[1], P1.val[1]); + + XMMATRIX mResult; + mResult.r[0] = T0.val[0]; + mResult.r[1] = T0.val[1]; + mResult.r[2] = T1.val[0]; + mResult.r[3] = T1.val[1]; + return mResult; +#elif defined(_XM_AVX2_INTRINSICS_) + __m256 t0 = _mm256_castps128_ps256(M1.r[0]); + t0 = _mm256_insertf128_ps(t0, M1.r[1], 1); + __m256 t1 = _mm256_castps128_ps256(M1.r[2]); + t1 = _mm256_insertf128_ps(t1, M1.r[3], 1); + + __m256 u0 = _mm256_castps128_ps256(M2.r[0]); + u0 = _mm256_insertf128_ps(u0, M2.r[1], 1); + __m256 u1 = _mm256_castps128_ps256(M2.r[2]); + u1 = _mm256_insertf128_ps(u1, M2.r[3], 1); + + __m256 a0 = _mm256_shuffle_ps(t0, t0, _MM_SHUFFLE(0, 0, 0, 0)); + __m256 a1 = _mm256_shuffle_ps(t1, t1, _MM_SHUFFLE(0, 0, 0, 0)); + __m256 b0 = _mm256_permute2f128_ps(u0, u0, 0x00); + __m256 c0 = _mm256_mul_ps(a0, b0); + __m256 c1 = _mm256_mul_ps(a1, b0); + + a0 = _mm256_shuffle_ps(t0, t0, _MM_SHUFFLE(1, 1, 1, 1)); + a1 = _mm256_shuffle_ps(t1, t1, _MM_SHUFFLE(1, 1, 1, 1)); + b0 = _mm256_permute2f128_ps(u0, u0, 0x11); + __m256 c2 = _mm256_fmadd_ps(a0, b0, c0); + __m256 c3 = _mm256_fmadd_ps(a1, b0, c1); + + a0 = _mm256_shuffle_ps(t0, t0, _MM_SHUFFLE(2, 2, 2, 2)); + a1 = _mm256_shuffle_ps(t1, t1, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 b1 = _mm256_permute2f128_ps(u1, u1, 0x00); + __m256 c4 = _mm256_mul_ps(a0, b1); + __m256 c5 = _mm256_mul_ps(a1, b1); + + a0 = _mm256_shuffle_ps(t0, t0, _MM_SHUFFLE(3, 3, 3, 3)); + a1 = _mm256_shuffle_ps(t1, t1, _MM_SHUFFLE(3, 3, 3, 3)); + b1 = _mm256_permute2f128_ps(u1, u1, 0x11); + __m256 c6 = _mm256_fmadd_ps(a0, b1, c4); + __m256 c7 = _mm256_fmadd_ps(a1, b1, c5); + + t0 = _mm256_add_ps(c2, c6); + t1 = _mm256_add_ps(c3, c7); + + // Transpose result + __m256 vTemp = _mm256_unpacklo_ps(t0, t1); + __m256 vTemp2 = _mm256_unpackhi_ps(t0, t1); + __m256 vTemp3 = _mm256_permute2f128_ps(vTemp, vTemp2, 0x20); + __m256 vTemp4 = _mm256_permute2f128_ps(vTemp, vTemp2, 0x31); + vTemp = _mm256_unpacklo_ps(vTemp3, vTemp4); + vTemp2 = _mm256_unpackhi_ps(vTemp3, vTemp4); + t0 = _mm256_permute2f128_ps(vTemp, vTemp2, 0x20); + t1 = _mm256_permute2f128_ps(vTemp, vTemp2, 0x31); + + XMMATRIX mResult; + mResult.r[0] = _mm256_castps256_ps128(t0); + mResult.r[1] = _mm256_extractf128_ps(t0, 1); + mResult.r[2] = _mm256_castps256_ps128(t1); + mResult.r[3] = _mm256_extractf128_ps(t1, 1); + return mResult; +#elif defined(_XM_SSE_INTRINSICS_) + // Splat the component X,Y,Z then W +#if defined(_XM_AVX_INTRINSICS_) + XMVECTOR vX = _mm_broadcast_ss(reinterpret_cast(&M1.r[0]) + 0); + XMVECTOR vY = _mm_broadcast_ss(reinterpret_cast(&M1.r[0]) + 1); + XMVECTOR vZ = _mm_broadcast_ss(reinterpret_cast(&M1.r[0]) + 2); + XMVECTOR vW = _mm_broadcast_ss(reinterpret_cast(&M1.r[0]) + 3); +#else + // Use vW to hold the original row + XMVECTOR vW = M1.r[0]; + XMVECTOR vX = XM_PERMUTE_PS(vW, _MM_SHUFFLE(0, 0, 0, 0)); + XMVECTOR vY = XM_PERMUTE_PS(vW, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR vZ = XM_PERMUTE_PS(vW, _MM_SHUFFLE(2, 2, 2, 2)); + vW = XM_PERMUTE_PS(vW, _MM_SHUFFLE(3, 3, 3, 3)); +#endif + // Perform the operation on the first row + vX = _mm_mul_ps(vX, M2.r[0]); + vY = _mm_mul_ps(vY, M2.r[1]); + vZ = _mm_mul_ps(vZ, M2.r[2]); + vW = _mm_mul_ps(vW, M2.r[3]); + // Perform a binary add to reduce cumulative errors + vX = _mm_add_ps(vX, vZ); + vY = _mm_add_ps(vY, vW); + vX = _mm_add_ps(vX, vY); + XMVECTOR r0 = vX; + // Repeat for the other 3 rows +#if defined(_XM_AVX_INTRINSICS_) + vX = _mm_broadcast_ss(reinterpret_cast(&M1.r[1]) + 0); + vY = _mm_broadcast_ss(reinterpret_cast(&M1.r[1]) + 1); + vZ = _mm_broadcast_ss(reinterpret_cast(&M1.r[1]) + 2); + vW = _mm_broadcast_ss(reinterpret_cast(&M1.r[1]) + 3); +#else + vW = M1.r[1]; + vX = XM_PERMUTE_PS(vW, _MM_SHUFFLE(0, 0, 0, 0)); + vY = XM_PERMUTE_PS(vW, _MM_SHUFFLE(1, 1, 1, 1)); + vZ = XM_PERMUTE_PS(vW, _MM_SHUFFLE(2, 2, 2, 2)); + vW = XM_PERMUTE_PS(vW, _MM_SHUFFLE(3, 3, 3, 3)); +#endif + vX = _mm_mul_ps(vX, M2.r[0]); + vY = _mm_mul_ps(vY, M2.r[1]); + vZ = _mm_mul_ps(vZ, M2.r[2]); + vW = _mm_mul_ps(vW, M2.r[3]); + vX = _mm_add_ps(vX, vZ); + vY = _mm_add_ps(vY, vW); + vX = _mm_add_ps(vX, vY); + XMVECTOR r1 = vX; +#if defined(_XM_AVX_INTRINSICS_) + vX = _mm_broadcast_ss(reinterpret_cast(&M1.r[2]) + 0); + vY = _mm_broadcast_ss(reinterpret_cast(&M1.r[2]) + 1); + vZ = _mm_broadcast_ss(reinterpret_cast(&M1.r[2]) + 2); + vW = _mm_broadcast_ss(reinterpret_cast(&M1.r[2]) + 3); +#else + vW = M1.r[2]; + vX = XM_PERMUTE_PS(vW, _MM_SHUFFLE(0, 0, 0, 0)); + vY = XM_PERMUTE_PS(vW, _MM_SHUFFLE(1, 1, 1, 1)); + vZ = XM_PERMUTE_PS(vW, _MM_SHUFFLE(2, 2, 2, 2)); + vW = XM_PERMUTE_PS(vW, _MM_SHUFFLE(3, 3, 3, 3)); +#endif + vX = _mm_mul_ps(vX, M2.r[0]); + vY = _mm_mul_ps(vY, M2.r[1]); + vZ = _mm_mul_ps(vZ, M2.r[2]); + vW = _mm_mul_ps(vW, M2.r[3]); + vX = _mm_add_ps(vX, vZ); + vY = _mm_add_ps(vY, vW); + vX = _mm_add_ps(vX, vY); + XMVECTOR r2 = vX; +#if defined(_XM_AVX_INTRINSICS_) + vX = _mm_broadcast_ss(reinterpret_cast(&M1.r[3]) + 0); + vY = _mm_broadcast_ss(reinterpret_cast(&M1.r[3]) + 1); + vZ = _mm_broadcast_ss(reinterpret_cast(&M1.r[3]) + 2); + vW = _mm_broadcast_ss(reinterpret_cast(&M1.r[3]) + 3); +#else + vW = M1.r[3]; + vX = XM_PERMUTE_PS(vW, _MM_SHUFFLE(0, 0, 0, 0)); + vY = XM_PERMUTE_PS(vW, _MM_SHUFFLE(1, 1, 1, 1)); + vZ = XM_PERMUTE_PS(vW, _MM_SHUFFLE(2, 2, 2, 2)); + vW = XM_PERMUTE_PS(vW, _MM_SHUFFLE(3, 3, 3, 3)); +#endif + vX = _mm_mul_ps(vX, M2.r[0]); + vY = _mm_mul_ps(vY, M2.r[1]); + vZ = _mm_mul_ps(vZ, M2.r[2]); + vW = _mm_mul_ps(vW, M2.r[3]); + vX = _mm_add_ps(vX, vZ); + vY = _mm_add_ps(vY, vW); + vX = _mm_add_ps(vX, vY); + XMVECTOR r3 = vX; + + // Transpose result + // x.x,x.y,y.x,y.y + XMVECTOR vTemp1 = _mm_shuffle_ps(r0, r1, _MM_SHUFFLE(1, 0, 1, 0)); + // x.z,x.w,y.z,y.w + XMVECTOR vTemp3 = _mm_shuffle_ps(r0, r1, _MM_SHUFFLE(3, 2, 3, 2)); + // z.x,z.y,w.x,w.y + XMVECTOR vTemp2 = _mm_shuffle_ps(r2, r3, _MM_SHUFFLE(1, 0, 1, 0)); + // z.z,z.w,w.z,w.w + XMVECTOR vTemp4 = _mm_shuffle_ps(r2, r3, _MM_SHUFFLE(3, 2, 3, 2)); + + XMMATRIX mResult; + // x.x,y.x,z.x,w.x + mResult.r[0] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(2, 0, 2, 0)); + // x.y,y.y,z.y,w.y + mResult.r[1] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(3, 1, 3, 1)); + // x.z,y.z,z.z,w.z + mResult.r[2] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 0, 2, 0)); + // x.w,y.w,z.w,w.w + mResult.r[3] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(3, 1, 3, 1)); + return mResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixTranspose(FXMMATRIX M) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + // Original matrix: + // + // m00m01m02m03 + // m10m11m12m13 + // m20m21m22m23 + // m30m31m32m33 + + XMMATRIX P; + P.r[0] = XMVectorMergeXY(M.r[0], M.r[2]); // m00m20m01m21 + P.r[1] = XMVectorMergeXY(M.r[1], M.r[3]); // m10m30m11m31 + P.r[2] = XMVectorMergeZW(M.r[0], M.r[2]); // m02m22m03m23 + P.r[3] = XMVectorMergeZW(M.r[1], M.r[3]); // m12m32m13m33 + + XMMATRIX MT; + MT.r[0] = XMVectorMergeXY(P.r[0], P.r[1]); // m00m10m20m30 + MT.r[1] = XMVectorMergeZW(P.r[0], P.r[1]); // m01m11m21m31 + MT.r[2] = XMVectorMergeXY(P.r[2], P.r[3]); // m02m12m22m32 + MT.r[3] = XMVectorMergeZW(P.r[2], P.r[3]); // m03m13m23m33 + return MT; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4x2_t P0 = vzipq_f32(M.r[0], M.r[2]); + float32x4x2_t P1 = vzipq_f32(M.r[1], M.r[3]); + + float32x4x2_t T0 = vzipq_f32(P0.val[0], P1.val[0]); + float32x4x2_t T1 = vzipq_f32(P0.val[1], P1.val[1]); + + XMMATRIX mResult; + mResult.r[0] = T0.val[0]; + mResult.r[1] = T0.val[1]; + mResult.r[2] = T1.val[0]; + mResult.r[3] = T1.val[1]; + return mResult; +#elif defined(_XM_AVX2_INTRINSICS_) + __m256 t0 = _mm256_castps128_ps256(M.r[0]); + t0 = _mm256_insertf128_ps(t0, M.r[1], 1); + __m256 t1 = _mm256_castps128_ps256(M.r[2]); + t1 = _mm256_insertf128_ps(t1, M.r[3], 1); + + __m256 vTemp = _mm256_unpacklo_ps(t0, t1); + __m256 vTemp2 = _mm256_unpackhi_ps(t0, t1); + __m256 vTemp3 = _mm256_permute2f128_ps(vTemp, vTemp2, 0x20); + __m256 vTemp4 = _mm256_permute2f128_ps(vTemp, vTemp2, 0x31); + vTemp = _mm256_unpacklo_ps(vTemp3, vTemp4); + vTemp2 = _mm256_unpackhi_ps(vTemp3, vTemp4); + t0 = _mm256_permute2f128_ps(vTemp, vTemp2, 0x20); + t1 = _mm256_permute2f128_ps(vTemp, vTemp2, 0x31); + + XMMATRIX mResult; + mResult.r[0] = _mm256_castps256_ps128(t0); + mResult.r[1] = _mm256_extractf128_ps(t0, 1); + mResult.r[2] = _mm256_castps256_ps128(t1); + mResult.r[3] = _mm256_extractf128_ps(t1, 1); + return mResult; +#elif defined(_XM_SSE_INTRINSICS_) + // x.x,x.y,y.x,y.y + XMVECTOR vTemp1 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(1, 0, 1, 0)); + // x.z,x.w,y.z,y.w + XMVECTOR vTemp3 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(3, 2, 3, 2)); + // z.x,z.y,w.x,w.y + XMVECTOR vTemp2 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(1, 0, 1, 0)); + // z.z,z.w,w.z,w.w + XMVECTOR vTemp4 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(3, 2, 3, 2)); + + XMMATRIX mResult; + // x.x,y.x,z.x,w.x + mResult.r[0] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(2, 0, 2, 0)); + // x.y,y.y,z.y,w.y + mResult.r[1] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(3, 1, 3, 1)); + // x.z,y.z,z.z,w.z + mResult.r[2] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 0, 2, 0)); + // x.w,y.w,z.w,w.w + mResult.r[3] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(3, 1, 3, 1)); + return mResult; +#endif +} + +//------------------------------------------------------------------------------ +// Return the inverse and the determinant of a 4x4 matrix +_Use_decl_annotations_ +inline XMMATRIX XM_CALLCONV XMMatrixInverse +( + XMVECTOR* pDeterminant, + FXMMATRIX M +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) + + XMMATRIX MT = XMMatrixTranspose(M); + + XMVECTOR V0[4], V1[4]; + V0[0] = XMVectorSwizzle(MT.r[2]); + V1[0] = XMVectorSwizzle(MT.r[3]); + V0[1] = XMVectorSwizzle(MT.r[0]); + V1[1] = XMVectorSwizzle(MT.r[1]); + V0[2] = XMVectorPermute(MT.r[2], MT.r[0]); + V1[2] = XMVectorPermute(MT.r[3], MT.r[1]); + + XMVECTOR D0 = XMVectorMultiply(V0[0], V1[0]); + XMVECTOR D1 = XMVectorMultiply(V0[1], V1[1]); + XMVECTOR D2 = XMVectorMultiply(V0[2], V1[2]); + + V0[0] = XMVectorSwizzle(MT.r[2]); + V1[0] = XMVectorSwizzle(MT.r[3]); + V0[1] = XMVectorSwizzle(MT.r[0]); + V1[1] = XMVectorSwizzle(MT.r[1]); + V0[2] = XMVectorPermute(MT.r[2], MT.r[0]); + V1[2] = XMVectorPermute(MT.r[3], MT.r[1]); + + D0 = XMVectorNegativeMultiplySubtract(V0[0], V1[0], D0); + D1 = XMVectorNegativeMultiplySubtract(V0[1], V1[1], D1); + D2 = XMVectorNegativeMultiplySubtract(V0[2], V1[2], D2); + + V0[0] = XMVectorSwizzle(MT.r[1]); + V1[0] = XMVectorPermute(D0, D2); + V0[1] = XMVectorSwizzle(MT.r[0]); + V1[1] = XMVectorPermute(D0, D2); + V0[2] = XMVectorSwizzle(MT.r[3]); + V1[2] = XMVectorPermute(D1, D2); + V0[3] = XMVectorSwizzle(MT.r[2]); + V1[3] = XMVectorPermute(D1, D2); + + XMVECTOR C0 = XMVectorMultiply(V0[0], V1[0]); + XMVECTOR C2 = XMVectorMultiply(V0[1], V1[1]); + XMVECTOR C4 = XMVectorMultiply(V0[2], V1[2]); + XMVECTOR C6 = XMVectorMultiply(V0[3], V1[3]); + + V0[0] = XMVectorSwizzle(MT.r[1]); + V1[0] = XMVectorPermute(D0, D2); + V0[1] = XMVectorSwizzle(MT.r[0]); + V1[1] = XMVectorPermute(D0, D2); + V0[2] = XMVectorSwizzle(MT.r[3]); + V1[2] = XMVectorPermute(D1, D2); + V0[3] = XMVectorSwizzle(MT.r[2]); + V1[3] = XMVectorPermute(D1, D2); + + C0 = XMVectorNegativeMultiplySubtract(V0[0], V1[0], C0); + C2 = XMVectorNegativeMultiplySubtract(V0[1], V1[1], C2); + C4 = XMVectorNegativeMultiplySubtract(V0[2], V1[2], C4); + C6 = XMVectorNegativeMultiplySubtract(V0[3], V1[3], C6); + + V0[0] = XMVectorSwizzle(MT.r[1]); + V1[0] = XMVectorPermute(D0, D2); + V0[1] = XMVectorSwizzle(MT.r[0]); + V1[1] = XMVectorPermute(D0, D2); + V0[2] = XMVectorSwizzle(MT.r[3]); + V1[2] = XMVectorPermute(D1, D2); + V0[3] = XMVectorSwizzle(MT.r[2]); + V1[3] = XMVectorPermute(D1, D2); + + XMVECTOR C1 = XMVectorNegativeMultiplySubtract(V0[0], V1[0], C0); + C0 = XMVectorMultiplyAdd(V0[0], V1[0], C0); + XMVECTOR C3 = XMVectorMultiplyAdd(V0[1], V1[1], C2); + C2 = XMVectorNegativeMultiplySubtract(V0[1], V1[1], C2); + XMVECTOR C5 = XMVectorNegativeMultiplySubtract(V0[2], V1[2], C4); + C4 = XMVectorMultiplyAdd(V0[2], V1[2], C4); + XMVECTOR C7 = XMVectorMultiplyAdd(V0[3], V1[3], C6); + C6 = XMVectorNegativeMultiplySubtract(V0[3], V1[3], C6); + + XMMATRIX R; + R.r[0] = XMVectorSelect(C0, C1, g_XMSelect0101.v); + R.r[1] = XMVectorSelect(C2, C3, g_XMSelect0101.v); + R.r[2] = XMVectorSelect(C4, C5, g_XMSelect0101.v); + R.r[3] = XMVectorSelect(C6, C7, g_XMSelect0101.v); + + XMVECTOR Determinant = XMVector4Dot(R.r[0], MT.r[0]); + + if (pDeterminant != nullptr) + *pDeterminant = Determinant; + + XMVECTOR Reciprocal = XMVectorReciprocal(Determinant); + + XMMATRIX Result; + Result.r[0] = XMVectorMultiply(R.r[0], Reciprocal); + Result.r[1] = XMVectorMultiply(R.r[1], Reciprocal); + Result.r[2] = XMVectorMultiply(R.r[2], Reciprocal); + Result.r[3] = XMVectorMultiply(R.r[3], Reciprocal); + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Transpose matrix + XMVECTOR vTemp1 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(1, 0, 1, 0)); + XMVECTOR vTemp3 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(3, 2, 3, 2)); + XMVECTOR vTemp2 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(1, 0, 1, 0)); + XMVECTOR vTemp4 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(3, 2, 3, 2)); + + XMMATRIX MT; + MT.r[0] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(2, 0, 2, 0)); + MT.r[1] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(3, 1, 3, 1)); + MT.r[2] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 0, 2, 0)); + MT.r[3] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(3, 1, 3, 1)); + + XMVECTOR V00 = XM_PERMUTE_PS(MT.r[2], _MM_SHUFFLE(1, 1, 0, 0)); + XMVECTOR V10 = XM_PERMUTE_PS(MT.r[3], _MM_SHUFFLE(3, 2, 3, 2)); + XMVECTOR V01 = XM_PERMUTE_PS(MT.r[0], _MM_SHUFFLE(1, 1, 0, 0)); + XMVECTOR V11 = XM_PERMUTE_PS(MT.r[1], _MM_SHUFFLE(3, 2, 3, 2)); + XMVECTOR V02 = _mm_shuffle_ps(MT.r[2], MT.r[0], _MM_SHUFFLE(2, 0, 2, 0)); + XMVECTOR V12 = _mm_shuffle_ps(MT.r[3], MT.r[1], _MM_SHUFFLE(3, 1, 3, 1)); + + XMVECTOR D0 = _mm_mul_ps(V00, V10); + XMVECTOR D1 = _mm_mul_ps(V01, V11); + XMVECTOR D2 = _mm_mul_ps(V02, V12); + + V00 = XM_PERMUTE_PS(MT.r[2], _MM_SHUFFLE(3, 2, 3, 2)); + V10 = XM_PERMUTE_PS(MT.r[3], _MM_SHUFFLE(1, 1, 0, 0)); + V01 = XM_PERMUTE_PS(MT.r[0], _MM_SHUFFLE(3, 2, 3, 2)); + V11 = XM_PERMUTE_PS(MT.r[1], _MM_SHUFFLE(1, 1, 0, 0)); + V02 = _mm_shuffle_ps(MT.r[2], MT.r[0], _MM_SHUFFLE(3, 1, 3, 1)); + V12 = _mm_shuffle_ps(MT.r[3], MT.r[1], _MM_SHUFFLE(2, 0, 2, 0)); + + D0 = XM_FNMADD_PS(V00, V10, D0); + D1 = XM_FNMADD_PS(V01, V11, D1); + D2 = XM_FNMADD_PS(V02, V12, D2); + // V11 = D0Y,D0W,D2Y,D2Y + V11 = _mm_shuffle_ps(D0, D2, _MM_SHUFFLE(1, 1, 3, 1)); + V00 = XM_PERMUTE_PS(MT.r[1], _MM_SHUFFLE(1, 0, 2, 1)); + V10 = _mm_shuffle_ps(V11, D0, _MM_SHUFFLE(0, 3, 0, 2)); + V01 = XM_PERMUTE_PS(MT.r[0], _MM_SHUFFLE(0, 1, 0, 2)); + V11 = _mm_shuffle_ps(V11, D0, _MM_SHUFFLE(2, 1, 2, 1)); + // V13 = D1Y,D1W,D2W,D2W + XMVECTOR V13 = _mm_shuffle_ps(D1, D2, _MM_SHUFFLE(3, 3, 3, 1)); + V02 = XM_PERMUTE_PS(MT.r[3], _MM_SHUFFLE(1, 0, 2, 1)); + V12 = _mm_shuffle_ps(V13, D1, _MM_SHUFFLE(0, 3, 0, 2)); + XMVECTOR V03 = XM_PERMUTE_PS(MT.r[2], _MM_SHUFFLE(0, 1, 0, 2)); + V13 = _mm_shuffle_ps(V13, D1, _MM_SHUFFLE(2, 1, 2, 1)); + + XMVECTOR C0 = _mm_mul_ps(V00, V10); + XMVECTOR C2 = _mm_mul_ps(V01, V11); + XMVECTOR C4 = _mm_mul_ps(V02, V12); + XMVECTOR C6 = _mm_mul_ps(V03, V13); + + // V11 = D0X,D0Y,D2X,D2X + V11 = _mm_shuffle_ps(D0, D2, _MM_SHUFFLE(0, 0, 1, 0)); + V00 = XM_PERMUTE_PS(MT.r[1], _MM_SHUFFLE(2, 1, 3, 2)); + V10 = _mm_shuffle_ps(D0, V11, _MM_SHUFFLE(2, 1, 0, 3)); + V01 = XM_PERMUTE_PS(MT.r[0], _MM_SHUFFLE(1, 3, 2, 3)); + V11 = _mm_shuffle_ps(D0, V11, _MM_SHUFFLE(0, 2, 1, 2)); + // V13 = D1X,D1Y,D2Z,D2Z + V13 = _mm_shuffle_ps(D1, D2, _MM_SHUFFLE(2, 2, 1, 0)); + V02 = XM_PERMUTE_PS(MT.r[3], _MM_SHUFFLE(2, 1, 3, 2)); + V12 = _mm_shuffle_ps(D1, V13, _MM_SHUFFLE(2, 1, 0, 3)); + V03 = XM_PERMUTE_PS(MT.r[2], _MM_SHUFFLE(1, 3, 2, 3)); + V13 = _mm_shuffle_ps(D1, V13, _MM_SHUFFLE(0, 2, 1, 2)); + + C0 = XM_FNMADD_PS(V00, V10, C0); + C2 = XM_FNMADD_PS(V01, V11, C2); + C4 = XM_FNMADD_PS(V02, V12, C4); + C6 = XM_FNMADD_PS(V03, V13, C6); + + V00 = XM_PERMUTE_PS(MT.r[1], _MM_SHUFFLE(0, 3, 0, 3)); + // V10 = D0Z,D0Z,D2X,D2Y + V10 = _mm_shuffle_ps(D0, D2, _MM_SHUFFLE(1, 0, 2, 2)); + V10 = XM_PERMUTE_PS(V10, _MM_SHUFFLE(0, 2, 3, 0)); + V01 = XM_PERMUTE_PS(MT.r[0], _MM_SHUFFLE(2, 0, 3, 1)); + // V11 = D0X,D0W,D2X,D2Y + V11 = _mm_shuffle_ps(D0, D2, _MM_SHUFFLE(1, 0, 3, 0)); + V11 = XM_PERMUTE_PS(V11, _MM_SHUFFLE(2, 1, 0, 3)); + V02 = XM_PERMUTE_PS(MT.r[3], _MM_SHUFFLE(0, 3, 0, 3)); + // V12 = D1Z,D1Z,D2Z,D2W + V12 = _mm_shuffle_ps(D1, D2, _MM_SHUFFLE(3, 2, 2, 2)); + V12 = XM_PERMUTE_PS(V12, _MM_SHUFFLE(0, 2, 3, 0)); + V03 = XM_PERMUTE_PS(MT.r[2], _MM_SHUFFLE(2, 0, 3, 1)); + // V13 = D1X,D1W,D2Z,D2W + V13 = _mm_shuffle_ps(D1, D2, _MM_SHUFFLE(3, 2, 3, 0)); + V13 = XM_PERMUTE_PS(V13, _MM_SHUFFLE(2, 1, 0, 3)); + + V00 = _mm_mul_ps(V00, V10); + V01 = _mm_mul_ps(V01, V11); + V02 = _mm_mul_ps(V02, V12); + V03 = _mm_mul_ps(V03, V13); + XMVECTOR C1 = _mm_sub_ps(C0, V00); + C0 = _mm_add_ps(C0, V00); + XMVECTOR C3 = _mm_add_ps(C2, V01); + C2 = _mm_sub_ps(C2, V01); + XMVECTOR C5 = _mm_sub_ps(C4, V02); + C4 = _mm_add_ps(C4, V02); + XMVECTOR C7 = _mm_add_ps(C6, V03); + C6 = _mm_sub_ps(C6, V03); + + C0 = _mm_shuffle_ps(C0, C1, _MM_SHUFFLE(3, 1, 2, 0)); + C2 = _mm_shuffle_ps(C2, C3, _MM_SHUFFLE(3, 1, 2, 0)); + C4 = _mm_shuffle_ps(C4, C5, _MM_SHUFFLE(3, 1, 2, 0)); + C6 = _mm_shuffle_ps(C6, C7, _MM_SHUFFLE(3, 1, 2, 0)); + C0 = XM_PERMUTE_PS(C0, _MM_SHUFFLE(3, 1, 2, 0)); + C2 = XM_PERMUTE_PS(C2, _MM_SHUFFLE(3, 1, 2, 0)); + C4 = XM_PERMUTE_PS(C4, _MM_SHUFFLE(3, 1, 2, 0)); + C6 = XM_PERMUTE_PS(C6, _MM_SHUFFLE(3, 1, 2, 0)); + // Get the determinant + XMVECTOR vTemp = XMVector4Dot(C0, MT.r[0]); + if (pDeterminant != nullptr) + *pDeterminant = vTemp; + vTemp = _mm_div_ps(g_XMOne, vTemp); + XMMATRIX mResult; + mResult.r[0] = _mm_mul_ps(C0, vTemp); + mResult.r[1] = _mm_mul_ps(C2, vTemp); + mResult.r[2] = _mm_mul_ps(C4, vTemp); + mResult.r[3] = _mm_mul_ps(C6, vTemp); + return mResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixVectorTensorProduct +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ + XMMATRIX mResult; + mResult.r[0] = XMVectorMultiply(XMVectorSwizzle<0, 0, 0, 0>(V1), V2); + mResult.r[1] = XMVectorMultiply(XMVectorSwizzle<1, 1, 1, 1>(V1), V2); + mResult.r[2] = XMVectorMultiply(XMVectorSwizzle<2, 2, 2, 2>(V1), V2); + mResult.r[3] = XMVectorMultiply(XMVectorSwizzle<3, 3, 3, 3>(V1), V2); + return mResult; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMMatrixDeterminant(FXMMATRIX M) noexcept +{ + static const XMVECTORF32 Sign = { { { 1.0f, -1.0f, 1.0f, -1.0f } } }; + + XMVECTOR V0 = XMVectorSwizzle(M.r[2]); + XMVECTOR V1 = XMVectorSwizzle(M.r[3]); + XMVECTOR V2 = XMVectorSwizzle(M.r[2]); + XMVECTOR V3 = XMVectorSwizzle(M.r[3]); + XMVECTOR V4 = XMVectorSwizzle(M.r[2]); + XMVECTOR V5 = XMVectorSwizzle(M.r[3]); + + XMVECTOR P0 = XMVectorMultiply(V0, V1); + XMVECTOR P1 = XMVectorMultiply(V2, V3); + XMVECTOR P2 = XMVectorMultiply(V4, V5); + + V0 = XMVectorSwizzle(M.r[2]); + V1 = XMVectorSwizzle(M.r[3]); + V2 = XMVectorSwizzle(M.r[2]); + V3 = XMVectorSwizzle(M.r[3]); + V4 = XMVectorSwizzle(M.r[2]); + V5 = XMVectorSwizzle(M.r[3]); + + P0 = XMVectorNegativeMultiplySubtract(V0, V1, P0); + P1 = XMVectorNegativeMultiplySubtract(V2, V3, P1); + P2 = XMVectorNegativeMultiplySubtract(V4, V5, P2); + + V0 = XMVectorSwizzle(M.r[1]); + V1 = XMVectorSwizzle(M.r[1]); + V2 = XMVectorSwizzle(M.r[1]); + + XMVECTOR S = XMVectorMultiply(M.r[0], Sign.v); + XMVECTOR R = XMVectorMultiply(V0, P0); + R = XMVectorNegativeMultiplySubtract(V1, P1, R); + R = XMVectorMultiplyAdd(V2, P2, R); + + return XMVector4Dot(S, R); +} + +#define XM3RANKDECOMPOSE(a, b, c, x, y, z) \ + if((x) < (y)) \ + { \ + if((y) < (z)) \ + { \ + (a) = 2; \ + (b) = 1; \ + (c) = 0; \ + } \ + else \ + { \ + (a) = 1; \ + \ + if((x) < (z)) \ + { \ + (b) = 2; \ + (c) = 0; \ + } \ + else \ + { \ + (b) = 0; \ + (c) = 2; \ + } \ + } \ + } \ + else \ + { \ + if((x) < (z)) \ + { \ + (a) = 2; \ + (b) = 0; \ + (c) = 1; \ + } \ + else \ + { \ + (a) = 0; \ + \ + if((y) < (z)) \ + { \ + (b) = 2; \ + (c) = 1; \ + } \ + else \ + { \ + (b) = 1; \ + (c) = 2; \ + } \ + } \ + } + +#define XM3_DECOMP_EPSILON 0.0001f + +_Use_decl_annotations_ +inline bool XM_CALLCONV XMMatrixDecompose +( + XMVECTOR* outScale, + XMVECTOR* outRotQuat, + XMVECTOR* outTrans, + FXMMATRIX M +) noexcept +{ + static const XMVECTOR* pvCanonicalBasis[3] = { + &g_XMIdentityR0.v, + &g_XMIdentityR1.v, + &g_XMIdentityR2.v + }; + + assert(outScale != nullptr); + assert(outRotQuat != nullptr); + assert(outTrans != nullptr); + + // Get the translation + outTrans[0] = M.r[3]; + + XMVECTOR* ppvBasis[3]; + XMMATRIX matTemp; + ppvBasis[0] = &matTemp.r[0]; + ppvBasis[1] = &matTemp.r[1]; + ppvBasis[2] = &matTemp.r[2]; + + matTemp.r[0] = M.r[0]; + matTemp.r[1] = M.r[1]; + matTemp.r[2] = M.r[2]; + matTemp.r[3] = g_XMIdentityR3.v; + + auto pfScales = reinterpret_cast(outScale); + + size_t a, b, c; + XMVectorGetXPtr(&pfScales[0], XMVector3Length(ppvBasis[0][0])); + XMVectorGetXPtr(&pfScales[1], XMVector3Length(ppvBasis[1][0])); + XMVectorGetXPtr(&pfScales[2], XMVector3Length(ppvBasis[2][0])); + pfScales[3] = 0.f; + + XM3RANKDECOMPOSE(a, b, c, pfScales[0], pfScales[1], pfScales[2]) + + if (pfScales[a] < XM3_DECOMP_EPSILON) + { + ppvBasis[a][0] = pvCanonicalBasis[a][0]; + } + ppvBasis[a][0] = XMVector3Normalize(ppvBasis[a][0]); + + if (pfScales[b] < XM3_DECOMP_EPSILON) + { + size_t aa, bb, cc; + float fAbsX, fAbsY, fAbsZ; + + fAbsX = fabsf(XMVectorGetX(ppvBasis[a][0])); + fAbsY = fabsf(XMVectorGetY(ppvBasis[a][0])); + fAbsZ = fabsf(XMVectorGetZ(ppvBasis[a][0])); + + XM3RANKDECOMPOSE(aa, bb, cc, fAbsX, fAbsY, fAbsZ) + + ppvBasis[b][0] = XMVector3Cross(ppvBasis[a][0], pvCanonicalBasis[cc][0]); + } + + ppvBasis[b][0] = XMVector3Normalize(ppvBasis[b][0]); + + if (pfScales[c] < XM3_DECOMP_EPSILON) + { + ppvBasis[c][0] = XMVector3Cross(ppvBasis[a][0], ppvBasis[b][0]); + } + + ppvBasis[c][0] = XMVector3Normalize(ppvBasis[c][0]); + + float fDet = XMVectorGetX(XMMatrixDeterminant(matTemp)); + + // use Kramer's rule to check for handedness of coordinate system + if (fDet < 0.0f) + { + // switch coordinate system by negating the scale and inverting the basis vector on the x-axis + pfScales[a] = -pfScales[a]; + ppvBasis[a][0] = XMVectorNegate(ppvBasis[a][0]); + + fDet = -fDet; + } + + fDet -= 1.0f; + fDet *= fDet; + + if (XM3_DECOMP_EPSILON < fDet) + { + // Non-SRT matrix encountered + return false; + } + + // generate the quaternion from the matrix + outRotQuat[0] = XMQuaternionRotationMatrix(matTemp); + return true; +} + +#undef XM3_DECOMP_EPSILON +#undef XM3RANKDECOMPOSE + +//------------------------------------------------------------------------------ +// Transformation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixIdentity() noexcept +{ + XMMATRIX M; + M.r[0] = g_XMIdentityR0.v; + M.r[1] = g_XMIdentityR1.v; + M.r[2] = g_XMIdentityR2.v; + M.r[3] = g_XMIdentityR3.v; + return M; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixSet +( + float m00, float m01, float m02, float m03, + float m10, float m11, float m12, float m13, + float m20, float m21, float m22, float m23, + float m30, float m31, float m32, float m33 +) noexcept +{ + XMMATRIX M; +#if defined(_XM_NO_INTRINSICS_) + M.m[0][0] = m00; M.m[0][1] = m01; M.m[0][2] = m02; M.m[0][3] = m03; + M.m[1][0] = m10; M.m[1][1] = m11; M.m[1][2] = m12; M.m[1][3] = m13; + M.m[2][0] = m20; M.m[2][1] = m21; M.m[2][2] = m22; M.m[2][3] = m23; + M.m[3][0] = m30; M.m[3][1] = m31; M.m[3][2] = m32; M.m[3][3] = m33; +#else + M.r[0] = XMVectorSet(m00, m01, m02, m03); + M.r[1] = XMVectorSet(m10, m11, m12, m13); + M.r[2] = XMVectorSet(m20, m21, m22, m23); + M.r[3] = XMVectorSet(m30, m31, m32, m33); +#endif + return M; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixTranslation +( + float OffsetX, + float OffsetY, + float OffsetZ +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + M.m[0][0] = 1.0f; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = 1.0f; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = 1.0f; + M.m[2][3] = 0.0f; + + M.m[3][0] = OffsetX; + M.m[3][1] = OffsetY; + M.m[3][2] = OffsetZ; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_SSE_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) + XMMATRIX M; + M.r[0] = g_XMIdentityR0.v; + M.r[1] = g_XMIdentityR1.v; + M.r[2] = g_XMIdentityR2.v; + M.r[3] = XMVectorSet(OffsetX, OffsetY, OffsetZ, 1.f); + return M; +#endif +} + + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixTranslationFromVector(FXMVECTOR Offset) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + M.m[0][0] = 1.0f; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = 1.0f; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = 1.0f; + M.m[2][3] = 0.0f; + + M.m[3][0] = Offset.vector4_f32[0]; + M.m[3][1] = Offset.vector4_f32[1]; + M.m[3][2] = Offset.vector4_f32[2]; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_SSE_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) + XMMATRIX M; + M.r[0] = g_XMIdentityR0.v; + M.r[1] = g_XMIdentityR1.v; + M.r[2] = g_XMIdentityR2.v; + M.r[3] = XMVectorSelect(g_XMIdentityR3.v, Offset, g_XMSelect1110.v); + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixScaling +( + float ScaleX, + float ScaleY, + float ScaleZ +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + M.m[0][0] = ScaleX; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = ScaleY; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = ScaleZ; + M.m[2][3] = 0.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = 0.0f; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + const XMVECTOR Zero = vdupq_n_f32(0); + XMMATRIX M; + M.r[0] = vsetq_lane_f32(ScaleX, Zero, 0); + M.r[1] = vsetq_lane_f32(ScaleY, Zero, 1); + M.r[2] = vsetq_lane_f32(ScaleZ, Zero, 2); + M.r[3] = g_XMIdentityR3.v; + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + M.r[0] = _mm_set_ps(0, 0, 0, ScaleX); + M.r[1] = _mm_set_ps(0, 0, ScaleY, 0); + M.r[2] = _mm_set_ps(0, ScaleZ, 0, 0); + M.r[3] = g_XMIdentityR3.v; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixScalingFromVector(FXMVECTOR Scale) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + M.m[0][0] = Scale.vector4_f32[0]; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = Scale.vector4_f32[1]; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = Scale.vector4_f32[2]; + M.m[2][3] = 0.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = 0.0f; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMMATRIX M; + M.r[0] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(Scale), g_XMMaskX)); + M.r[1] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(Scale), g_XMMaskY)); + M.r[2] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(Scale), g_XMMaskZ)); + M.r[3] = g_XMIdentityR3.v; + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + M.r[0] = _mm_and_ps(Scale, g_XMMaskX); + M.r[1] = _mm_and_ps(Scale, g_XMMaskY); + M.r[2] = _mm_and_ps(Scale, g_XMMaskZ); + M.r[3] = g_XMIdentityR3.v; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixRotationX(float Angle) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + float fSinAngle; + float fCosAngle; + XMScalarSinCos(&fSinAngle, &fCosAngle, Angle); + + XMMATRIX M; + M.m[0][0] = 1.0f; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = fCosAngle; + M.m[1][2] = fSinAngle; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = -fSinAngle; + M.m[2][2] = fCosAngle; + M.m[2][3] = 0.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = 0.0f; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float fSinAngle; + float fCosAngle; + XMScalarSinCos(&fSinAngle, &fCosAngle, Angle); + + const float32x4_t Zero = vdupq_n_f32(0); + + float32x4_t T1 = vsetq_lane_f32(fCosAngle, Zero, 1); + T1 = vsetq_lane_f32(fSinAngle, T1, 2); + + float32x4_t T2 = vsetq_lane_f32(-fSinAngle, Zero, 1); + T2 = vsetq_lane_f32(fCosAngle, T2, 2); + + XMMATRIX M; + M.r[0] = g_XMIdentityR0.v; + M.r[1] = T1; + M.r[2] = T2; + M.r[3] = g_XMIdentityR3.v; + return M; +#elif defined(_XM_SSE_INTRINSICS_) + float SinAngle; + float CosAngle; + XMScalarSinCos(&SinAngle, &CosAngle, Angle); + + XMVECTOR vSin = _mm_set_ss(SinAngle); + XMVECTOR vCos = _mm_set_ss(CosAngle); + // x = 0,y = cos,z = sin, w = 0 + vCos = _mm_shuffle_ps(vCos, vSin, _MM_SHUFFLE(3, 0, 0, 3)); + XMMATRIX M; + M.r[0] = g_XMIdentityR0; + M.r[1] = vCos; + // x = 0,y = sin,z = cos, w = 0 + vCos = XM_PERMUTE_PS(vCos, _MM_SHUFFLE(3, 1, 2, 0)); + // x = 0,y = -sin,z = cos, w = 0 + vCos = _mm_mul_ps(vCos, g_XMNegateY); + M.r[2] = vCos; + M.r[3] = g_XMIdentityR3; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixRotationY(float Angle) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + float fSinAngle; + float fCosAngle; + XMScalarSinCos(&fSinAngle, &fCosAngle, Angle); + + XMMATRIX M; + M.m[0][0] = fCosAngle; + M.m[0][1] = 0.0f; + M.m[0][2] = -fSinAngle; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = 1.0f; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = fSinAngle; + M.m[2][1] = 0.0f; + M.m[2][2] = fCosAngle; + M.m[2][3] = 0.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = 0.0f; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float fSinAngle; + float fCosAngle; + XMScalarSinCos(&fSinAngle, &fCosAngle, Angle); + + const float32x4_t Zero = vdupq_n_f32(0); + + float32x4_t T0 = vsetq_lane_f32(fCosAngle, Zero, 0); + T0 = vsetq_lane_f32(-fSinAngle, T0, 2); + + float32x4_t T2 = vsetq_lane_f32(fSinAngle, Zero, 0); + T2 = vsetq_lane_f32(fCosAngle, T2, 2); + + XMMATRIX M; + M.r[0] = T0; + M.r[1] = g_XMIdentityR1.v; + M.r[2] = T2; + M.r[3] = g_XMIdentityR3.v; + return M; +#elif defined(_XM_SSE_INTRINSICS_) + float SinAngle; + float CosAngle; + XMScalarSinCos(&SinAngle, &CosAngle, Angle); + + XMVECTOR vSin = _mm_set_ss(SinAngle); + XMVECTOR vCos = _mm_set_ss(CosAngle); + // x = sin,y = 0,z = cos, w = 0 + vSin = _mm_shuffle_ps(vSin, vCos, _MM_SHUFFLE(3, 0, 3, 0)); + XMMATRIX M; + M.r[2] = vSin; + M.r[1] = g_XMIdentityR1; + // x = cos,y = 0,z = sin, w = 0 + vSin = XM_PERMUTE_PS(vSin, _MM_SHUFFLE(3, 0, 1, 2)); + // x = cos,y = 0,z = -sin, w = 0 + vSin = _mm_mul_ps(vSin, g_XMNegateZ); + M.r[0] = vSin; + M.r[3] = g_XMIdentityR3; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixRotationZ(float Angle) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + float fSinAngle; + float fCosAngle; + XMScalarSinCos(&fSinAngle, &fCosAngle, Angle); + + XMMATRIX M; + M.m[0][0] = fCosAngle; + M.m[0][1] = fSinAngle; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = -fSinAngle; + M.m[1][1] = fCosAngle; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = 1.0f; + M.m[2][3] = 0.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = 0.0f; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float fSinAngle; + float fCosAngle; + XMScalarSinCos(&fSinAngle, &fCosAngle, Angle); + + const float32x4_t Zero = vdupq_n_f32(0); + + float32x4_t T0 = vsetq_lane_f32(fCosAngle, Zero, 0); + T0 = vsetq_lane_f32(fSinAngle, T0, 1); + + float32x4_t T1 = vsetq_lane_f32(-fSinAngle, Zero, 0); + T1 = vsetq_lane_f32(fCosAngle, T1, 1); + + XMMATRIX M; + M.r[0] = T0; + M.r[1] = T1; + M.r[2] = g_XMIdentityR2.v; + M.r[3] = g_XMIdentityR3.v; + return M; +#elif defined(_XM_SSE_INTRINSICS_) + float SinAngle; + float CosAngle; + XMScalarSinCos(&SinAngle, &CosAngle, Angle); + + XMVECTOR vSin = _mm_set_ss(SinAngle); + XMVECTOR vCos = _mm_set_ss(CosAngle); + // x = cos,y = sin,z = 0, w = 0 + vCos = _mm_unpacklo_ps(vCos, vSin); + XMMATRIX M; + M.r[0] = vCos; + // x = sin,y = cos,z = 0, w = 0 + vCos = XM_PERMUTE_PS(vCos, _MM_SHUFFLE(3, 2, 0, 1)); + // x = cos,y = -sin,z = 0, w = 0 + vCos = _mm_mul_ps(vCos, g_XMNegateX); + M.r[1] = vCos; + M.r[2] = g_XMIdentityR2; + M.r[3] = g_XMIdentityR3; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixRotationRollPitchYaw +( + float Pitch, + float Yaw, + float Roll +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + float cp = cosf(Pitch); + float sp = sinf(Pitch); + + float cy = cosf(Yaw); + float sy = sinf(Yaw); + + float cr = cosf(Roll); + float sr = sinf(Roll); + + XMMATRIX M; + M.m[0][0] = cr * cy + sr * sp * sy; + M.m[0][1] = sr * cp; + M.m[0][2] = sr * sp * cy - cr * sy; + M.m[0][3] = 0.0f; + + M.m[1][0] = cr * sp * sy - sr * cy; + M.m[1][1] = cr * cp; + M.m[1][2] = sr * sy + cr * sp * cy; + M.m[1][3] = 0.0f; + + M.m[2][0] = cp * sy; + M.m[2][1] = -sp; + M.m[2][2] = cp * cy; + M.m[2][3] = 0.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = 0.0f; + M.m[3][3] = 1.0f; + return M; +#else + XMVECTOR Angles = XMVectorSet(Pitch, Yaw, Roll, 0.0f); + return XMMatrixRotationRollPitchYawFromVector(Angles); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixRotationRollPitchYawFromVector +( + FXMVECTOR Angles // +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + float cp = cosf(Angles.vector4_f32[0]); + float sp = sinf(Angles.vector4_f32[0]); + + float cy = cosf(Angles.vector4_f32[1]); + float sy = sinf(Angles.vector4_f32[1]); + + float cr = cosf(Angles.vector4_f32[2]); + float sr = sinf(Angles.vector4_f32[2]); + + XMMATRIX M; + M.m[0][0] = cr * cy + sr * sp * sy; + M.m[0][1] = sr * cp; + M.m[0][2] = sr * sp * cy - cr * sy; + M.m[0][3] = 0.0f; + + M.m[1][0] = cr * sp * sy - sr * cy; + M.m[1][1] = cr * cp; + M.m[1][2] = sr * sy + cr * sp * cy; + M.m[1][3] = 0.0f; + + M.m[2][0] = cp * sy; + M.m[2][1] = -sp; + M.m[2][2] = cp * cy; + M.m[2][3] = 0.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = 0.0f; + M.m[3][3] = 1.0f; + return M; +#else + static const XMVECTORF32 Sign = { { { 1.0f, -1.0f, -1.0f, 1.0f } } }; + + XMVECTOR SinAngles, CosAngles; + XMVectorSinCos(&SinAngles, &CosAngles, Angles); + + XMVECTOR P0 = XMVectorPermute(SinAngles, CosAngles); + XMVECTOR Y0 = XMVectorPermute(SinAngles, CosAngles); + XMVECTOR P1 = XMVectorPermute(SinAngles, CosAngles); + XMVECTOR Y1 = XMVectorPermute(SinAngles, CosAngles); + XMVECTOR P2 = XMVectorPermute(SinAngles, CosAngles); + XMVECTOR P3 = XMVectorPermute(SinAngles, CosAngles); + XMVECTOR Y2 = XMVectorSplatX(SinAngles); + XMVECTOR NS = XMVectorNegate(SinAngles); + + XMVECTOR Q0 = XMVectorMultiply(P0, Y0); + XMVECTOR Q1 = XMVectorMultiply(P1, Sign.v); + Q1 = XMVectorMultiply(Q1, Y1); + XMVECTOR Q2 = XMVectorMultiply(P2, Y2); + Q2 = XMVectorMultiplyAdd(Q2, P3, Q1); + + XMVECTOR V0 = XMVectorPermute(Q0, Q2); + XMVECTOR V1 = XMVectorPermute(Q0, Q2); + XMVECTOR V2 = XMVectorPermute(Q0, NS); + + XMMATRIX M; + M.r[0] = XMVectorSelect(g_XMZero, V0, g_XMSelect1110.v); + M.r[1] = XMVectorSelect(g_XMZero, V1, g_XMSelect1110.v); + M.r[2] = XMVectorSelect(g_XMZero, V2, g_XMSelect1110.v); + M.r[3] = g_XMIdentityR3; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixRotationNormal +( + FXMVECTOR NormalAxis, + float Angle +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) + + float fSinAngle; + float fCosAngle; + XMScalarSinCos(&fSinAngle, &fCosAngle, Angle); + + XMVECTOR A = XMVectorSet(fSinAngle, fCosAngle, 1.0f - fCosAngle, 0.0f); + + XMVECTOR C2 = XMVectorSplatZ(A); + XMVECTOR C1 = XMVectorSplatY(A); + XMVECTOR C0 = XMVectorSplatX(A); + + XMVECTOR N0 = XMVectorSwizzle(NormalAxis); + XMVECTOR N1 = XMVectorSwizzle(NormalAxis); + + XMVECTOR V0 = XMVectorMultiply(C2, N0); + V0 = XMVectorMultiply(V0, N1); + + XMVECTOR R0 = XMVectorMultiply(C2, NormalAxis); + R0 = XMVectorMultiplyAdd(R0, NormalAxis, C1); + + XMVECTOR R1 = XMVectorMultiplyAdd(C0, NormalAxis, V0); + XMVECTOR R2 = XMVectorNegativeMultiplySubtract(C0, NormalAxis, V0); + + V0 = XMVectorSelect(A, R0, g_XMSelect1110.v); + XMVECTOR V1 = XMVectorPermute(R1, R2); + XMVECTOR V2 = XMVectorPermute(R1, R2); + + XMMATRIX M; + M.r[0] = XMVectorPermute(V0, V1); + M.r[1] = XMVectorPermute(V0, V1); + M.r[2] = XMVectorPermute(V0, V2); + M.r[3] = g_XMIdentityR3.v; + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + float fSinAngle; + float fCosAngle; + XMScalarSinCos(&fSinAngle, &fCosAngle, Angle); + + XMVECTOR C2 = _mm_set_ps1(1.0f - fCosAngle); + XMVECTOR C1 = _mm_set_ps1(fCosAngle); + XMVECTOR C0 = _mm_set_ps1(fSinAngle); + + XMVECTOR N0 = XM_PERMUTE_PS(NormalAxis, _MM_SHUFFLE(3, 0, 2, 1)); + XMVECTOR N1 = XM_PERMUTE_PS(NormalAxis, _MM_SHUFFLE(3, 1, 0, 2)); + + XMVECTOR V0 = _mm_mul_ps(C2, N0); + V0 = _mm_mul_ps(V0, N1); + + XMVECTOR R0 = _mm_mul_ps(C2, NormalAxis); + R0 = _mm_mul_ps(R0, NormalAxis); + R0 = _mm_add_ps(R0, C1); + + XMVECTOR R1 = _mm_mul_ps(C0, NormalAxis); + R1 = _mm_add_ps(R1, V0); + XMVECTOR R2 = _mm_mul_ps(C0, NormalAxis); + R2 = _mm_sub_ps(V0, R2); + + V0 = _mm_and_ps(R0, g_XMMask3); + XMVECTOR V1 = _mm_shuffle_ps(R1, R2, _MM_SHUFFLE(2, 1, 2, 0)); + V1 = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 3, 2, 1)); + XMVECTOR V2 = _mm_shuffle_ps(R1, R2, _MM_SHUFFLE(0, 0, 1, 1)); + V2 = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 0, 2, 0)); + + R2 = _mm_shuffle_ps(V0, V1, _MM_SHUFFLE(1, 0, 3, 0)); + R2 = XM_PERMUTE_PS(R2, _MM_SHUFFLE(1, 3, 2, 0)); + + XMMATRIX M; + M.r[0] = R2; + + R2 = _mm_shuffle_ps(V0, V1, _MM_SHUFFLE(3, 2, 3, 1)); + R2 = XM_PERMUTE_PS(R2, _MM_SHUFFLE(1, 3, 0, 2)); + M.r[1] = R2; + + V2 = _mm_shuffle_ps(V2, V0, _MM_SHUFFLE(3, 2, 1, 0)); + M.r[2] = V2; + M.r[3] = g_XMIdentityR3.v; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixRotationAxis +( + FXMVECTOR Axis, + float Angle +) noexcept +{ + assert(!XMVector3Equal(Axis, XMVectorZero())); + assert(!XMVector3IsInfinite(Axis)); + + XMVECTOR Normal = XMVector3Normalize(Axis); + return XMMatrixRotationNormal(Normal, Angle); +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixRotationQuaternion(FXMVECTOR Quaternion) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + float qx = Quaternion.vector4_f32[0]; + float qxx = qx * qx; + + float qy = Quaternion.vector4_f32[1]; + float qyy = qy * qy; + + float qz = Quaternion.vector4_f32[2]; + float qzz = qz * qz; + + float qw = Quaternion.vector4_f32[3]; + + XMMATRIX M; + M.m[0][0] = 1.f - 2.f * qyy - 2.f * qzz; + M.m[0][1] = 2.f * qx * qy + 2.f * qz * qw; + M.m[0][2] = 2.f * qx * qz - 2.f * qy * qw; + M.m[0][3] = 0.f; + + M.m[1][0] = 2.f * qx * qy - 2.f * qz * qw; + M.m[1][1] = 1.f - 2.f * qxx - 2.f * qzz; + M.m[1][2] = 2.f * qy * qz + 2.f * qx * qw; + M.m[1][3] = 0.f; + + M.m[2][0] = 2.f * qx * qz + 2.f * qy * qw; + M.m[2][1] = 2.f * qy * qz - 2.f * qx * qw; + M.m[2][2] = 1.f - 2.f * qxx - 2.f * qyy; + M.m[2][3] = 0.f; + + M.m[3][0] = 0.f; + M.m[3][1] = 0.f; + M.m[3][2] = 0.f; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 Constant1110 = { { { 1.0f, 1.0f, 1.0f, 0.0f } } }; + + XMVECTOR Q0 = XMVectorAdd(Quaternion, Quaternion); + XMVECTOR Q1 = XMVectorMultiply(Quaternion, Q0); + + XMVECTOR V0 = XMVectorPermute(Q1, Constant1110.v); + XMVECTOR V1 = XMVectorPermute(Q1, Constant1110.v); + XMVECTOR R0 = XMVectorSubtract(Constant1110, V0); + R0 = XMVectorSubtract(R0, V1); + + V0 = XMVectorSwizzle(Quaternion); + V1 = XMVectorSwizzle(Q0); + V0 = XMVectorMultiply(V0, V1); + + V1 = XMVectorSplatW(Quaternion); + XMVECTOR V2 = XMVectorSwizzle(Q0); + V1 = XMVectorMultiply(V1, V2); + + XMVECTOR R1 = XMVectorAdd(V0, V1); + XMVECTOR R2 = XMVectorSubtract(V0, V1); + + V0 = XMVectorPermute(R1, R2); + V1 = XMVectorPermute(R1, R2); + + XMMATRIX M; + M.r[0] = XMVectorPermute(R0, V0); + M.r[1] = XMVectorPermute(R0, V0); + M.r[2] = XMVectorPermute(R0, V1); + M.r[3] = g_XMIdentityR3.v; + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 Constant1110 = { { { 1.0f, 1.0f, 1.0f, 0.0f } } }; + + XMVECTOR Q0 = _mm_add_ps(Quaternion, Quaternion); + XMVECTOR Q1 = _mm_mul_ps(Quaternion, Q0); + + XMVECTOR V0 = XM_PERMUTE_PS(Q1, _MM_SHUFFLE(3, 0, 0, 1)); + V0 = _mm_and_ps(V0, g_XMMask3); + XMVECTOR V1 = XM_PERMUTE_PS(Q1, _MM_SHUFFLE(3, 1, 2, 2)); + V1 = _mm_and_ps(V1, g_XMMask3); + XMVECTOR R0 = _mm_sub_ps(Constant1110, V0); + R0 = _mm_sub_ps(R0, V1); + + V0 = XM_PERMUTE_PS(Quaternion, _MM_SHUFFLE(3, 1, 0, 0)); + V1 = XM_PERMUTE_PS(Q0, _MM_SHUFFLE(3, 2, 1, 2)); + V0 = _mm_mul_ps(V0, V1); + + V1 = XM_PERMUTE_PS(Quaternion, _MM_SHUFFLE(3, 3, 3, 3)); + XMVECTOR V2 = XM_PERMUTE_PS(Q0, _MM_SHUFFLE(3, 0, 2, 1)); + V1 = _mm_mul_ps(V1, V2); + + XMVECTOR R1 = _mm_add_ps(V0, V1); + XMVECTOR R2 = _mm_sub_ps(V0, V1); + + V0 = _mm_shuffle_ps(R1, R2, _MM_SHUFFLE(1, 0, 2, 1)); + V0 = XM_PERMUTE_PS(V0, _MM_SHUFFLE(1, 3, 2, 0)); + V1 = _mm_shuffle_ps(R1, R2, _MM_SHUFFLE(2, 2, 0, 0)); + V1 = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 0, 2, 0)); + + Q1 = _mm_shuffle_ps(R0, V0, _MM_SHUFFLE(1, 0, 3, 0)); + Q1 = XM_PERMUTE_PS(Q1, _MM_SHUFFLE(1, 3, 2, 0)); + + XMMATRIX M; + M.r[0] = Q1; + + Q1 = _mm_shuffle_ps(R0, V0, _MM_SHUFFLE(3, 2, 3, 1)); + Q1 = XM_PERMUTE_PS(Q1, _MM_SHUFFLE(1, 3, 0, 2)); + M.r[1] = Q1; + + Q1 = _mm_shuffle_ps(V1, R0, _MM_SHUFFLE(3, 2, 1, 0)); + M.r[2] = Q1; + M.r[3] = g_XMIdentityR3; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixTransformation2D +( + FXMVECTOR ScalingOrigin, + float ScalingOrientation, + FXMVECTOR Scaling, + FXMVECTOR RotationOrigin, + float Rotation, + GXMVECTOR Translation +) noexcept +{ + // M = Inverse(MScalingOrigin) * Transpose(MScalingOrientation) * MScaling * MScalingOrientation * + // MScalingOrigin * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; + + XMVECTOR VScalingOrigin = XMVectorSelect(g_XMSelect1100.v, ScalingOrigin, g_XMSelect1100.v); + XMVECTOR NegScalingOrigin = XMVectorNegate(VScalingOrigin); + + XMMATRIX MScalingOriginI = XMMatrixTranslationFromVector(NegScalingOrigin); + XMMATRIX MScalingOrientation = XMMatrixRotationZ(ScalingOrientation); + XMMATRIX MScalingOrientationT = XMMatrixTranspose(MScalingOrientation); + XMVECTOR VScaling = XMVectorSelect(g_XMOne.v, Scaling, g_XMSelect1100.v); + XMMATRIX MScaling = XMMatrixScalingFromVector(VScaling); + XMVECTOR VRotationOrigin = XMVectorSelect(g_XMSelect1100.v, RotationOrigin, g_XMSelect1100.v); + XMMATRIX MRotation = XMMatrixRotationZ(Rotation); + XMVECTOR VTranslation = XMVectorSelect(g_XMSelect1100.v, Translation, g_XMSelect1100.v); + + XMMATRIX M = XMMatrixMultiply(MScalingOriginI, MScalingOrientationT); + M = XMMatrixMultiply(M, MScaling); + M = XMMatrixMultiply(M, MScalingOrientation); + M.r[3] = XMVectorAdd(M.r[3], VScalingOrigin); + M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin); + M = XMMatrixMultiply(M, MRotation); + M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin); + M.r[3] = XMVectorAdd(M.r[3], VTranslation); + + return M; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixTransformation +( + FXMVECTOR ScalingOrigin, + FXMVECTOR ScalingOrientationQuaternion, + FXMVECTOR Scaling, + GXMVECTOR RotationOrigin, + HXMVECTOR RotationQuaternion, + HXMVECTOR Translation +) noexcept +{ + // M = Inverse(MScalingOrigin) * Transpose(MScalingOrientation) * MScaling * MScalingOrientation * + // MScalingOrigin * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; + + XMVECTOR VScalingOrigin = XMVectorSelect(g_XMSelect1110.v, ScalingOrigin, g_XMSelect1110.v); + XMVECTOR NegScalingOrigin = XMVectorNegate(ScalingOrigin); + + XMMATRIX MScalingOriginI = XMMatrixTranslationFromVector(NegScalingOrigin); + XMMATRIX MScalingOrientation = XMMatrixRotationQuaternion(ScalingOrientationQuaternion); + XMMATRIX MScalingOrientationT = XMMatrixTranspose(MScalingOrientation); + XMMATRIX MScaling = XMMatrixScalingFromVector(Scaling); + XMVECTOR VRotationOrigin = XMVectorSelect(g_XMSelect1110.v, RotationOrigin, g_XMSelect1110.v); + XMMATRIX MRotation = XMMatrixRotationQuaternion(RotationQuaternion); + XMVECTOR VTranslation = XMVectorSelect(g_XMSelect1110.v, Translation, g_XMSelect1110.v); + + XMMATRIX M; + M = XMMatrixMultiply(MScalingOriginI, MScalingOrientationT); + M = XMMatrixMultiply(M, MScaling); + M = XMMatrixMultiply(M, MScalingOrientation); + M.r[3] = XMVectorAdd(M.r[3], VScalingOrigin); + M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin); + M = XMMatrixMultiply(M, MRotation); + M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin); + M.r[3] = XMVectorAdd(M.r[3], VTranslation); + return M; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixAffineTransformation2D +( + FXMVECTOR Scaling, + FXMVECTOR RotationOrigin, + float Rotation, + FXMVECTOR Translation +) noexcept +{ + // M = MScaling * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; + + XMVECTOR VScaling = XMVectorSelect(g_XMOne.v, Scaling, g_XMSelect1100.v); + XMMATRIX MScaling = XMMatrixScalingFromVector(VScaling); + XMVECTOR VRotationOrigin = XMVectorSelect(g_XMSelect1100.v, RotationOrigin, g_XMSelect1100.v); + XMMATRIX MRotation = XMMatrixRotationZ(Rotation); + XMVECTOR VTranslation = XMVectorSelect(g_XMSelect1100.v, Translation, g_XMSelect1100.v); + + XMMATRIX M; + M = MScaling; + M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin); + M = XMMatrixMultiply(M, MRotation); + M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin); + M.r[3] = XMVectorAdd(M.r[3], VTranslation); + return M; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixAffineTransformation +( + FXMVECTOR Scaling, + FXMVECTOR RotationOrigin, + FXMVECTOR RotationQuaternion, + GXMVECTOR Translation +) noexcept +{ + // M = MScaling * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; + + XMMATRIX MScaling = XMMatrixScalingFromVector(Scaling); + XMVECTOR VRotationOrigin = XMVectorSelect(g_XMSelect1110.v, RotationOrigin, g_XMSelect1110.v); + XMMATRIX MRotation = XMMatrixRotationQuaternion(RotationQuaternion); + XMVECTOR VTranslation = XMVectorSelect(g_XMSelect1110.v, Translation, g_XMSelect1110.v); + + XMMATRIX M; + M = MScaling; + M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin); + M = XMMatrixMultiply(M, MRotation); + M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin); + M.r[3] = XMVectorAdd(M.r[3], VTranslation); + return M; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixReflect(FXMVECTOR ReflectionPlane) noexcept +{ + assert(!XMVector3Equal(ReflectionPlane, XMVectorZero())); + assert(!XMPlaneIsInfinite(ReflectionPlane)); + + static const XMVECTORF32 NegativeTwo = { { { -2.0f, -2.0f, -2.0f, 0.0f } } }; + + XMVECTOR P = XMPlaneNormalize(ReflectionPlane); + XMVECTOR S = XMVectorMultiply(P, NegativeTwo); + + XMVECTOR A = XMVectorSplatX(P); + XMVECTOR B = XMVectorSplatY(P); + XMVECTOR C = XMVectorSplatZ(P); + XMVECTOR D = XMVectorSplatW(P); + + XMMATRIX M; + M.r[0] = XMVectorMultiplyAdd(A, S, g_XMIdentityR0.v); + M.r[1] = XMVectorMultiplyAdd(B, S, g_XMIdentityR1.v); + M.r[2] = XMVectorMultiplyAdd(C, S, g_XMIdentityR2.v); + M.r[3] = XMVectorMultiplyAdd(D, S, g_XMIdentityR3.v); + return M; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixShadow +( + FXMVECTOR ShadowPlane, + FXMVECTOR LightPosition +) noexcept +{ + static const XMVECTORU32 Select0001 = { { { XM_SELECT_0, XM_SELECT_0, XM_SELECT_0, XM_SELECT_1 } } }; + + assert(!XMVector3Equal(ShadowPlane, XMVectorZero())); + assert(!XMPlaneIsInfinite(ShadowPlane)); + + XMVECTOR P = XMPlaneNormalize(ShadowPlane); + XMVECTOR Dot = XMPlaneDot(P, LightPosition); + P = XMVectorNegate(P); + XMVECTOR D = XMVectorSplatW(P); + XMVECTOR C = XMVectorSplatZ(P); + XMVECTOR B = XMVectorSplatY(P); + XMVECTOR A = XMVectorSplatX(P); + Dot = XMVectorSelect(Select0001.v, Dot, Select0001.v); + + XMMATRIX M; + M.r[3] = XMVectorMultiplyAdd(D, LightPosition, Dot); + Dot = XMVectorRotateLeft(Dot, 1); + M.r[2] = XMVectorMultiplyAdd(C, LightPosition, Dot); + Dot = XMVectorRotateLeft(Dot, 1); + M.r[1] = XMVectorMultiplyAdd(B, LightPosition, Dot); + Dot = XMVectorRotateLeft(Dot, 1); + M.r[0] = XMVectorMultiplyAdd(A, LightPosition, Dot); + return M; +} + +//------------------------------------------------------------------------------ +// View and projection initialization operations +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixLookAtLH +( + FXMVECTOR EyePosition, + FXMVECTOR FocusPosition, + FXMVECTOR UpDirection +) noexcept +{ + XMVECTOR EyeDirection = XMVectorSubtract(FocusPosition, EyePosition); + return XMMatrixLookToLH(EyePosition, EyeDirection, UpDirection); +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixLookAtRH +( + FXMVECTOR EyePosition, + FXMVECTOR FocusPosition, + FXMVECTOR UpDirection +) noexcept +{ + XMVECTOR NegEyeDirection = XMVectorSubtract(EyePosition, FocusPosition); + return XMMatrixLookToLH(EyePosition, NegEyeDirection, UpDirection); +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixLookToLH +( + FXMVECTOR EyePosition, + FXMVECTOR EyeDirection, + FXMVECTOR UpDirection +) noexcept +{ + assert(!XMVector3Equal(EyeDirection, XMVectorZero())); + assert(!XMVector3IsInfinite(EyeDirection)); + assert(!XMVector3Equal(UpDirection, XMVectorZero())); + assert(!XMVector3IsInfinite(UpDirection)); + + XMVECTOR R2 = XMVector3Normalize(EyeDirection); + + XMVECTOR R0 = XMVector3Cross(UpDirection, R2); + R0 = XMVector3Normalize(R0); + + XMVECTOR R1 = XMVector3Cross(R2, R0); + + XMVECTOR NegEyePosition = XMVectorNegate(EyePosition); + + XMVECTOR D0 = XMVector3Dot(R0, NegEyePosition); + XMVECTOR D1 = XMVector3Dot(R1, NegEyePosition); + XMVECTOR D2 = XMVector3Dot(R2, NegEyePosition); + + XMMATRIX M; + M.r[0] = XMVectorSelect(D0, R0, g_XMSelect1110.v); + M.r[1] = XMVectorSelect(D1, R1, g_XMSelect1110.v); + M.r[2] = XMVectorSelect(D2, R2, g_XMSelect1110.v); + M.r[3] = g_XMIdentityR3.v; + + M = XMMatrixTranspose(M); + + return M; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixLookToRH +( + FXMVECTOR EyePosition, + FXMVECTOR EyeDirection, + FXMVECTOR UpDirection +) noexcept +{ + XMVECTOR NegEyeDirection = XMVectorNegate(EyeDirection); + return XMMatrixLookToLH(EyePosition, NegEyeDirection, UpDirection); +} + +//------------------------------------------------------------------------------ + +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable:28931, "PREfast noise: Esp:1266") +#endif + +inline XMMATRIX XM_CALLCONV XMMatrixPerspectiveLH +( + float ViewWidth, + float ViewHeight, + float NearZ, + float FarZ +) noexcept +{ + assert(NearZ > 0.f && FarZ > 0.f); + assert(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); + assert(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); + assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + +#if defined(_XM_NO_INTRINSICS_) + + float TwoNearZ = NearZ + NearZ; + float fRange = FarZ / (FarZ - NearZ); + + XMMATRIX M; + M.m[0][0] = TwoNearZ / ViewWidth; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = TwoNearZ / ViewHeight; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = fRange; + M.m[2][3] = 1.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = -fRange * NearZ; + M.m[3][3] = 0.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float TwoNearZ = NearZ + NearZ; + float fRange = FarZ / (FarZ - NearZ); + const float32x4_t Zero = vdupq_n_f32(0); + XMMATRIX M; + M.r[0] = vsetq_lane_f32(TwoNearZ / ViewWidth, Zero, 0); + M.r[1] = vsetq_lane_f32(TwoNearZ / ViewHeight, Zero, 1); + M.r[2] = vsetq_lane_f32(fRange, g_XMIdentityR3.v, 2); + M.r[3] = vsetq_lane_f32(-fRange * NearZ, Zero, 2); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + float TwoNearZ = NearZ + NearZ; + float fRange = FarZ / (FarZ - NearZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + TwoNearZ / ViewWidth, + TwoNearZ / ViewHeight, + fRange, + -fRange * NearZ + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp, vValues); + // TwoNearZ / ViewWidth,0,0,0 + M.r[0] = vTemp; + // 0,TwoNearZ / ViewHeight,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp, g_XMMaskY); + M.r[1] = vTemp; + // x=fRange,y=-fRange * NearZ,0,1.0f + vValues = _mm_shuffle_ps(vValues, g_XMIdentityR3, _MM_SHUFFLE(3, 2, 3, 2)); + // 0,0,fRange,1.0f + vTemp = _mm_setzero_ps(); + vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(3, 0, 0, 0)); + M.r[2] = vTemp; + // 0,0,-fRange * NearZ,0 + vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(2, 1, 0, 0)); + M.r[3] = vTemp; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixPerspectiveRH +( + float ViewWidth, + float ViewHeight, + float NearZ, + float FarZ +) noexcept +{ + assert(NearZ > 0.f && FarZ > 0.f); + assert(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); + assert(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); + assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + +#if defined(_XM_NO_INTRINSICS_) + + float TwoNearZ = NearZ + NearZ; + float fRange = FarZ / (NearZ - FarZ); + + XMMATRIX M; + M.m[0][0] = TwoNearZ / ViewWidth; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = TwoNearZ / ViewHeight; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = fRange; + M.m[2][3] = -1.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = fRange * NearZ; + M.m[3][3] = 0.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float TwoNearZ = NearZ + NearZ; + float fRange = FarZ / (NearZ - FarZ); + const float32x4_t Zero = vdupq_n_f32(0); + + XMMATRIX M; + M.r[0] = vsetq_lane_f32(TwoNearZ / ViewWidth, Zero, 0); + M.r[1] = vsetq_lane_f32(TwoNearZ / ViewHeight, Zero, 1); + M.r[2] = vsetq_lane_f32(fRange, g_XMNegIdentityR3.v, 2); + M.r[3] = vsetq_lane_f32(fRange * NearZ, Zero, 2); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + float TwoNearZ = NearZ + NearZ; + float fRange = FarZ / (NearZ - FarZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + TwoNearZ / ViewWidth, + TwoNearZ / ViewHeight, + fRange, + fRange * NearZ + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp, vValues); + // TwoNearZ / ViewWidth,0,0,0 + M.r[0] = vTemp; + // 0,TwoNearZ / ViewHeight,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp, g_XMMaskY); + M.r[1] = vTemp; + // x=fRange,y=-fRange * NearZ,0,-1.0f + vValues = _mm_shuffle_ps(vValues, g_XMNegIdentityR3, _MM_SHUFFLE(3, 2, 3, 2)); + // 0,0,fRange,-1.0f + vTemp = _mm_setzero_ps(); + vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(3, 0, 0, 0)); + M.r[2] = vTemp; + // 0,0,-fRange * NearZ,0 + vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(2, 1, 0, 0)); + M.r[3] = vTemp; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixPerspectiveFovLH +( + float FovAngleY, + float AspectRatio, + float NearZ, + float FarZ +) noexcept +{ + assert(NearZ > 0.f && FarZ > 0.f); + assert(!XMScalarNearEqual(FovAngleY, 0.0f, 0.00001f * 2.0f)); + assert(!XMScalarNearEqual(AspectRatio, 0.0f, 0.00001f)); + assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + +#if defined(_XM_NO_INTRINSICS_) + + float SinFov; + float CosFov; + XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); + + float Height = CosFov / SinFov; + float Width = Height / AspectRatio; + float fRange = FarZ / (FarZ - NearZ); + + XMMATRIX M; + M.m[0][0] = Width; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = Height; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = fRange; + M.m[2][3] = 1.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = -fRange * NearZ; + M.m[3][3] = 0.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float SinFov; + float CosFov; + XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); + + float fRange = FarZ / (FarZ - NearZ); + float Height = CosFov / SinFov; + float Width = Height / AspectRatio; + const float32x4_t Zero = vdupq_n_f32(0); + + XMMATRIX M; + M.r[0] = vsetq_lane_f32(Width, Zero, 0); + M.r[1] = vsetq_lane_f32(Height, Zero, 1); + M.r[2] = vsetq_lane_f32(fRange, g_XMIdentityR3.v, 2); + M.r[3] = vsetq_lane_f32(-fRange * NearZ, Zero, 2); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + float SinFov; + float CosFov; + XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); + + float fRange = FarZ / (FarZ - NearZ); + // Note: This is recorded on the stack + float Height = CosFov / SinFov; + XMVECTOR rMem = { + Height / AspectRatio, + Height, + fRange, + -fRange * NearZ + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp, vValues); + // Height / AspectRatio,0,0,0 + XMMATRIX M; + M.r[0] = vTemp; + // 0,Height,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp, g_XMMaskY); + M.r[1] = vTemp; + // x=fRange,y=-fRange * NearZ,0,1.0f + vTemp = _mm_setzero_ps(); + vValues = _mm_shuffle_ps(vValues, g_XMIdentityR3, _MM_SHUFFLE(3, 2, 3, 2)); + // 0,0,fRange,1.0f + vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(3, 0, 0, 0)); + M.r[2] = vTemp; + // 0,0,-fRange * NearZ,0.0f + vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(2, 1, 0, 0)); + M.r[3] = vTemp; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixPerspectiveFovRH +( + float FovAngleY, + float AspectRatio, + float NearZ, + float FarZ +) noexcept +{ + assert(NearZ > 0.f && FarZ > 0.f); + assert(!XMScalarNearEqual(FovAngleY, 0.0f, 0.00001f * 2.0f)); + assert(!XMScalarNearEqual(AspectRatio, 0.0f, 0.00001f)); + assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + +#if defined(_XM_NO_INTRINSICS_) + + float SinFov; + float CosFov; + XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); + + float Height = CosFov / SinFov; + float Width = Height / AspectRatio; + float fRange = FarZ / (NearZ - FarZ); + + XMMATRIX M; + M.m[0][0] = Width; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = Height; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = fRange; + M.m[2][3] = -1.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = fRange * NearZ; + M.m[3][3] = 0.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float SinFov; + float CosFov; + XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); + float fRange = FarZ / (NearZ - FarZ); + float Height = CosFov / SinFov; + float Width = Height / AspectRatio; + const float32x4_t Zero = vdupq_n_f32(0); + + XMMATRIX M; + M.r[0] = vsetq_lane_f32(Width, Zero, 0); + M.r[1] = vsetq_lane_f32(Height, Zero, 1); + M.r[2] = vsetq_lane_f32(fRange, g_XMNegIdentityR3.v, 2); + M.r[3] = vsetq_lane_f32(fRange * NearZ, Zero, 2); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + float SinFov; + float CosFov; + XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); + float fRange = FarZ / (NearZ - FarZ); + // Note: This is recorded on the stack + float Height = CosFov / SinFov; + XMVECTOR rMem = { + Height / AspectRatio, + Height, + fRange, + fRange * NearZ + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp, vValues); + // Height / AspectRatio,0,0,0 + XMMATRIX M; + M.r[0] = vTemp; + // 0,Height,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp, g_XMMaskY); + M.r[1] = vTemp; + // x=fRange,y=-fRange * NearZ,0,-1.0f + vTemp = _mm_setzero_ps(); + vValues = _mm_shuffle_ps(vValues, g_XMNegIdentityR3, _MM_SHUFFLE(3, 2, 3, 2)); + // 0,0,fRange,-1.0f + vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(3, 0, 0, 0)); + M.r[2] = vTemp; + // 0,0,fRange * NearZ,0.0f + vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(2, 1, 0, 0)); + M.r[3] = vTemp; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixPerspectiveOffCenterLH +( + float ViewLeft, + float ViewRight, + float ViewBottom, + float ViewTop, + float NearZ, + float FarZ +) noexcept +{ + assert(NearZ > 0.f && FarZ > 0.f); + assert(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f)); + assert(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f)); + assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + +#if defined(_XM_NO_INTRINSICS_) + + float TwoNearZ = NearZ + NearZ; + float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + float fRange = FarZ / (FarZ - NearZ); + + XMMATRIX M; + M.m[0][0] = TwoNearZ * ReciprocalWidth; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = TwoNearZ * ReciprocalHeight; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = -(ViewLeft + ViewRight) * ReciprocalWidth; + M.m[2][1] = -(ViewTop + ViewBottom) * ReciprocalHeight; + M.m[2][2] = fRange; + M.m[2][3] = 1.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = -fRange * NearZ; + M.m[3][3] = 0.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float TwoNearZ = NearZ + NearZ; + float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + float fRange = FarZ / (FarZ - NearZ); + const float32x4_t Zero = vdupq_n_f32(0); + + XMMATRIX M; + M.r[0] = vsetq_lane_f32(TwoNearZ * ReciprocalWidth, Zero, 0); + M.r[1] = vsetq_lane_f32(TwoNearZ * ReciprocalHeight, Zero, 1); + M.r[2] = XMVectorSet(-(ViewLeft + ViewRight) * ReciprocalWidth, + -(ViewTop + ViewBottom) * ReciprocalHeight, + fRange, + 1.0f); + M.r[3] = vsetq_lane_f32(-fRange * NearZ, Zero, 2); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + float TwoNearZ = NearZ + NearZ; + float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + float fRange = FarZ / (FarZ - NearZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + TwoNearZ * ReciprocalWidth, + TwoNearZ * ReciprocalHeight, + -fRange * NearZ, + 0 + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp, vValues); + // TwoNearZ*ReciprocalWidth,0,0,0 + M.r[0] = vTemp; + // 0,TwoNearZ*ReciprocalHeight,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp, g_XMMaskY); + M.r[1] = vTemp; + // 0,0,fRange,1.0f + M.r[2] = XMVectorSet(-(ViewLeft + ViewRight) * ReciprocalWidth, + -(ViewTop + ViewBottom) * ReciprocalHeight, + fRange, + 1.0f); + // 0,0,-fRange * NearZ,0.0f + vValues = _mm_and_ps(vValues, g_XMMaskZ); + M.r[3] = vValues; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixPerspectiveOffCenterRH +( + float ViewLeft, + float ViewRight, + float ViewBottom, + float ViewTop, + float NearZ, + float FarZ +) noexcept +{ + assert(NearZ > 0.f && FarZ > 0.f); + assert(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f)); + assert(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f)); + assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + +#if defined(_XM_NO_INTRINSICS_) + + float TwoNearZ = NearZ + NearZ; + float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + float fRange = FarZ / (NearZ - FarZ); + + XMMATRIX M; + M.m[0][0] = TwoNearZ * ReciprocalWidth; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = TwoNearZ * ReciprocalHeight; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = (ViewLeft + ViewRight) * ReciprocalWidth; + M.m[2][1] = (ViewTop + ViewBottom) * ReciprocalHeight; + M.m[2][2] = fRange; + M.m[2][3] = -1.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = fRange * NearZ; + M.m[3][3] = 0.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float TwoNearZ = NearZ + NearZ; + float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + float fRange = FarZ / (NearZ - FarZ); + const float32x4_t Zero = vdupq_n_f32(0); + + XMMATRIX M; + M.r[0] = vsetq_lane_f32(TwoNearZ * ReciprocalWidth, Zero, 0); + M.r[1] = vsetq_lane_f32(TwoNearZ * ReciprocalHeight, Zero, 1); + M.r[2] = XMVectorSet((ViewLeft + ViewRight) * ReciprocalWidth, + (ViewTop + ViewBottom) * ReciprocalHeight, + fRange, + -1.0f); + M.r[3] = vsetq_lane_f32(fRange * NearZ, Zero, 2); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + float TwoNearZ = NearZ + NearZ; + float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + float fRange = FarZ / (NearZ - FarZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + TwoNearZ * ReciprocalWidth, + TwoNearZ * ReciprocalHeight, + fRange * NearZ, + 0 + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp, vValues); + // TwoNearZ*ReciprocalWidth,0,0,0 + M.r[0] = vTemp; + // 0,TwoNearZ*ReciprocalHeight,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp, g_XMMaskY); + M.r[1] = vTemp; + // 0,0,fRange,1.0f + M.r[2] = XMVectorSet((ViewLeft + ViewRight) * ReciprocalWidth, + (ViewTop + ViewBottom) * ReciprocalHeight, + fRange, + -1.0f); + // 0,0,-fRange * NearZ,0.0f + vValues = _mm_and_ps(vValues, g_XMMaskZ); + M.r[3] = vValues; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixOrthographicLH +( + float ViewWidth, + float ViewHeight, + float NearZ, + float FarZ +) noexcept +{ + assert(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); + assert(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); + assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + +#if defined(_XM_NO_INTRINSICS_) + + float fRange = 1.0f / (FarZ - NearZ); + + XMMATRIX M; + M.m[0][0] = 2.0f / ViewWidth; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = 2.0f / ViewHeight; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = fRange; + M.m[2][3] = 0.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = -fRange * NearZ; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float fRange = 1.0f / (FarZ - NearZ); + + const float32x4_t Zero = vdupq_n_f32(0); + XMMATRIX M; + M.r[0] = vsetq_lane_f32(2.0f / ViewWidth, Zero, 0); + M.r[1] = vsetq_lane_f32(2.0f / ViewHeight, Zero, 1); + M.r[2] = vsetq_lane_f32(fRange, Zero, 2); + M.r[3] = vsetq_lane_f32(-fRange * NearZ, g_XMIdentityR3.v, 2); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + float fRange = 1.0f / (FarZ - NearZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + 2.0f / ViewWidth, + 2.0f / ViewHeight, + fRange, + -fRange * NearZ + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp, vValues); + // 2.0f / ViewWidth,0,0,0 + M.r[0] = vTemp; + // 0,2.0f / ViewHeight,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp, g_XMMaskY); + M.r[1] = vTemp; + // x=fRange,y=-fRange * NearZ,0,1.0f + vTemp = _mm_setzero_ps(); + vValues = _mm_shuffle_ps(vValues, g_XMIdentityR3, _MM_SHUFFLE(3, 2, 3, 2)); + // 0,0,fRange,0.0f + vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(2, 0, 0, 0)); + M.r[2] = vTemp; + // 0,0,-fRange * NearZ,1.0f + vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(3, 1, 0, 0)); + M.r[3] = vTemp; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixOrthographicRH +( + float ViewWidth, + float ViewHeight, + float NearZ, + float FarZ +) noexcept +{ + assert(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); + assert(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); + assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + +#if defined(_XM_NO_INTRINSICS_) + + float fRange = 1.0f / (NearZ - FarZ); + + XMMATRIX M; + M.m[0][0] = 2.0f / ViewWidth; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = 2.0f / ViewHeight; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = fRange; + M.m[2][3] = 0.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = fRange * NearZ; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float fRange = 1.0f / (NearZ - FarZ); + + const float32x4_t Zero = vdupq_n_f32(0); + XMMATRIX M; + M.r[0] = vsetq_lane_f32(2.0f / ViewWidth, Zero, 0); + M.r[1] = vsetq_lane_f32(2.0f / ViewHeight, Zero, 1); + M.r[2] = vsetq_lane_f32(fRange, Zero, 2); + M.r[3] = vsetq_lane_f32(fRange * NearZ, g_XMIdentityR3.v, 2); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + float fRange = 1.0f / (NearZ - FarZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + 2.0f / ViewWidth, + 2.0f / ViewHeight, + fRange, + fRange * NearZ + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp, vValues); + // 2.0f / ViewWidth,0,0,0 + M.r[0] = vTemp; + // 0,2.0f / ViewHeight,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp, g_XMMaskY); + M.r[1] = vTemp; + // x=fRange,y=fRange * NearZ,0,1.0f + vTemp = _mm_setzero_ps(); + vValues = _mm_shuffle_ps(vValues, g_XMIdentityR3, _MM_SHUFFLE(3, 2, 3, 2)); + // 0,0,fRange,0.0f + vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(2, 0, 0, 0)); + M.r[2] = vTemp; + // 0,0,fRange * NearZ,1.0f + vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(3, 1, 0, 0)); + M.r[3] = vTemp; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixOrthographicOffCenterLH +( + float ViewLeft, + float ViewRight, + float ViewBottom, + float ViewTop, + float NearZ, + float FarZ +) noexcept +{ + assert(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f)); + assert(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f)); + assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + +#if defined(_XM_NO_INTRINSICS_) + + float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + float fRange = 1.0f / (FarZ - NearZ); + + XMMATRIX M; + M.m[0][0] = ReciprocalWidth + ReciprocalWidth; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = ReciprocalHeight + ReciprocalHeight; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = fRange; + M.m[2][3] = 0.0f; + + M.m[3][0] = -(ViewLeft + ViewRight) * ReciprocalWidth; + M.m[3][1] = -(ViewTop + ViewBottom) * ReciprocalHeight; + M.m[3][2] = -fRange * NearZ; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + float fRange = 1.0f / (FarZ - NearZ); + const float32x4_t Zero = vdupq_n_f32(0); + XMMATRIX M; + M.r[0] = vsetq_lane_f32(ReciprocalWidth + ReciprocalWidth, Zero, 0); + M.r[1] = vsetq_lane_f32(ReciprocalHeight + ReciprocalHeight, Zero, 1); + M.r[2] = vsetq_lane_f32(fRange, Zero, 2); + M.r[3] = XMVectorSet(-(ViewLeft + ViewRight) * ReciprocalWidth, + -(ViewTop + ViewBottom) * ReciprocalHeight, + -fRange * NearZ, + 1.0f); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + float fReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + float fReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + float fRange = 1.0f / (FarZ - NearZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + fReciprocalWidth, + fReciprocalHeight, + fRange, + 1.0f + }; + XMVECTOR rMem2 = { + -(ViewLeft + ViewRight), + -(ViewTop + ViewBottom), + -NearZ, + 1.0f + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp, vValues); + // fReciprocalWidth*2,0,0,0 + vTemp = _mm_add_ss(vTemp, vTemp); + M.r[0] = vTemp; + // 0,fReciprocalHeight*2,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp, g_XMMaskY); + vTemp = _mm_add_ps(vTemp, vTemp); + M.r[1] = vTemp; + // 0,0,fRange,0.0f + vTemp = vValues; + vTemp = _mm_and_ps(vTemp, g_XMMaskZ); + M.r[2] = vTemp; + // -(ViewLeft + ViewRight)*fReciprocalWidth,-(ViewTop + ViewBottom)*fReciprocalHeight,fRange*-NearZ,1.0f + vValues = _mm_mul_ps(vValues, rMem2); + M.r[3] = vValues; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixOrthographicOffCenterRH +( + float ViewLeft, + float ViewRight, + float ViewBottom, + float ViewTop, + float NearZ, + float FarZ +) noexcept +{ + assert(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f)); + assert(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f)); + assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + +#if defined(_XM_NO_INTRINSICS_) + + float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + float fRange = 1.0f / (NearZ - FarZ); + + XMMATRIX M; + M.m[0][0] = ReciprocalWidth + ReciprocalWidth; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = ReciprocalHeight + ReciprocalHeight; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = fRange; + M.m[2][3] = 0.0f; + + M.r[3] = XMVectorSet(-(ViewLeft + ViewRight) * ReciprocalWidth, + -(ViewTop + ViewBottom) * ReciprocalHeight, + fRange * NearZ, + 1.0f); + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + float fRange = 1.0f / (NearZ - FarZ); + const float32x4_t Zero = vdupq_n_f32(0); + XMMATRIX M; + M.r[0] = vsetq_lane_f32(ReciprocalWidth + ReciprocalWidth, Zero, 0); + M.r[1] = vsetq_lane_f32(ReciprocalHeight + ReciprocalHeight, Zero, 1); + M.r[2] = vsetq_lane_f32(fRange, Zero, 2); + M.r[3] = XMVectorSet(-(ViewLeft + ViewRight) * ReciprocalWidth, + -(ViewTop + ViewBottom) * ReciprocalHeight, + fRange * NearZ, + 1.0f); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + float fReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + float fReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + float fRange = 1.0f / (NearZ - FarZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + fReciprocalWidth, + fReciprocalHeight, + fRange, + 1.0f + }; + XMVECTOR rMem2 = { + -(ViewLeft + ViewRight), + -(ViewTop + ViewBottom), + NearZ, + 1.0f + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp, vValues); + // fReciprocalWidth*2,0,0,0 + vTemp = _mm_add_ss(vTemp, vTemp); + M.r[0] = vTemp; + // 0,fReciprocalHeight*2,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp, g_XMMaskY); + vTemp = _mm_add_ps(vTemp, vTemp); + M.r[1] = vTemp; + // 0,0,fRange,0.0f + vTemp = vValues; + vTemp = _mm_and_ps(vTemp, g_XMMaskZ); + M.r[2] = vTemp; + // -(ViewLeft + ViewRight)*fReciprocalWidth,-(ViewTop + ViewBottom)*fReciprocalHeight,fRange*-NearZ,1.0f + vValues = _mm_mul_ps(vValues, rMem2); + M.r[3] = vValues; + return M; +#endif +} + +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif + +/**************************************************************************** + * + * XMMATRIX operators and methods + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMMATRIX::XMMATRIX +( + float m00, float m01, float m02, float m03, + float m10, float m11, float m12, float m13, + float m20, float m21, float m22, float m23, + float m30, float m31, float m32, float m33 +) noexcept +{ + r[0] = XMVectorSet(m00, m01, m02, m03); + r[1] = XMVectorSet(m10, m11, m12, m13); + r[2] = XMVectorSet(m20, m21, m22, m23); + r[3] = XMVectorSet(m30, m31, m32, m33); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMMATRIX::XMMATRIX(const float* pArray) noexcept +{ + assert(pArray != nullptr); + r[0] = XMLoadFloat4(reinterpret_cast(pArray)); + r[1] = XMLoadFloat4(reinterpret_cast(pArray + 4)); + r[2] = XMLoadFloat4(reinterpret_cast(pArray + 8)); + r[3] = XMLoadFloat4(reinterpret_cast(pArray + 12)); +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XMMATRIX::operator- () const noexcept +{ + XMMATRIX R; + R.r[0] = XMVectorNegate(r[0]); + R.r[1] = XMVectorNegate(r[1]); + R.r[2] = XMVectorNegate(r[2]); + R.r[3] = XMVectorNegate(r[3]); + return R; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX& XM_CALLCONV XMMATRIX::operator+= (FXMMATRIX M) noexcept +{ + r[0] = XMVectorAdd(r[0], M.r[0]); + r[1] = XMVectorAdd(r[1], M.r[1]); + r[2] = XMVectorAdd(r[2], M.r[2]); + r[3] = XMVectorAdd(r[3], M.r[3]); + return *this; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX& XM_CALLCONV XMMATRIX::operator-= (FXMMATRIX M) noexcept +{ + r[0] = XMVectorSubtract(r[0], M.r[0]); + r[1] = XMVectorSubtract(r[1], M.r[1]); + r[2] = XMVectorSubtract(r[2], M.r[2]); + r[3] = XMVectorSubtract(r[3], M.r[3]); + return *this; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX& XM_CALLCONV XMMATRIX::operator*=(FXMMATRIX M) noexcept +{ + *this = XMMatrixMultiply(*this, M); + return *this; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX& XMMATRIX::operator*= (float S) noexcept +{ + r[0] = XMVectorScale(r[0], S); + r[1] = XMVectorScale(r[1], S); + r[2] = XMVectorScale(r[2], S); + r[3] = XMVectorScale(r[3], S); + return *this; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX& XMMATRIX::operator/= (float S) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vS = XMVectorReplicate(S); + r[0] = XMVectorDivide(r[0], vS); + r[1] = XMVectorDivide(r[1], vS); + r[2] = XMVectorDivide(r[2], vS); + r[3] = XMVectorDivide(r[3], vS); + return *this; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + float32x4_t vS = vdupq_n_f32(S); + r[0] = vdivq_f32(r[0], vS); + r[1] = vdivq_f32(r[1], vS); + r[2] = vdivq_f32(r[2], vS); + r[3] = vdivq_f32(r[3], vS); +#else + // 2 iterations of Newton-Raphson refinement of reciprocal + float32x2_t vS = vdup_n_f32(S); + float32x2_t R0 = vrecpe_f32(vS); + float32x2_t S0 = vrecps_f32(R0, vS); + R0 = vmul_f32(S0, R0); + S0 = vrecps_f32(R0, vS); + R0 = vmul_f32(S0, R0); + float32x4_t Reciprocal = vcombine_f32(R0, R0); + r[0] = vmulq_f32(r[0], Reciprocal); + r[1] = vmulq_f32(r[1], Reciprocal); + r[2] = vmulq_f32(r[2], Reciprocal); + r[3] = vmulq_f32(r[3], Reciprocal); +#endif + return *this; +#elif defined(_XM_SSE_INTRINSICS_) + __m128 vS = _mm_set_ps1(S); + r[0] = _mm_div_ps(r[0], vS); + r[1] = _mm_div_ps(r[1], vS); + r[2] = _mm_div_ps(r[2], vS); + r[3] = _mm_div_ps(r[3], vS); + return *this; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMATRIX::operator+ (FXMMATRIX M) const noexcept +{ + XMMATRIX R; + R.r[0] = XMVectorAdd(r[0], M.r[0]); + R.r[1] = XMVectorAdd(r[1], M.r[1]); + R.r[2] = XMVectorAdd(r[2], M.r[2]); + R.r[3] = XMVectorAdd(r[3], M.r[3]); + return R; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMATRIX::operator- (FXMMATRIX M) const noexcept +{ + XMMATRIX R; + R.r[0] = XMVectorSubtract(r[0], M.r[0]); + R.r[1] = XMVectorSubtract(r[1], M.r[1]); + R.r[2] = XMVectorSubtract(r[2], M.r[2]); + R.r[3] = XMVectorSubtract(r[3], M.r[3]); + return R; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMATRIX::operator*(FXMMATRIX M) const noexcept +{ + return XMMatrixMultiply(*this, M); +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XMMATRIX::operator* (float S) const noexcept +{ + XMMATRIX R; + R.r[0] = XMVectorScale(r[0], S); + R.r[1] = XMVectorScale(r[1], S); + R.r[2] = XMVectorScale(r[2], S); + R.r[3] = XMVectorScale(r[3], S); + return R; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XMMATRIX::operator/ (float S) const noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vS = XMVectorReplicate(S); + XMMATRIX R; + R.r[0] = XMVectorDivide(r[0], vS); + R.r[1] = XMVectorDivide(r[1], vS); + R.r[2] = XMVectorDivide(r[2], vS); + R.r[3] = XMVectorDivide(r[3], vS); + return R; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + float32x4_t vS = vdupq_n_f32(S); + XMMATRIX R; + R.r[0] = vdivq_f32(r[0], vS); + R.r[1] = vdivq_f32(r[1], vS); + R.r[2] = vdivq_f32(r[2], vS); + R.r[3] = vdivq_f32(r[3], vS); +#else + // 2 iterations of Newton-Raphson refinement of reciprocal + float32x2_t vS = vdup_n_f32(S); + float32x2_t R0 = vrecpe_f32(vS); + float32x2_t S0 = vrecps_f32(R0, vS); + R0 = vmul_f32(S0, R0); + S0 = vrecps_f32(R0, vS); + R0 = vmul_f32(S0, R0); + float32x4_t Reciprocal = vcombine_f32(R0, R0); + XMMATRIX R; + R.r[0] = vmulq_f32(r[0], Reciprocal); + R.r[1] = vmulq_f32(r[1], Reciprocal); + R.r[2] = vmulq_f32(r[2], Reciprocal); + R.r[3] = vmulq_f32(r[3], Reciprocal); +#endif + return R; +#elif defined(_XM_SSE_INTRINSICS_) + __m128 vS = _mm_set_ps1(S); + XMMATRIX R; + R.r[0] = _mm_div_ps(r[0], vS); + R.r[1] = _mm_div_ps(r[1], vS); + R.r[2] = _mm_div_ps(r[2], vS); + R.r[3] = _mm_div_ps(r[3], vS); + return R; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV operator* +( + float S, + FXMMATRIX M +) noexcept +{ + XMMATRIX R; + R.r[0] = XMVectorScale(M.r[0], S); + R.r[1] = XMVectorScale(M.r[1], S); + R.r[2] = XMVectorScale(M.r[2], S); + R.r[3] = XMVectorScale(M.r[3], S); + return R; +} + +/**************************************************************************** + * + * XMFLOAT3X3 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMFLOAT3X3::XMFLOAT3X3(const float* pArray) noexcept +{ + assert(pArray != nullptr); + for (size_t Row = 0; Row < 3; Row++) + { + for (size_t Column = 0; Column < 3; Column++) + { + m[Row][Column] = pArray[Row * 3 + Column]; + } + } +} + +/**************************************************************************** + * + * XMFLOAT4X3 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMFLOAT4X3::XMFLOAT4X3(const float* pArray) noexcept +{ + assert(pArray != nullptr); + + m[0][0] = pArray[0]; + m[0][1] = pArray[1]; + m[0][2] = pArray[2]; + + m[1][0] = pArray[3]; + m[1][1] = pArray[4]; + m[1][2] = pArray[5]; + + m[2][0] = pArray[6]; + m[2][1] = pArray[7]; + m[2][2] = pArray[8]; + + m[3][0] = pArray[9]; + m[3][1] = pArray[10]; + m[3][2] = pArray[11]; +} + +/**************************************************************************** +* +* XMFLOAT3X4 operators +* +****************************************************************************/ + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMFLOAT3X4::XMFLOAT3X4(const float* pArray) noexcept +{ + assert(pArray != nullptr); + + m[0][0] = pArray[0]; + m[0][1] = pArray[1]; + m[0][2] = pArray[2]; + m[0][3] = pArray[3]; + + m[1][0] = pArray[4]; + m[1][1] = pArray[5]; + m[1][2] = pArray[6]; + m[1][3] = pArray[7]; + + m[2][0] = pArray[8]; + m[2][1] = pArray[9]; + m[2][2] = pArray[10]; + m[2][3] = pArray[11]; +} + +/**************************************************************************** + * + * XMFLOAT4X4 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMFLOAT4X4::XMFLOAT4X4(const float* pArray) noexcept +{ + assert(pArray != nullptr); + + m[0][0] = pArray[0]; + m[0][1] = pArray[1]; + m[0][2] = pArray[2]; + m[0][3] = pArray[3]; + + m[1][0] = pArray[4]; + m[1][1] = pArray[5]; + m[1][2] = pArray[6]; + m[1][3] = pArray[7]; + + m[2][0] = pArray[8]; + m[2][1] = pArray[9]; + m[2][2] = pArray[10]; + m[2][3] = pArray[11]; + + m[3][0] = pArray[12]; + m[3][1] = pArray[13]; + m[3][2] = pArray[14]; + m[3][3] = pArray[15]; +} + diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXMathMisc.inl b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXMathMisc.inl new file mode 100644 index 0000000..5f88da6 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXMathMisc.inl @@ -0,0 +1,2493 @@ +//------------------------------------------------------------------------------------- +// DirectXMathMisc.inl -- SIMD C++ Math library +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +// +// http://go.microsoft.com/fwlink/?LinkID=615560 +//------------------------------------------------------------------------------------- + +#pragma once + +/**************************************************************************** + * + * Quaternion + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + // Comparison operations + //------------------------------------------------------------------------------ + + //------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMQuaternionEqual +( + FXMVECTOR Q1, + FXMVECTOR Q2 +) noexcept +{ + return XMVector4Equal(Q1, Q2); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMQuaternionNotEqual +( + FXMVECTOR Q1, + FXMVECTOR Q2 +) noexcept +{ + return XMVector4NotEqual(Q1, Q2); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMQuaternionIsNaN(FXMVECTOR Q) noexcept +{ + return XMVector4IsNaN(Q); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMQuaternionIsInfinite(FXMVECTOR Q) noexcept +{ + return XMVector4IsInfinite(Q); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMQuaternionIsIdentity(FXMVECTOR Q) noexcept +{ + return XMVector4Equal(Q, g_XMIdentityR3.v); +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionDot +( + FXMVECTOR Q1, + FXMVECTOR Q2 +) noexcept +{ + return XMVector4Dot(Q1, Q2); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionMultiply +( + FXMVECTOR Q1, + FXMVECTOR Q2 +) noexcept +{ + // Returns the product Q2*Q1 (which is the concatenation of a rotation Q1 followed by the rotation Q2) + + // [ (Q2.w * Q1.x) + (Q2.x * Q1.w) + (Q2.y * Q1.z) - (Q2.z * Q1.y), + // (Q2.w * Q1.y) - (Q2.x * Q1.z) + (Q2.y * Q1.w) + (Q2.z * Q1.x), + // (Q2.w * Q1.z) + (Q2.x * Q1.y) - (Q2.y * Q1.x) + (Q2.z * Q1.w), + // (Q2.w * Q1.w) - (Q2.x * Q1.x) - (Q2.y * Q1.y) - (Q2.z * Q1.z) ] + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + (Q2.vector4_f32[3] * Q1.vector4_f32[0]) + (Q2.vector4_f32[0] * Q1.vector4_f32[3]) + (Q2.vector4_f32[1] * Q1.vector4_f32[2]) - (Q2.vector4_f32[2] * Q1.vector4_f32[1]), + (Q2.vector4_f32[3] * Q1.vector4_f32[1]) - (Q2.vector4_f32[0] * Q1.vector4_f32[2]) + (Q2.vector4_f32[1] * Q1.vector4_f32[3]) + (Q2.vector4_f32[2] * Q1.vector4_f32[0]), + (Q2.vector4_f32[3] * Q1.vector4_f32[2]) + (Q2.vector4_f32[0] * Q1.vector4_f32[1]) - (Q2.vector4_f32[1] * Q1.vector4_f32[0]) + (Q2.vector4_f32[2] * Q1.vector4_f32[3]), + (Q2.vector4_f32[3] * Q1.vector4_f32[3]) - (Q2.vector4_f32[0] * Q1.vector4_f32[0]) - (Q2.vector4_f32[1] * Q1.vector4_f32[1]) - (Q2.vector4_f32[2] * Q1.vector4_f32[2]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 ControlWZYX = { { { 1.0f, -1.0f, 1.0f, -1.0f } } }; + static const XMVECTORF32 ControlZWXY = { { { 1.0f, 1.0f, -1.0f, -1.0f } } }; + static const XMVECTORF32 ControlYXWZ = { { { -1.0f, 1.0f, 1.0f, -1.0f } } }; + + float32x2_t Q2L = vget_low_f32(Q2); + float32x2_t Q2H = vget_high_f32(Q2); + + float32x4_t Q2X = vdupq_lane_f32(Q2L, 0); + float32x4_t Q2Y = vdupq_lane_f32(Q2L, 1); + float32x4_t Q2Z = vdupq_lane_f32(Q2H, 0); + XMVECTOR vResult = vmulq_lane_f32(Q1, Q2H, 1); + + // Mul by Q1WZYX + float32x4_t vTemp = vrev64q_f32(Q1); + vTemp = vcombine_f32(vget_high_f32(vTemp), vget_low_f32(vTemp)); + Q2X = vmulq_f32(Q2X, vTemp); + vResult = vmlaq_f32(vResult, Q2X, ControlWZYX); + + // Mul by Q1ZWXY + vTemp = vreinterpretq_f32_u32(vrev64q_u32(vreinterpretq_u32_f32(vTemp))); + Q2Y = vmulq_f32(Q2Y, vTemp); + vResult = vmlaq_f32(vResult, Q2Y, ControlZWXY); + + // Mul by Q1YXWZ + vTemp = vreinterpretq_f32_u32(vrev64q_u32(vreinterpretq_u32_f32(vTemp))); + vTemp = vcombine_f32(vget_high_f32(vTemp), vget_low_f32(vTemp)); + Q2Z = vmulq_f32(Q2Z, vTemp); + vResult = vmlaq_f32(vResult, Q2Z, ControlYXWZ); + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 ControlWZYX = { { { 1.0f, -1.0f, 1.0f, -1.0f } } }; + static const XMVECTORF32 ControlZWXY = { { { 1.0f, 1.0f, -1.0f, -1.0f } } }; + static const XMVECTORF32 ControlYXWZ = { { { -1.0f, 1.0f, 1.0f, -1.0f } } }; + // Copy to SSE registers and use as few as possible for x86 + XMVECTOR Q2X = Q2; + XMVECTOR Q2Y = Q2; + XMVECTOR Q2Z = Q2; + XMVECTOR vResult = Q2; + // Splat with one instruction + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 3, 3, 3)); + Q2X = XM_PERMUTE_PS(Q2X, _MM_SHUFFLE(0, 0, 0, 0)); + Q2Y = XM_PERMUTE_PS(Q2Y, _MM_SHUFFLE(1, 1, 1, 1)); + Q2Z = XM_PERMUTE_PS(Q2Z, _MM_SHUFFLE(2, 2, 2, 2)); + // Retire Q1 and perform Q1*Q2W + vResult = _mm_mul_ps(vResult, Q1); + XMVECTOR Q1Shuffle = Q1; + // Shuffle the copies of Q1 + Q1Shuffle = XM_PERMUTE_PS(Q1Shuffle, _MM_SHUFFLE(0, 1, 2, 3)); + // Mul by Q1WZYX + Q2X = _mm_mul_ps(Q2X, Q1Shuffle); + Q1Shuffle = XM_PERMUTE_PS(Q1Shuffle, _MM_SHUFFLE(2, 3, 0, 1)); + // Flip the signs on y and z + vResult = XM_FMADD_PS(Q2X, ControlWZYX, vResult); + // Mul by Q1ZWXY + Q2Y = _mm_mul_ps(Q2Y, Q1Shuffle); + Q1Shuffle = XM_PERMUTE_PS(Q1Shuffle, _MM_SHUFFLE(0, 1, 2, 3)); + // Flip the signs on z and w + Q2Y = _mm_mul_ps(Q2Y, ControlZWXY); + // Mul by Q1YXWZ + Q2Z = _mm_mul_ps(Q2Z, Q1Shuffle); + // Flip the signs on x and w + Q2Y = XM_FMADD_PS(Q2Z, ControlYXWZ, Q2Y); + vResult = _mm_add_ps(vResult, Q2Y); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionLengthSq(FXMVECTOR Q) noexcept +{ + return XMVector4LengthSq(Q); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionReciprocalLength(FXMVECTOR Q) noexcept +{ + return XMVector4ReciprocalLength(Q); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionLength(FXMVECTOR Q) noexcept +{ + return XMVector4Length(Q); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionNormalizeEst(FXMVECTOR Q) noexcept +{ + return XMVector4NormalizeEst(Q); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionNormalize(FXMVECTOR Q) noexcept +{ + return XMVector4Normalize(Q); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionConjugate(FXMVECTOR Q) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + -Q.vector4_f32[0], + -Q.vector4_f32[1], + -Q.vector4_f32[2], + Q.vector4_f32[3] + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 NegativeOne3 = { { { -1.0f, -1.0f, -1.0f, 1.0f } } }; + return vmulq_f32(Q, NegativeOne3.v); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 NegativeOne3 = { { { -1.0f, -1.0f, -1.0f, 1.0f } } }; + return _mm_mul_ps(Q, NegativeOne3); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionInverse(FXMVECTOR Q) noexcept +{ + XMVECTOR L = XMVector4LengthSq(Q); + XMVECTOR Conjugate = XMQuaternionConjugate(Q); + + XMVECTOR Control = XMVectorLessOrEqual(L, g_XMEpsilon.v); + + XMVECTOR Result = XMVectorDivide(Conjugate, L); + + Result = XMVectorSelect(Result, g_XMZero, Control); + + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionLn(FXMVECTOR Q) noexcept +{ + static const XMVECTORF32 OneMinusEpsilon = { { { 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f } } }; + + XMVECTOR QW = XMVectorSplatW(Q); + XMVECTOR Q0 = XMVectorSelect(g_XMSelect1110.v, Q, g_XMSelect1110.v); + + XMVECTOR ControlW = XMVectorInBounds(QW, OneMinusEpsilon.v); + + XMVECTOR Theta = XMVectorACos(QW); + XMVECTOR SinTheta = XMVectorSin(Theta); + + XMVECTOR S = XMVectorDivide(Theta, SinTheta); + + XMVECTOR Result = XMVectorMultiply(Q0, S); + Result = XMVectorSelect(Q0, Result, ControlW); + + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionExp(FXMVECTOR Q) noexcept +{ + XMVECTOR Theta = XMVector3Length(Q); + + XMVECTOR SinTheta, CosTheta; + XMVectorSinCos(&SinTheta, &CosTheta, Theta); + + XMVECTOR S = XMVectorDivide(SinTheta, Theta); + + XMVECTOR Result = XMVectorMultiply(Q, S); + + const XMVECTOR Zero = XMVectorZero(); + XMVECTOR Control = XMVectorNearEqual(Theta, Zero, g_XMEpsilon.v); + Result = XMVectorSelect(Result, Q, Control); + + Result = XMVectorSelect(CosTheta, Result, g_XMSelect1110.v); + + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionSlerp +( + FXMVECTOR Q0, + FXMVECTOR Q1, + float t +) noexcept +{ + XMVECTOR T = XMVectorReplicate(t); + return XMQuaternionSlerpV(Q0, Q1, T); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionSlerpV +( + FXMVECTOR Q0, + FXMVECTOR Q1, + FXMVECTOR T +) noexcept +{ + assert((XMVectorGetY(T) == XMVectorGetX(T)) && (XMVectorGetZ(T) == XMVectorGetX(T)) && (XMVectorGetW(T) == XMVectorGetX(T))); + + // Result = Q0 * sin((1.0 - t) * Omega) / sin(Omega) + Q1 * sin(t * Omega) / sin(Omega) + +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) + + const XMVECTORF32 OneMinusEpsilon = { { { 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f } } }; + + XMVECTOR CosOmega = XMQuaternionDot(Q0, Q1); + + const XMVECTOR Zero = XMVectorZero(); + XMVECTOR Control = XMVectorLess(CosOmega, Zero); + XMVECTOR Sign = XMVectorSelect(g_XMOne.v, g_XMNegativeOne.v, Control); + + CosOmega = XMVectorMultiply(CosOmega, Sign); + + Control = XMVectorLess(CosOmega, OneMinusEpsilon); + + XMVECTOR SinOmega = XMVectorNegativeMultiplySubtract(CosOmega, CosOmega, g_XMOne.v); + SinOmega = XMVectorSqrt(SinOmega); + + XMVECTOR Omega = XMVectorATan2(SinOmega, CosOmega); + + XMVECTOR SignMask = XMVectorSplatSignMask(); + XMVECTOR V01 = XMVectorShiftLeft(T, Zero, 2); + SignMask = XMVectorShiftLeft(SignMask, Zero, 3); + V01 = XMVectorXorInt(V01, SignMask); + V01 = XMVectorAdd(g_XMIdentityR0.v, V01); + + XMVECTOR InvSinOmega = XMVectorReciprocal(SinOmega); + + XMVECTOR S0 = XMVectorMultiply(V01, Omega); + S0 = XMVectorSin(S0); + S0 = XMVectorMultiply(S0, InvSinOmega); + + S0 = XMVectorSelect(V01, S0, Control); + + XMVECTOR S1 = XMVectorSplatY(S0); + S0 = XMVectorSplatX(S0); + + S1 = XMVectorMultiply(S1, Sign); + + XMVECTOR Result = XMVectorMultiply(Q0, S0); + Result = XMVectorMultiplyAdd(Q1, S1, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 OneMinusEpsilon = { { { 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f } } }; + static const XMVECTORU32 SignMask2 = { { { 0x80000000, 0x00000000, 0x00000000, 0x00000000 } } }; + + XMVECTOR CosOmega = XMQuaternionDot(Q0, Q1); + + const XMVECTOR Zero = XMVectorZero(); + XMVECTOR Control = XMVectorLess(CosOmega, Zero); + XMVECTOR Sign = XMVectorSelect(g_XMOne, g_XMNegativeOne, Control); + + CosOmega = _mm_mul_ps(CosOmega, Sign); + + Control = XMVectorLess(CosOmega, OneMinusEpsilon); + + XMVECTOR SinOmega = _mm_mul_ps(CosOmega, CosOmega); + SinOmega = _mm_sub_ps(g_XMOne, SinOmega); + SinOmega = _mm_sqrt_ps(SinOmega); + + XMVECTOR Omega = XMVectorATan2(SinOmega, CosOmega); + + XMVECTOR V01 = XM_PERMUTE_PS(T, _MM_SHUFFLE(2, 3, 0, 1)); + V01 = _mm_and_ps(V01, g_XMMaskXY); + V01 = _mm_xor_ps(V01, SignMask2); + V01 = _mm_add_ps(g_XMIdentityR0, V01); + + XMVECTOR S0 = _mm_mul_ps(V01, Omega); + S0 = XMVectorSin(S0); + S0 = _mm_div_ps(S0, SinOmega); + + S0 = XMVectorSelect(V01, S0, Control); + + XMVECTOR S1 = XMVectorSplatY(S0); + S0 = XMVectorSplatX(S0); + + S1 = _mm_mul_ps(S1, Sign); + XMVECTOR Result = _mm_mul_ps(Q0, S0); + S1 = _mm_mul_ps(S1, Q1); + Result = _mm_add_ps(Result, S1); + return Result; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionSquad +( + FXMVECTOR Q0, + FXMVECTOR Q1, + FXMVECTOR Q2, + GXMVECTOR Q3, + float t +) noexcept +{ + XMVECTOR T = XMVectorReplicate(t); + return XMQuaternionSquadV(Q0, Q1, Q2, Q3, T); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionSquadV +( + FXMVECTOR Q0, + FXMVECTOR Q1, + FXMVECTOR Q2, + GXMVECTOR Q3, + HXMVECTOR T +) noexcept +{ + assert((XMVectorGetY(T) == XMVectorGetX(T)) && (XMVectorGetZ(T) == XMVectorGetX(T)) && (XMVectorGetW(T) == XMVectorGetX(T))); + + XMVECTOR TP = T; + const XMVECTOR Two = XMVectorSplatConstant(2, 0); + + XMVECTOR Q03 = XMQuaternionSlerpV(Q0, Q3, T); + XMVECTOR Q12 = XMQuaternionSlerpV(Q1, Q2, T); + + TP = XMVectorNegativeMultiplySubtract(TP, TP, TP); + TP = XMVectorMultiply(TP, Two); + + XMVECTOR Result = XMQuaternionSlerpV(Q03, Q12, TP); + + return Result; +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMQuaternionSquadSetup +( + XMVECTOR* pA, + XMVECTOR* pB, + XMVECTOR* pC, + FXMVECTOR Q0, + FXMVECTOR Q1, + FXMVECTOR Q2, + GXMVECTOR Q3 +) noexcept +{ + assert(pA); + assert(pB); + assert(pC); + + XMVECTOR LS12 = XMQuaternionLengthSq(XMVectorAdd(Q1, Q2)); + XMVECTOR LD12 = XMQuaternionLengthSq(XMVectorSubtract(Q1, Q2)); + XMVECTOR SQ2 = XMVectorNegate(Q2); + + XMVECTOR Control1 = XMVectorLess(LS12, LD12); + SQ2 = XMVectorSelect(Q2, SQ2, Control1); + + XMVECTOR LS01 = XMQuaternionLengthSq(XMVectorAdd(Q0, Q1)); + XMVECTOR LD01 = XMQuaternionLengthSq(XMVectorSubtract(Q0, Q1)); + XMVECTOR SQ0 = XMVectorNegate(Q0); + + XMVECTOR LS23 = XMQuaternionLengthSq(XMVectorAdd(SQ2, Q3)); + XMVECTOR LD23 = XMQuaternionLengthSq(XMVectorSubtract(SQ2, Q3)); + XMVECTOR SQ3 = XMVectorNegate(Q3); + + XMVECTOR Control0 = XMVectorLess(LS01, LD01); + XMVECTOR Control2 = XMVectorLess(LS23, LD23); + + SQ0 = XMVectorSelect(Q0, SQ0, Control0); + SQ3 = XMVectorSelect(Q3, SQ3, Control2); + + XMVECTOR InvQ1 = XMQuaternionInverse(Q1); + XMVECTOR InvQ2 = XMQuaternionInverse(SQ2); + + XMVECTOR LnQ0 = XMQuaternionLn(XMQuaternionMultiply(InvQ1, SQ0)); + XMVECTOR LnQ2 = XMQuaternionLn(XMQuaternionMultiply(InvQ1, SQ2)); + XMVECTOR LnQ1 = XMQuaternionLn(XMQuaternionMultiply(InvQ2, Q1)); + XMVECTOR LnQ3 = XMQuaternionLn(XMQuaternionMultiply(InvQ2, SQ3)); + + const XMVECTOR NegativeOneQuarter = XMVectorSplatConstant(-1, 2); + + XMVECTOR ExpQ02 = XMVectorMultiply(XMVectorAdd(LnQ0, LnQ2), NegativeOneQuarter); + XMVECTOR ExpQ13 = XMVectorMultiply(XMVectorAdd(LnQ1, LnQ3), NegativeOneQuarter); + ExpQ02 = XMQuaternionExp(ExpQ02); + ExpQ13 = XMQuaternionExp(ExpQ13); + + *pA = XMQuaternionMultiply(Q1, ExpQ02); + *pB = XMQuaternionMultiply(SQ2, ExpQ13); + *pC = SQ2; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionBaryCentric +( + FXMVECTOR Q0, + FXMVECTOR Q1, + FXMVECTOR Q2, + float f, + float g +) noexcept +{ + float s = f + g; + + XMVECTOR Result; + if ((s < 0.00001f) && (s > -0.00001f)) + { + Result = Q0; + } + else + { + XMVECTOR Q01 = XMQuaternionSlerp(Q0, Q1, s); + XMVECTOR Q02 = XMQuaternionSlerp(Q0, Q2, s); + + Result = XMQuaternionSlerp(Q01, Q02, g / s); + } + + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionBaryCentricV +( + FXMVECTOR Q0, + FXMVECTOR Q1, + FXMVECTOR Q2, + GXMVECTOR F, + HXMVECTOR G +) noexcept +{ + assert((XMVectorGetY(F) == XMVectorGetX(F)) && (XMVectorGetZ(F) == XMVectorGetX(F)) && (XMVectorGetW(F) == XMVectorGetX(F))); + assert((XMVectorGetY(G) == XMVectorGetX(G)) && (XMVectorGetZ(G) == XMVectorGetX(G)) && (XMVectorGetW(G) == XMVectorGetX(G))); + + const XMVECTOR Epsilon = XMVectorSplatConstant(1, 16); + + XMVECTOR S = XMVectorAdd(F, G); + + XMVECTOR Result; + if (XMVector4InBounds(S, Epsilon)) + { + Result = Q0; + } + else + { + XMVECTOR Q01 = XMQuaternionSlerpV(Q0, Q1, S); + XMVECTOR Q02 = XMQuaternionSlerpV(Q0, Q2, S); + XMVECTOR GS = XMVectorReciprocal(S); + GS = XMVectorMultiply(G, GS); + + Result = XMQuaternionSlerpV(Q01, Q02, GS); + } + + return Result; +} + +//------------------------------------------------------------------------------ +// Transformation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionIdentity() noexcept +{ + return g_XMIdentityR3.v; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionRotationRollPitchYaw +( + float Pitch, + float Yaw, + float Roll +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + const float halfpitch = Pitch * 0.5f; + float cp = cosf(halfpitch); + float sp = sinf(halfpitch); + + const float halfyaw = Yaw * 0.5f; + float cy = cosf(halfyaw); + float sy = sinf(halfyaw); + + const float halfroll = Roll * 0.5f; + float cr = cosf(halfroll); + float sr = sinf(halfroll); + + XMVECTORF32 vResult = { { { + cr * sp * cy + sr * cp * sy, + cr * cp * sy - sr * sp * cy, + sr * cp * cy - cr * sp * sy, + cr * cp * cy + sr * sp * sy + } } }; + return vResult; +#else + XMVECTOR Angles = XMVectorSet(Pitch, Yaw, Roll, 0.0f); + return XMQuaternionRotationRollPitchYawFromVector(Angles); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionRotationRollPitchYawFromVector +( + FXMVECTOR Angles // +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + const float halfpitch = Angles.vector4_f32[0] * 0.5f; + float cp = cosf(halfpitch); + float sp = sinf(halfpitch); + + const float halfyaw = Angles.vector4_f32[1] * 0.5f; + float cy = cosf(halfyaw); + float sy = sinf(halfyaw); + + const float halfroll = Angles.vector4_f32[2] * 0.5f; + float cr = cosf(halfroll); + float sr = sinf(halfroll); + + XMVECTORF32 vResult = { { { + cr * sp * cy + sr * cp * sy, + cr * cp * sy - sr * sp * cy, + sr * cp * cy - cr * sp * sy, + cr * cp * cy + sr * sp * sy + } } }; + return vResult; +#else + static const XMVECTORF32 Sign = { { { 1.0f, -1.0f, -1.0f, 1.0f } } }; + + XMVECTOR HalfAngles = XMVectorMultiply(Angles, g_XMOneHalf.v); + + XMVECTOR SinAngles, CosAngles; + XMVectorSinCos(&SinAngles, &CosAngles, HalfAngles); + + XMVECTOR P0 = XMVectorPermute(SinAngles, CosAngles); + XMVECTOR Y0 = XMVectorPermute(SinAngles, CosAngles); + XMVECTOR R0 = XMVectorPermute(SinAngles, CosAngles); + XMVECTOR P1 = XMVectorPermute(CosAngles, SinAngles); + XMVECTOR Y1 = XMVectorPermute(CosAngles, SinAngles); + XMVECTOR R1 = XMVectorPermute(CosAngles, SinAngles); + + XMVECTOR Q1 = XMVectorMultiply(P1, Sign.v); + XMVECTOR Q0 = XMVectorMultiply(P0, Y0); + Q1 = XMVectorMultiply(Q1, Y1); + Q0 = XMVectorMultiply(Q0, R0); + XMVECTOR Q = XMVectorMultiplyAdd(Q1, R1, Q0); + + return Q; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionRotationNormal +( + FXMVECTOR NormalAxis, + float Angle +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) + + XMVECTOR N = XMVectorSelect(g_XMOne.v, NormalAxis, g_XMSelect1110.v); + + float SinV, CosV; + XMScalarSinCos(&SinV, &CosV, 0.5f * Angle); + + XMVECTOR Scale = XMVectorSet(SinV, SinV, SinV, CosV); + return XMVectorMultiply(N, Scale); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR N = _mm_and_ps(NormalAxis, g_XMMask3); + N = _mm_or_ps(N, g_XMIdentityR3); + XMVECTOR Scale = _mm_set_ps1(0.5f * Angle); + XMVECTOR vSine; + XMVECTOR vCosine; + XMVectorSinCos(&vSine, &vCosine, Scale); + Scale = _mm_and_ps(vSine, g_XMMask3); + vCosine = _mm_and_ps(vCosine, g_XMMaskW); + Scale = _mm_or_ps(Scale, vCosine); + N = _mm_mul_ps(N, Scale); + return N; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionRotationAxis +( + FXMVECTOR Axis, + float Angle +) noexcept +{ + assert(!XMVector3Equal(Axis, XMVectorZero())); + assert(!XMVector3IsInfinite(Axis)); + + XMVECTOR Normal = XMVector3Normalize(Axis); + XMVECTOR Q = XMQuaternionRotationNormal(Normal, Angle); + return Q; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionRotationMatrix(FXMMATRIX M) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 q; + float r22 = M.m[2][2]; + if (r22 <= 0.f) // x^2 + y^2 >= z^2 + w^2 + { + float dif10 = M.m[1][1] - M.m[0][0]; + float omr22 = 1.f - r22; + if (dif10 <= 0.f) // x^2 >= y^2 + { + float fourXSqr = omr22 - dif10; + float inv4x = 0.5f / sqrtf(fourXSqr); + q.f[0] = fourXSqr * inv4x; + q.f[1] = (M.m[0][1] + M.m[1][0]) * inv4x; + q.f[2] = (M.m[0][2] + M.m[2][0]) * inv4x; + q.f[3] = (M.m[1][2] - M.m[2][1]) * inv4x; + } + else // y^2 >= x^2 + { + float fourYSqr = omr22 + dif10; + float inv4y = 0.5f / sqrtf(fourYSqr); + q.f[0] = (M.m[0][1] + M.m[1][0]) * inv4y; + q.f[1] = fourYSqr * inv4y; + q.f[2] = (M.m[1][2] + M.m[2][1]) * inv4y; + q.f[3] = (M.m[2][0] - M.m[0][2]) * inv4y; + } + } + else // z^2 + w^2 >= x^2 + y^2 + { + float sum10 = M.m[1][1] + M.m[0][0]; + float opr22 = 1.f + r22; + if (sum10 <= 0.f) // z^2 >= w^2 + { + float fourZSqr = opr22 - sum10; + float inv4z = 0.5f / sqrtf(fourZSqr); + q.f[0] = (M.m[0][2] + M.m[2][0]) * inv4z; + q.f[1] = (M.m[1][2] + M.m[2][1]) * inv4z; + q.f[2] = fourZSqr * inv4z; + q.f[3] = (M.m[0][1] - M.m[1][0]) * inv4z; + } + else // w^2 >= z^2 + { + float fourWSqr = opr22 + sum10; + float inv4w = 0.5f / sqrtf(fourWSqr); + q.f[0] = (M.m[1][2] - M.m[2][1]) * inv4w; + q.f[1] = (M.m[2][0] - M.m[0][2]) * inv4w; + q.f[2] = (M.m[0][1] - M.m[1][0]) * inv4w; + q.f[3] = fourWSqr * inv4w; + } + } + return q.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 XMPMMP = { { { +1.0f, -1.0f, -1.0f, +1.0f } } }; + static const XMVECTORF32 XMMPMP = { { { -1.0f, +1.0f, -1.0f, +1.0f } } }; + static const XMVECTORF32 XMMMPP = { { { -1.0f, -1.0f, +1.0f, +1.0f } } }; + static const XMVECTORU32 Select0110 = { { { XM_SELECT_0, XM_SELECT_1, XM_SELECT_1, XM_SELECT_0 } } }; + static const XMVECTORU32 Select0010 = { { { XM_SELECT_0, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0 } } }; + + float32x4_t r0 = M.r[0]; + float32x4_t r1 = M.r[1]; + float32x4_t r2 = M.r[2]; + + float32x4_t r00 = vdupq_lane_f32(vget_low_f32(r0), 0); + float32x4_t r11 = vdupq_lane_f32(vget_low_f32(r1), 1); + float32x4_t r22 = vdupq_lane_f32(vget_high_f32(r2), 0); + + // x^2 >= y^2 equivalent to r11 - r00 <= 0 + float32x4_t r11mr00 = vsubq_f32(r11, r00); + uint32x4_t x2gey2 = vcleq_f32(r11mr00, g_XMZero); + + // z^2 >= w^2 equivalent to r11 + r00 <= 0 + float32x4_t r11pr00 = vaddq_f32(r11, r00); + uint32x4_t z2gew2 = vcleq_f32(r11pr00, g_XMZero); + + // x^2 + y^2 >= z^2 + w^2 equivalent to r22 <= 0 + uint32x4_t x2py2gez2pw2 = vcleq_f32(r22, g_XMZero); + + // (4*x^2, 4*y^2, 4*z^2, 4*w^2) + float32x4_t t0 = vmulq_f32(XMPMMP, r00); + float32x4_t x2y2z2w2 = vmlaq_f32(t0, XMMPMP, r11); + x2y2z2w2 = vmlaq_f32(x2y2z2w2, XMMMPP, r22); + x2y2z2w2 = vaddq_f32(x2y2z2w2, g_XMOne); + + // (r01, r02, r12, r11) + t0 = vextq_f32(r0, r0, 1); + float32x4_t t1 = vextq_f32(r1, r1, 1); + t0 = vcombine_f32(vget_low_f32(t0), vrev64_f32(vget_low_f32(t1))); + + // (r10, r20, r21, r10) + t1 = vextq_f32(r2, r2, 3); + float32x4_t r10 = vdupq_lane_f32(vget_low_f32(r1), 0); + t1 = vbslq_f32(Select0110, t1, r10); + + // (4*x*y, 4*x*z, 4*y*z, unused) + float32x4_t xyxzyz = vaddq_f32(t0, t1); + + // (r21, r20, r10, r10) + t0 = vcombine_f32(vrev64_f32(vget_low_f32(r2)), vget_low_f32(r10)); + + // (r12, r02, r01, r12) + float32x4_t t2 = vcombine_f32(vrev64_f32(vget_high_f32(r0)), vrev64_f32(vget_low_f32(r0))); + float32x4_t t3 = vdupq_lane_f32(vget_high_f32(r1), 0); + t1 = vbslq_f32(Select0110, t2, t3); + + // (4*x*w, 4*y*w, 4*z*w, unused) + float32x4_t xwywzw = vsubq_f32(t0, t1); + xwywzw = vmulq_f32(XMMPMP, xwywzw); + + // (4*x*x, 4*x*y, 4*x*z, 4*x*w) + t0 = vextq_f32(xyxzyz, xyxzyz, 3); + t1 = vbslq_f32(Select0110, t0, x2y2z2w2); + t2 = vdupq_lane_f32(vget_low_f32(xwywzw), 0); + float32x4_t tensor0 = vbslq_f32(g_XMSelect1110, t1, t2); + + // (4*y*x, 4*y*y, 4*y*z, 4*y*w) + t0 = vbslq_f32(g_XMSelect1011, xyxzyz, x2y2z2w2); + t1 = vdupq_lane_f32(vget_low_f32(xwywzw), 1); + float32x4_t tensor1 = vbslq_f32(g_XMSelect1110, t0, t1); + + // (4*z*x, 4*z*y, 4*z*z, 4*z*w) + t0 = vextq_f32(xyxzyz, xyxzyz, 1); + t1 = vcombine_f32(vget_low_f32(t0), vrev64_f32(vget_high_f32(xwywzw))); + float32x4_t tensor2 = vbslq_f32(Select0010, x2y2z2w2, t1); + + // (4*w*x, 4*w*y, 4*w*z, 4*w*w) + float32x4_t tensor3 = vbslq_f32(g_XMSelect1110, xwywzw, x2y2z2w2); + + // Select the row of the tensor-product matrix that has the largest + // magnitude. + t0 = vbslq_f32(x2gey2, tensor0, tensor1); + t1 = vbslq_f32(z2gew2, tensor2, tensor3); + t2 = vbslq_f32(x2py2gez2pw2, t0, t1); + + // Normalize the row. No division by zero is possible because the + // quaternion is unit-length (and the row is a nonzero multiple of + // the quaternion). + t0 = XMVector4Length(t2); + return XMVectorDivide(t2, t0); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 XMPMMP = { { { +1.0f, -1.0f, -1.0f, +1.0f } } }; + static const XMVECTORF32 XMMPMP = { { { -1.0f, +1.0f, -1.0f, +1.0f } } }; + static const XMVECTORF32 XMMMPP = { { { -1.0f, -1.0f, +1.0f, +1.0f } } }; + + XMVECTOR r0 = M.r[0]; // (r00, r01, r02, 0) + XMVECTOR r1 = M.r[1]; // (r10, r11, r12, 0) + XMVECTOR r2 = M.r[2]; // (r20, r21, r22, 0) + + // (r00, r00, r00, r00) + XMVECTOR r00 = XM_PERMUTE_PS(r0, _MM_SHUFFLE(0, 0, 0, 0)); + // (r11, r11, r11, r11) + XMVECTOR r11 = XM_PERMUTE_PS(r1, _MM_SHUFFLE(1, 1, 1, 1)); + // (r22, r22, r22, r22) + XMVECTOR r22 = XM_PERMUTE_PS(r2, _MM_SHUFFLE(2, 2, 2, 2)); + + // x^2 >= y^2 equivalent to r11 - r00 <= 0 + // (r11 - r00, r11 - r00, r11 - r00, r11 - r00) + XMVECTOR r11mr00 = _mm_sub_ps(r11, r00); + XMVECTOR x2gey2 = _mm_cmple_ps(r11mr00, g_XMZero); + + // z^2 >= w^2 equivalent to r11 + r00 <= 0 + // (r11 + r00, r11 + r00, r11 + r00, r11 + r00) + XMVECTOR r11pr00 = _mm_add_ps(r11, r00); + XMVECTOR z2gew2 = _mm_cmple_ps(r11pr00, g_XMZero); + + // x^2 + y^2 >= z^2 + w^2 equivalent to r22 <= 0 + XMVECTOR x2py2gez2pw2 = _mm_cmple_ps(r22, g_XMZero); + + // (4*x^2, 4*y^2, 4*z^2, 4*w^2) + XMVECTOR t0 = XM_FMADD_PS(XMPMMP, r00, g_XMOne); + XMVECTOR t1 = _mm_mul_ps(XMMPMP, r11); + XMVECTOR t2 = XM_FMADD_PS(XMMMPP, r22, t0); + XMVECTOR x2y2z2w2 = _mm_add_ps(t1, t2); + + // (r01, r02, r12, r11) + t0 = _mm_shuffle_ps(r0, r1, _MM_SHUFFLE(1, 2, 2, 1)); + // (r10, r10, r20, r21) + t1 = _mm_shuffle_ps(r1, r2, _MM_SHUFFLE(1, 0, 0, 0)); + // (r10, r20, r21, r10) + t1 = XM_PERMUTE_PS(t1, _MM_SHUFFLE(1, 3, 2, 0)); + // (4*x*y, 4*x*z, 4*y*z, unused) + XMVECTOR xyxzyz = _mm_add_ps(t0, t1); + + // (r21, r20, r10, r10) + t0 = _mm_shuffle_ps(r2, r1, _MM_SHUFFLE(0, 0, 0, 1)); + // (r12, r12, r02, r01) + t1 = _mm_shuffle_ps(r1, r0, _MM_SHUFFLE(1, 2, 2, 2)); + // (r12, r02, r01, r12) + t1 = XM_PERMUTE_PS(t1, _MM_SHUFFLE(1, 3, 2, 0)); + // (4*x*w, 4*y*w, 4*z*w, unused) + XMVECTOR xwywzw = _mm_sub_ps(t0, t1); + xwywzw = _mm_mul_ps(XMMPMP, xwywzw); + + // (4*x^2, 4*y^2, 4*x*y, unused) + t0 = _mm_shuffle_ps(x2y2z2w2, xyxzyz, _MM_SHUFFLE(0, 0, 1, 0)); + // (4*z^2, 4*w^2, 4*z*w, unused) + t1 = _mm_shuffle_ps(x2y2z2w2, xwywzw, _MM_SHUFFLE(0, 2, 3, 2)); + // (4*x*z, 4*y*z, 4*x*w, 4*y*w) + t2 = _mm_shuffle_ps(xyxzyz, xwywzw, _MM_SHUFFLE(1, 0, 2, 1)); + + // (4*x*x, 4*x*y, 4*x*z, 4*x*w) + XMVECTOR tensor0 = _mm_shuffle_ps(t0, t2, _MM_SHUFFLE(2, 0, 2, 0)); + // (4*y*x, 4*y*y, 4*y*z, 4*y*w) + XMVECTOR tensor1 = _mm_shuffle_ps(t0, t2, _MM_SHUFFLE(3, 1, 1, 2)); + // (4*z*x, 4*z*y, 4*z*z, 4*z*w) + XMVECTOR tensor2 = _mm_shuffle_ps(t2, t1, _MM_SHUFFLE(2, 0, 1, 0)); + // (4*w*x, 4*w*y, 4*w*z, 4*w*w) + XMVECTOR tensor3 = _mm_shuffle_ps(t2, t1, _MM_SHUFFLE(1, 2, 3, 2)); + + // Select the row of the tensor-product matrix that has the largest + // magnitude. + t0 = _mm_and_ps(x2gey2, tensor0); + t1 = _mm_andnot_ps(x2gey2, tensor1); + t0 = _mm_or_ps(t0, t1); + t1 = _mm_and_ps(z2gew2, tensor2); + t2 = _mm_andnot_ps(z2gew2, tensor3); + t1 = _mm_or_ps(t1, t2); + t0 = _mm_and_ps(x2py2gez2pw2, t0); + t1 = _mm_andnot_ps(x2py2gez2pw2, t1); + t2 = _mm_or_ps(t0, t1); + + // Normalize the row. No division by zero is possible because the + // quaternion is unit-length (and the row is a nonzero multiple of + // the quaternion). + t0 = XMVector4Length(t2); + return _mm_div_ps(t2, t0); +#endif +} + +//------------------------------------------------------------------------------ +// Conversion operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMQuaternionToAxisAngle +( + XMVECTOR* pAxis, + float* pAngle, + FXMVECTOR Q +) noexcept +{ + assert(pAxis); + assert(pAngle); + + *pAxis = Q; + + *pAngle = 2.0f * XMScalarACos(XMVectorGetW(Q)); +} + +/**************************************************************************** + * + * Plane + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + // Comparison operations + //------------------------------------------------------------------------------ + + //------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMPlaneEqual +( + FXMVECTOR P1, + FXMVECTOR P2 +) noexcept +{ + return XMVector4Equal(P1, P2); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMPlaneNearEqual +( + FXMVECTOR P1, + FXMVECTOR P2, + FXMVECTOR Epsilon +) noexcept +{ + XMVECTOR NP1 = XMPlaneNormalize(P1); + XMVECTOR NP2 = XMPlaneNormalize(P2); + return XMVector4NearEqual(NP1, NP2, Epsilon); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMPlaneNotEqual +( + FXMVECTOR P1, + FXMVECTOR P2 +) noexcept +{ + return XMVector4NotEqual(P1, P2); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMPlaneIsNaN(FXMVECTOR P) noexcept +{ + return XMVector4IsNaN(P); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMPlaneIsInfinite(FXMVECTOR P) noexcept +{ + return XMVector4IsInfinite(P); +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMPlaneDot +( + FXMVECTOR P, + FXMVECTOR V +) noexcept +{ + return XMVector4Dot(P, V); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMPlaneDotCoord +( + FXMVECTOR P, + FXMVECTOR V +) noexcept +{ + // Result = P[0] * V[0] + P[1] * V[1] + P[2] * V[2] + P[3] + + XMVECTOR V3 = XMVectorSelect(g_XMOne.v, V, g_XMSelect1110.v); + XMVECTOR Result = XMVector4Dot(P, V3); + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMPlaneDotNormal +( + FXMVECTOR P, + FXMVECTOR V +) noexcept +{ + return XMVector3Dot(P, V); +} + +//------------------------------------------------------------------------------ +// XMPlaneNormalizeEst uses a reciprocal estimate and +// returns QNaN on zero and infinite vectors. + +inline XMVECTOR XM_CALLCONV XMPlaneNormalizeEst(FXMVECTOR P) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) + + XMVECTOR Result = XMVector3ReciprocalLengthEst(P); + return XMVectorMultiply(P, Result); + +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(P, P, 0x7f); + XMVECTOR vResult = _mm_rsqrt_ps(vTemp); + return _mm_mul_ps(vResult, P); +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product + XMVECTOR vDot = _mm_mul_ps(P, P); + // x=Dot.y, y=Dot.z + XMVECTOR vTemp = XM_PERMUTE_PS(vDot, _MM_SHUFFLE(2, 1, 2, 1)); + // Result.x = x+y + vDot = _mm_add_ss(vDot, vTemp); + // x=Dot.z + vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); + // Result.x = (x+y)+z + vDot = _mm_add_ss(vDot, vTemp); + // Splat x + vDot = XM_PERMUTE_PS(vDot, _MM_SHUFFLE(0, 0, 0, 0)); + // Get the reciprocal + vDot = _mm_rsqrt_ps(vDot); + // Get the reciprocal + vDot = _mm_mul_ps(vDot, P); + return vDot; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMPlaneNormalize(FXMVECTOR P) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + float fLengthSq = sqrtf((P.vector4_f32[0] * P.vector4_f32[0]) + (P.vector4_f32[1] * P.vector4_f32[1]) + (P.vector4_f32[2] * P.vector4_f32[2])); + // Prevent divide by zero + if (fLengthSq > 0) + { + fLengthSq = 1.0f / fLengthSq; + } + XMVECTORF32 vResult = { { { + P.vector4_f32[0] * fLengthSq, + P.vector4_f32[1] * fLengthSq, + P.vector4_f32[2] * fLengthSq, + P.vector4_f32[3] * fLengthSq + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMVECTOR vLength = XMVector3ReciprocalLength(P); + return XMVectorMultiply(P, vLength); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vLengthSq = _mm_dp_ps(P, P, 0x7f); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); + // Reciprocal mul to perform the normalization + vResult = _mm_div_ps(P, vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult, vLengthSq); + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y and z only + XMVECTOR vLengthSq = _mm_mul_ps(P, P); + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(2, 1, 2, 1)); + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); + // Reciprocal mul to perform the normalization + vResult = _mm_div_ps(P, vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult, vLengthSq); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMPlaneIntersectLine +( + FXMVECTOR P, + FXMVECTOR LinePoint1, + FXMVECTOR LinePoint2 +) noexcept +{ + XMVECTOR V1 = XMVector3Dot(P, LinePoint1); + XMVECTOR V2 = XMVector3Dot(P, LinePoint2); + XMVECTOR D = XMVectorSubtract(V1, V2); + + XMVECTOR VT = XMPlaneDotCoord(P, LinePoint1); + VT = XMVectorDivide(VT, D); + + XMVECTOR Point = XMVectorSubtract(LinePoint2, LinePoint1); + Point = XMVectorMultiplyAdd(Point, VT, LinePoint1); + + const XMVECTOR Zero = XMVectorZero(); + XMVECTOR Control = XMVectorNearEqual(D, Zero, g_XMEpsilon.v); + + return XMVectorSelect(Point, g_XMQNaN.v, Control); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMPlaneIntersectPlane +( + XMVECTOR* pLinePoint1, + XMVECTOR* pLinePoint2, + FXMVECTOR P1, + FXMVECTOR P2 +) noexcept +{ + assert(pLinePoint1); + assert(pLinePoint2); + + XMVECTOR V1 = XMVector3Cross(P2, P1); + + XMVECTOR LengthSq = XMVector3LengthSq(V1); + + XMVECTOR V2 = XMVector3Cross(P2, V1); + + XMVECTOR P1W = XMVectorSplatW(P1); + XMVECTOR Point = XMVectorMultiply(V2, P1W); + + XMVECTOR V3 = XMVector3Cross(V1, P1); + + XMVECTOR P2W = XMVectorSplatW(P2); + Point = XMVectorMultiplyAdd(V3, P2W, Point); + + XMVECTOR LinePoint1 = XMVectorDivide(Point, LengthSq); + + XMVECTOR LinePoint2 = XMVectorAdd(LinePoint1, V1); + + XMVECTOR Control = XMVectorLessOrEqual(LengthSq, g_XMEpsilon.v); + *pLinePoint1 = XMVectorSelect(LinePoint1, g_XMQNaN.v, Control); + *pLinePoint2 = XMVectorSelect(LinePoint2, g_XMQNaN.v, Control); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMPlaneTransform +( + FXMVECTOR P, + FXMMATRIX ITM +) noexcept +{ + XMVECTOR W = XMVectorSplatW(P); + XMVECTOR Z = XMVectorSplatZ(P); + XMVECTOR Y = XMVectorSplatY(P); + XMVECTOR X = XMVectorSplatX(P); + + XMVECTOR Result = XMVectorMultiply(W, ITM.r[3]); + Result = XMVectorMultiplyAdd(Z, ITM.r[2], Result); + Result = XMVectorMultiplyAdd(Y, ITM.r[1], Result); + Result = XMVectorMultiplyAdd(X, ITM.r[0], Result); + return Result; +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMFLOAT4* XM_CALLCONV XMPlaneTransformStream +( + XMFLOAT4* pOutputStream, + size_t OutputStride, + const XMFLOAT4* pInputStream, + size_t InputStride, + size_t PlaneCount, + FXMMATRIX ITM +) noexcept +{ + return XMVector4TransformStream(pOutputStream, + OutputStride, + pInputStream, + InputStride, + PlaneCount, + ITM); +} + +//------------------------------------------------------------------------------ +// Conversion operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMPlaneFromPointNormal +( + FXMVECTOR Point, + FXMVECTOR Normal +) noexcept +{ + XMVECTOR W = XMVector3Dot(Point, Normal); + W = XMVectorNegate(W); + return XMVectorSelect(W, Normal, g_XMSelect1110.v); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMPlaneFromPoints +( + FXMVECTOR Point1, + FXMVECTOR Point2, + FXMVECTOR Point3 +) noexcept +{ + XMVECTOR V21 = XMVectorSubtract(Point1, Point2); + XMVECTOR V31 = XMVectorSubtract(Point1, Point3); + + XMVECTOR N = XMVector3Cross(V21, V31); + N = XMVector3Normalize(N); + + XMVECTOR D = XMPlaneDotNormal(N, Point1); + D = XMVectorNegate(D); + + XMVECTOR Result = XMVectorSelect(D, N, g_XMSelect1110.v); + + return Result; +} + +/**************************************************************************** + * + * Color + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + // Comparison operations + //------------------------------------------------------------------------------ + + //------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMColorEqual +( + FXMVECTOR C1, + FXMVECTOR C2 +) noexcept +{ + return XMVector4Equal(C1, C2); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMColorNotEqual +( + FXMVECTOR C1, + FXMVECTOR C2 +) noexcept +{ + return XMVector4NotEqual(C1, C2); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMColorGreater +( + FXMVECTOR C1, + FXMVECTOR C2 +) noexcept +{ + return XMVector4Greater(C1, C2); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMColorGreaterOrEqual +( + FXMVECTOR C1, + FXMVECTOR C2 +) noexcept +{ + return XMVector4GreaterOrEqual(C1, C2); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMColorLess +( + FXMVECTOR C1, + FXMVECTOR C2 +) noexcept +{ + return XMVector4Less(C1, C2); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMColorLessOrEqual +( + FXMVECTOR C1, + FXMVECTOR C2 +) noexcept +{ + return XMVector4LessOrEqual(C1, C2); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMColorIsNaN(FXMVECTOR C) noexcept +{ + return XMVector4IsNaN(C); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMColorIsInfinite(FXMVECTOR C) noexcept +{ + return XMVector4IsInfinite(C); +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorNegative(FXMVECTOR vColor) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + 1.0f - vColor.vector4_f32[0], + 1.0f - vColor.vector4_f32[1], + 1.0f - vColor.vector4_f32[2], + vColor.vector4_f32[3] + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vTemp = veorq_u32(vreinterpretq_u32_f32(vColor), g_XMNegate3); + return vaddq_f32(vreinterpretq_f32_u32(vTemp), g_XMOne3); +#elif defined(_XM_SSE_INTRINSICS_) + // Negate only x,y and z. + XMVECTOR vTemp = _mm_xor_ps(vColor, g_XMNegate3); + // Add 1,1,1,0 to -x,-y,-z,w + return _mm_add_ps(vTemp, g_XMOne3); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorModulate +( + FXMVECTOR C1, + FXMVECTOR C2 +) noexcept +{ + return XMVectorMultiply(C1, C2); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorAdjustSaturation +( + FXMVECTOR vColor, + float fSaturation +) noexcept +{ + // Luminance = 0.2125f * C[0] + 0.7154f * C[1] + 0.0721f * C[2]; + // Result = (C - Luminance) * Saturation + Luminance; + + const XMVECTORF32 gvLuminance = { { { 0.2125f, 0.7154f, 0.0721f, 0.0f } } }; +#if defined(_XM_NO_INTRINSICS_) + float fLuminance = (vColor.vector4_f32[0] * gvLuminance.f[0]) + (vColor.vector4_f32[1] * gvLuminance.f[1]) + (vColor.vector4_f32[2] * gvLuminance.f[2]); + XMVECTOR vResult; + vResult.vector4_f32[0] = ((vColor.vector4_f32[0] - fLuminance) * fSaturation) + fLuminance; + vResult.vector4_f32[1] = ((vColor.vector4_f32[1] - fLuminance) * fSaturation) + fLuminance; + vResult.vector4_f32[2] = ((vColor.vector4_f32[2] - fLuminance) * fSaturation) + fLuminance; + vResult.vector4_f32[3] = vColor.vector4_f32[3]; + return vResult; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMVECTOR vLuminance = XMVector3Dot(vColor, gvLuminance); + XMVECTOR vResult = vsubq_f32(vColor, vLuminance); + vResult = vmlaq_n_f32(vLuminance, vResult, fSaturation); + return vbslq_f32(g_XMSelect1110, vResult, vColor); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vLuminance = XMVector3Dot(vColor, gvLuminance); + // Splat fSaturation + XMVECTOR vSaturation = _mm_set_ps1(fSaturation); + // vResult = ((vColor-vLuminance)*vSaturation)+vLuminance; + XMVECTOR vResult = _mm_sub_ps(vColor, vLuminance); + vResult = XM_FMADD_PS(vResult, vSaturation, vLuminance); + // Retain w from the source color + vLuminance = _mm_shuffle_ps(vResult, vColor, _MM_SHUFFLE(3, 2, 2, 2)); // x = vResult.z,y = vResult.z,z = vColor.z,w=vColor.w + vResult = _mm_shuffle_ps(vResult, vLuminance, _MM_SHUFFLE(3, 0, 1, 0)); // x = vResult.x,y = vResult.y,z = vResult.z,w=vColor.w + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorAdjustContrast +( + FXMVECTOR vColor, + float fContrast +) noexcept +{ + // Result = (vColor - 0.5f) * fContrast + 0.5f; + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + ((vColor.vector4_f32[0] - 0.5f) * fContrast) + 0.5f, + ((vColor.vector4_f32[1] - 0.5f) * fContrast) + 0.5f, + ((vColor.vector4_f32[2] - 0.5f) * fContrast) + 0.5f, + vColor.vector4_f32[3] // Leave W untouched + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMVECTOR vResult = vsubq_f32(vColor, g_XMOneHalf.v); + vResult = vmlaq_n_f32(g_XMOneHalf.v, vResult, fContrast); + return vbslq_f32(g_XMSelect1110, vResult, vColor); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vScale = _mm_set_ps1(fContrast); // Splat the scale + XMVECTOR vResult = _mm_sub_ps(vColor, g_XMOneHalf); // Subtract 0.5f from the source (Saving source) + vResult = XM_FMADD_PS(vResult, vScale, g_XMOneHalf); +// Retain w from the source color + vScale = _mm_shuffle_ps(vResult, vColor, _MM_SHUFFLE(3, 2, 2, 2)); // x = vResult.z,y = vResult.z,z = vColor.z,w=vColor.w + vResult = _mm_shuffle_ps(vResult, vScale, _MM_SHUFFLE(3, 0, 1, 0)); // x = vResult.x,y = vResult.y,z = vResult.z,w=vColor.w + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorRGBToHSL(FXMVECTOR rgb) noexcept +{ + XMVECTOR r = XMVectorSplatX(rgb); + XMVECTOR g = XMVectorSplatY(rgb); + XMVECTOR b = XMVectorSplatZ(rgb); + + XMVECTOR min = XMVectorMin(r, XMVectorMin(g, b)); + XMVECTOR max = XMVectorMax(r, XMVectorMax(g, b)); + + XMVECTOR l = XMVectorMultiply(XMVectorAdd(min, max), g_XMOneHalf); + + XMVECTOR d = XMVectorSubtract(max, min); + + XMVECTOR la = XMVectorSelect(rgb, l, g_XMSelect1110); + + if (XMVector3Less(d, g_XMEpsilon)) + { + // Achromatic, assume H and S of 0 + return XMVectorSelect(la, g_XMZero, g_XMSelect1100); + } + else + { + XMVECTOR s, h; + + XMVECTOR d2 = XMVectorAdd(min, max); + + if (XMVector3Greater(l, g_XMOneHalf)) + { + // d / (2-max-min) + s = XMVectorDivide(d, XMVectorSubtract(g_XMTwo, d2)); + } + else + { + // d / (max+min) + s = XMVectorDivide(d, d2); + } + + if (XMVector3Equal(r, max)) + { + // Red is max + h = XMVectorDivide(XMVectorSubtract(g, b), d); + } + else if (XMVector3Equal(g, max)) + { + // Green is max + h = XMVectorDivide(XMVectorSubtract(b, r), d); + h = XMVectorAdd(h, g_XMTwo); + } + else + { + // Blue is max + h = XMVectorDivide(XMVectorSubtract(r, g), d); + h = XMVectorAdd(h, g_XMFour); + } + + h = XMVectorDivide(h, g_XMSix); + + if (XMVector3Less(h, g_XMZero)) + h = XMVectorAdd(h, g_XMOne); + + XMVECTOR lha = XMVectorSelect(la, h, g_XMSelect1100); + return XMVectorSelect(s, lha, g_XMSelect1011); + } +} + +//------------------------------------------------------------------------------ + +namespace Internal +{ + + inline XMVECTOR XM_CALLCONV XMColorHue2Clr(FXMVECTOR p, FXMVECTOR q, FXMVECTOR h) noexcept + { + static const XMVECTORF32 oneSixth = { { { 1.0f / 6.0f, 1.0f / 6.0f, 1.0f / 6.0f, 1.0f / 6.0f } } }; + static const XMVECTORF32 twoThirds = { { { 2.0f / 3.0f, 2.0f / 3.0f, 2.0f / 3.0f, 2.0f / 3.0f } } }; + + XMVECTOR t = h; + + if (XMVector3Less(t, g_XMZero)) + t = XMVectorAdd(t, g_XMOne); + + if (XMVector3Greater(t, g_XMOne)) + t = XMVectorSubtract(t, g_XMOne); + + if (XMVector3Less(t, oneSixth)) + { + // p + (q - p) * 6 * t + XMVECTOR t1 = XMVectorSubtract(q, p); + XMVECTOR t2 = XMVectorMultiply(g_XMSix, t); + return XMVectorMultiplyAdd(t1, t2, p); + } + + if (XMVector3Less(t, g_XMOneHalf)) + return q; + + if (XMVector3Less(t, twoThirds)) + { + // p + (q - p) * 6 * (2/3 - t) + XMVECTOR t1 = XMVectorSubtract(q, p); + XMVECTOR t2 = XMVectorMultiply(g_XMSix, XMVectorSubtract(twoThirds, t)); + return XMVectorMultiplyAdd(t1, t2, p); + } + + return p; + } + +} // namespace Internal + +inline XMVECTOR XM_CALLCONV XMColorHSLToRGB(FXMVECTOR hsl) noexcept +{ + static const XMVECTORF32 oneThird = { { { 1.0f / 3.0f, 1.0f / 3.0f, 1.0f / 3.0f, 1.0f / 3.0f } } }; + + XMVECTOR s = XMVectorSplatY(hsl); + XMVECTOR l = XMVectorSplatZ(hsl); + + if (XMVector3NearEqual(s, g_XMZero, g_XMEpsilon)) + { + // Achromatic + return XMVectorSelect(hsl, l, g_XMSelect1110); + } + else + { + XMVECTOR h = XMVectorSplatX(hsl); + + XMVECTOR q; + if (XMVector3Less(l, g_XMOneHalf)) + { + q = XMVectorMultiply(l, XMVectorAdd(g_XMOne, s)); + } + else + { + q = XMVectorSubtract(XMVectorAdd(l, s), XMVectorMultiply(l, s)); + } + + XMVECTOR p = XMVectorSubtract(XMVectorMultiply(g_XMTwo, l), q); + + XMVECTOR r = DirectX::Internal::XMColorHue2Clr(p, q, XMVectorAdd(h, oneThird)); + XMVECTOR g = DirectX::Internal::XMColorHue2Clr(p, q, h); + XMVECTOR b = DirectX::Internal::XMColorHue2Clr(p, q, XMVectorSubtract(h, oneThird)); + + XMVECTOR rg = XMVectorSelect(g, r, g_XMSelect1000); + XMVECTOR ba = XMVectorSelect(hsl, b, g_XMSelect1110); + + return XMVectorSelect(ba, rg, g_XMSelect1100); + } +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorRGBToHSV(FXMVECTOR rgb) noexcept +{ + XMVECTOR r = XMVectorSplatX(rgb); + XMVECTOR g = XMVectorSplatY(rgb); + XMVECTOR b = XMVectorSplatZ(rgb); + + XMVECTOR min = XMVectorMin(r, XMVectorMin(g, b)); + XMVECTOR v = XMVectorMax(r, XMVectorMax(g, b)); + + XMVECTOR d = XMVectorSubtract(v, min); + + XMVECTOR s = (XMVector3NearEqual(v, g_XMZero, g_XMEpsilon)) ? g_XMZero : XMVectorDivide(d, v); + + if (XMVector3Less(d, g_XMEpsilon)) + { + // Achromatic, assume H of 0 + XMVECTOR hv = XMVectorSelect(v, g_XMZero, g_XMSelect1000); + XMVECTOR hva = XMVectorSelect(rgb, hv, g_XMSelect1110); + return XMVectorSelect(s, hva, g_XMSelect1011); + } + else + { + XMVECTOR h; + + if (XMVector3Equal(r, v)) + { + // Red is max + h = XMVectorDivide(XMVectorSubtract(g, b), d); + + if (XMVector3Less(g, b)) + h = XMVectorAdd(h, g_XMSix); + } + else if (XMVector3Equal(g, v)) + { + // Green is max + h = XMVectorDivide(XMVectorSubtract(b, r), d); + h = XMVectorAdd(h, g_XMTwo); + } + else + { + // Blue is max + h = XMVectorDivide(XMVectorSubtract(r, g), d); + h = XMVectorAdd(h, g_XMFour); + } + + h = XMVectorDivide(h, g_XMSix); + + XMVECTOR hv = XMVectorSelect(v, h, g_XMSelect1000); + XMVECTOR hva = XMVectorSelect(rgb, hv, g_XMSelect1110); + return XMVectorSelect(s, hva, g_XMSelect1011); + } +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorHSVToRGB(FXMVECTOR hsv) noexcept +{ + XMVECTOR h = XMVectorSplatX(hsv); + XMVECTOR s = XMVectorSplatY(hsv); + XMVECTOR v = XMVectorSplatZ(hsv); + + XMVECTOR h6 = XMVectorMultiply(h, g_XMSix); + + XMVECTOR i = XMVectorFloor(h6); + XMVECTOR f = XMVectorSubtract(h6, i); + + // p = v* (1-s) + XMVECTOR p = XMVectorMultiply(v, XMVectorSubtract(g_XMOne, s)); + + // q = v*(1-f*s) + XMVECTOR q = XMVectorMultiply(v, XMVectorSubtract(g_XMOne, XMVectorMultiply(f, s))); + + // t = v*(1 - (1-f)*s) + XMVECTOR t = XMVectorMultiply(v, XMVectorSubtract(g_XMOne, XMVectorMultiply(XMVectorSubtract(g_XMOne, f), s))); + + auto ii = static_cast(XMVectorGetX(XMVectorMod(i, g_XMSix))); + + XMVECTOR _rgb; + + switch (ii) + { + case 0: // rgb = vtp + { + XMVECTOR vt = XMVectorSelect(t, v, g_XMSelect1000); + _rgb = XMVectorSelect(p, vt, g_XMSelect1100); + } + break; + case 1: // rgb = qvp + { + XMVECTOR qv = XMVectorSelect(v, q, g_XMSelect1000); + _rgb = XMVectorSelect(p, qv, g_XMSelect1100); + } + break; + case 2: // rgb = pvt + { + XMVECTOR pv = XMVectorSelect(v, p, g_XMSelect1000); + _rgb = XMVectorSelect(t, pv, g_XMSelect1100); + } + break; + case 3: // rgb = pqv + { + XMVECTOR pq = XMVectorSelect(q, p, g_XMSelect1000); + _rgb = XMVectorSelect(v, pq, g_XMSelect1100); + } + break; + case 4: // rgb = tpv + { + XMVECTOR tp = XMVectorSelect(p, t, g_XMSelect1000); + _rgb = XMVectorSelect(v, tp, g_XMSelect1100); + } + break; + default: // rgb = vpq + { + XMVECTOR vp = XMVectorSelect(p, v, g_XMSelect1000); + _rgb = XMVectorSelect(q, vp, g_XMSelect1100); + } + break; + } + + return XMVectorSelect(hsv, _rgb, g_XMSelect1110); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorRGBToYUV(FXMVECTOR rgb) noexcept +{ + static const XMVECTORF32 Scale0 = { { { 0.299f, -0.147f, 0.615f, 0.0f } } }; + static const XMVECTORF32 Scale1 = { { { 0.587f, -0.289f, -0.515f, 0.0f } } }; + static const XMVECTORF32 Scale2 = { { { 0.114f, 0.436f, -0.100f, 0.0f } } }; + + XMMATRIX M(Scale0, Scale1, Scale2, g_XMZero); + XMVECTOR clr = XMVector3Transform(rgb, M); + + return XMVectorSelect(rgb, clr, g_XMSelect1110); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorYUVToRGB(FXMVECTOR yuv) noexcept +{ + static const XMVECTORF32 Scale1 = { { { 0.0f, -0.395f, 2.032f, 0.0f } } }; + static const XMVECTORF32 Scale2 = { { { 1.140f, -0.581f, 0.0f, 0.0f } } }; + + XMMATRIX M(g_XMOne, Scale1, Scale2, g_XMZero); + XMVECTOR clr = XMVector3Transform(yuv, M); + + return XMVectorSelect(yuv, clr, g_XMSelect1110); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorRGBToYUV_HD(FXMVECTOR rgb) noexcept +{ + static const XMVECTORF32 Scale0 = { { { 0.2126f, -0.0997f, 0.6150f, 0.0f } } }; + static const XMVECTORF32 Scale1 = { { { 0.7152f, -0.3354f, -0.5586f, 0.0f } } }; + static const XMVECTORF32 Scale2 = { { { 0.0722f, 0.4351f, -0.0564f, 0.0f } } }; + + XMMATRIX M(Scale0, Scale1, Scale2, g_XMZero); + XMVECTOR clr = XMVector3Transform(rgb, M); + + return XMVectorSelect(rgb, clr, g_XMSelect1110); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorYUVToRGB_HD(FXMVECTOR yuv) noexcept +{ + static const XMVECTORF32 Scale1 = { { { 0.0f, -0.2153f, 2.1324f, 0.0f } } }; + static const XMVECTORF32 Scale2 = { { { 1.2803f, -0.3806f, 0.0f, 0.0f } } }; + + XMMATRIX M(g_XMOne, Scale1, Scale2, g_XMZero); + XMVECTOR clr = XMVector3Transform(yuv, M); + + return XMVectorSelect(yuv, clr, g_XMSelect1110); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorRGBToYUV_UHD(FXMVECTOR rgb) noexcept +{ + static const XMVECTORF32 Scale0 = { { { 0.2627f, -0.1215f, 0.6150f, 0.0f } } }; + static const XMVECTORF32 Scale1 = { { { 0.6780f, -0.3136f, -0.5655f, 0.0f } } }; + static const XMVECTORF32 Scale2 = { { { 0.0593f, 0.4351f, -0.0495f, 0.0f } } }; + + XMMATRIX M(Scale0, Scale1, Scale2, g_XMZero); + XMVECTOR clr = XMVector3Transform(rgb, M); + + return XMVectorSelect(rgb, clr, g_XMSelect1110); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorYUVToRGB_UHD(FXMVECTOR yuv) noexcept +{ + static const XMVECTORF32 Scale1 = { { { 0.0f, -0.1891f, 2.1620f, 0.0f } } }; + static const XMVECTORF32 Scale2 = { { { 1.1989f, -0.4645f, 0.0f, 0.0f } } }; + + XMMATRIX M(g_XMOne, Scale1, Scale2, g_XMZero); + XMVECTOR clr = XMVector3Transform(yuv, M); + + return XMVectorSelect(yuv, clr, g_XMSelect1110); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorRGBToXYZ(FXMVECTOR rgb) noexcept +{ + static const XMVECTORF32 Scale0 = { { { 0.4887180f, 0.1762044f, 0.0000000f, 0.0f } } }; + static const XMVECTORF32 Scale1 = { { { 0.3106803f, 0.8129847f, 0.0102048f, 0.0f } } }; + static const XMVECTORF32 Scale2 = { { { 0.2006017f, 0.0108109f, 0.9897952f, 0.0f } } }; + static const XMVECTORF32 Scale = { { { 1.f / 0.17697f, 1.f / 0.17697f, 1.f / 0.17697f, 0.0f } } }; + + XMMATRIX M(Scale0, Scale1, Scale2, g_XMZero); + XMVECTOR clr = XMVectorMultiply(XMVector3Transform(rgb, M), Scale); + + return XMVectorSelect(rgb, clr, g_XMSelect1110); +} + +inline XMVECTOR XM_CALLCONV XMColorXYZToRGB(FXMVECTOR xyz) noexcept +{ + static const XMVECTORF32 Scale0 = { { { 2.3706743f, -0.5138850f, 0.0052982f, 0.0f } } }; + static const XMVECTORF32 Scale1 = { { { -0.9000405f, 1.4253036f, -0.0146949f, 0.0f } } }; + static const XMVECTORF32 Scale2 = { { { -0.4706338f, 0.0885814f, 1.0093968f, 0.0f } } }; + static const XMVECTORF32 Scale = { { { 0.17697f, 0.17697f, 0.17697f, 0.0f } } }; + + XMMATRIX M(Scale0, Scale1, Scale2, g_XMZero); + XMVECTOR clr = XMVector3Transform(XMVectorMultiply(xyz, Scale), M); + + return XMVectorSelect(xyz, clr, g_XMSelect1110); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorXYZToSRGB(FXMVECTOR xyz) noexcept +{ + static const XMVECTORF32 Scale0 = { { { 3.2406f, -0.9689f, 0.0557f, 0.0f } } }; + static const XMVECTORF32 Scale1 = { { { -1.5372f, 1.8758f, -0.2040f, 0.0f } } }; + static const XMVECTORF32 Scale2 = { { { -0.4986f, 0.0415f, 1.0570f, 0.0f } } }; + static const XMVECTORF32 Cutoff = { { { 0.0031308f, 0.0031308f, 0.0031308f, 0.0f } } }; + static const XMVECTORF32 Exp = { { { 1.0f / 2.4f, 1.0f / 2.4f, 1.0f / 2.4f, 1.0f } } }; + + XMMATRIX M(Scale0, Scale1, Scale2, g_XMZero); + XMVECTOR lclr = XMVector3Transform(xyz, M); + + XMVECTOR sel = XMVectorGreater(lclr, Cutoff); + + // clr = 12.92 * lclr for lclr <= 0.0031308f + XMVECTOR smallC = XMVectorMultiply(lclr, g_XMsrgbScale); + + // clr = (1+a)*pow(lclr, 1/2.4) - a for lclr > 0.0031308 (where a = 0.055) + XMVECTOR largeC = XMVectorSubtract(XMVectorMultiply(g_XMsrgbA1, XMVectorPow(lclr, Exp)), g_XMsrgbA); + + XMVECTOR clr = XMVectorSelect(smallC, largeC, sel); + + return XMVectorSelect(xyz, clr, g_XMSelect1110); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorSRGBToXYZ(FXMVECTOR srgb) noexcept +{ + static const XMVECTORF32 Scale0 = { { { 0.4124f, 0.2126f, 0.0193f, 0.0f } } }; + static const XMVECTORF32 Scale1 = { { { 0.3576f, 0.7152f, 0.1192f, 0.0f } } }; + static const XMVECTORF32 Scale2 = { { { 0.1805f, 0.0722f, 0.9505f, 0.0f } } }; + static const XMVECTORF32 Cutoff = { { { 0.04045f, 0.04045f, 0.04045f, 0.0f } } }; + static const XMVECTORF32 Exp = { { { 2.4f, 2.4f, 2.4f, 1.0f } } }; + + XMVECTOR sel = XMVectorGreater(srgb, Cutoff); + + // lclr = clr / 12.92 + XMVECTOR smallC = XMVectorDivide(srgb, g_XMsrgbScale); + + // lclr = pow( (clr + a) / (1+a), 2.4 ) + XMVECTOR largeC = XMVectorPow(XMVectorDivide(XMVectorAdd(srgb, g_XMsrgbA), g_XMsrgbA1), Exp); + + XMVECTOR lclr = XMVectorSelect(smallC, largeC, sel); + + XMMATRIX M(Scale0, Scale1, Scale2, g_XMZero); + XMVECTOR clr = XMVector3Transform(lclr, M); + + return XMVectorSelect(srgb, clr, g_XMSelect1110); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorRGBToSRGB(FXMVECTOR rgb) noexcept +{ + static const XMVECTORF32 Cutoff = { { { 0.0031308f, 0.0031308f, 0.0031308f, 1.f } } }; + static const XMVECTORF32 Linear = { { { 12.92f, 12.92f, 12.92f, 1.f } } }; + static const XMVECTORF32 Scale = { { { 1.055f, 1.055f, 1.055f, 1.f } } }; + static const XMVECTORF32 Bias = { { { 0.055f, 0.055f, 0.055f, 0.f } } }; + static const XMVECTORF32 InvGamma = { { { 1.0f / 2.4f, 1.0f / 2.4f, 1.0f / 2.4f, 1.f } } }; + + XMVECTOR V = XMVectorSaturate(rgb); + XMVECTOR V0 = XMVectorMultiply(V, Linear); + XMVECTOR V1 = XMVectorSubtract(XMVectorMultiply(Scale, XMVectorPow(V, InvGamma)), Bias); + XMVECTOR select = XMVectorLess(V, Cutoff); + V = XMVectorSelect(V1, V0, select); + return XMVectorSelect(rgb, V, g_XMSelect1110); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorSRGBToRGB(FXMVECTOR srgb) noexcept +{ + static const XMVECTORF32 Cutoff = { { { 0.04045f, 0.04045f, 0.04045f, 1.f } } }; + static const XMVECTORF32 ILinear = { { { 1.f / 12.92f, 1.f / 12.92f, 1.f / 12.92f, 1.f } } }; + static const XMVECTORF32 Scale = { { { 1.f / 1.055f, 1.f / 1.055f, 1.f / 1.055f, 1.f } } }; + static const XMVECTORF32 Bias = { { { 0.055f, 0.055f, 0.055f, 0.f } } }; + static const XMVECTORF32 Gamma = { { { 2.4f, 2.4f, 2.4f, 1.f } } }; + + XMVECTOR V = XMVectorSaturate(srgb); + XMVECTOR V0 = XMVectorMultiply(V, ILinear); + XMVECTOR V1 = XMVectorPow(XMVectorMultiply(XMVectorAdd(V, Bias), Scale), Gamma); + XMVECTOR select = XMVectorGreater(V, Cutoff); + V = XMVectorSelect(V0, V1, select); + return XMVectorSelect(srgb, V, g_XMSelect1110); +} + +/**************************************************************************** + * + * Miscellaneous + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline bool XMVerifyCPUSupport() noexcept +{ +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + int CPUInfo[4] = { -1 }; +#if defined(__clang__) || defined(__GNUC__) + __cpuid(0, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]); +#else + __cpuid(CPUInfo, 0); +#endif + +#ifdef __AVX2__ + if (CPUInfo[0] < 7) + return false; +#else + if (CPUInfo[0] < 1) + return false; +#endif + +#if defined(__clang__) || defined(__GNUC__) + __cpuid(1, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]); +#else + __cpuid(CPUInfo, 1); +#endif + +#if defined(__AVX2__) || defined(_XM_AVX2_INTRINSICS_) + // The compiler can emit FMA3 instructions even without explicit intrinsics use + if ((CPUInfo[2] & 0x38081001) != 0x38081001) + return false; // No F16C/AVX/OSXSAVE/SSE4.1/FMA3/SSE3 support +#elif defined(_XM_FMA3_INTRINSICS_) && defined(_XM_F16C_INTRINSICS_) + if ((CPUInfo[2] & 0x38081001) != 0x38081001) + return false; // No F16C/AVX/OSXSAVE/SSE4.1/FMA3/SSE3 support +#elif defined(_XM_FMA3_INTRINSICS_) + if ((CPUInfo[2] & 0x18081001) != 0x18081001) + return false; // No AVX/OSXSAVE/SSE4.1/FMA3/SSE3 support +#elif defined(_XM_F16C_INTRINSICS_) + if ((CPUInfo[2] & 0x38080001) != 0x38080001) + return false; // No F16C/AVX/OSXSAVE/SSE4.1/SSE3 support +#elif defined(__AVX__) || defined(_XM_AVX_INTRINSICS_) + if ((CPUInfo[2] & 0x18080001) != 0x18080001) + return false; // No AVX/OSXSAVE/SSE4.1/SSE3 support +#elif defined(_XM_SSE4_INTRINSICS_) + if ((CPUInfo[2] & 0x80001) != 0x80001) + return false; // No SSE3/SSE4.1 support +#elif defined(_XM_SSE3_INTRINSICS_) + if (!(CPUInfo[2] & 0x1)) + return false; // No SSE3 support +#endif + + // The x64 processor model requires SSE2 support, but no harm in checking + if ((CPUInfo[3] & 0x6000000) != 0x6000000) + return false; // No SSE2/SSE support + +#if defined(__AVX2__) || defined(_XM_AVX2_INTRINSICS_) +#if defined(__clang__) || defined(__GNUC__) + __cpuid_count(7, 0, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]); +#else + __cpuidex(CPUInfo, 7, 0); +#endif + if (!(CPUInfo[1] & 0x20)) + return false; // No AVX2 support +#endif + + return true; +#elif defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + // ARM-NEON support is required for the Windows on ARM platform + return true; +#else + // No intrinsics path always supported + return true; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMFresnelTerm +( + FXMVECTOR CosIncidentAngle, + FXMVECTOR RefractionIndex +) noexcept +{ + assert(!XMVector4IsInfinite(CosIncidentAngle)); + + // Result = 0.5f * (g - c)^2 / (g + c)^2 * ((c * (g + c) - 1)^2 / (c * (g - c) + 1)^2 + 1) where + // c = CosIncidentAngle + // g = sqrt(c^2 + RefractionIndex^2 - 1) + +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) + + XMVECTOR G = XMVectorMultiplyAdd(RefractionIndex, RefractionIndex, g_XMNegativeOne.v); + G = XMVectorMultiplyAdd(CosIncidentAngle, CosIncidentAngle, G); + G = XMVectorAbs(G); + G = XMVectorSqrt(G); + + XMVECTOR S = XMVectorAdd(G, CosIncidentAngle); + XMVECTOR D = XMVectorSubtract(G, CosIncidentAngle); + + XMVECTOR V0 = XMVectorMultiply(D, D); + XMVECTOR V1 = XMVectorMultiply(S, S); + V1 = XMVectorReciprocal(V1); + V0 = XMVectorMultiply(g_XMOneHalf.v, V0); + V0 = XMVectorMultiply(V0, V1); + + XMVECTOR V2 = XMVectorMultiplyAdd(CosIncidentAngle, S, g_XMNegativeOne.v); + XMVECTOR V3 = XMVectorMultiplyAdd(CosIncidentAngle, D, g_XMOne.v); + V2 = XMVectorMultiply(V2, V2); + V3 = XMVectorMultiply(V3, V3); + V3 = XMVectorReciprocal(V3); + V2 = XMVectorMultiplyAdd(V2, V3, g_XMOne.v); + + XMVECTOR Result = XMVectorMultiply(V0, V2); + + Result = XMVectorSaturate(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // G = sqrt(abs((RefractionIndex^2-1) + CosIncidentAngle^2)) + XMVECTOR G = _mm_mul_ps(RefractionIndex, RefractionIndex); + XMVECTOR vTemp = _mm_mul_ps(CosIncidentAngle, CosIncidentAngle); + G = _mm_sub_ps(G, g_XMOne); + vTemp = _mm_add_ps(vTemp, G); + // max((0-vTemp),vTemp) == abs(vTemp) + // The abs is needed to deal with refraction and cosine being zero + G = _mm_setzero_ps(); + G = _mm_sub_ps(G, vTemp); + G = _mm_max_ps(G, vTemp); + // Last operation, the sqrt() + G = _mm_sqrt_ps(G); + + // Calc G-C and G+C + XMVECTOR GAddC = _mm_add_ps(G, CosIncidentAngle); + XMVECTOR GSubC = _mm_sub_ps(G, CosIncidentAngle); + // Perform the term (0.5f *(g - c)^2) / (g + c)^2 + XMVECTOR vResult = _mm_mul_ps(GSubC, GSubC); + vTemp = _mm_mul_ps(GAddC, GAddC); + vResult = _mm_mul_ps(vResult, g_XMOneHalf); + vResult = _mm_div_ps(vResult, vTemp); + // Perform the term ((c * (g + c) - 1)^2 / (c * (g - c) + 1)^2 + 1) + GAddC = _mm_mul_ps(GAddC, CosIncidentAngle); + GSubC = _mm_mul_ps(GSubC, CosIncidentAngle); + GAddC = _mm_sub_ps(GAddC, g_XMOne); + GSubC = _mm_add_ps(GSubC, g_XMOne); + GAddC = _mm_mul_ps(GAddC, GAddC); + GSubC = _mm_mul_ps(GSubC, GSubC); + GAddC = _mm_div_ps(GAddC, GSubC); + GAddC = _mm_add_ps(GAddC, g_XMOne); + // Multiply the two term parts + vResult = _mm_mul_ps(vResult, GAddC); + // Clamp to 0.0 - 1.0f + vResult = _mm_max_ps(vResult, g_XMZero); + vResult = _mm_min_ps(vResult, g_XMOne); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XMScalarNearEqual +( + float S1, + float S2, + float Epsilon +) noexcept +{ + float Delta = S1 - S2; + return (fabsf(Delta) <= Epsilon); +} + +//------------------------------------------------------------------------------ +// Modulo the range of the given angle such that -XM_PI <= Angle < XM_PI +inline float XMScalarModAngle(float Angle) noexcept +{ + // Note: The modulo is performed with unsigned math only to work + // around a precision error on numbers that are close to PI + + // Normalize the range from 0.0f to XM_2PI + Angle = Angle + XM_PI; + // Perform the modulo, unsigned + float fTemp = fabsf(Angle); + fTemp = fTemp - (XM_2PI * static_cast(static_cast(fTemp / XM_2PI))); + // Restore the number to the range of -XM_PI to XM_PI-epsilon + fTemp = fTemp - XM_PI; + // If the modulo'd value was negative, restore negation + if (Angle < 0.0f) + { + fTemp = -fTemp; + } + return fTemp; +} + +//------------------------------------------------------------------------------ + +inline float XMScalarSin(float Value) noexcept +{ + // Map Value to y in [-pi,pi], x = 2*pi*quotient + remainder. + float quotient = XM_1DIV2PI * Value; + if (Value >= 0.0f) + { + quotient = static_cast(static_cast(quotient + 0.5f)); + } + else + { + quotient = static_cast(static_cast(quotient - 0.5f)); + } + float y = Value - XM_2PI * quotient; + + // Map y to [-pi/2,pi/2] with sin(y) = sin(Value). + if (y > XM_PIDIV2) + { + y = XM_PI - y; + } + else if (y < -XM_PIDIV2) + { + y = -XM_PI - y; + } + + // 11-degree minimax approximation + float y2 = y * y; + return (((((-2.3889859e-08f * y2 + 2.7525562e-06f) * y2 - 0.00019840874f) * y2 + 0.0083333310f) * y2 - 0.16666667f) * y2 + 1.0f) * y; +} + +//------------------------------------------------------------------------------ + +inline float XMScalarSinEst(float Value) noexcept +{ + // Map Value to y in [-pi,pi], x = 2*pi*quotient + remainder. + float quotient = XM_1DIV2PI * Value; + if (Value >= 0.0f) + { + quotient = static_cast(static_cast(quotient + 0.5f)); + } + else + { + quotient = static_cast(static_cast(quotient - 0.5f)); + } + float y = Value - XM_2PI * quotient; + + // Map y to [-pi/2,pi/2] with sin(y) = sin(Value). + if (y > XM_PIDIV2) + { + y = XM_PI - y; + } + else if (y < -XM_PIDIV2) + { + y = -XM_PI - y; + } + + // 7-degree minimax approximation + float y2 = y * y; + return (((-0.00018524670f * y2 + 0.0083139502f) * y2 - 0.16665852f) * y2 + 1.0f) * y; +} + +//------------------------------------------------------------------------------ + +inline float XMScalarCos(float Value) noexcept +{ + // Map Value to y in [-pi,pi], x = 2*pi*quotient + remainder. + float quotient = XM_1DIV2PI * Value; + if (Value >= 0.0f) + { + quotient = static_cast(static_cast(quotient + 0.5f)); + } + else + { + quotient = static_cast(static_cast(quotient - 0.5f)); + } + float y = Value - XM_2PI * quotient; + + // Map y to [-pi/2,pi/2] with cos(y) = sign*cos(x). + float sign; + if (y > XM_PIDIV2) + { + y = XM_PI - y; + sign = -1.0f; + } + else if (y < -XM_PIDIV2) + { + y = -XM_PI - y; + sign = -1.0f; + } + else + { + sign = +1.0f; + } + + // 10-degree minimax approximation + float y2 = y * y; + float p = ((((-2.6051615e-07f * y2 + 2.4760495e-05f) * y2 - 0.0013888378f) * y2 + 0.041666638f) * y2 - 0.5f) * y2 + 1.0f; + return sign * p; +} + +//------------------------------------------------------------------------------ + +inline float XMScalarCosEst(float Value) noexcept +{ + // Map Value to y in [-pi,pi], x = 2*pi*quotient + remainder. + float quotient = XM_1DIV2PI * Value; + if (Value >= 0.0f) + { + quotient = static_cast(static_cast(quotient + 0.5f)); + } + else + { + quotient = static_cast(static_cast(quotient - 0.5f)); + } + float y = Value - XM_2PI * quotient; + + // Map y to [-pi/2,pi/2] with cos(y) = sign*cos(x). + float sign; + if (y > XM_PIDIV2) + { + y = XM_PI - y; + sign = -1.0f; + } + else if (y < -XM_PIDIV2) + { + y = -XM_PI - y; + sign = -1.0f; + } + else + { + sign = +1.0f; + } + + // 6-degree minimax approximation + float y2 = y * y; + float p = ((-0.0012712436f * y2 + 0.041493919f) * y2 - 0.49992746f) * y2 + 1.0f; + return sign * p; +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline void XMScalarSinCos +( + float* pSin, + float* pCos, + float Value +) noexcept +{ + assert(pSin); + assert(pCos); + + // Map Value to y in [-pi,pi], x = 2*pi*quotient + remainder. + float quotient = XM_1DIV2PI * Value; + if (Value >= 0.0f) + { + quotient = static_cast(static_cast(quotient + 0.5f)); + } + else + { + quotient = static_cast(static_cast(quotient - 0.5f)); + } + float y = Value - XM_2PI * quotient; + + // Map y to [-pi/2,pi/2] with sin(y) = sin(Value). + float sign; + if (y > XM_PIDIV2) + { + y = XM_PI - y; + sign = -1.0f; + } + else if (y < -XM_PIDIV2) + { + y = -XM_PI - y; + sign = -1.0f; + } + else + { + sign = +1.0f; + } + + float y2 = y * y; + + // 11-degree minimax approximation + *pSin = (((((-2.3889859e-08f * y2 + 2.7525562e-06f) * y2 - 0.00019840874f) * y2 + 0.0083333310f) * y2 - 0.16666667f) * y2 + 1.0f) * y; + + // 10-degree minimax approximation + float p = ((((-2.6051615e-07f * y2 + 2.4760495e-05f) * y2 - 0.0013888378f) * y2 + 0.041666638f) * y2 - 0.5f) * y2 + 1.0f; + *pCos = sign * p; +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline void XMScalarSinCosEst +( + float* pSin, + float* pCos, + float Value +) noexcept +{ + assert(pSin); + assert(pCos); + + // Map Value to y in [-pi,pi], x = 2*pi*quotient + remainder. + float quotient = XM_1DIV2PI * Value; + if (Value >= 0.0f) + { + quotient = static_cast(static_cast(quotient + 0.5f)); + } + else + { + quotient = static_cast(static_cast(quotient - 0.5f)); + } + float y = Value - XM_2PI * quotient; + + // Map y to [-pi/2,pi/2] with sin(y) = sin(Value). + float sign; + if (y > XM_PIDIV2) + { + y = XM_PI - y; + sign = -1.0f; + } + else if (y < -XM_PIDIV2) + { + y = -XM_PI - y; + sign = -1.0f; + } + else + { + sign = +1.0f; + } + + float y2 = y * y; + + // 7-degree minimax approximation + *pSin = (((-0.00018524670f * y2 + 0.0083139502f) * y2 - 0.16665852f) * y2 + 1.0f) * y; + + // 6-degree minimax approximation + float p = ((-0.0012712436f * y2 + 0.041493919f) * y2 - 0.49992746f) * y2 + 1.0f; + *pCos = sign * p; +} + +//------------------------------------------------------------------------------ + +inline float XMScalarASin(float Value) noexcept +{ + // Clamp input to [-1,1]. + bool nonnegative = (Value >= 0.0f); + float x = fabsf(Value); + float omx = 1.0f - x; + if (omx < 0.0f) + { + omx = 0.0f; + } + float root = sqrtf(omx); + + // 7-degree minimax approximation + float result = ((((((-0.0012624911f * x + 0.0066700901f) * x - 0.0170881256f) * x + 0.0308918810f) * x - 0.0501743046f) * x + 0.0889789874f) * x - 0.2145988016f) * x + 1.5707963050f; + result *= root; // acos(|x|) + + // acos(x) = pi - acos(-x) when x < 0, asin(x) = pi/2 - acos(x) + return (nonnegative ? XM_PIDIV2 - result : result - XM_PIDIV2); +} + +//------------------------------------------------------------------------------ + +inline float XMScalarASinEst(float Value) noexcept +{ + // Clamp input to [-1,1]. + bool nonnegative = (Value >= 0.0f); + float x = fabsf(Value); + float omx = 1.0f - x; + if (omx < 0.0f) + { + omx = 0.0f; + } + float root = sqrtf(omx); + + // 3-degree minimax approximation + float result = ((-0.0187293f * x + 0.0742610f) * x - 0.2121144f) * x + 1.5707288f; + result *= root; // acos(|x|) + + // acos(x) = pi - acos(-x) when x < 0, asin(x) = pi/2 - acos(x) + return (nonnegative ? XM_PIDIV2 - result : result - XM_PIDIV2); +} + +//------------------------------------------------------------------------------ + +inline float XMScalarACos(float Value) noexcept +{ + // Clamp input to [-1,1]. + bool nonnegative = (Value >= 0.0f); + float x = fabsf(Value); + float omx = 1.0f - x; + if (omx < 0.0f) + { + omx = 0.0f; + } + float root = sqrtf(omx); + + // 7-degree minimax approximation + float result = ((((((-0.0012624911f * x + 0.0066700901f) * x - 0.0170881256f) * x + 0.0308918810f) * x - 0.0501743046f) * x + 0.0889789874f) * x - 0.2145988016f) * x + 1.5707963050f; + result *= root; + + // acos(x) = pi - acos(-x) when x < 0 + return (nonnegative ? result : XM_PI - result); +} + +//------------------------------------------------------------------------------ + +inline float XMScalarACosEst(float Value) noexcept +{ + // Clamp input to [-1,1]. + bool nonnegative = (Value >= 0.0f); + float x = fabsf(Value); + float omx = 1.0f - x; + if (omx < 0.0f) + { + omx = 0.0f; + } + float root = sqrtf(omx); + + // 3-degree minimax approximation + float result = ((-0.0187293f * x + 0.0742610f) * x - 0.2121144f) * x + 1.5707288f; + result *= root; + + // acos(x) = pi - acos(-x) when x < 0 + return (nonnegative ? result : XM_PI - result); +} + diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXMathVector.inl b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXMathVector.inl new file mode 100644 index 0000000..e3db56a --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXMathVector.inl @@ -0,0 +1,14819 @@ +//------------------------------------------------------------------------------------- +// DirectXMathVector.inl -- SIMD C++ Math library +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +// +// http://go.microsoft.com/fwlink/?LinkID=615560 +//------------------------------------------------------------------------------------- + +#pragma once + +#if defined(_XM_NO_INTRINSICS_) +#define XMISNAN(x) isnan(x) +#define XMISINF(x) isinf(x) +#endif + +#if defined(_XM_SSE_INTRINSICS_) + +#define XM3UNPACK3INTO4(l1, l2, l3) \ + XMVECTOR V3 = _mm_shuffle_ps(l2, l3, _MM_SHUFFLE(0, 0, 3, 2));\ + XMVECTOR V2 = _mm_shuffle_ps(l2, l1, _MM_SHUFFLE(3, 3, 1, 0));\ + V2 = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 0, 2));\ + XMVECTOR V4 = _mm_castsi128_ps(_mm_srli_si128(_mm_castps_si128(L3), 32 / 8)) + +#define XM3PACK4INTO3(v2x) \ + v2x = _mm_shuffle_ps(V2, V3, _MM_SHUFFLE(1, 0, 2, 1));\ + V2 = _mm_shuffle_ps(V2, V1, _MM_SHUFFLE(2, 2, 0, 0));\ + V1 = _mm_shuffle_ps(V1, V2, _MM_SHUFFLE(0, 2, 1, 0));\ + V3 = _mm_shuffle_ps(V3, V4, _MM_SHUFFLE(0, 0, 2, 2));\ + V3 = _mm_shuffle_ps(V3, V4, _MM_SHUFFLE(2, 1, 2, 0)) + +#endif + +/**************************************************************************** + * + * General Vector + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + // Assignment operations + //------------------------------------------------------------------------------ + + //------------------------------------------------------------------------------ + // Return a vector with all elements equaling zero +inline XMVECTOR XM_CALLCONV XMVectorZero() noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { 0.0f, 0.0f, 0.0f, 0.0f } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vdupq_n_f32(0); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_setzero_ps(); +#endif +} + +//------------------------------------------------------------------------------ +// Initialize a vector with four floating point values +inline XMVECTOR XM_CALLCONV XMVectorSet +( + float x, + float y, + float z, + float w +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { x, y, z, w } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t V0 = vcreate_f32( + static_cast(*reinterpret_cast(&x)) + | (static_cast(*reinterpret_cast(&y)) << 32)); + float32x2_t V1 = vcreate_f32( + static_cast(*reinterpret_cast(&z)) + | (static_cast(*reinterpret_cast(&w)) << 32)); + return vcombine_f32(V0, V1); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_set_ps(w, z, y, x); +#endif +} + +//------------------------------------------------------------------------------ +// Initialize a vector with four integer values +inline XMVECTOR XM_CALLCONV XMVectorSetInt +( + uint32_t x, + uint32_t y, + uint32_t z, + uint32_t w +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 vResult = { { { x, y, z, w } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t V0 = vcreate_u32(static_cast(x) | (static_cast(y) << 32)); + uint32x2_t V1 = vcreate_u32(static_cast(z) | (static_cast(w) << 32)); + return vreinterpretq_f32_u32(vcombine_u32(V0, V1)); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_set_epi32(static_cast(w), static_cast(z), static_cast(y), static_cast(x)); + return _mm_castsi128_ps(V); +#endif +} + +//------------------------------------------------------------------------------ +// Initialize a vector with a replicated floating point value +inline XMVECTOR XM_CALLCONV XMVectorReplicate(float Value) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult; + vResult.f[0] = + vResult.f[1] = + vResult.f[2] = + vResult.f[3] = Value; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vdupq_n_f32(Value); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_set_ps1(Value); +#endif +} + +//------------------------------------------------------------------------------ +// Initialize a vector with a replicated floating point value passed by pointer +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorReplicatePtr(const float* pValue) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + float Value = pValue[0]; + XMVECTORF32 vResult; + vResult.f[0] = + vResult.f[1] = + vResult.f[2] = + vResult.f[3] = Value; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vld1q_dup_f32(pValue); +#elif defined(_XM_AVX_INTRINSICS_) + return _mm_broadcast_ss(pValue); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_load_ps1(pValue); +#endif +} + +//------------------------------------------------------------------------------ +// Initialize a vector with a replicated integer value +inline XMVECTOR XM_CALLCONV XMVectorReplicateInt(uint32_t Value) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 vResult; + vResult.u[0] = + vResult.u[1] = + vResult.u[2] = + vResult.u[3] = Value; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vdupq_n_u32(Value)); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_set1_epi32(static_cast(Value)); + return _mm_castsi128_ps(vTemp); +#endif +} + +//------------------------------------------------------------------------------ +// Initialize a vector with a replicated integer value passed by pointer +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorReplicateIntPtr(const uint32_t* pValue) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + uint32_t Value = pValue[0]; + XMVECTORU32 vResult; + vResult.u[0] = + vResult.u[1] = + vResult.u[2] = + vResult.u[3] = Value; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vld1q_dup_u32(pValue)); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_load_ps1(reinterpret_cast(pValue)); +#endif +} + +//------------------------------------------------------------------------------ +// Initialize a vector with all bits set (true mask) +inline XMVECTOR XM_CALLCONV XMVectorTrueInt() noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 vResult = { { { 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_s32(vdupq_n_s32(-1)); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_set1_epi32(-1); + return _mm_castsi128_ps(V); +#endif +} + +//------------------------------------------------------------------------------ +// Initialize a vector with all bits clear (false mask) +inline XMVECTOR XM_CALLCONV XMVectorFalseInt() noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { 0.0f, 0.0f, 0.0f, 0.0f } } }; + return vResult; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vdupq_n_u32(0)); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_setzero_ps(); +#endif +} + +//------------------------------------------------------------------------------ +// Replicate the x component of the vector +inline XMVECTOR XM_CALLCONV XMVectorSplatX(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult; + vResult.f[0] = + vResult.f[1] = + vResult.f[2] = + vResult.f[3] = V.vector4_f32[0]; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vdupq_lane_f32(vget_low_f32(V), 0); +#elif defined(_XM_AVX2_INTRINSICS_) && defined(_XM_FAVOR_INTEL_) + return _mm_broadcastss_ps(V); +#elif defined(_XM_SSE_INTRINSICS_) + return XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); +#endif +} + +//------------------------------------------------------------------------------ +// Replicate the y component of the vector +inline XMVECTOR XM_CALLCONV XMVectorSplatY(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult; + vResult.f[0] = + vResult.f[1] = + vResult.f[2] = + vResult.f[3] = V.vector4_f32[1]; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vdupq_lane_f32(vget_low_f32(V), 1); +#elif defined(_XM_SSE_INTRINSICS_) + return XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); +#endif +} + +//------------------------------------------------------------------------------ +// Replicate the z component of the vector +inline XMVECTOR XM_CALLCONV XMVectorSplatZ(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult; + vResult.f[0] = + vResult.f[1] = + vResult.f[2] = + vResult.f[3] = V.vector4_f32[2]; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vdupq_lane_f32(vget_high_f32(V), 0); +#elif defined(_XM_SSE_INTRINSICS_) + return XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); +#endif +} + +//------------------------------------------------------------------------------ +// Replicate the w component of the vector +inline XMVECTOR XM_CALLCONV XMVectorSplatW(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult; + vResult.f[0] = + vResult.f[1] = + vResult.f[2] = + vResult.f[3] = V.vector4_f32[3]; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vdupq_lane_f32(vget_high_f32(V), 1); +#elif defined(_XM_SSE_INTRINSICS_) + return XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); +#endif +} + +//------------------------------------------------------------------------------ +// Return a vector of 1.0f,1.0f,1.0f,1.0f +inline XMVECTOR XM_CALLCONV XMVectorSplatOne() noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult; + vResult.f[0] = + vResult.f[1] = + vResult.f[2] = + vResult.f[3] = 1.0f; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vdupq_n_f32(1.0f); +#elif defined(_XM_SSE_INTRINSICS_) + return g_XMOne; +#endif +} + +//------------------------------------------------------------------------------ +// Return a vector of INF,INF,INF,INF +inline XMVECTOR XM_CALLCONV XMVectorSplatInfinity() noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 vResult; + vResult.u[0] = + vResult.u[1] = + vResult.u[2] = + vResult.u[3] = 0x7F800000; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vdupq_n_u32(0x7F800000)); +#elif defined(_XM_SSE_INTRINSICS_) + return g_XMInfinity; +#endif +} + +//------------------------------------------------------------------------------ +// Return a vector of Q_NAN,Q_NAN,Q_NAN,Q_NAN +inline XMVECTOR XM_CALLCONV XMVectorSplatQNaN() noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 vResult; + vResult.u[0] = + vResult.u[1] = + vResult.u[2] = + vResult.u[3] = 0x7FC00000; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vdupq_n_u32(0x7FC00000)); +#elif defined(_XM_SSE_INTRINSICS_) + return g_XMQNaN; +#endif +} + +//------------------------------------------------------------------------------ +// Return a vector of 1.192092896e-7f,1.192092896e-7f,1.192092896e-7f,1.192092896e-7f +inline XMVECTOR XM_CALLCONV XMVectorSplatEpsilon() noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 vResult; + vResult.u[0] = + vResult.u[1] = + vResult.u[2] = + vResult.u[3] = 0x34000000; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vdupq_n_u32(0x34000000)); +#elif defined(_XM_SSE_INTRINSICS_) + return g_XMEpsilon; +#endif +} + +//------------------------------------------------------------------------------ +// Return a vector of -0.0f (0x80000000),-0.0f,-0.0f,-0.0f +inline XMVECTOR XM_CALLCONV XMVectorSplatSignMask() noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 vResult; + vResult.u[0] = + vResult.u[1] = + vResult.u[2] = + vResult.u[3] = 0x80000000U; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vdupq_n_u32(0x80000000U)); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_set1_epi32(static_cast(0x80000000)); + return _mm_castsi128_ps(V); +#endif +} + +//------------------------------------------------------------------------------ +// Return a floating point value via an index. This is not a recommended +// function to use due to performance loss. +inline float XM_CALLCONV XMVectorGetByIndex(FXMVECTOR V, size_t i) noexcept +{ + assert(i < 4); + _Analysis_assume_(i < 4); +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_f32[i]; +#else + XMVECTORF32 U; + U.v = V; + return U.f[i]; +#endif +} + +//------------------------------------------------------------------------------ +// Return the X component in an FPU register. +inline float XM_CALLCONV XMVectorGetX(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_f32[0]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vgetq_lane_f32(V, 0); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_cvtss_f32(V); +#endif +} + +// Return the Y component in an FPU register. +inline float XM_CALLCONV XMVectorGetY(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_f32[1]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vgetq_lane_f32(V, 1); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + return _mm_cvtss_f32(vTemp); +#endif +} + +// Return the Z component in an FPU register. +inline float XM_CALLCONV XMVectorGetZ(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_f32[2]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vgetq_lane_f32(V, 2); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + return _mm_cvtss_f32(vTemp); +#endif +} + +// Return the W component in an FPU register. +inline float XM_CALLCONV XMVectorGetW(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_f32[3]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vgetq_lane_f32(V, 3); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + return _mm_cvtss_f32(vTemp); +#endif +} + +//------------------------------------------------------------------------------ + +// Store a component indexed by i into a 32 bit float location in memory. +_Use_decl_annotations_ +inline void XM_CALLCONV XMVectorGetByIndexPtr(float* f, FXMVECTOR V, size_t i) noexcept +{ + assert(f != nullptr); + assert(i < 4); + _Analysis_assume_(i < 4); +#if defined(_XM_NO_INTRINSICS_) + *f = V.vector4_f32[i]; +#else + XMVECTORF32 U; + U.v = V; + *f = U.f[i]; +#endif +} + +//------------------------------------------------------------------------------ + +// Store the X component into a 32 bit float location in memory. +_Use_decl_annotations_ +inline void XM_CALLCONV XMVectorGetXPtr(float* x, FXMVECTOR V) noexcept +{ + assert(x != nullptr); +#if defined(_XM_NO_INTRINSICS_) + *x = V.vector4_f32[0]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + vst1q_lane_f32(x, V, 0); +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_ss(x, V); +#endif +} + +// Store the Y component into a 32 bit float location in memory. +_Use_decl_annotations_ +inline void XM_CALLCONV XMVectorGetYPtr(float* y, FXMVECTOR V) noexcept +{ + assert(y != nullptr); +#if defined(_XM_NO_INTRINSICS_) + *y = V.vector4_f32[1]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + vst1q_lane_f32(y, V, 1); +#elif defined(_XM_SSE4_INTRINSICS_) + * (reinterpret_cast(y)) = _mm_extract_ps(V, 1); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + _mm_store_ss(y, vResult); +#endif +} + +// Store the Z component into a 32 bit float location in memory. +_Use_decl_annotations_ +inline void XM_CALLCONV XMVectorGetZPtr(float* z, FXMVECTOR V) noexcept +{ + assert(z != nullptr); +#if defined(_XM_NO_INTRINSICS_) + *z = V.vector4_f32[2]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + vst1q_lane_f32(z, V, 2); +#elif defined(_XM_SSE4_INTRINSICS_) + * (reinterpret_cast(z)) = _mm_extract_ps(V, 2); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + _mm_store_ss(z, vResult); +#endif +} + +// Store the W component into a 32 bit float location in memory. +_Use_decl_annotations_ +inline void XM_CALLCONV XMVectorGetWPtr(float* w, FXMVECTOR V) noexcept +{ + assert(w != nullptr); +#if defined(_XM_NO_INTRINSICS_) + *w = V.vector4_f32[3]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + vst1q_lane_f32(w, V, 3); +#elif defined(_XM_SSE4_INTRINSICS_) + * (reinterpret_cast(w)) = _mm_extract_ps(V, 3); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + _mm_store_ss(w, vResult); +#endif +} + +//------------------------------------------------------------------------------ + +// Return an integer value via an index. This is not a recommended +// function to use due to performance loss. +inline uint32_t XM_CALLCONV XMVectorGetIntByIndex(FXMVECTOR V, size_t i) noexcept +{ + assert(i < 4); + _Analysis_assume_(i < 4); +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_u32[i]; +#else + XMVECTORU32 U; + U.v = V; + return U.u[i]; +#endif +} + +//------------------------------------------------------------------------------ + +// Return the X component in an integer register. +inline uint32_t XM_CALLCONV XMVectorGetIntX(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_u32[0]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vgetq_lane_u32(vreinterpretq_u32_f32(V), 0); +#elif defined(_XM_SSE_INTRINSICS_) + return static_cast(_mm_cvtsi128_si32(_mm_castps_si128(V))); +#endif +} + +// Return the Y component in an integer register. +inline uint32_t XM_CALLCONV XMVectorGetIntY(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_u32[1]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vgetq_lane_u32(vreinterpretq_u32_f32(V), 1); +#elif defined(_XM_SSE4_INTRINSICS_) + __m128i V1 = _mm_castps_si128(V); + return static_cast(_mm_extract_epi32(V1, 1)); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vResulti = _mm_shuffle_epi32(_mm_castps_si128(V), _MM_SHUFFLE(1, 1, 1, 1)); + return static_cast(_mm_cvtsi128_si32(vResulti)); +#endif +} + +// Return the Z component in an integer register. +inline uint32_t XM_CALLCONV XMVectorGetIntZ(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_u32[2]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vgetq_lane_u32(vreinterpretq_u32_f32(V), 2); +#elif defined(_XM_SSE4_INTRINSICS_) + __m128i V1 = _mm_castps_si128(V); + return static_cast(_mm_extract_epi32(V1, 2)); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vResulti = _mm_shuffle_epi32(_mm_castps_si128(V), _MM_SHUFFLE(2, 2, 2, 2)); + return static_cast(_mm_cvtsi128_si32(vResulti)); +#endif +} + +// Return the W component in an integer register. +inline uint32_t XM_CALLCONV XMVectorGetIntW(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_u32[3]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vgetq_lane_u32(vreinterpretq_u32_f32(V), 3); +#elif defined(_XM_SSE4_INTRINSICS_) + __m128i V1 = _mm_castps_si128(V); + return static_cast(_mm_extract_epi32(V1, 3)); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vResulti = _mm_shuffle_epi32(_mm_castps_si128(V), _MM_SHUFFLE(3, 3, 3, 3)); + return static_cast(_mm_cvtsi128_si32(vResulti)); +#endif +} + +//------------------------------------------------------------------------------ + +// Store a component indexed by i into a 32 bit integer location in memory. +_Use_decl_annotations_ +inline void XM_CALLCONV XMVectorGetIntByIndexPtr(uint32_t* x, FXMVECTOR V, size_t i) noexcept +{ + assert(x != nullptr); + assert(i < 4); + _Analysis_assume_(i < 4); +#if defined(_XM_NO_INTRINSICS_) + *x = V.vector4_u32[i]; +#else + XMVECTORU32 U; + U.v = V; + *x = U.u[i]; +#endif +} + +//------------------------------------------------------------------------------ + +// Store the X component into a 32 bit integer location in memory. +_Use_decl_annotations_ +inline void XM_CALLCONV XMVectorGetIntXPtr(uint32_t* x, FXMVECTOR V) noexcept +{ + assert(x != nullptr); +#if defined(_XM_NO_INTRINSICS_) + *x = V.vector4_u32[0]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + vst1q_lane_u32(x, *reinterpret_cast(&V), 0); +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_ss(reinterpret_cast(x), V); +#endif +} + +// Store the Y component into a 32 bit integer location in memory. +_Use_decl_annotations_ +inline void XM_CALLCONV XMVectorGetIntYPtr(uint32_t* y, FXMVECTOR V) noexcept +{ + assert(y != nullptr); +#if defined(_XM_NO_INTRINSICS_) + *y = V.vector4_u32[1]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + vst1q_lane_u32(y, *reinterpret_cast(&V), 1); +#elif defined(_XM_SSE4_INTRINSICS_) + __m128i V1 = _mm_castps_si128(V); + *y = static_cast(_mm_extract_epi32(V1, 1)); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + _mm_store_ss(reinterpret_cast(y), vResult); +#endif +} + +// Store the Z component into a 32 bit integer locaCantion in memory. +_Use_decl_annotations_ +inline void XM_CALLCONV XMVectorGetIntZPtr(uint32_t* z, FXMVECTOR V) noexcept +{ + assert(z != nullptr); +#if defined(_XM_NO_INTRINSICS_) + *z = V.vector4_u32[2]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + vst1q_lane_u32(z, *reinterpret_cast(&V), 2); +#elif defined(_XM_SSE4_INTRINSICS_) + __m128i V1 = _mm_castps_si128(V); + *z = static_cast(_mm_extract_epi32(V1, 2)); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + _mm_store_ss(reinterpret_cast(z), vResult); +#endif +} + +// Store the W component into a 32 bit integer location in memory. +_Use_decl_annotations_ +inline void XM_CALLCONV XMVectorGetIntWPtr(uint32_t* w, FXMVECTOR V) noexcept +{ + assert(w != nullptr); +#if defined(_XM_NO_INTRINSICS_) + *w = V.vector4_u32[3]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + vst1q_lane_u32(w, *reinterpret_cast(&V), 3); +#elif defined(_XM_SSE4_INTRINSICS_) + __m128i V1 = _mm_castps_si128(V); + *w = static_cast(_mm_extract_epi32(V1, 3)); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + _mm_store_ss(reinterpret_cast(w), vResult); +#endif +} + +//------------------------------------------------------------------------------ + +// Set a single indexed floating point component +inline XMVECTOR XM_CALLCONV XMVectorSetByIndex(FXMVECTOR V, float f, size_t i) noexcept +{ + assert(i < 4); + _Analysis_assume_(i < 4); + XMVECTORF32 U; + U.v = V; + U.f[i] = f; + return U.v; +} + +//------------------------------------------------------------------------------ + +// Sets the X component of a vector to a passed floating point value +inline XMVECTOR XM_CALLCONV XMVectorSetX(FXMVECTOR V, float x) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 U = { { { + x, + V.vector4_f32[1], + V.vector4_f32[2], + V.vector4_f32[3] + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vsetq_lane_f32(x, V, 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_set_ss(x); + vResult = _mm_move_ss(V, vResult); + return vResult; +#endif +} + +// Sets the Y component of a vector to a passed floating point value +inline XMVECTOR XM_CALLCONV XMVectorSetY(FXMVECTOR V, float y) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 U = { { { + V.vector4_f32[0], + y, + V.vector4_f32[2], + V.vector4_f32[3] + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vsetq_lane_f32(y, V, 1); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vResult = _mm_set_ss(y); + vResult = _mm_insert_ps(V, vResult, 0x10); + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + // Swap y and x + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 2, 0, 1)); + // Convert input to vector + XMVECTOR vTemp = _mm_set_ss(y); + // Replace the x component + vResult = _mm_move_ss(vResult, vTemp); + // Swap y and x again + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 2, 0, 1)); + return vResult; +#endif +} +// Sets the Z component of a vector to a passed floating point value +inline XMVECTOR XM_CALLCONV XMVectorSetZ(FXMVECTOR V, float z) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 U = { { { + V.vector4_f32[0], + V.vector4_f32[1], + z, + V.vector4_f32[3] + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vsetq_lane_f32(z, V, 2); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vResult = _mm_set_ss(z); + vResult = _mm_insert_ps(V, vResult, 0x20); + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + // Swap z and x + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 0, 1, 2)); + // Convert input to vector + XMVECTOR vTemp = _mm_set_ss(z); + // Replace the x component + vResult = _mm_move_ss(vResult, vTemp); + // Swap z and x again + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 0, 1, 2)); + return vResult; +#endif +} + +// Sets the W component of a vector to a passed floating point value +inline XMVECTOR XM_CALLCONV XMVectorSetW(FXMVECTOR V, float w) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 U = { { { + V.vector4_f32[0], + V.vector4_f32[1], + V.vector4_f32[2], + w + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vsetq_lane_f32(w, V, 3); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vResult = _mm_set_ss(w); + vResult = _mm_insert_ps(V, vResult, 0x30); + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + // Swap w and x + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 2, 1, 3)); + // Convert input to vector + XMVECTOR vTemp = _mm_set_ss(w); + // Replace the x component + vResult = _mm_move_ss(vResult, vTemp); + // Swap w and x again + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(0, 2, 1, 3)); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +// Sets a component of a vector to a floating point value passed by pointer +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorSetByIndexPtr(FXMVECTOR V, const float* f, size_t i) noexcept +{ + assert(f != nullptr); + assert(i < 4); + _Analysis_assume_(i < 4); + XMVECTORF32 U; + U.v = V; + U.f[i] = *f; + return U.v; +} + +//------------------------------------------------------------------------------ + +// Sets the X component of a vector to a floating point value passed by pointer +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorSetXPtr(FXMVECTOR V, const float* x) noexcept +{ + assert(x != nullptr); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 U = { { { + *x, + V.vector4_f32[1], + V.vector4_f32[2], + V.vector4_f32[3] + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vld1q_lane_f32(x, V, 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_load_ss(x); + vResult = _mm_move_ss(V, vResult); + return vResult; +#endif +} + +// Sets the Y component of a vector to a floating point value passed by pointer +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorSetYPtr(FXMVECTOR V, const float* y) noexcept +{ + assert(y != nullptr); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 U = { { { + V.vector4_f32[0], + *y, + V.vector4_f32[2], + V.vector4_f32[3] + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vld1q_lane_f32(y, V, 1); +#elif defined(_XM_SSE_INTRINSICS_) + // Swap y and x + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 2, 0, 1)); + // Convert input to vector + XMVECTOR vTemp = _mm_load_ss(y); + // Replace the x component + vResult = _mm_move_ss(vResult, vTemp); + // Swap y and x again + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 2, 0, 1)); + return vResult; +#endif +} + +// Sets the Z component of a vector to a floating point value passed by pointer +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorSetZPtr(FXMVECTOR V, const float* z) noexcept +{ + assert(z != nullptr); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 U = { { { + V.vector4_f32[0], + V.vector4_f32[1], + *z, + V.vector4_f32[3] + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vld1q_lane_f32(z, V, 2); +#elif defined(_XM_SSE_INTRINSICS_) + // Swap z and x + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 0, 1, 2)); + // Convert input to vector + XMVECTOR vTemp = _mm_load_ss(z); + // Replace the x component + vResult = _mm_move_ss(vResult, vTemp); + // Swap z and x again + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 0, 1, 2)); + return vResult; +#endif +} + +// Sets the W component of a vector to a floating point value passed by pointer +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorSetWPtr(FXMVECTOR V, const float* w) noexcept +{ + assert(w != nullptr); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 U = { { { + V.vector4_f32[0], + V.vector4_f32[1], + V.vector4_f32[2], + *w + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vld1q_lane_f32(w, V, 3); +#elif defined(_XM_SSE_INTRINSICS_) + // Swap w and x + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 2, 1, 3)); + // Convert input to vector + XMVECTOR vTemp = _mm_load_ss(w); + // Replace the x component + vResult = _mm_move_ss(vResult, vTemp); + // Swap w and x again + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(0, 2, 1, 3)); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +// Sets a component of a vector to an integer passed by value +inline XMVECTOR XM_CALLCONV XMVectorSetIntByIndex(FXMVECTOR V, uint32_t x, size_t i) noexcept +{ + assert(i < 4); + _Analysis_assume_(i < 4); + XMVECTORU32 tmp; + tmp.v = V; + tmp.u[i] = x; + return tmp; +} + +//------------------------------------------------------------------------------ + +// Sets the X component of a vector to an integer passed by value +inline XMVECTOR XM_CALLCONV XMVectorSetIntX(FXMVECTOR V, uint32_t x) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 U = { { { + x, + V.vector4_u32[1], + V.vector4_u32[2], + V.vector4_u32[3] + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vsetq_lane_u32(x, vreinterpretq_u32_f32(V), 0)); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cvtsi32_si128(static_cast(x)); + XMVECTOR vResult = _mm_move_ss(V, _mm_castsi128_ps(vTemp)); + return vResult; +#endif +} + +// Sets the Y component of a vector to an integer passed by value +inline XMVECTOR XM_CALLCONV XMVectorSetIntY(FXMVECTOR V, uint32_t y) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 U = { { { + V.vector4_u32[0], + y, + V.vector4_u32[2], + V.vector4_u32[3] + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vsetq_lane_u32(y, vreinterpretq_u32_f32(V), 1)); +#elif defined(_XM_SSE4_INTRINSICS_) + __m128i vResult = _mm_castps_si128(V); + vResult = _mm_insert_epi32(vResult, static_cast(y), 1); + return _mm_castsi128_ps(vResult); +#elif defined(_XM_SSE_INTRINSICS_) + // Swap y and x + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 2, 0, 1)); + // Convert input to vector + __m128i vTemp = _mm_cvtsi32_si128(static_cast(y)); + // Replace the x component + vResult = _mm_move_ss(vResult, _mm_castsi128_ps(vTemp)); + // Swap y and x again + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 2, 0, 1)); + return vResult; +#endif +} + +// Sets the Z component of a vector to an integer passed by value +inline XMVECTOR XM_CALLCONV XMVectorSetIntZ(FXMVECTOR V, uint32_t z) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 U = { { { + V.vector4_u32[0], + V.vector4_u32[1], + z, + V.vector4_u32[3] + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vsetq_lane_u32(z, vreinterpretq_u32_f32(V), 2)); +#elif defined(_XM_SSE4_INTRINSICS_) + __m128i vResult = _mm_castps_si128(V); + vResult = _mm_insert_epi32(vResult, static_cast(z), 2); + return _mm_castsi128_ps(vResult); +#elif defined(_XM_SSE_INTRINSICS_) + // Swap z and x + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 0, 1, 2)); + // Convert input to vector + __m128i vTemp = _mm_cvtsi32_si128(static_cast(z)); + // Replace the x component + vResult = _mm_move_ss(vResult, _mm_castsi128_ps(vTemp)); + // Swap z and x again + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 0, 1, 2)); + return vResult; +#endif +} + +// Sets the W component of a vector to an integer passed by value +inline XMVECTOR XM_CALLCONV XMVectorSetIntW(FXMVECTOR V, uint32_t w) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 U = { { { + V.vector4_u32[0], + V.vector4_u32[1], + V.vector4_u32[2], + w + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vsetq_lane_u32(w, vreinterpretq_u32_f32(V), 3)); +#elif defined(_XM_SSE4_INTRINSICS_) + __m128i vResult = _mm_castps_si128(V); + vResult = _mm_insert_epi32(vResult, static_cast(w), 3); + return _mm_castsi128_ps(vResult); +#elif defined(_XM_SSE_INTRINSICS_) + // Swap w and x + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 2, 1, 3)); + // Convert input to vector + __m128i vTemp = _mm_cvtsi32_si128(static_cast(w)); + // Replace the x component + vResult = _mm_move_ss(vResult, _mm_castsi128_ps(vTemp)); + // Swap w and x again + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(0, 2, 1, 3)); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +// Sets a component of a vector to an integer value passed by pointer +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorSetIntByIndexPtr(FXMVECTOR V, const uint32_t* x, size_t i) noexcept +{ + assert(x != nullptr); + assert(i < 4); + _Analysis_assume_(i < 4); + XMVECTORU32 tmp; + tmp.v = V; + tmp.u[i] = *x; + return tmp; +} + +//------------------------------------------------------------------------------ + +// Sets the X component of a vector to an integer value passed by pointer +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorSetIntXPtr(FXMVECTOR V, const uint32_t* x) noexcept +{ + assert(x != nullptr); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 U = { { { + *x, + V.vector4_u32[1], + V.vector4_u32[2], + V.vector4_u32[3] + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vld1q_lane_u32(x, *reinterpret_cast(&V), 0)); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_load_ss(reinterpret_cast(x)); + XMVECTOR vResult = _mm_move_ss(V, vTemp); + return vResult; +#endif +} + +// Sets the Y component of a vector to an integer value passed by pointer +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorSetIntYPtr(FXMVECTOR V, const uint32_t* y) noexcept +{ + assert(y != nullptr); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 U = { { { + V.vector4_u32[0], + *y, + V.vector4_u32[2], + V.vector4_u32[3] + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vld1q_lane_u32(y, *reinterpret_cast(&V), 1)); +#elif defined(_XM_SSE_INTRINSICS_) + // Swap y and x + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 2, 0, 1)); + // Convert input to vector + XMVECTOR vTemp = _mm_load_ss(reinterpret_cast(y)); + // Replace the x component + vResult = _mm_move_ss(vResult, vTemp); + // Swap y and x again + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 2, 0, 1)); + return vResult; +#endif +} + +// Sets the Z component of a vector to an integer value passed by pointer +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorSetIntZPtr(FXMVECTOR V, const uint32_t* z) noexcept +{ + assert(z != nullptr); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 U = { { { + V.vector4_u32[0], + V.vector4_u32[1], + *z, + V.vector4_u32[3] + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vld1q_lane_u32(z, *reinterpret_cast(&V), 2)); +#elif defined(_XM_SSE_INTRINSICS_) + // Swap z and x + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 0, 1, 2)); + // Convert input to vector + XMVECTOR vTemp = _mm_load_ss(reinterpret_cast(z)); + // Replace the x component + vResult = _mm_move_ss(vResult, vTemp); + // Swap z and x again + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 0, 1, 2)); + return vResult; +#endif +} + +// Sets the W component of a vector to an integer value passed by pointer +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorSetIntWPtr(FXMVECTOR V, const uint32_t* w) noexcept +{ + assert(w != nullptr); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 U = { { { + V.vector4_u32[0], + V.vector4_u32[1], + V.vector4_u32[2], + *w + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vld1q_lane_u32(w, *reinterpret_cast(&V), 3)); +#elif defined(_XM_SSE_INTRINSICS_) + // Swap w and x + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 2, 1, 3)); + // Convert input to vector + XMVECTOR vTemp = _mm_load_ss(reinterpret_cast(w)); + // Replace the x component + vResult = _mm_move_ss(vResult, vTemp); + // Swap w and x again + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(0, 2, 1, 3)); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorSwizzle +( + FXMVECTOR V, + uint32_t E0, + uint32_t E1, + uint32_t E2, + uint32_t E3 +) noexcept +{ + assert((E0 < 4) && (E1 < 4) && (E2 < 4) && (E3 < 4)); + _Analysis_assume_((E0 < 4) && (E1 < 4) && (E2 < 4) && (E3 < 4)); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + V.vector4_f32[E0], + V.vector4_f32[E1], + V.vector4_f32[E2], + V.vector4_f32[E3] + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const uint32_t ControlElement[4] = + { + 0x03020100, // XM_SWIZZLE_X + 0x07060504, // XM_SWIZZLE_Y + 0x0B0A0908, // XM_SWIZZLE_Z + 0x0F0E0D0C, // XM_SWIZZLE_W + }; + + uint8x8x2_t tbl; + tbl.val[0] = vreinterpret_u8_f32(vget_low_f32(V)); + tbl.val[1] = vreinterpret_u8_f32(vget_high_f32(V)); + + uint32x2_t idx = vcreate_u32(static_cast(ControlElement[E0]) | (static_cast(ControlElement[E1]) << 32)); + const uint8x8_t rL = vtbl2_u8(tbl, vreinterpret_u8_u32(idx)); + + idx = vcreate_u32(static_cast(ControlElement[E2]) | (static_cast(ControlElement[E3]) << 32)); + const uint8x8_t rH = vtbl2_u8(tbl, vreinterpret_u8_u32(idx)); + + return vcombine_f32(vreinterpret_f32_u8(rL), vreinterpret_f32_u8(rH)); +#elif defined(_XM_AVX_INTRINSICS_) + unsigned int elem[4] = { E0, E1, E2, E3 }; + __m128i vControl = _mm_loadu_si128(reinterpret_cast(&elem[0])); + return _mm_permutevar_ps(V, vControl); +#else + auto aPtr = reinterpret_cast(&V); + + XMVECTOR Result; + auto pWork = reinterpret_cast(&Result); + + pWork[0] = aPtr[E0]; + pWork[1] = aPtr[E1]; + pWork[2] = aPtr[E2]; + pWork[3] = aPtr[E3]; + + return Result; +#endif +} + +//------------------------------------------------------------------------------ +inline XMVECTOR XM_CALLCONV XMVectorPermute +( + FXMVECTOR V1, + FXMVECTOR V2, + uint32_t PermuteX, + uint32_t PermuteY, + uint32_t PermuteZ, + uint32_t PermuteW +) noexcept +{ + assert(PermuteX <= 7 && PermuteY <= 7 && PermuteZ <= 7 && PermuteW <= 7); + _Analysis_assume_(PermuteX <= 7 && PermuteY <= 7 && PermuteZ <= 7 && PermuteW <= 7); + +#if defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + static const uint32_t ControlElement[8] = + { + 0x03020100, // XM_PERMUTE_0X + 0x07060504, // XM_PERMUTE_0Y + 0x0B0A0908, // XM_PERMUTE_0Z + 0x0F0E0D0C, // XM_PERMUTE_0W + 0x13121110, // XM_PERMUTE_1X + 0x17161514, // XM_PERMUTE_1Y + 0x1B1A1918, // XM_PERMUTE_1Z + 0x1F1E1D1C, // XM_PERMUTE_1W + }; + + uint8x8x4_t tbl; + tbl.val[0] = vreinterpret_u8_f32(vget_low_f32(V1)); + tbl.val[1] = vreinterpret_u8_f32(vget_high_f32(V1)); + tbl.val[2] = vreinterpret_u8_f32(vget_low_f32(V2)); + tbl.val[3] = vreinterpret_u8_f32(vget_high_f32(V2)); + + uint32x2_t idx = vcreate_u32(static_cast(ControlElement[PermuteX]) | (static_cast(ControlElement[PermuteY]) << 32)); + const uint8x8_t rL = vtbl4_u8(tbl, vreinterpret_u8_u32(idx)); + + idx = vcreate_u32(static_cast(ControlElement[PermuteZ]) | (static_cast(ControlElement[PermuteW]) << 32)); + const uint8x8_t rH = vtbl4_u8(tbl, vreinterpret_u8_u32(idx)); + + return vcombine_f32(vreinterpret_f32_u8(rL), vreinterpret_f32_u8(rH)); +#elif defined(_XM_AVX_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + static const XMVECTORU32 three = { { { 3, 3, 3, 3 } } }; + + XM_ALIGNED_DATA(16) unsigned int elem[4] = { PermuteX, PermuteY, PermuteZ, PermuteW }; + __m128i vControl = _mm_load_si128(reinterpret_cast(&elem[0])); + + __m128i vSelect = _mm_cmpgt_epi32(vControl, three); + vControl = _mm_castps_si128(_mm_and_ps(_mm_castsi128_ps(vControl), three)); + + __m128 shuffled1 = _mm_permutevar_ps(V1, vControl); + __m128 shuffled2 = _mm_permutevar_ps(V2, vControl); + + __m128 masked1 = _mm_andnot_ps(_mm_castsi128_ps(vSelect), shuffled1); + __m128 masked2 = _mm_and_ps(_mm_castsi128_ps(vSelect), shuffled2); + + return _mm_or_ps(masked1, masked2); +#else + + const uint32_t* aPtr[2]; + aPtr[0] = reinterpret_cast(&V1); + aPtr[1] = reinterpret_cast(&V2); + + XMVECTOR Result; + auto pWork = reinterpret_cast(&Result); + + const uint32_t i0 = PermuteX & 3; + const uint32_t vi0 = PermuteX >> 2; + pWork[0] = aPtr[vi0][i0]; + + const uint32_t i1 = PermuteY & 3; + const uint32_t vi1 = PermuteY >> 2; + pWork[1] = aPtr[vi1][i1]; + + const uint32_t i2 = PermuteZ & 3; + const uint32_t vi2 = PermuteZ >> 2; + pWork[2] = aPtr[vi2][i2]; + + const uint32_t i3 = PermuteW & 3; + const uint32_t vi3 = PermuteW >> 2; + pWork[3] = aPtr[vi3][i3]; + + return Result; +#endif +} + +//------------------------------------------------------------------------------ +// Define a control vector to be used in XMVectorSelect +// operations. The four integers specified in XMVectorSelectControl +// serve as indices to select between components in two vectors. +// The first index controls selection for the first component of +// the vectors involved in a select operation, the second index +// controls selection for the second component etc. A value of +// zero for an index causes the corresponding component from the first +// vector to be selected whereas a one causes the component from the +// second vector to be selected instead. + +inline XMVECTOR XM_CALLCONV XMVectorSelectControl +( + uint32_t VectorIndex0, + uint32_t VectorIndex1, + uint32_t VectorIndex2, + uint32_t VectorIndex3 +) noexcept +{ +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + // x=Index0,y=Index1,z=Index2,w=Index3 + __m128i vTemp = _mm_set_epi32(static_cast(VectorIndex3), static_cast(VectorIndex2), static_cast(VectorIndex1), static_cast(VectorIndex0)); + // Any non-zero entries become 0xFFFFFFFF else 0 + vTemp = _mm_cmpgt_epi32(vTemp, g_XMZero); + return _mm_castsi128_ps(vTemp); +#elif defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + int32x2_t V0 = vcreate_s32(static_cast(VectorIndex0) | (static_cast(VectorIndex1) << 32)); + int32x2_t V1 = vcreate_s32(static_cast(VectorIndex2) | (static_cast(VectorIndex3) << 32)); + int32x4_t vTemp = vcombine_s32(V0, V1); + // Any non-zero entries become 0xFFFFFFFF else 0 + return vreinterpretq_f32_u32(vcgtq_s32(vTemp, g_XMZero)); +#else + XMVECTOR ControlVector; + const uint32_t ControlElement[] = + { + XM_SELECT_0, + XM_SELECT_1 + }; + + assert(VectorIndex0 < 2); + assert(VectorIndex1 < 2); + assert(VectorIndex2 < 2); + assert(VectorIndex3 < 2); + _Analysis_assume_(VectorIndex0 < 2); + _Analysis_assume_(VectorIndex1 < 2); + _Analysis_assume_(VectorIndex2 < 2); + _Analysis_assume_(VectorIndex3 < 2); + + ControlVector.vector4_u32[0] = ControlElement[VectorIndex0]; + ControlVector.vector4_u32[1] = ControlElement[VectorIndex1]; + ControlVector.vector4_u32[2] = ControlElement[VectorIndex2]; + ControlVector.vector4_u32[3] = ControlElement[VectorIndex3]; + + return ControlVector; + +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorSelect +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR Control +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Result = { { { + (V1.vector4_u32[0] & ~Control.vector4_u32[0]) | (V2.vector4_u32[0] & Control.vector4_u32[0]), + (V1.vector4_u32[1] & ~Control.vector4_u32[1]) | (V2.vector4_u32[1] & Control.vector4_u32[1]), + (V1.vector4_u32[2] & ~Control.vector4_u32[2]) | (V2.vector4_u32[2] & Control.vector4_u32[2]), + (V1.vector4_u32[3] & ~Control.vector4_u32[3]) | (V2.vector4_u32[3] & Control.vector4_u32[3]), + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vbslq_f32(vreinterpretq_u32_f32(Control), V2, V1); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp1 = _mm_andnot_ps(Control, V1); + XMVECTOR vTemp2 = _mm_and_ps(V2, Control); + return _mm_or_ps(vTemp1, vTemp2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorMergeXY +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Result = { { { + V1.vector4_u32[0], + V2.vector4_u32[0], + V1.vector4_u32[1], + V2.vector4_u32[1], + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vzipq_f32(V1, V2).val[0]; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_unpacklo_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorMergeZW +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Result = { { { + V1.vector4_u32[2], + V2.vector4_u32[2], + V1.vector4_u32[3], + V2.vector4_u32[3] + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vzipq_f32(V1, V2).val[1]; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_unpackhi_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorShiftLeft(FXMVECTOR V1, FXMVECTOR V2, uint32_t Elements) noexcept +{ + assert(Elements < 4); + _Analysis_assume_(Elements < 4); + return XMVectorPermute(V1, V2, Elements, ((Elements)+1), ((Elements)+2), ((Elements)+3)); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorRotateLeft(FXMVECTOR V, uint32_t Elements) noexcept +{ + assert(Elements < 4); + _Analysis_assume_(Elements < 4); + return XMVectorSwizzle(V, Elements & 3, (Elements + 1) & 3, (Elements + 2) & 3, (Elements + 3) & 3); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorRotateRight(FXMVECTOR V, uint32_t Elements) noexcept +{ + assert(Elements < 4); + _Analysis_assume_(Elements < 4); + return XMVectorSwizzle(V, (4 - (Elements)) & 3, (5 - (Elements)) & 3, (6 - (Elements)) & 3, (7 - (Elements)) & 3); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorInsert( + FXMVECTOR VD, FXMVECTOR VS, + uint32_t VSLeftRotateElements, + uint32_t Select0, uint32_t Select1, uint32_t Select2, uint32_t Select3) noexcept +{ + XMVECTOR Control = XMVectorSelectControl(Select0 & 1, Select1 & 1, Select2 & 1, Select3 & 1); + return XMVectorSelect(VD, XMVectorRotateLeft(VS, VSLeftRotateElements), Control); +} + +//------------------------------------------------------------------------------ +// Comparison operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Control = { { { + (V1.vector4_f32[0] == V2.vector4_f32[0]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[1] == V2.vector4_f32[1]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[2] == V2.vector4_f32[2]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[3] == V2.vector4_f32[3]) ? 0xFFFFFFFF : 0, + } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vceqq_f32(V1, V2)); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_cmpeq_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorEqualR +( + uint32_t* pCR, + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ + assert(pCR != nullptr); +#if defined(_XM_NO_INTRINSICS_) + uint32_t ux = (V1.vector4_f32[0] == V2.vector4_f32[0]) ? 0xFFFFFFFFU : 0; + uint32_t uy = (V1.vector4_f32[1] == V2.vector4_f32[1]) ? 0xFFFFFFFFU : 0; + uint32_t uz = (V1.vector4_f32[2] == V2.vector4_f32[2]) ? 0xFFFFFFFFU : 0; + uint32_t uw = (V1.vector4_f32[3] == V2.vector4_f32[3]) ? 0xFFFFFFFFU : 0; + uint32_t CR = 0; + if (ux & uy & uz & uw) + { + // All elements are greater + CR = XM_CRMASK_CR6TRUE; + } + else if (!(ux | uy | uz | uw)) + { + // All elements are not greater + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + + XMVECTORU32 Control = { { { ux, uy, uz, uw } } }; + return Control; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vreinterpret_u8_u32(vget_low_u32(vResult)), vreinterpret_u8_u32(vget_high_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); + uint32_t CR = 0; + if (r == 0xFFFFFFFFU) + { + // All elements are equal + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + // All elements are not equal + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + return vreinterpretq_f32_u32(vResult); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); + uint32_t CR = 0; + int iTest = _mm_movemask_ps(vTemp); + if (iTest == 0xf) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + // All elements are not greater + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + return vTemp; +#endif +} + +//------------------------------------------------------------------------------ +// Treat the components of the vectors as unsigned integers and +// compare individual bits between the two. This is useful for +// comparing control vectors and result vectors returned from +// other comparison operations. + +inline XMVECTOR XM_CALLCONV XMVectorEqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Control = { { { + (V1.vector4_u32[0] == V2.vector4_u32[0]) ? 0xFFFFFFFF : 0, + (V1.vector4_u32[1] == V2.vector4_u32[1]) ? 0xFFFFFFFF : 0, + (V1.vector4_u32[2] == V2.vector4_u32[2]) ? 0xFFFFFFFF : 0, + (V1.vector4_u32[3] == V2.vector4_u32[3]) ? 0xFFFFFFFF : 0, + } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vceqq_s32(vreinterpretq_s32_f32(V1), vreinterpretq_s32_f32(V2))); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); + return _mm_castsi128_ps(V); +#endif +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorEqualIntR +( + uint32_t* pCR, + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ + assert(pCR != nullptr); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Control = XMVectorEqualInt(V1, V2); + + *pCR = 0; + if (XMVector4EqualInt(Control, XMVectorTrueInt())) + { + // All elements are equal + *pCR |= XM_CRMASK_CR6TRUE; + } + else if (XMVector4EqualInt(Control, XMVectorFalseInt())) + { + // All elements are not equal + *pCR |= XM_CRMASK_CR6FALSE; + } + return Control; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); + uint32_t CR = 0; + if (r == 0xFFFFFFFFU) + { + // All elements are equal + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + // All elements are not equal + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + return vreinterpretq_f32_u32(vResult); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); + int iTemp = _mm_movemask_ps(_mm_castsi128_ps(V)); + uint32_t CR = 0; + if (iTemp == 0x0F) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTemp) + { + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + return _mm_castsi128_ps(V); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorNearEqual +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR Epsilon +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + float fDeltax = V1.vector4_f32[0] - V2.vector4_f32[0]; + float fDeltay = V1.vector4_f32[1] - V2.vector4_f32[1]; + float fDeltaz = V1.vector4_f32[2] - V2.vector4_f32[2]; + float fDeltaw = V1.vector4_f32[3] - V2.vector4_f32[3]; + + fDeltax = fabsf(fDeltax); + fDeltay = fabsf(fDeltay); + fDeltaz = fabsf(fDeltaz); + fDeltaw = fabsf(fDeltaw); + + XMVECTORU32 Control = { { { + (fDeltax <= Epsilon.vector4_f32[0]) ? 0xFFFFFFFFU : 0, + (fDeltay <= Epsilon.vector4_f32[1]) ? 0xFFFFFFFFU : 0, + (fDeltaz <= Epsilon.vector4_f32[2]) ? 0xFFFFFFFFU : 0, + (fDeltaw <= Epsilon.vector4_f32[3]) ? 0xFFFFFFFFU : 0, + } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t vDelta = vsubq_f32(V1, V2); +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + return vacleq_f32(vDelta, Epsilon); +#else + return vreinterpretq_f32_u32(vcleq_f32(vabsq_f32(vDelta), Epsilon)); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + // Get the difference + XMVECTOR vDelta = _mm_sub_ps(V1, V2); + // Get the absolute value of the difference + XMVECTOR vTemp = _mm_setzero_ps(); + vTemp = _mm_sub_ps(vTemp, vDelta); + vTemp = _mm_max_ps(vTemp, vDelta); + vTemp = _mm_cmple_ps(vTemp, Epsilon); + return vTemp; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorNotEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Control = { { { + (V1.vector4_f32[0] != V2.vector4_f32[0]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[1] != V2.vector4_f32[1]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[2] != V2.vector4_f32[2]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[3] != V2.vector4_f32[3]) ? 0xFFFFFFFF : 0, + } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vmvnq_u32(vceqq_f32(V1, V2))); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_cmpneq_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorNotEqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Control = { { { + (V1.vector4_u32[0] != V2.vector4_u32[0]) ? 0xFFFFFFFFU : 0, + (V1.vector4_u32[1] != V2.vector4_u32[1]) ? 0xFFFFFFFFU : 0, + (V1.vector4_u32[2] != V2.vector4_u32[2]) ? 0xFFFFFFFFU : 0, + (V1.vector4_u32[3] != V2.vector4_u32[3]) ? 0xFFFFFFFFU : 0 + } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vmvnq_u32( + vceqq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)))); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); + return _mm_xor_ps(_mm_castsi128_ps(V), g_XMNegOneMask); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorGreater +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Control = { { { + (V1.vector4_f32[0] > V2.vector4_f32[0]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[1] > V2.vector4_f32[1]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[2] > V2.vector4_f32[2]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[3] > V2.vector4_f32[3]) ? 0xFFFFFFFF : 0 + } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vcgtq_f32(V1, V2)); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_cmpgt_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorGreaterR +( + uint32_t* pCR, + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ + assert(pCR != nullptr); +#if defined(_XM_NO_INTRINSICS_) + + uint32_t ux = (V1.vector4_f32[0] > V2.vector4_f32[0]) ? 0xFFFFFFFFU : 0; + uint32_t uy = (V1.vector4_f32[1] > V2.vector4_f32[1]) ? 0xFFFFFFFFU : 0; + uint32_t uz = (V1.vector4_f32[2] > V2.vector4_f32[2]) ? 0xFFFFFFFFU : 0; + uint32_t uw = (V1.vector4_f32[3] > V2.vector4_f32[3]) ? 0xFFFFFFFFU : 0; + uint32_t CR = 0; + if (ux & uy & uz & uw) + { + // All elements are greater + CR = XM_CRMASK_CR6TRUE; + } + else if (!(ux | uy | uz | uw)) + { + // All elements are not greater + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + + XMVECTORU32 Control = { { { ux, uy, uz, uw } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcgtq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); + uint32_t CR = 0; + if (r == 0xFFFFFFFFU) + { + // All elements are greater + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + // All elements are not greater + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + return vreinterpretq_f32_u32(vResult); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpgt_ps(V1, V2); + uint32_t CR = 0; + int iTest = _mm_movemask_ps(vTemp); + if (iTest == 0xf) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + // All elements are not greater + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + return vTemp; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorGreaterOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Control = { { { + (V1.vector4_f32[0] >= V2.vector4_f32[0]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[1] >= V2.vector4_f32[1]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[2] >= V2.vector4_f32[2]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[3] >= V2.vector4_f32[3]) ? 0xFFFFFFFF : 0 + } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vcgeq_f32(V1, V2)); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_cmpge_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorGreaterOrEqualR +( + uint32_t* pCR, + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ + assert(pCR != nullptr); +#if defined(_XM_NO_INTRINSICS_) + + uint32_t ux = (V1.vector4_f32[0] >= V2.vector4_f32[0]) ? 0xFFFFFFFFU : 0; + uint32_t uy = (V1.vector4_f32[1] >= V2.vector4_f32[1]) ? 0xFFFFFFFFU : 0; + uint32_t uz = (V1.vector4_f32[2] >= V2.vector4_f32[2]) ? 0xFFFFFFFFU : 0; + uint32_t uw = (V1.vector4_f32[3] >= V2.vector4_f32[3]) ? 0xFFFFFFFFU : 0; + uint32_t CR = 0; + if (ux & uy & uz & uw) + { + // All elements are greater + CR = XM_CRMASK_CR6TRUE; + } + else if (!(ux | uy | uz | uw)) + { + // All elements are not greater + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + + XMVECTORU32 Control = { { { ux, uy, uz, uw } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcgeq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); + uint32_t CR = 0; + if (r == 0xFFFFFFFFU) + { + // All elements are greater or equal + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + // All elements are not greater or equal + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + return vreinterpretq_f32_u32(vResult); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpge_ps(V1, V2); + uint32_t CR = 0; + int iTest = _mm_movemask_ps(vTemp); + if (iTest == 0xf) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + // All elements are not greater + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + return vTemp; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorLess +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Control = { { { + (V1.vector4_f32[0] < V2.vector4_f32[0]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[1] < V2.vector4_f32[1]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[2] < V2.vector4_f32[2]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[3] < V2.vector4_f32[3]) ? 0xFFFFFFFF : 0 + } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vcltq_f32(V1, V2)); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_cmplt_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorLessOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Control = { { { + (V1.vector4_f32[0] <= V2.vector4_f32[0]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[1] <= V2.vector4_f32[1]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[2] <= V2.vector4_f32[2]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[3] <= V2.vector4_f32[3]) ? 0xFFFFFFFF : 0 + } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vcleq_f32(V1, V2)); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_cmple_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorInBounds +( + FXMVECTOR V, + FXMVECTOR Bounds +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Control = { { { + (V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) ? 0xFFFFFFFF : 0, + (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]) ? 0xFFFFFFFF : 0, + (V.vector4_f32[2] <= Bounds.vector4_f32[2] && V.vector4_f32[2] >= -Bounds.vector4_f32[2]) ? 0xFFFFFFFF : 0, + (V.vector4_f32[3] <= Bounds.vector4_f32[3] && V.vector4_f32[3] >= -Bounds.vector4_f32[3]) ? 0xFFFFFFFF : 0 + } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Test if less than or equal + uint32x4_t vTemp1 = vcleq_f32(V, Bounds); + // Negate the bounds + uint32x4_t vTemp2 = vreinterpretq_u32_f32(vnegq_f32(Bounds)); + // Test if greater or equal (Reversed) + vTemp2 = vcleq_f32(vreinterpretq_f32_u32(vTemp2), V); + // Blend answers + vTemp1 = vandq_u32(vTemp1, vTemp2); + return vreinterpretq_f32_u32(vTemp1); +#elif defined(_XM_SSE_INTRINSICS_) + // Test if less than or equal + XMVECTOR vTemp1 = _mm_cmple_ps(V, Bounds); + // Negate the bounds + XMVECTOR vTemp2 = _mm_mul_ps(Bounds, g_XMNegativeOne); + // Test if greater or equal (Reversed) + vTemp2 = _mm_cmple_ps(vTemp2, V); + // Blend answers + vTemp1 = _mm_and_ps(vTemp1, vTemp2); + return vTemp1; +#endif +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorInBoundsR +( + uint32_t* pCR, + FXMVECTOR V, + FXMVECTOR Bounds +) noexcept +{ + assert(pCR != nullptr); +#if defined(_XM_NO_INTRINSICS_) + + uint32_t ux = (V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) ? 0xFFFFFFFFU : 0; + uint32_t uy = (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]) ? 0xFFFFFFFFU : 0; + uint32_t uz = (V.vector4_f32[2] <= Bounds.vector4_f32[2] && V.vector4_f32[2] >= -Bounds.vector4_f32[2]) ? 0xFFFFFFFFU : 0; + uint32_t uw = (V.vector4_f32[3] <= Bounds.vector4_f32[3] && V.vector4_f32[3] >= -Bounds.vector4_f32[3]) ? 0xFFFFFFFFU : 0; + + uint32_t CR = 0; + if (ux & uy & uz & uw) + { + // All elements are in bounds + CR = XM_CRMASK_CR6BOUNDS; + } + *pCR = CR; + + XMVECTORU32 Control = { { { ux, uy, uz, uw } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Test if less than or equal + uint32x4_t vTemp1 = vcleq_f32(V, Bounds); + // Negate the bounds + uint32x4_t vTemp2 = vreinterpretq_u32_f32(vnegq_f32(Bounds)); + // Test if greater or equal (Reversed) + vTemp2 = vcleq_f32(vreinterpretq_f32_u32(vTemp2), V); + // Blend answers + vTemp1 = vandq_u32(vTemp1, vTemp2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vTemp1)), vget_high_u8(vreinterpretq_u8_u32(vTemp1))); + uint16x4x2_t vTemp3 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp3.val[1]), 1); + uint32_t CR = 0; + if (r == 0xFFFFFFFFU) + { + // All elements are in bounds + CR = XM_CRMASK_CR6BOUNDS; + } + *pCR = CR; + return vreinterpretq_f32_u32(vTemp1); +#elif defined(_XM_SSE_INTRINSICS_) + // Test if less than or equal + XMVECTOR vTemp1 = _mm_cmple_ps(V, Bounds); + // Negate the bounds + XMVECTOR vTemp2 = _mm_mul_ps(Bounds, g_XMNegativeOne); + // Test if greater or equal (Reversed) + vTemp2 = _mm_cmple_ps(vTemp2, V); + // Blend answers + vTemp1 = _mm_and_ps(vTemp1, vTemp2); + + uint32_t CR = 0; + if (_mm_movemask_ps(vTemp1) == 0xf) + { + // All elements are in bounds + CR = XM_CRMASK_CR6BOUNDS; + } + *pCR = CR; + return vTemp1; +#endif +} + +//------------------------------------------------------------------------------ + +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) +#pragma float_control(push) +#pragma float_control(precise, on) +#endif + +inline XMVECTOR XM_CALLCONV XMVectorIsNaN(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Control = { { { + XMISNAN(V.vector4_f32[0]) ? 0xFFFFFFFFU : 0, + XMISNAN(V.vector4_f32[1]) ? 0xFFFFFFFFU : 0, + XMISNAN(V.vector4_f32[2]) ? 0xFFFFFFFFU : 0, + XMISNAN(V.vector4_f32[3]) ? 0xFFFFFFFFU : 0 + } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Test against itself. NaN is always not equal + uint32x4_t vTempNan = vceqq_f32(V, V); + // Flip results + return vreinterpretq_f32_u32(vmvnq_u32(vTempNan)); +#elif defined(_XM_SSE_INTRINSICS_) + // Test against itself. NaN is always not equal + return _mm_cmpneq_ps(V, V); +#endif +} + +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) +#pragma float_control(pop) +#endif + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorIsInfinite(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Control = { { { + XMISINF(V.vector4_f32[0]) ? 0xFFFFFFFFU : 0, + XMISINF(V.vector4_f32[1]) ? 0xFFFFFFFFU : 0, + XMISINF(V.vector4_f32[2]) ? 0xFFFFFFFFU : 0, + XMISINF(V.vector4_f32[3]) ? 0xFFFFFFFFU : 0 + } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Mask off the sign bit + uint32x4_t vTemp = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); + // Compare to infinity + vTemp = vceqq_f32(vreinterpretq_f32_u32(vTemp), g_XMInfinity); + // If any are infinity, the signs are true. + return vreinterpretq_f32_u32(vTemp); +#elif defined(_XM_SSE_INTRINSICS_) + // Mask off the sign bit + __m128 vTemp = _mm_and_ps(V, g_XMAbsMask); + // Compare to infinity + vTemp = _mm_cmpeq_ps(vTemp, g_XMInfinity); + // If any are infinity, the signs are true. + return vTemp; +#endif +} + +//------------------------------------------------------------------------------ +// Rounding and clamping operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorMin +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + (V1.vector4_f32[0] < V2.vector4_f32[0]) ? V1.vector4_f32[0] : V2.vector4_f32[0], + (V1.vector4_f32[1] < V2.vector4_f32[1]) ? V1.vector4_f32[1] : V2.vector4_f32[1], + (V1.vector4_f32[2] < V2.vector4_f32[2]) ? V1.vector4_f32[2] : V2.vector4_f32[2], + (V1.vector4_f32[3] < V2.vector4_f32[3]) ? V1.vector4_f32[3] : V2.vector4_f32[3] + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vminq_f32(V1, V2); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_min_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorMax +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + (V1.vector4_f32[0] > V2.vector4_f32[0]) ? V1.vector4_f32[0] : V2.vector4_f32[0], + (V1.vector4_f32[1] > V2.vector4_f32[1]) ? V1.vector4_f32[1] : V2.vector4_f32[1], + (V1.vector4_f32[2] > V2.vector4_f32[2]) ? V1.vector4_f32[2] : V2.vector4_f32[2], + (V1.vector4_f32[3] > V2.vector4_f32[3]) ? V1.vector4_f32[3] : V2.vector4_f32[3] + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vmaxq_f32(V1, V2); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_max_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +namespace Internal +{ + // Round to nearest (even) a.k.a. banker's rounding + inline float round_to_nearest(float x) noexcept + { + float i = floorf(x); + x -= i; + if (x < 0.5f) + return i; + if (x > 0.5f) + return i + 1.f; + + float int_part; + (void)modff(i / 2.f, &int_part); + if ((2.f * int_part) == i) + { + return i; + } + + return i + 1.f; + } +} + +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) +#pragma float_control(push) +#pragma float_control(precise, on) +#endif + +inline XMVECTOR XM_CALLCONV XMVectorRound(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + Internal::round_to_nearest(V.vector4_f32[0]), + Internal::round_to_nearest(V.vector4_f32[1]), + Internal::round_to_nearest(V.vector4_f32[2]), + Internal::round_to_nearest(V.vector4_f32[3]) + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + return vrndnq_f32(V); +#else + uint32x4_t sign = vandq_u32(vreinterpretq_u32_f32(V), g_XMNegativeZero); + float32x4_t sMagic = vreinterpretq_f32_u32(vorrq_u32(g_XMNoFraction, sign)); + float32x4_t R1 = vaddq_f32(V, sMagic); + R1 = vsubq_f32(R1, sMagic); + float32x4_t R2 = vabsq_f32(V); + uint32x4_t mask = vcleq_f32(R2, g_XMNoFraction); + return vbslq_f32(mask, R1, V); +#endif +#elif defined(_XM_SSE4_INTRINSICS_) + return _mm_round_ps(V, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC); +#elif defined(_XM_SSE_INTRINSICS_) + __m128 sign = _mm_and_ps(V, g_XMNegativeZero); + __m128 sMagic = _mm_or_ps(g_XMNoFraction, sign); + __m128 R1 = _mm_add_ps(V, sMagic); + R1 = _mm_sub_ps(R1, sMagic); + __m128 R2 = _mm_and_ps(V, g_XMAbsMask); + __m128 mask = _mm_cmple_ps(R2, g_XMNoFraction); + R2 = _mm_andnot_ps(mask, V); + R1 = _mm_and_ps(R1, mask); + XMVECTOR vResult = _mm_xor_ps(R1, R2); + return vResult; +#endif +} + +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) +#pragma float_control(pop) +#endif + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorTruncate(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR Result; + uint32_t i; + + // Avoid C4701 + Result.vector4_f32[0] = 0.0f; + + for (i = 0; i < 4; i++) + { + if (XMISNAN(V.vector4_f32[i])) + { + Result.vector4_u32[i] = 0x7FC00000; + } + else if (fabsf(V.vector4_f32[i]) < 8388608.0f) + { + Result.vector4_f32[i] = static_cast(static_cast(V.vector4_f32[i])); + } + else + { + Result.vector4_f32[i] = V.vector4_f32[i]; + } + } + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + return vrndq_f32(V); +#else + float32x4_t vTest = vabsq_f32(V); + vTest = vreinterpretq_f32_u32(vcltq_f32(vTest, g_XMNoFraction)); + + int32x4_t vInt = vcvtq_s32_f32(V); + float32x4_t vResult = vcvtq_f32_s32(vInt); + + // All numbers less than 8388608 will use the round to int + // All others, use the ORIGINAL value + return vbslq_f32(vreinterpretq_u32_f32(vTest), vResult, V); +#endif +#elif defined(_XM_SSE4_INTRINSICS_) + return _mm_round_ps(V, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC); +#elif defined(_XM_SSE_INTRINSICS_) + // To handle NAN, INF and numbers greater than 8388608, use masking + // Get the abs value + __m128i vTest = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); + // Test for greater than 8388608 (All floats with NO fractionals, NAN and INF + vTest = _mm_cmplt_epi32(vTest, g_XMNoFraction); + // Convert to int and back to float for rounding with truncation + __m128i vInt = _mm_cvttps_epi32(V); + // Convert back to floats + XMVECTOR vResult = _mm_cvtepi32_ps(vInt); + // All numbers less than 8388608 will use the round to int + vResult = _mm_and_ps(vResult, _mm_castsi128_ps(vTest)); + // All others, use the ORIGINAL value + vTest = _mm_andnot_si128(vTest, _mm_castps_si128(V)); + vResult = _mm_or_ps(vResult, _mm_castsi128_ps(vTest)); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorFloor(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + floorf(V.vector4_f32[0]), + floorf(V.vector4_f32[1]), + floorf(V.vector4_f32[2]), + floorf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + return vrndmq_f32(V); +#else + float32x4_t vTest = vabsq_f32(V); + vTest = vreinterpretq_f32_u32(vcltq_f32(vTest, g_XMNoFraction)); + // Truncate + int32x4_t vInt = vcvtq_s32_f32(V); + float32x4_t vResult = vcvtq_f32_s32(vInt); + uint32x4_t vLargerMask = vcgtq_f32(vResult, V); + // 0 -> 0, 0xffffffff -> -1.0f + float32x4_t vLarger = vcvtq_f32_s32(vreinterpretq_s32_u32(vLargerMask)); + vResult = vaddq_f32(vResult, vLarger); + // All numbers less than 8388608 will use the round to int + // All others, use the ORIGINAL value + return vbslq_f32(vreinterpretq_u32_f32(vTest), vResult, V); +#endif +#elif defined(_XM_SSE4_INTRINSICS_) + return _mm_floor_ps(V); +#elif defined(_XM_SSE_INTRINSICS_) + // To handle NAN, INF and numbers greater than 8388608, use masking + __m128i vTest = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); + vTest = _mm_cmplt_epi32(vTest, g_XMNoFraction); + // Truncate + __m128i vInt = _mm_cvttps_epi32(V); + XMVECTOR vResult = _mm_cvtepi32_ps(vInt); + __m128 vLarger = _mm_cmpgt_ps(vResult, V); + // 0 -> 0, 0xffffffff -> -1.0f + vLarger = _mm_cvtepi32_ps(_mm_castps_si128(vLarger)); + vResult = _mm_add_ps(vResult, vLarger); + // All numbers less than 8388608 will use the round to int + vResult = _mm_and_ps(vResult, _mm_castsi128_ps(vTest)); + // All others, use the ORIGINAL value + vTest = _mm_andnot_si128(vTest, _mm_castps_si128(V)); + vResult = _mm_or_ps(vResult, _mm_castsi128_ps(vTest)); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorCeiling(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + ceilf(V.vector4_f32[0]), + ceilf(V.vector4_f32[1]), + ceilf(V.vector4_f32[2]), + ceilf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + return vrndpq_f32(V); +#else + float32x4_t vTest = vabsq_f32(V); + vTest = vreinterpretq_f32_u32(vcltq_f32(vTest, g_XMNoFraction)); + // Truncate + int32x4_t vInt = vcvtq_s32_f32(V); + float32x4_t vResult = vcvtq_f32_s32(vInt); + uint32x4_t vSmallerMask = vcltq_f32(vResult, V); + // 0 -> 0, 0xffffffff -> -1.0f + float32x4_t vSmaller = vcvtq_f32_s32(vreinterpretq_s32_u32(vSmallerMask)); + vResult = vsubq_f32(vResult, vSmaller); + // All numbers less than 8388608 will use the round to int + // All others, use the ORIGINAL value + return vbslq_f32(vreinterpretq_u32_f32(vTest), vResult, V); +#endif +#elif defined(_XM_SSE4_INTRINSICS_) + return _mm_ceil_ps(V); +#elif defined(_XM_SSE_INTRINSICS_) + // To handle NAN, INF and numbers greater than 8388608, use masking + __m128i vTest = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); + vTest = _mm_cmplt_epi32(vTest, g_XMNoFraction); + // Truncate + __m128i vInt = _mm_cvttps_epi32(V); + XMVECTOR vResult = _mm_cvtepi32_ps(vInt); + __m128 vSmaller = _mm_cmplt_ps(vResult, V); + // 0 -> 0, 0xffffffff -> -1.0f + vSmaller = _mm_cvtepi32_ps(_mm_castps_si128(vSmaller)); + vResult = _mm_sub_ps(vResult, vSmaller); + // All numbers less than 8388608 will use the round to int + vResult = _mm_and_ps(vResult, _mm_castsi128_ps(vTest)); + // All others, use the ORIGINAL value + vTest = _mm_andnot_si128(vTest, _mm_castps_si128(V)); + vResult = _mm_or_ps(vResult, _mm_castsi128_ps(vTest)); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorClamp +( + FXMVECTOR V, + FXMVECTOR Min, + FXMVECTOR Max +) noexcept +{ + assert(XMVector4LessOrEqual(Min, Max)); + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result = XMVectorMax(Min, V); + Result = XMVectorMin(Max, Result); + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t vResult = vmaxq_f32(Min, V); + vResult = vminq_f32(Max, vResult); + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult; + vResult = _mm_max_ps(Min, V); + vResult = _mm_min_ps(Max, vResult); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorSaturate(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + const XMVECTOR Zero = XMVectorZero(); + + return XMVectorClamp(V, Zero, g_XMOne.v); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Set <0 to 0 + float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(0)); + // Set>1 to 1 + return vminq_f32(vResult, vdupq_n_f32(1.0f)); +#elif defined(_XM_SSE_INTRINSICS_) + // Set <0 to 0 + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + // Set>1 to 1 + return _mm_min_ps(vResult, g_XMOne); +#endif +} + +//------------------------------------------------------------------------------ +// Bitwise logical operations +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorAndInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Result = { { { + V1.vector4_u32[0] & V2.vector4_u32[0], + V1.vector4_u32[1] & V2.vector4_u32[1], + V1.vector4_u32[2] & V2.vector4_u32[2], + V1.vector4_u32[3] & V2.vector4_u32[3] + } } }; + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2))); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_and_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorAndCInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Result = { { { + V1.vector4_u32[0] & ~V2.vector4_u32[0], + V1.vector4_u32[1] & ~V2.vector4_u32[1], + V1.vector4_u32[2] & ~V2.vector4_u32[2], + V1.vector4_u32[3] & ~V2.vector4_u32[3] + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2))); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_andnot_si128(_mm_castps_si128(V2), _mm_castps_si128(V1)); + return _mm_castsi128_ps(V); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorOrInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Result = { { { + V1.vector4_u32[0] | V2.vector4_u32[0], + V1.vector4_u32[1] | V2.vector4_u32[1], + V1.vector4_u32[2] | V2.vector4_u32[2], + V1.vector4_u32[3] | V2.vector4_u32[3] + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vorrq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2))); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_or_si128(_mm_castps_si128(V1), _mm_castps_si128(V2)); + return _mm_castsi128_ps(V); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorNorInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Result = { { { + ~(V1.vector4_u32[0] | V2.vector4_u32[0]), + ~(V1.vector4_u32[1] | V2.vector4_u32[1]), + ~(V1.vector4_u32[2] | V2.vector4_u32[2]), + ~(V1.vector4_u32[3] | V2.vector4_u32[3]) + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t Result = vorrq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)); + return vreinterpretq_f32_u32(vbicq_u32(g_XMNegOneMask, Result)); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i Result; + Result = _mm_or_si128(_mm_castps_si128(V1), _mm_castps_si128(V2)); + Result = _mm_andnot_si128(Result, g_XMNegOneMask); + return _mm_castsi128_ps(Result); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorXorInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Result = { { { + V1.vector4_u32[0] ^ V2.vector4_u32[0], + V1.vector4_u32[1] ^ V2.vector4_u32[1], + V1.vector4_u32[2] ^ V2.vector4_u32[2], + V1.vector4_u32[3] ^ V2.vector4_u32[3] + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(veorq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2))); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_xor_si128(_mm_castps_si128(V1), _mm_castps_si128(V2)); + return _mm_castsi128_ps(V); +#endif +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorNegate(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + -V.vector4_f32[0], + -V.vector4_f32[1], + -V.vector4_f32[2], + -V.vector4_f32[3] + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vnegq_f32(V); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR Z; + + Z = _mm_setzero_ps(); + + return _mm_sub_ps(Z, V); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorAdd +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + V1.vector4_f32[0] + V2.vector4_f32[0], + V1.vector4_f32[1] + V2.vector4_f32[1], + V1.vector4_f32[2] + V2.vector4_f32[2], + V1.vector4_f32[3] + V2.vector4_f32[3] + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vaddq_f32(V1, V2); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_add_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorSum(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result; + Result.f[0] = + Result.f[1] = + Result.f[2] = + Result.f[3] = V.vector4_f32[0] + V.vector4_f32[1] + V.vector4_f32[2] + V.vector4_f32[3]; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + float32x4_t vTemp = vpaddq_f32(V, V); + return vpaddq_f32(vTemp, vTemp); +#else + float32x2_t v1 = vget_low_f32(V); + float32x2_t v2 = vget_high_f32(V); + v1 = vadd_f32(v1, v2); + v1 = vpadd_f32(v1, v1); + return vcombine_f32(v1, v1); +#endif +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vTemp = _mm_hadd_ps(V, V); + return _mm_hadd_ps(vTemp, vTemp); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 3, 0, 1)); + XMVECTOR vTemp2 = _mm_add_ps(V, vTemp); + vTemp = XM_PERMUTE_PS(vTemp2, _MM_SHUFFLE(1, 0, 3, 2)); + return _mm_add_ps(vTemp, vTemp2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorAddAngles +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + const XMVECTOR Zero = XMVectorZero(); + + // Add the given angles together. If the range of V1 is such + // that -Pi <= V1 < Pi and the range of V2 is such that + // -2Pi <= V2 <= 2Pi, then the range of the resulting angle + // will be -Pi <= Result < Pi. + XMVECTOR Result = XMVectorAdd(V1, V2); + + XMVECTOR Mask = XMVectorLess(Result, g_XMNegativePi.v); + XMVECTOR Offset = XMVectorSelect(Zero, g_XMTwoPi.v, Mask); + + Mask = XMVectorGreaterOrEqual(Result, g_XMPi.v); + Offset = XMVectorSelect(Offset, g_XMNegativeTwoPi.v, Mask); + + Result = XMVectorAdd(Result, Offset); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Adjust the angles + float32x4_t vResult = vaddq_f32(V1, V2); + // Less than Pi? + uint32x4_t vOffset = vcltq_f32(vResult, g_XMNegativePi); + vOffset = vandq_u32(vOffset, g_XMTwoPi); + // Add 2Pi to all entries less than -Pi + vResult = vaddq_f32(vResult, vreinterpretq_f32_u32(vOffset)); + // Greater than or equal to Pi? + vOffset = vcgeq_f32(vResult, g_XMPi); + vOffset = vandq_u32(vOffset, g_XMTwoPi); + // Sub 2Pi to all entries greater than Pi + vResult = vsubq_f32(vResult, vreinterpretq_f32_u32(vOffset)); + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + // Adjust the angles + XMVECTOR vResult = _mm_add_ps(V1, V2); + // Less than Pi? + XMVECTOR vOffset = _mm_cmplt_ps(vResult, g_XMNegativePi); + vOffset = _mm_and_ps(vOffset, g_XMTwoPi); + // Add 2Pi to all entries less than -Pi + vResult = _mm_add_ps(vResult, vOffset); + // Greater than or equal to Pi? + vOffset = _mm_cmpge_ps(vResult, g_XMPi); + vOffset = _mm_and_ps(vOffset, g_XMTwoPi); + // Sub 2Pi to all entries greater than Pi + vResult = _mm_sub_ps(vResult, vOffset); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorSubtract +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + V1.vector4_f32[0] - V2.vector4_f32[0], + V1.vector4_f32[1] - V2.vector4_f32[1], + V1.vector4_f32[2] - V2.vector4_f32[2], + V1.vector4_f32[3] - V2.vector4_f32[3] + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vsubq_f32(V1, V2); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_sub_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorSubtractAngles +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + const XMVECTOR Zero = XMVectorZero(); + + // Subtract the given angles. If the range of V1 is such + // that -Pi <= V1 < Pi and the range of V2 is such that + // -2Pi <= V2 <= 2Pi, then the range of the resulting angle + // will be -Pi <= Result < Pi. + XMVECTOR Result = XMVectorSubtract(V1, V2); + + XMVECTOR Mask = XMVectorLess(Result, g_XMNegativePi.v); + XMVECTOR Offset = XMVectorSelect(Zero, g_XMTwoPi.v, Mask); + + Mask = XMVectorGreaterOrEqual(Result, g_XMPi.v); + Offset = XMVectorSelect(Offset, g_XMNegativeTwoPi.v, Mask); + + Result = XMVectorAdd(Result, Offset); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Adjust the angles + XMVECTOR vResult = vsubq_f32(V1, V2); + // Less than Pi? + uint32x4_t vOffset = vcltq_f32(vResult, g_XMNegativePi); + vOffset = vandq_u32(vOffset, g_XMTwoPi); + // Add 2Pi to all entries less than -Pi + vResult = vaddq_f32(vResult, vreinterpretq_f32_u32(vOffset)); + // Greater than or equal to Pi? + vOffset = vcgeq_f32(vResult, g_XMPi); + vOffset = vandq_u32(vOffset, g_XMTwoPi); + // Sub 2Pi to all entries greater than Pi + vResult = vsubq_f32(vResult, vreinterpretq_f32_u32(vOffset)); + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + // Adjust the angles + XMVECTOR vResult = _mm_sub_ps(V1, V2); + // Less than Pi? + XMVECTOR vOffset = _mm_cmplt_ps(vResult, g_XMNegativePi); + vOffset = _mm_and_ps(vOffset, g_XMTwoPi); + // Add 2Pi to all entries less than -Pi + vResult = _mm_add_ps(vResult, vOffset); + // Greater than or equal to Pi? + vOffset = _mm_cmpge_ps(vResult, g_XMPi); + vOffset = _mm_and_ps(vOffset, g_XMTwoPi); + // Sub 2Pi to all entries greater than Pi + vResult = _mm_sub_ps(vResult, vOffset); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorMultiply +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + V1.vector4_f32[0] * V2.vector4_f32[0], + V1.vector4_f32[1] * V2.vector4_f32[1], + V1.vector4_f32[2] * V2.vector4_f32[2], + V1.vector4_f32[3] * V2.vector4_f32[3] + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vmulq_f32(V1, V2); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_mul_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorMultiplyAdd +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR V3 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + V1.vector4_f32[0] * V2.vector4_f32[0] + V3.vector4_f32[0], + V1.vector4_f32[1] * V2.vector4_f32[1] + V3.vector4_f32[1], + V1.vector4_f32[2] * V2.vector4_f32[2] + V3.vector4_f32[2], + V1.vector4_f32[3] * V2.vector4_f32[3] + V3.vector4_f32[3] + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + return vfmaq_f32(V3, V1, V2); +#else + return vmlaq_f32(V3, V1, V2); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + return XM_FMADD_PS(V1, V2, V3); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorDivide +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + V1.vector4_f32[0] / V2.vector4_f32[0], + V1.vector4_f32[1] / V2.vector4_f32[1], + V1.vector4_f32[2] / V2.vector4_f32[2], + V1.vector4_f32[3] / V2.vector4_f32[3] + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + return vdivq_f32(V1, V2); +#else + // 2 iterations of Newton-Raphson refinement of reciprocal + float32x4_t Reciprocal = vrecpeq_f32(V2); + float32x4_t S = vrecpsq_f32(Reciprocal, V2); + Reciprocal = vmulq_f32(S, Reciprocal); + S = vrecpsq_f32(Reciprocal, V2); + Reciprocal = vmulq_f32(S, Reciprocal); + return vmulq_f32(V1, Reciprocal); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_div_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorNegativeMultiplySubtract +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR V3 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + V3.vector4_f32[0] - (V1.vector4_f32[0] * V2.vector4_f32[0]), + V3.vector4_f32[1] - (V1.vector4_f32[1] * V2.vector4_f32[1]), + V3.vector4_f32[2] - (V1.vector4_f32[2] * V2.vector4_f32[2]), + V3.vector4_f32[3] - (V1.vector4_f32[3] * V2.vector4_f32[3]) + } } }; + return Result; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + return vfmsq_f32(V3, V1, V2); +#else + return vmlsq_f32(V3, V1, V2); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + return XM_FNMADD_PS(V1, V2, V3); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorScale +( + FXMVECTOR V, + float ScaleFactor +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + V.vector4_f32[0] * ScaleFactor, + V.vector4_f32[1] * ScaleFactor, + V.vector4_f32[2] * ScaleFactor, + V.vector4_f32[3] * ScaleFactor + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vmulq_n_f32(V, ScaleFactor); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_set_ps1(ScaleFactor); + return _mm_mul_ps(vResult, V); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorReciprocalEst(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + 1.f / V.vector4_f32[0], + 1.f / V.vector4_f32[1], + 1.f / V.vector4_f32[2], + 1.f / V.vector4_f32[3] + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vrecpeq_f32(V); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_rcp_ps(V); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorReciprocal(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + 1.f / V.vector4_f32[0], + 1.f / V.vector4_f32[1], + 1.f / V.vector4_f32[2], + 1.f / V.vector4_f32[3] + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + float32x4_t one = vdupq_n_f32(1.0f); + return vdivq_f32(one, V); +#else + // 2 iterations of Newton-Raphson refinement + float32x4_t Reciprocal = vrecpeq_f32(V); + float32x4_t S = vrecpsq_f32(Reciprocal, V); + Reciprocal = vmulq_f32(S, Reciprocal); + S = vrecpsq_f32(Reciprocal, V); + return vmulq_f32(S, Reciprocal); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_div_ps(g_XMOne, V); +#endif +} + +//------------------------------------------------------------------------------ +// Return an estimated square root +inline XMVECTOR XM_CALLCONV XMVectorSqrtEst(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + sqrtf(V.vector4_f32[0]), + sqrtf(V.vector4_f32[1]), + sqrtf(V.vector4_f32[2]), + sqrtf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // 1 iteration of Newton-Raphson refinment of sqrt + float32x4_t S0 = vrsqrteq_f32(V); + float32x4_t P0 = vmulq_f32(V, S0); + float32x4_t R0 = vrsqrtsq_f32(P0, S0); + float32x4_t S1 = vmulq_f32(S0, R0); + + XMVECTOR VEqualsInfinity = XMVectorEqualInt(V, g_XMInfinity.v); + XMVECTOR VEqualsZero = XMVectorEqual(V, vdupq_n_f32(0)); + XMVECTOR Result = vmulq_f32(V, S1); + XMVECTOR Select = XMVectorEqualInt(VEqualsInfinity, VEqualsZero); + return XMVectorSelect(V, Result, Select); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_sqrt_ps(V); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorSqrt(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + sqrtf(V.vector4_f32[0]), + sqrtf(V.vector4_f32[1]), + sqrtf(V.vector4_f32[2]), + sqrtf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // 3 iterations of Newton-Raphson refinment of sqrt + float32x4_t S0 = vrsqrteq_f32(V); + float32x4_t P0 = vmulq_f32(V, S0); + float32x4_t R0 = vrsqrtsq_f32(P0, S0); + float32x4_t S1 = vmulq_f32(S0, R0); + float32x4_t P1 = vmulq_f32(V, S1); + float32x4_t R1 = vrsqrtsq_f32(P1, S1); + float32x4_t S2 = vmulq_f32(S1, R1); + float32x4_t P2 = vmulq_f32(V, S2); + float32x4_t R2 = vrsqrtsq_f32(P2, S2); + float32x4_t S3 = vmulq_f32(S2, R2); + + XMVECTOR VEqualsInfinity = XMVectorEqualInt(V, g_XMInfinity.v); + XMVECTOR VEqualsZero = XMVectorEqual(V, vdupq_n_f32(0)); + XMVECTOR Result = vmulq_f32(V, S3); + XMVECTOR Select = XMVectorEqualInt(VEqualsInfinity, VEqualsZero); + return XMVectorSelect(V, Result, Select); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_sqrt_ps(V); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorReciprocalSqrtEst(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + 1.f / sqrtf(V.vector4_f32[0]), + 1.f / sqrtf(V.vector4_f32[1]), + 1.f / sqrtf(V.vector4_f32[2]), + 1.f / sqrtf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vrsqrteq_f32(V); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_rsqrt_ps(V); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorReciprocalSqrt(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + 1.f / sqrtf(V.vector4_f32[0]), + 1.f / sqrtf(V.vector4_f32[1]), + 1.f / sqrtf(V.vector4_f32[2]), + 1.f / sqrtf(V.vector4_f32[3]) + } } }; + return Result; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // 2 iterations of Newton-Raphson refinement of reciprocal + float32x4_t S0 = vrsqrteq_f32(V); + + float32x4_t P0 = vmulq_f32(V, S0); + float32x4_t R0 = vrsqrtsq_f32(P0, S0); + + float32x4_t S1 = vmulq_f32(S0, R0); + float32x4_t P1 = vmulq_f32(V, S1); + float32x4_t R1 = vrsqrtsq_f32(P1, S1); + + return vmulq_f32(S1, R1); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_sqrt_ps(V); + vResult = _mm_div_ps(g_XMOne, vResult); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorExp2(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + exp2f(V.vector4_f32[0]), + exp2f(V.vector4_f32[1]), + exp2f(V.vector4_f32[2]), + exp2f(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + int32x4_t itrunc = vcvtq_s32_f32(V); + float32x4_t ftrunc = vcvtq_f32_s32(itrunc); + float32x4_t y = vsubq_f32(V, ftrunc); + + float32x4_t poly = vmlaq_f32(g_XMExpEst6, g_XMExpEst7, y); + poly = vmlaq_f32(g_XMExpEst5, poly, y); + poly = vmlaq_f32(g_XMExpEst4, poly, y); + poly = vmlaq_f32(g_XMExpEst3, poly, y); + poly = vmlaq_f32(g_XMExpEst2, poly, y); + poly = vmlaq_f32(g_XMExpEst1, poly, y); + poly = vmlaq_f32(g_XMOne, poly, y); + + int32x4_t biased = vaddq_s32(itrunc, g_XMExponentBias); + biased = vshlq_n_s32(biased, 23); + float32x4_t result0 = XMVectorDivide(vreinterpretq_f32_s32(biased), poly); + + biased = vaddq_s32(itrunc, g_XM253); + biased = vshlq_n_s32(biased, 23); + float32x4_t result1 = XMVectorDivide(vreinterpretq_f32_s32(biased), poly); + result1 = vmulq_f32(g_XMMinNormal.v, result1); + + // Use selection to handle the cases + // if (V is NaN) -> QNaN; + // else if (V sign bit set) + // if (V > -150) + // if (V.exponent < -126) -> result1 + // else -> result0 + // else -> +0 + // else + // if (V < 128) -> result0 + // else -> +inf + + uint32x4_t comp = vcltq_s32(vreinterpretq_s32_f32(V), g_XMBin128); + float32x4_t result2 = vbslq_f32(comp, result0, g_XMInfinity); + + comp = vcltq_s32(itrunc, g_XMSubnormalExponent); + float32x4_t result3 = vbslq_f32(comp, result1, result0); + + comp = vcltq_s32(vreinterpretq_s32_f32(V), g_XMBinNeg150); + float32x4_t result4 = vbslq_f32(comp, result3, g_XMZero); + + int32x4_t sign = vandq_s32(vreinterpretq_s32_f32(V), g_XMNegativeZero); + comp = vceqq_s32(sign, g_XMNegativeZero); + float32x4_t result5 = vbslq_f32(comp, result4, result2); + + int32x4_t t0 = vandq_s32(vreinterpretq_s32_f32(V), g_XMQNaNTest); + int32x4_t t1 = vandq_s32(vreinterpretq_s32_f32(V), g_XMInfinity); + t0 = vreinterpretq_s32_u32(vceqq_s32(t0, g_XMZero)); + t1 = vreinterpretq_s32_u32(vceqq_s32(t1, g_XMInfinity)); + int32x4_t isNaN = vbicq_s32(t1, t0); + + float32x4_t vResult = vbslq_f32(vreinterpretq_u32_s32(isNaN), g_XMQNaN, result5); + return vResult; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_exp2_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i itrunc = _mm_cvttps_epi32(V); + __m128 ftrunc = _mm_cvtepi32_ps(itrunc); + __m128 y = _mm_sub_ps(V, ftrunc); + + __m128 poly = XM_FMADD_PS(g_XMExpEst7, y, g_XMExpEst6); + poly = XM_FMADD_PS(poly, y, g_XMExpEst5); + poly = XM_FMADD_PS(poly, y, g_XMExpEst4); + poly = XM_FMADD_PS(poly, y, g_XMExpEst3); + poly = XM_FMADD_PS(poly, y, g_XMExpEst2); + poly = XM_FMADD_PS(poly, y, g_XMExpEst1); + poly = XM_FMADD_PS(poly, y, g_XMOne); + + __m128i biased = _mm_add_epi32(itrunc, g_XMExponentBias); + biased = _mm_slli_epi32(biased, 23); + __m128 result0 = _mm_div_ps(_mm_castsi128_ps(biased), poly); + + biased = _mm_add_epi32(itrunc, g_XM253); + biased = _mm_slli_epi32(biased, 23); + __m128 result1 = _mm_div_ps(_mm_castsi128_ps(biased), poly); + result1 = _mm_mul_ps(g_XMMinNormal.v, result1); + + // Use selection to handle the cases + // if (V is NaN) -> QNaN; + // else if (V sign bit set) + // if (V > -150) + // if (V.exponent < -126) -> result1 + // else -> result0 + // else -> +0 + // else + // if (V < 128) -> result0 + // else -> +inf + + __m128i comp = _mm_cmplt_epi32(_mm_castps_si128(V), g_XMBin128); + __m128i select0 = _mm_and_si128(comp, _mm_castps_si128(result0)); + __m128i select1 = _mm_andnot_si128(comp, g_XMInfinity); + __m128i result2 = _mm_or_si128(select0, select1); + + comp = _mm_cmplt_epi32(itrunc, g_XMSubnormalExponent); + select1 = _mm_and_si128(comp, _mm_castps_si128(result1)); + select0 = _mm_andnot_si128(comp, _mm_castps_si128(result0)); + __m128i result3 = _mm_or_si128(select0, select1); + + comp = _mm_cmplt_epi32(_mm_castps_si128(V), g_XMBinNeg150); + select0 = _mm_and_si128(comp, result3); + select1 = _mm_andnot_si128(comp, g_XMZero); + __m128i result4 = _mm_or_si128(select0, select1); + + __m128i sign = _mm_and_si128(_mm_castps_si128(V), g_XMNegativeZero); + comp = _mm_cmpeq_epi32(sign, g_XMNegativeZero); + select0 = _mm_and_si128(comp, result4); + select1 = _mm_andnot_si128(comp, result2); + __m128i result5 = _mm_or_si128(select0, select1); + + __m128i t0 = _mm_and_si128(_mm_castps_si128(V), g_XMQNaNTest); + __m128i t1 = _mm_and_si128(_mm_castps_si128(V), g_XMInfinity); + t0 = _mm_cmpeq_epi32(t0, g_XMZero); + t1 = _mm_cmpeq_epi32(t1, g_XMInfinity); + __m128i isNaN = _mm_andnot_si128(t0, t1); + + select0 = _mm_and_si128(isNaN, g_XMQNaN); + select1 = _mm_andnot_si128(isNaN, result5); + __m128i vResult = _mm_or_si128(select0, select1); + + return _mm_castsi128_ps(vResult); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorExp10(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + powf(10.0f, V.vector4_f32[0]), + powf(10.0f, V.vector4_f32[1]), + powf(10.0f, V.vector4_f32[2]), + powf(10.0f, V.vector4_f32[3]) + } } }; + return Result.v; + +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_exp10_ps(V); + return Result; +#else + // exp10(V) = exp2(vin*log2(10)) + XMVECTOR Vten = XMVectorMultiply(g_XMLg10, V); + return XMVectorExp2(Vten); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorExpE(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + expf(V.vector4_f32[0]), + expf(V.vector4_f32[1]), + expf(V.vector4_f32[2]), + expf(V.vector4_f32[3]) + } } }; + return Result.v; + +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_exp_ps(V); + return Result; +#else + // expE(V) = exp2(vin*log2(e)) + XMVECTOR Ve = XMVectorMultiply(g_XMLgE, V); + return XMVectorExp2(Ve); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorExp(FXMVECTOR V) noexcept +{ + return XMVectorExp2(V); +} + +//------------------------------------------------------------------------------ + +#if defined(_XM_SSE_INTRINSICS_) + +namespace Internal +{ + inline __m128i multi_sll_epi32(__m128i value, __m128i count) noexcept + { + __m128i v = _mm_shuffle_epi32(value, _MM_SHUFFLE(0, 0, 0, 0)); + __m128i c = _mm_shuffle_epi32(count, _MM_SHUFFLE(0, 0, 0, 0)); + c = _mm_and_si128(c, g_XMMaskX); + __m128i r0 = _mm_sll_epi32(v, c); + + v = _mm_shuffle_epi32(value, _MM_SHUFFLE(1, 1, 1, 1)); + c = _mm_shuffle_epi32(count, _MM_SHUFFLE(1, 1, 1, 1)); + c = _mm_and_si128(c, g_XMMaskX); + __m128i r1 = _mm_sll_epi32(v, c); + + v = _mm_shuffle_epi32(value, _MM_SHUFFLE(2, 2, 2, 2)); + c = _mm_shuffle_epi32(count, _MM_SHUFFLE(2, 2, 2, 2)); + c = _mm_and_si128(c, g_XMMaskX); + __m128i r2 = _mm_sll_epi32(v, c); + + v = _mm_shuffle_epi32(value, _MM_SHUFFLE(3, 3, 3, 3)); + c = _mm_shuffle_epi32(count, _MM_SHUFFLE(3, 3, 3, 3)); + c = _mm_and_si128(c, g_XMMaskX); + __m128i r3 = _mm_sll_epi32(v, c); + + // (r0,r0,r1,r1) + __m128 r01 = _mm_shuffle_ps(_mm_castsi128_ps(r0), _mm_castsi128_ps(r1), _MM_SHUFFLE(0, 0, 0, 0)); + // (r2,r2,r3,r3) + __m128 r23 = _mm_shuffle_ps(_mm_castsi128_ps(r2), _mm_castsi128_ps(r3), _MM_SHUFFLE(0, 0, 0, 0)); + // (r0,r1,r2,r3) + __m128 result = _mm_shuffle_ps(r01, r23, _MM_SHUFFLE(2, 0, 2, 0)); + return _mm_castps_si128(result); + } + + inline __m128i multi_srl_epi32(__m128i value, __m128i count) noexcept + { + __m128i v = _mm_shuffle_epi32(value, _MM_SHUFFLE(0, 0, 0, 0)); + __m128i c = _mm_shuffle_epi32(count, _MM_SHUFFLE(0, 0, 0, 0)); + c = _mm_and_si128(c, g_XMMaskX); + __m128i r0 = _mm_srl_epi32(v, c); + + v = _mm_shuffle_epi32(value, _MM_SHUFFLE(1, 1, 1, 1)); + c = _mm_shuffle_epi32(count, _MM_SHUFFLE(1, 1, 1, 1)); + c = _mm_and_si128(c, g_XMMaskX); + __m128i r1 = _mm_srl_epi32(v, c); + + v = _mm_shuffle_epi32(value, _MM_SHUFFLE(2, 2, 2, 2)); + c = _mm_shuffle_epi32(count, _MM_SHUFFLE(2, 2, 2, 2)); + c = _mm_and_si128(c, g_XMMaskX); + __m128i r2 = _mm_srl_epi32(v, c); + + v = _mm_shuffle_epi32(value, _MM_SHUFFLE(3, 3, 3, 3)); + c = _mm_shuffle_epi32(count, _MM_SHUFFLE(3, 3, 3, 3)); + c = _mm_and_si128(c, g_XMMaskX); + __m128i r3 = _mm_srl_epi32(v, c); + + // (r0,r0,r1,r1) + __m128 r01 = _mm_shuffle_ps(_mm_castsi128_ps(r0), _mm_castsi128_ps(r1), _MM_SHUFFLE(0, 0, 0, 0)); + // (r2,r2,r3,r3) + __m128 r23 = _mm_shuffle_ps(_mm_castsi128_ps(r2), _mm_castsi128_ps(r3), _MM_SHUFFLE(0, 0, 0, 0)); + // (r0,r1,r2,r3) + __m128 result = _mm_shuffle_ps(r01, r23, _MM_SHUFFLE(2, 0, 2, 0)); + return _mm_castps_si128(result); + } + + inline __m128i GetLeadingBit(const __m128i value) noexcept + { + static const XMVECTORI32 g_XM0000FFFF = { { { 0x0000FFFF, 0x0000FFFF, 0x0000FFFF, 0x0000FFFF } } }; + static const XMVECTORI32 g_XM000000FF = { { { 0x000000FF, 0x000000FF, 0x000000FF, 0x000000FF } } }; + static const XMVECTORI32 g_XM0000000F = { { { 0x0000000F, 0x0000000F, 0x0000000F, 0x0000000F } } }; + static const XMVECTORI32 g_XM00000003 = { { { 0x00000003, 0x00000003, 0x00000003, 0x00000003 } } }; + + __m128i v = value, r, c, b, s; + + c = _mm_cmpgt_epi32(v, g_XM0000FFFF); // c = (v > 0xFFFF) + b = _mm_srli_epi32(c, 31); // b = (c ? 1 : 0) + r = _mm_slli_epi32(b, 4); // r = (b << 4) + v = multi_srl_epi32(v, r); // v = (v >> r) + + c = _mm_cmpgt_epi32(v, g_XM000000FF); // c = (v > 0xFF) + b = _mm_srli_epi32(c, 31); // b = (c ? 1 : 0) + s = _mm_slli_epi32(b, 3); // s = (b << 3) + v = multi_srl_epi32(v, s); // v = (v >> s) + r = _mm_or_si128(r, s); // r = (r | s) + + c = _mm_cmpgt_epi32(v, g_XM0000000F); // c = (v > 0xF) + b = _mm_srli_epi32(c, 31); // b = (c ? 1 : 0) + s = _mm_slli_epi32(b, 2); // s = (b << 2) + v = multi_srl_epi32(v, s); // v = (v >> s) + r = _mm_or_si128(r, s); // r = (r | s) + + c = _mm_cmpgt_epi32(v, g_XM00000003); // c = (v > 0x3) + b = _mm_srli_epi32(c, 31); // b = (c ? 1 : 0) + s = _mm_slli_epi32(b, 1); // s = (b << 1) + v = multi_srl_epi32(v, s); // v = (v >> s) + r = _mm_or_si128(r, s); // r = (r | s) + + s = _mm_srli_epi32(v, 1); + r = _mm_or_si128(r, s); + return r; + } +} // namespace Internal + +#endif // _XM_SSE_INTRINSICS_ + +#if defined(_XM_ARM_NEON_INTRINSICS_) + +namespace Internal +{ + inline int32x4_t GetLeadingBit(const int32x4_t value) noexcept + { + static const XMVECTORI32 g_XM0000FFFF = { { { 0x0000FFFF, 0x0000FFFF, 0x0000FFFF, 0x0000FFFF } } }; + static const XMVECTORI32 g_XM000000FF = { { { 0x000000FF, 0x000000FF, 0x000000FF, 0x000000FF } } }; + static const XMVECTORI32 g_XM0000000F = { { { 0x0000000F, 0x0000000F, 0x0000000F, 0x0000000F } } }; + static const XMVECTORI32 g_XM00000003 = { { { 0x00000003, 0x00000003, 0x00000003, 0x00000003 } } }; + + uint32x4_t c = vcgtq_s32(value, g_XM0000FFFF); // c = (v > 0xFFFF) + int32x4_t b = vshrq_n_s32(vreinterpretq_s32_u32(c), 31); // b = (c ? 1 : 0) + int32x4_t r = vshlq_n_s32(b, 4); // r = (b << 4) + r = vnegq_s32(r); + int32x4_t v = vshlq_s32(value, r); // v = (v >> r) + + c = vcgtq_s32(v, g_XM000000FF); // c = (v > 0xFF) + b = vshrq_n_s32(vreinterpretq_s32_u32(c), 31); // b = (c ? 1 : 0) + int32x4_t s = vshlq_n_s32(b, 3); // s = (b << 3) + s = vnegq_s32(s); + v = vshlq_s32(v, s); // v = (v >> s) + r = vorrq_s32(r, s); // r = (r | s) + + c = vcgtq_s32(v, g_XM0000000F); // c = (v > 0xF) + b = vshrq_n_s32(vreinterpretq_s32_u32(c), 31); // b = (c ? 1 : 0) + s = vshlq_n_s32(b, 2); // s = (b << 2) + s = vnegq_s32(s); + v = vshlq_s32(v, s); // v = (v >> s) + r = vorrq_s32(r, s); // r = (r | s) + + c = vcgtq_s32(v, g_XM00000003); // c = (v > 0x3) + b = vshrq_n_s32(vreinterpretq_s32_u32(c), 31); // b = (c ? 1 : 0) + s = vshlq_n_s32(b, 1); // s = (b << 1) + s = vnegq_s32(s); + v = vshlq_s32(v, s); // v = (v >> s) + r = vorrq_s32(r, s); // r = (r | s) + + s = vshrq_n_s32(v, 1); + r = vorrq_s32(r, s); + return r; + } + +} // namespace Internal + +#endif + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorLog2(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + log2f(V.vector4_f32[0]), + log2f(V.vector4_f32[1]), + log2f(V.vector4_f32[2]), + log2f(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + int32x4_t rawBiased = vandq_s32(vreinterpretq_s32_f32(V), g_XMInfinity); + int32x4_t trailing = vandq_s32(vreinterpretq_s32_f32(V), g_XMQNaNTest); + uint32x4_t isExponentZero = vceqq_s32(vreinterpretq_s32_f32(g_XMZero), rawBiased); + + // Compute exponent and significand for normals. + int32x4_t biased = vshrq_n_s32(rawBiased, 23); + int32x4_t exponentNor = vsubq_s32(biased, g_XMExponentBias); + int32x4_t trailingNor = trailing; + + // Compute exponent and significand for subnormals. + int32x4_t leading = Internal::GetLeadingBit(trailing); + int32x4_t shift = vsubq_s32(g_XMNumTrailing, leading); + int32x4_t exponentSub = vsubq_s32(g_XMSubnormalExponent, shift); + int32x4_t trailingSub = vshlq_s32(trailing, shift); + trailingSub = vandq_s32(trailingSub, g_XMQNaNTest); + int32x4_t e = vbslq_s32(isExponentZero, exponentSub, exponentNor); + int32x4_t t = vbslq_s32(isExponentZero, trailingSub, trailingNor); + + // Compute the approximation. + int32x4_t tmp = vorrq_s32(vreinterpretq_s32_f32(g_XMOne), t); + float32x4_t y = vsubq_f32(vreinterpretq_f32_s32(tmp), g_XMOne); + + float32x4_t log2 = vmlaq_f32(g_XMLogEst6, g_XMLogEst7, y); + log2 = vmlaq_f32(g_XMLogEst5, log2, y); + log2 = vmlaq_f32(g_XMLogEst4, log2, y); + log2 = vmlaq_f32(g_XMLogEst3, log2, y); + log2 = vmlaq_f32(g_XMLogEst2, log2, y); + log2 = vmlaq_f32(g_XMLogEst1, log2, y); + log2 = vmlaq_f32(g_XMLogEst0, log2, y); + log2 = vmlaq_f32(vcvtq_f32_s32(e), log2, y); + + // if (x is NaN) -> QNaN + // else if (V is positive) + // if (V is infinite) -> +inf + // else -> log2(V) + // else + // if (V is zero) -> -inf + // else -> -QNaN + + uint32x4_t isInfinite = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); + isInfinite = vceqq_u32(isInfinite, g_XMInfinity); + + uint32x4_t isGreaterZero = vcgtq_f32(V, g_XMZero); + uint32x4_t isNotFinite = vcgtq_f32(V, g_XMInfinity); + uint32x4_t isPositive = vbicq_u32(isGreaterZero, isNotFinite); + + uint32x4_t isZero = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); + isZero = vceqq_u32(isZero, g_XMZero); + + uint32x4_t t0 = vandq_u32(vreinterpretq_u32_f32(V), g_XMQNaNTest); + uint32x4_t t1 = vandq_u32(vreinterpretq_u32_f32(V), g_XMInfinity); + t0 = vceqq_u32(t0, g_XMZero); + t1 = vceqq_u32(t1, g_XMInfinity); + uint32x4_t isNaN = vbicq_u32(t1, t0); + + float32x4_t result = vbslq_f32(isInfinite, g_XMInfinity, log2); + float32x4_t tmp2 = vbslq_f32(isZero, g_XMNegInfinity, g_XMNegQNaN); + result = vbslq_f32(isPositive, result, tmp2); + result = vbslq_f32(isNaN, g_XMQNaN, result); + return result; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_log2_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i rawBiased = _mm_and_si128(_mm_castps_si128(V), g_XMInfinity); + __m128i trailing = _mm_and_si128(_mm_castps_si128(V), g_XMQNaNTest); + __m128i isExponentZero = _mm_cmpeq_epi32(g_XMZero, rawBiased); + + // Compute exponent and significand for normals. + __m128i biased = _mm_srli_epi32(rawBiased, 23); + __m128i exponentNor = _mm_sub_epi32(biased, g_XMExponentBias); + __m128i trailingNor = trailing; + + // Compute exponent and significand for subnormals. + __m128i leading = Internal::GetLeadingBit(trailing); + __m128i shift = _mm_sub_epi32(g_XMNumTrailing, leading); + __m128i exponentSub = _mm_sub_epi32(g_XMSubnormalExponent, shift); + __m128i trailingSub = Internal::multi_sll_epi32(trailing, shift); + trailingSub = _mm_and_si128(trailingSub, g_XMQNaNTest); + + __m128i select0 = _mm_and_si128(isExponentZero, exponentSub); + __m128i select1 = _mm_andnot_si128(isExponentZero, exponentNor); + __m128i e = _mm_or_si128(select0, select1); + + select0 = _mm_and_si128(isExponentZero, trailingSub); + select1 = _mm_andnot_si128(isExponentZero, trailingNor); + __m128i t = _mm_or_si128(select0, select1); + + // Compute the approximation. + __m128i tmp = _mm_or_si128(g_XMOne, t); + __m128 y = _mm_sub_ps(_mm_castsi128_ps(tmp), g_XMOne); + + __m128 log2 = XM_FMADD_PS(g_XMLogEst7, y, g_XMLogEst6); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst5); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst4); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst3); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst2); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst1); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst0); + log2 = XM_FMADD_PS(log2, y, _mm_cvtepi32_ps(e)); + + // if (x is NaN) -> QNaN + // else if (V is positive) + // if (V is infinite) -> +inf + // else -> log2(V) + // else + // if (V is zero) -> -inf + // else -> -QNaN + + __m128i isInfinite = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); + isInfinite = _mm_cmpeq_epi32(isInfinite, g_XMInfinity); + + __m128i isGreaterZero = _mm_cmpgt_epi32(_mm_castps_si128(V), g_XMZero); + __m128i isNotFinite = _mm_cmpgt_epi32(_mm_castps_si128(V), g_XMInfinity); + __m128i isPositive = _mm_andnot_si128(isNotFinite, isGreaterZero); + + __m128i isZero = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); + isZero = _mm_cmpeq_epi32(isZero, g_XMZero); + + __m128i t0 = _mm_and_si128(_mm_castps_si128(V), g_XMQNaNTest); + __m128i t1 = _mm_and_si128(_mm_castps_si128(V), g_XMInfinity); + t0 = _mm_cmpeq_epi32(t0, g_XMZero); + t1 = _mm_cmpeq_epi32(t1, g_XMInfinity); + __m128i isNaN = _mm_andnot_si128(t0, t1); + + select0 = _mm_and_si128(isInfinite, g_XMInfinity); + select1 = _mm_andnot_si128(isInfinite, _mm_castps_si128(log2)); + __m128i result = _mm_or_si128(select0, select1); + + select0 = _mm_and_si128(isZero, g_XMNegInfinity); + select1 = _mm_andnot_si128(isZero, g_XMNegQNaN); + tmp = _mm_or_si128(select0, select1); + + select0 = _mm_and_si128(isPositive, result); + select1 = _mm_andnot_si128(isPositive, tmp); + result = _mm_or_si128(select0, select1); + + select0 = _mm_and_si128(isNaN, g_XMQNaN); + select1 = _mm_andnot_si128(isNaN, result); + result = _mm_or_si128(select0, select1); + + return _mm_castsi128_ps(result); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorLog10(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + log10f(V.vector4_f32[0]), + log10f(V.vector4_f32[1]), + log10f(V.vector4_f32[2]), + log10f(V.vector4_f32[3]) + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + int32x4_t rawBiased = vandq_s32(vreinterpretq_s32_f32(V), g_XMInfinity); + int32x4_t trailing = vandq_s32(vreinterpretq_s32_f32(V), g_XMQNaNTest); + uint32x4_t isExponentZero = vceqq_s32(g_XMZero, rawBiased); + + // Compute exponent and significand for normals. + int32x4_t biased = vshrq_n_s32(rawBiased, 23); + int32x4_t exponentNor = vsubq_s32(biased, g_XMExponentBias); + int32x4_t trailingNor = trailing; + + // Compute exponent and significand for subnormals. + int32x4_t leading = Internal::GetLeadingBit(trailing); + int32x4_t shift = vsubq_s32(g_XMNumTrailing, leading); + int32x4_t exponentSub = vsubq_s32(g_XMSubnormalExponent, shift); + int32x4_t trailingSub = vshlq_s32(trailing, shift); + trailingSub = vandq_s32(trailingSub, g_XMQNaNTest); + int32x4_t e = vbslq_s32(isExponentZero, exponentSub, exponentNor); + int32x4_t t = vbslq_s32(isExponentZero, trailingSub, trailingNor); + + // Compute the approximation. + int32x4_t tmp = vorrq_s32(g_XMOne, t); + float32x4_t y = vsubq_f32(vreinterpretq_f32_s32(tmp), g_XMOne); + + float32x4_t log2 = vmlaq_f32(g_XMLogEst6, g_XMLogEst7, y); + log2 = vmlaq_f32(g_XMLogEst5, log2, y); + log2 = vmlaq_f32(g_XMLogEst4, log2, y); + log2 = vmlaq_f32(g_XMLogEst3, log2, y); + log2 = vmlaq_f32(g_XMLogEst2, log2, y); + log2 = vmlaq_f32(g_XMLogEst1, log2, y); + log2 = vmlaq_f32(g_XMLogEst0, log2, y); + log2 = vmlaq_f32(vcvtq_f32_s32(e), log2, y); + + log2 = vmulq_f32(g_XMInvLg10, log2); + + // if (x is NaN) -> QNaN + // else if (V is positive) + // if (V is infinite) -> +inf + // else -> log2(V) + // else + // if (V is zero) -> -inf + // else -> -QNaN + + uint32x4_t isInfinite = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); + isInfinite = vceqq_u32(isInfinite, g_XMInfinity); + + uint32x4_t isGreaterZero = vcgtq_s32(vreinterpretq_s32_f32(V), g_XMZero); + uint32x4_t isNotFinite = vcgtq_s32(vreinterpretq_s32_f32(V), g_XMInfinity); + uint32x4_t isPositive = vbicq_u32(isGreaterZero, isNotFinite); + + uint32x4_t isZero = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); + isZero = vceqq_u32(isZero, g_XMZero); + + uint32x4_t t0 = vandq_u32(vreinterpretq_u32_f32(V), g_XMQNaNTest); + uint32x4_t t1 = vandq_u32(vreinterpretq_u32_f32(V), g_XMInfinity); + t0 = vceqq_u32(t0, g_XMZero); + t1 = vceqq_u32(t1, g_XMInfinity); + uint32x4_t isNaN = vbicq_u32(t1, t0); + + float32x4_t result = vbslq_f32(isInfinite, g_XMInfinity, log2); + float32x4_t tmp2 = vbslq_f32(isZero, g_XMNegInfinity, g_XMNegQNaN); + result = vbslq_f32(isPositive, result, tmp2); + result = vbslq_f32(isNaN, g_XMQNaN, result); + return result; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_log10_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i rawBiased = _mm_and_si128(_mm_castps_si128(V), g_XMInfinity); + __m128i trailing = _mm_and_si128(_mm_castps_si128(V), g_XMQNaNTest); + __m128i isExponentZero = _mm_cmpeq_epi32(g_XMZero, rawBiased); + + // Compute exponent and significand for normals. + __m128i biased = _mm_srli_epi32(rawBiased, 23); + __m128i exponentNor = _mm_sub_epi32(biased, g_XMExponentBias); + __m128i trailingNor = trailing; + + // Compute exponent and significand for subnormals. + __m128i leading = Internal::GetLeadingBit(trailing); + __m128i shift = _mm_sub_epi32(g_XMNumTrailing, leading); + __m128i exponentSub = _mm_sub_epi32(g_XMSubnormalExponent, shift); + __m128i trailingSub = Internal::multi_sll_epi32(trailing, shift); + trailingSub = _mm_and_si128(trailingSub, g_XMQNaNTest); + + __m128i select0 = _mm_and_si128(isExponentZero, exponentSub); + __m128i select1 = _mm_andnot_si128(isExponentZero, exponentNor); + __m128i e = _mm_or_si128(select0, select1); + + select0 = _mm_and_si128(isExponentZero, trailingSub); + select1 = _mm_andnot_si128(isExponentZero, trailingNor); + __m128i t = _mm_or_si128(select0, select1); + + // Compute the approximation. + __m128i tmp = _mm_or_si128(g_XMOne, t); + __m128 y = _mm_sub_ps(_mm_castsi128_ps(tmp), g_XMOne); + + __m128 log2 = XM_FMADD_PS(g_XMLogEst7, y, g_XMLogEst6); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst5); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst4); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst3); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst2); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst1); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst0); + log2 = XM_FMADD_PS(log2, y, _mm_cvtepi32_ps(e)); + + log2 = _mm_mul_ps(g_XMInvLg10, log2); + + // if (x is NaN) -> QNaN + // else if (V is positive) + // if (V is infinite) -> +inf + // else -> log2(V) + // else + // if (V is zero) -> -inf + // else -> -QNaN + + __m128i isInfinite = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); + isInfinite = _mm_cmpeq_epi32(isInfinite, g_XMInfinity); + + __m128i isGreaterZero = _mm_cmpgt_epi32(_mm_castps_si128(V), g_XMZero); + __m128i isNotFinite = _mm_cmpgt_epi32(_mm_castps_si128(V), g_XMInfinity); + __m128i isPositive = _mm_andnot_si128(isNotFinite, isGreaterZero); + + __m128i isZero = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); + isZero = _mm_cmpeq_epi32(isZero, g_XMZero); + + __m128i t0 = _mm_and_si128(_mm_castps_si128(V), g_XMQNaNTest); + __m128i t1 = _mm_and_si128(_mm_castps_si128(V), g_XMInfinity); + t0 = _mm_cmpeq_epi32(t0, g_XMZero); + t1 = _mm_cmpeq_epi32(t1, g_XMInfinity); + __m128i isNaN = _mm_andnot_si128(t0, t1); + + select0 = _mm_and_si128(isInfinite, g_XMInfinity); + select1 = _mm_andnot_si128(isInfinite, _mm_castps_si128(log2)); + __m128i result = _mm_or_si128(select0, select1); + + select0 = _mm_and_si128(isZero, g_XMNegInfinity); + select1 = _mm_andnot_si128(isZero, g_XMNegQNaN); + tmp = _mm_or_si128(select0, select1); + + select0 = _mm_and_si128(isPositive, result); + select1 = _mm_andnot_si128(isPositive, tmp); + result = _mm_or_si128(select0, select1); + + select0 = _mm_and_si128(isNaN, g_XMQNaN); + select1 = _mm_andnot_si128(isNaN, result); + result = _mm_or_si128(select0, select1); + + return _mm_castsi128_ps(result); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorLogE(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + logf(V.vector4_f32[0]), + logf(V.vector4_f32[1]), + logf(V.vector4_f32[2]), + logf(V.vector4_f32[3]) + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + int32x4_t rawBiased = vandq_s32(vreinterpretq_s32_f32(V), g_XMInfinity); + int32x4_t trailing = vandq_s32(vreinterpretq_s32_f32(V), g_XMQNaNTest); + uint32x4_t isExponentZero = vceqq_s32(g_XMZero, rawBiased); + + // Compute exponent and significand for normals. + int32x4_t biased = vshrq_n_s32(rawBiased, 23); + int32x4_t exponentNor = vsubq_s32(biased, g_XMExponentBias); + int32x4_t trailingNor = trailing; + + // Compute exponent and significand for subnormals. + int32x4_t leading = Internal::GetLeadingBit(trailing); + int32x4_t shift = vsubq_s32(g_XMNumTrailing, leading); + int32x4_t exponentSub = vsubq_s32(g_XMSubnormalExponent, shift); + int32x4_t trailingSub = vshlq_s32(trailing, shift); + trailingSub = vandq_s32(trailingSub, g_XMQNaNTest); + int32x4_t e = vbslq_s32(isExponentZero, exponentSub, exponentNor); + int32x4_t t = vbslq_s32(isExponentZero, trailingSub, trailingNor); + + // Compute the approximation. + int32x4_t tmp = vorrq_s32(g_XMOne, t); + float32x4_t y = vsubq_f32(vreinterpretq_f32_s32(tmp), g_XMOne); + + float32x4_t log2 = vmlaq_f32(g_XMLogEst6, g_XMLogEst7, y); + log2 = vmlaq_f32(g_XMLogEst5, log2, y); + log2 = vmlaq_f32(g_XMLogEst4, log2, y); + log2 = vmlaq_f32(g_XMLogEst3, log2, y); + log2 = vmlaq_f32(g_XMLogEst2, log2, y); + log2 = vmlaq_f32(g_XMLogEst1, log2, y); + log2 = vmlaq_f32(g_XMLogEst0, log2, y); + log2 = vmlaq_f32(vcvtq_f32_s32(e), log2, y); + + log2 = vmulq_f32(g_XMInvLgE, log2); + + // if (x is NaN) -> QNaN + // else if (V is positive) + // if (V is infinite) -> +inf + // else -> log2(V) + // else + // if (V is zero) -> -inf + // else -> -QNaN + + uint32x4_t isInfinite = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); + isInfinite = vceqq_u32(isInfinite, g_XMInfinity); + + uint32x4_t isGreaterZero = vcgtq_s32(vreinterpretq_s32_f32(V), g_XMZero); + uint32x4_t isNotFinite = vcgtq_s32(vreinterpretq_s32_f32(V), g_XMInfinity); + uint32x4_t isPositive = vbicq_u32(isGreaterZero, isNotFinite); + + uint32x4_t isZero = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); + isZero = vceqq_u32(isZero, g_XMZero); + + uint32x4_t t0 = vandq_u32(vreinterpretq_u32_f32(V), g_XMQNaNTest); + uint32x4_t t1 = vandq_u32(vreinterpretq_u32_f32(V), g_XMInfinity); + t0 = vceqq_u32(t0, g_XMZero); + t1 = vceqq_u32(t1, g_XMInfinity); + uint32x4_t isNaN = vbicq_u32(t1, t0); + + float32x4_t result = vbslq_f32(isInfinite, g_XMInfinity, log2); + float32x4_t tmp2 = vbslq_f32(isZero, g_XMNegInfinity, g_XMNegQNaN); + result = vbslq_f32(isPositive, result, tmp2); + result = vbslq_f32(isNaN, g_XMQNaN, result); + return result; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_log_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i rawBiased = _mm_and_si128(_mm_castps_si128(V), g_XMInfinity); + __m128i trailing = _mm_and_si128(_mm_castps_si128(V), g_XMQNaNTest); + __m128i isExponentZero = _mm_cmpeq_epi32(g_XMZero, rawBiased); + + // Compute exponent and significand for normals. + __m128i biased = _mm_srli_epi32(rawBiased, 23); + __m128i exponentNor = _mm_sub_epi32(biased, g_XMExponentBias); + __m128i trailingNor = trailing; + + // Compute exponent and significand for subnormals. + __m128i leading = Internal::GetLeadingBit(trailing); + __m128i shift = _mm_sub_epi32(g_XMNumTrailing, leading); + __m128i exponentSub = _mm_sub_epi32(g_XMSubnormalExponent, shift); + __m128i trailingSub = Internal::multi_sll_epi32(trailing, shift); + trailingSub = _mm_and_si128(trailingSub, g_XMQNaNTest); + + __m128i select0 = _mm_and_si128(isExponentZero, exponentSub); + __m128i select1 = _mm_andnot_si128(isExponentZero, exponentNor); + __m128i e = _mm_or_si128(select0, select1); + + select0 = _mm_and_si128(isExponentZero, trailingSub); + select1 = _mm_andnot_si128(isExponentZero, trailingNor); + __m128i t = _mm_or_si128(select0, select1); + + // Compute the approximation. + __m128i tmp = _mm_or_si128(g_XMOne, t); + __m128 y = _mm_sub_ps(_mm_castsi128_ps(tmp), g_XMOne); + + __m128 log2 = XM_FMADD_PS(g_XMLogEst7, y, g_XMLogEst6); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst5); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst4); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst3); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst2); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst1); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst0); + log2 = XM_FMADD_PS(log2, y, _mm_cvtepi32_ps(e)); + + log2 = _mm_mul_ps(g_XMInvLgE, log2); + + // if (x is NaN) -> QNaN + // else if (V is positive) + // if (V is infinite) -> +inf + // else -> log2(V) + // else + // if (V is zero) -> -inf + // else -> -QNaN + + __m128i isInfinite = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); + isInfinite = _mm_cmpeq_epi32(isInfinite, g_XMInfinity); + + __m128i isGreaterZero = _mm_cmpgt_epi32(_mm_castps_si128(V), g_XMZero); + __m128i isNotFinite = _mm_cmpgt_epi32(_mm_castps_si128(V), g_XMInfinity); + __m128i isPositive = _mm_andnot_si128(isNotFinite, isGreaterZero); + + __m128i isZero = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); + isZero = _mm_cmpeq_epi32(isZero, g_XMZero); + + __m128i t0 = _mm_and_si128(_mm_castps_si128(V), g_XMQNaNTest); + __m128i t1 = _mm_and_si128(_mm_castps_si128(V), g_XMInfinity); + t0 = _mm_cmpeq_epi32(t0, g_XMZero); + t1 = _mm_cmpeq_epi32(t1, g_XMInfinity); + __m128i isNaN = _mm_andnot_si128(t0, t1); + + select0 = _mm_and_si128(isInfinite, g_XMInfinity); + select1 = _mm_andnot_si128(isInfinite, _mm_castps_si128(log2)); + __m128i result = _mm_or_si128(select0, select1); + + select0 = _mm_and_si128(isZero, g_XMNegInfinity); + select1 = _mm_andnot_si128(isZero, g_XMNegQNaN); + tmp = _mm_or_si128(select0, select1); + + select0 = _mm_and_si128(isPositive, result); + select1 = _mm_andnot_si128(isPositive, tmp); + result = _mm_or_si128(select0, select1); + + select0 = _mm_and_si128(isNaN, g_XMQNaN); + select1 = _mm_andnot_si128(isNaN, result); + result = _mm_or_si128(select0, select1); + + return _mm_castsi128_ps(result); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorLog(FXMVECTOR V) noexcept +{ + return XMVectorLog2(V); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorPow +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + powf(V1.vector4_f32[0], V2.vector4_f32[0]), + powf(V1.vector4_f32[1], V2.vector4_f32[1]), + powf(V1.vector4_f32[2], V2.vector4_f32[2]), + powf(V1.vector4_f32[3], V2.vector4_f32[3]) + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMVECTORF32 vResult = { { { + powf(vgetq_lane_f32(V1, 0), vgetq_lane_f32(V2, 0)), + powf(vgetq_lane_f32(V1, 1), vgetq_lane_f32(V2, 1)), + powf(vgetq_lane_f32(V1, 2), vgetq_lane_f32(V2, 2)), + powf(vgetq_lane_f32(V1, 3), vgetq_lane_f32(V2, 3)) + } } }; + return vResult.v; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_pow_ps(V1, V2); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + XM_ALIGNED_DATA(16) float a[4]; + XM_ALIGNED_DATA(16) float b[4]; + _mm_store_ps(a, V1); + _mm_store_ps(b, V2); + XMVECTOR vResult = _mm_setr_ps( + powf(a[0], b[0]), + powf(a[1], b[1]), + powf(a[2], b[2]), + powf(a[3], b[3])); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorAbs(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + fabsf(V.vector4_f32[0]), + fabsf(V.vector4_f32[1]), + fabsf(V.vector4_f32[2]), + fabsf(V.vector4_f32[3]) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vabsq_f32(V); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_setzero_ps(); + vResult = _mm_sub_ps(vResult, V); + vResult = _mm_max_ps(vResult, V); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorMod +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ + // V1 % V2 = V1 - V2 * truncate(V1 / V2) + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Quotient = XMVectorDivide(V1, V2); + Quotient = XMVectorTruncate(Quotient); + XMVECTOR Result = XMVectorNegativeMultiplySubtract(V2, Quotient, V1); + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMVECTOR vResult = XMVectorDivide(V1, V2); + vResult = XMVectorTruncate(vResult); + return vmlsq_f32(V1, vResult, V2); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_div_ps(V1, V2); + vResult = XMVectorTruncate(vResult); + return XM_FNMADD_PS(vResult, V2, V1); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorModAngles(FXMVECTOR Angles) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + XMVECTOR Result; + + // Modulo the range of the given angles such that -XM_PI <= Angles < XM_PI + V = XMVectorMultiply(Angles, g_XMReciprocalTwoPi.v); + V = XMVectorRound(V); + Result = XMVectorNegativeMultiplySubtract(g_XMTwoPi.v, V, Angles); + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Modulo the range of the given angles such that -XM_PI <= Angles < XM_PI + XMVECTOR vResult = vmulq_f32(Angles, g_XMReciprocalTwoPi); + // Use the inline function due to complexity for rounding + vResult = XMVectorRound(vResult); + return vmlsq_f32(Angles, vResult, g_XMTwoPi); +#elif defined(_XM_SSE_INTRINSICS_) + // Modulo the range of the given angles such that -XM_PI <= Angles < XM_PI + XMVECTOR vResult = _mm_mul_ps(Angles, g_XMReciprocalTwoPi); + // Use the inline function due to complexity for rounding + vResult = XMVectorRound(vResult); + return XM_FNMADD_PS(vResult, g_XMTwoPi, Angles); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorSin(FXMVECTOR V) noexcept +{ + // 11-degree minimax approximation + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + sinf(V.vector4_f32[0]), + sinf(V.vector4_f32[1]), + sinf(V.vector4_f32[2]), + sinf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Force the value within the bounds of pi + XMVECTOR x = XMVectorModAngles(V); + + // Map in [-pi/2,pi/2] with sin(y) = sin(x). + uint32x4_t sign = vandq_u32(vreinterpretq_u32_f32(x), g_XMNegativeZero); + uint32x4_t c = vorrq_u32(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 + float32x4_t absx = vabsq_f32(x); + float32x4_t rflx = vsubq_f32(vreinterpretq_f32_u32(c), x); + uint32x4_t comp = vcleq_f32(absx, g_XMHalfPi); + x = vbslq_f32(comp, x, rflx); + + float32x4_t x2 = vmulq_f32(x, x); + + // Compute polynomial approximation + const XMVECTOR SC1 = g_XMSinCoefficients1; + const XMVECTOR SC0 = g_XMSinCoefficients0; + XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(SC0), 1); + XMVECTOR Result = vmlaq_lane_f32(vConstants, x2, vget_low_f32(SC1), 0); + + vConstants = vdupq_lane_f32(vget_high_f32(SC0), 0); + Result = vmlaq_f32(vConstants, Result, x2); + + vConstants = vdupq_lane_f32(vget_low_f32(SC0), 1); + Result = vmlaq_f32(vConstants, Result, x2); + + vConstants = vdupq_lane_f32(vget_low_f32(SC0), 0); + Result = vmlaq_f32(vConstants, Result, x2); + + Result = vmlaq_f32(g_XMOne, Result, x2); + Result = vmulq_f32(Result, x); + return Result; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_sin_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + // Force the value within the bounds of pi + XMVECTOR x = XMVectorModAngles(V); + + // Map in [-pi/2,pi/2] with sin(y) = sin(x). + __m128 sign = _mm_and_ps(x, g_XMNegativeZero); + __m128 c = _mm_or_ps(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 + __m128 absx = _mm_andnot_ps(sign, x); // |x| + __m128 rflx = _mm_sub_ps(c, x); + __m128 comp = _mm_cmple_ps(absx, g_XMHalfPi); + __m128 select0 = _mm_and_ps(comp, x); + __m128 select1 = _mm_andnot_ps(comp, rflx); + x = _mm_or_ps(select0, select1); + + __m128 x2 = _mm_mul_ps(x, x); + + // Compute polynomial approximation + const XMVECTOR SC1 = g_XMSinCoefficients1; + __m128 vConstantsB = XM_PERMUTE_PS(SC1, _MM_SHUFFLE(0, 0, 0, 0)); + const XMVECTOR SC0 = g_XMSinCoefficients0; + __m128 vConstants = XM_PERMUTE_PS(SC0, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Result = XM_FMADD_PS(vConstantsB, x2, vConstants); + + vConstants = XM_PERMUTE_PS(SC0, _MM_SHUFFLE(2, 2, 2, 2)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + vConstants = XM_PERMUTE_PS(SC0, _MM_SHUFFLE(1, 1, 1, 1)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + vConstants = XM_PERMUTE_PS(SC0, _MM_SHUFFLE(0, 0, 0, 0)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + Result = XM_FMADD_PS(Result, x2, g_XMOne); + Result = _mm_mul_ps(Result, x); + return Result; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorCos(FXMVECTOR V) noexcept +{ + // 10-degree minimax approximation + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + cosf(V.vector4_f32[0]), + cosf(V.vector4_f32[1]), + cosf(V.vector4_f32[2]), + cosf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Map V to x in [-pi,pi]. + XMVECTOR x = XMVectorModAngles(V); + + // Map in [-pi/2,pi/2] with cos(y) = sign*cos(x). + uint32x4_t sign = vandq_u32(vreinterpretq_u32_f32(x), g_XMNegativeZero); + uint32x4_t c = vorrq_u32(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 + float32x4_t absx = vabsq_f32(x); + float32x4_t rflx = vsubq_f32(vreinterpretq_f32_u32(c), x); + uint32x4_t comp = vcleq_f32(absx, g_XMHalfPi); + x = vbslq_f32(comp, x, rflx); + float32x4_t fsign = vbslq_f32(comp, g_XMOne, g_XMNegativeOne); + + float32x4_t x2 = vmulq_f32(x, x); + + // Compute polynomial approximation + const XMVECTOR CC1 = g_XMCosCoefficients1; + const XMVECTOR CC0 = g_XMCosCoefficients0; + XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(CC0), 1); + XMVECTOR Result = vmlaq_lane_f32(vConstants, x2, vget_low_f32(CC1), 0); + + vConstants = vdupq_lane_f32(vget_high_f32(CC0), 0); + Result = vmlaq_f32(vConstants, Result, x2); + + vConstants = vdupq_lane_f32(vget_low_f32(CC0), 1); + Result = vmlaq_f32(vConstants, Result, x2); + + vConstants = vdupq_lane_f32(vget_low_f32(CC0), 0); + Result = vmlaq_f32(vConstants, Result, x2); + + Result = vmlaq_f32(g_XMOne, Result, x2); + Result = vmulq_f32(Result, fsign); + return Result; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_cos_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + // Map V to x in [-pi,pi]. + XMVECTOR x = XMVectorModAngles(V); + + // Map in [-pi/2,pi/2] with cos(y) = sign*cos(x). + XMVECTOR sign = _mm_and_ps(x, g_XMNegativeZero); + __m128 c = _mm_or_ps(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 + __m128 absx = _mm_andnot_ps(sign, x); // |x| + __m128 rflx = _mm_sub_ps(c, x); + __m128 comp = _mm_cmple_ps(absx, g_XMHalfPi); + __m128 select0 = _mm_and_ps(comp, x); + __m128 select1 = _mm_andnot_ps(comp, rflx); + x = _mm_or_ps(select0, select1); + select0 = _mm_and_ps(comp, g_XMOne); + select1 = _mm_andnot_ps(comp, g_XMNegativeOne); + sign = _mm_or_ps(select0, select1); + + __m128 x2 = _mm_mul_ps(x, x); + + // Compute polynomial approximation + const XMVECTOR CC1 = g_XMCosCoefficients1; + __m128 vConstantsB = XM_PERMUTE_PS(CC1, _MM_SHUFFLE(0, 0, 0, 0)); + const XMVECTOR CC0 = g_XMCosCoefficients0; + __m128 vConstants = XM_PERMUTE_PS(CC0, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Result = XM_FMADD_PS(vConstantsB, x2, vConstants); + + vConstants = XM_PERMUTE_PS(CC0, _MM_SHUFFLE(2, 2, 2, 2)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + vConstants = XM_PERMUTE_PS(CC0, _MM_SHUFFLE(1, 1, 1, 1)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + vConstants = XM_PERMUTE_PS(CC0, _MM_SHUFFLE(0, 0, 0, 0)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + Result = XM_FMADD_PS(Result, x2, g_XMOne); + Result = _mm_mul_ps(Result, sign); + return Result; +#endif +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline void XM_CALLCONV XMVectorSinCos +( + XMVECTOR* pSin, + XMVECTOR* pCos, + FXMVECTOR V +) noexcept +{ + assert(pSin != nullptr); + assert(pCos != nullptr); + + // 11/10-degree minimax approximation + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Sin = { { { + sinf(V.vector4_f32[0]), + sinf(V.vector4_f32[1]), + sinf(V.vector4_f32[2]), + sinf(V.vector4_f32[3]) + } } }; + + XMVECTORF32 Cos = { { { + cosf(V.vector4_f32[0]), + cosf(V.vector4_f32[1]), + cosf(V.vector4_f32[2]), + cosf(V.vector4_f32[3]) + } } }; + + *pSin = Sin.v; + *pCos = Cos.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Force the value within the bounds of pi + XMVECTOR x = XMVectorModAngles(V); + + // Map in [-pi/2,pi/2] with cos(y) = sign*cos(x). + uint32x4_t sign = vandq_u32(vreinterpretq_u32_f32(x), g_XMNegativeZero); + uint32x4_t c = vorrq_u32(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 + float32x4_t absx = vabsq_f32(x); + float32x4_t rflx = vsubq_f32(vreinterpretq_f32_u32(c), x); + uint32x4_t comp = vcleq_f32(absx, g_XMHalfPi); + x = vbslq_f32(comp, x, rflx); + float32x4_t fsign = vbslq_f32(comp, g_XMOne, g_XMNegativeOne); + + float32x4_t x2 = vmulq_f32(x, x); + + // Compute polynomial approximation for sine + const XMVECTOR SC1 = g_XMSinCoefficients1; + const XMVECTOR SC0 = g_XMSinCoefficients0; + XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(SC0), 1); + XMVECTOR Result = vmlaq_lane_f32(vConstants, x2, vget_low_f32(SC1), 0); + + vConstants = vdupq_lane_f32(vget_high_f32(SC0), 0); + Result = vmlaq_f32(vConstants, Result, x2); + + vConstants = vdupq_lane_f32(vget_low_f32(SC0), 1); + Result = vmlaq_f32(vConstants, Result, x2); + + vConstants = vdupq_lane_f32(vget_low_f32(SC0), 0); + Result = vmlaq_f32(vConstants, Result, x2); + + Result = vmlaq_f32(g_XMOne, Result, x2); + *pSin = vmulq_f32(Result, x); + + // Compute polynomial approximation for cosine + const XMVECTOR CC1 = g_XMCosCoefficients1; + const XMVECTOR CC0 = g_XMCosCoefficients0; + vConstants = vdupq_lane_f32(vget_high_f32(CC0), 1); + Result = vmlaq_lane_f32(vConstants, x2, vget_low_f32(CC1), 0); + + vConstants = vdupq_lane_f32(vget_high_f32(CC0), 0); + Result = vmlaq_f32(vConstants, Result, x2); + + vConstants = vdupq_lane_f32(vget_low_f32(CC0), 1); + Result = vmlaq_f32(vConstants, Result, x2); + + vConstants = vdupq_lane_f32(vget_low_f32(CC0), 0); + Result = vmlaq_f32(vConstants, Result, x2); + + Result = vmlaq_f32(g_XMOne, Result, x2); + *pCos = vmulq_f32(Result, fsign); +#elif defined(_XM_SVML_INTRINSICS_) + *pSin = _mm_sincos_ps(pCos, V); +#elif defined(_XM_SSE_INTRINSICS_) + // Force the value within the bounds of pi + XMVECTOR x = XMVectorModAngles(V); + + // Map in [-pi/2,pi/2] with sin(y) = sin(x), cos(y) = sign*cos(x). + XMVECTOR sign = _mm_and_ps(x, g_XMNegativeZero); + __m128 c = _mm_or_ps(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 + __m128 absx = _mm_andnot_ps(sign, x); // |x| + __m128 rflx = _mm_sub_ps(c, x); + __m128 comp = _mm_cmple_ps(absx, g_XMHalfPi); + __m128 select0 = _mm_and_ps(comp, x); + __m128 select1 = _mm_andnot_ps(comp, rflx); + x = _mm_or_ps(select0, select1); + select0 = _mm_and_ps(comp, g_XMOne); + select1 = _mm_andnot_ps(comp, g_XMNegativeOne); + sign = _mm_or_ps(select0, select1); + + __m128 x2 = _mm_mul_ps(x, x); + + // Compute polynomial approximation of sine + const XMVECTOR SC1 = g_XMSinCoefficients1; + __m128 vConstantsB = XM_PERMUTE_PS(SC1, _MM_SHUFFLE(0, 0, 0, 0)); + const XMVECTOR SC0 = g_XMSinCoefficients0; + __m128 vConstants = XM_PERMUTE_PS(SC0, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Result = XM_FMADD_PS(vConstantsB, x2, vConstants); + + vConstants = XM_PERMUTE_PS(SC0, _MM_SHUFFLE(2, 2, 2, 2)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + vConstants = XM_PERMUTE_PS(SC0, _MM_SHUFFLE(1, 1, 1, 1)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + vConstants = XM_PERMUTE_PS(SC0, _MM_SHUFFLE(0, 0, 0, 0)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + Result = XM_FMADD_PS(Result, x2, g_XMOne); + Result = _mm_mul_ps(Result, x); + *pSin = Result; + + // Compute polynomial approximation of cosine + const XMVECTOR CC1 = g_XMCosCoefficients1; + vConstantsB = XM_PERMUTE_PS(CC1, _MM_SHUFFLE(0, 0, 0, 0)); + const XMVECTOR CC0 = g_XMCosCoefficients0; + vConstants = XM_PERMUTE_PS(CC0, _MM_SHUFFLE(3, 3, 3, 3)); + Result = XM_FMADD_PS(vConstantsB, x2, vConstants); + + vConstants = XM_PERMUTE_PS(CC0, _MM_SHUFFLE(2, 2, 2, 2)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + vConstants = XM_PERMUTE_PS(CC0, _MM_SHUFFLE(1, 1, 1, 1)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + vConstants = XM_PERMUTE_PS(CC0, _MM_SHUFFLE(0, 0, 0, 0)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + Result = XM_FMADD_PS(Result, x2, g_XMOne); + Result = _mm_mul_ps(Result, sign); + *pCos = Result; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorTan(FXMVECTOR V) noexcept +{ + // Cody and Waite algorithm to compute tangent. + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + tanf(V.vector4_f32[0]), + tanf(V.vector4_f32[1]), + tanf(V.vector4_f32[2]), + tanf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_tan_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) + + static const XMVECTORF32 TanCoefficients0 = { { { 1.0f, -4.667168334e-1f, 2.566383229e-2f, -3.118153191e-4f } } }; + static const XMVECTORF32 TanCoefficients1 = { { { 4.981943399e-7f, -1.333835001e-1f, 3.424887824e-3f, -1.786170734e-5f } } }; + static const XMVECTORF32 TanConstants = { { { 1.570796371f, 6.077100628e-11f, 0.000244140625f, 0.63661977228f /*2 / Pi*/ } } }; + static const XMVECTORU32 Mask = { { { 0x1, 0x1, 0x1, 0x1 } } }; + + XMVECTOR TwoDivPi = XMVectorSplatW(TanConstants.v); + + XMVECTOR Zero = XMVectorZero(); + + XMVECTOR C0 = XMVectorSplatX(TanConstants.v); + XMVECTOR C1 = XMVectorSplatY(TanConstants.v); + XMVECTOR Epsilon = XMVectorSplatZ(TanConstants.v); + + XMVECTOR VA = XMVectorMultiply(V, TwoDivPi); + + VA = XMVectorRound(VA); + + XMVECTOR VC = XMVectorNegativeMultiplySubtract(VA, C0, V); + + XMVECTOR VB = XMVectorAbs(VA); + + VC = XMVectorNegativeMultiplySubtract(VA, C1, VC); + +#if defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + VB = vreinterpretq_f32_u32(vcvtq_u32_f32(VB)); +#elif defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + reinterpret_cast<__m128i*>(&VB)[0] = _mm_cvttps_epi32(VB); +#else + for (size_t i = 0; i < 4; i++) + { + VB.vector4_u32[i] = static_cast(VB.vector4_f32[i]); + } +#endif + + XMVECTOR VC2 = XMVectorMultiply(VC, VC); + + XMVECTOR T7 = XMVectorSplatW(TanCoefficients1.v); + XMVECTOR T6 = XMVectorSplatZ(TanCoefficients1.v); + XMVECTOR T4 = XMVectorSplatX(TanCoefficients1.v); + XMVECTOR T3 = XMVectorSplatW(TanCoefficients0.v); + XMVECTOR T5 = XMVectorSplatY(TanCoefficients1.v); + XMVECTOR T2 = XMVectorSplatZ(TanCoefficients0.v); + XMVECTOR T1 = XMVectorSplatY(TanCoefficients0.v); + XMVECTOR T0 = XMVectorSplatX(TanCoefficients0.v); + + XMVECTOR VBIsEven = XMVectorAndInt(VB, Mask.v); + VBIsEven = XMVectorEqualInt(VBIsEven, Zero); + + XMVECTOR N = XMVectorMultiplyAdd(VC2, T7, T6); + XMVECTOR D = XMVectorMultiplyAdd(VC2, T4, T3); + N = XMVectorMultiplyAdd(VC2, N, T5); + D = XMVectorMultiplyAdd(VC2, D, T2); + N = XMVectorMultiply(VC2, N); + D = XMVectorMultiplyAdd(VC2, D, T1); + N = XMVectorMultiplyAdd(VC, N, VC); + XMVECTOR VCNearZero = XMVectorInBounds(VC, Epsilon); + D = XMVectorMultiplyAdd(VC2, D, T0); + + N = XMVectorSelect(N, VC, VCNearZero); + D = XMVectorSelect(D, g_XMOne.v, VCNearZero); + + XMVECTOR R0 = XMVectorNegate(N); + XMVECTOR R1 = XMVectorDivide(N, D); + R0 = XMVectorDivide(D, R0); + + XMVECTOR VIsZero = XMVectorEqual(V, Zero); + + XMVECTOR Result = XMVectorSelect(R0, R1, VBIsEven); + + Result = XMVectorSelect(Result, Zero, VIsZero); + + return Result; + +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorSinH(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + sinhf(V.vector4_f32[0]), + sinhf(V.vector4_f32[1]), + sinhf(V.vector4_f32[2]), + sinhf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f } } }; // 1.0f / ln(2.0f) + + XMVECTOR V1 = vmlaq_f32(g_XMNegativeOne.v, V, Scale.v); + XMVECTOR V2 = vmlsq_f32(g_XMNegativeOne.v, V, Scale.v); + XMVECTOR E1 = XMVectorExp(V1); + XMVECTOR E2 = XMVectorExp(V2); + + return vsubq_f32(E1, E2); +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_sinh_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f } } }; // 1.0f / ln(2.0f) + + XMVECTOR V1 = XM_FMADD_PS(V, Scale, g_XMNegativeOne); + XMVECTOR V2 = XM_FNMADD_PS(V, Scale, g_XMNegativeOne); + XMVECTOR E1 = XMVectorExp(V1); + XMVECTOR E2 = XMVectorExp(V2); + + return _mm_sub_ps(E1, E2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorCosH(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + coshf(V.vector4_f32[0]), + coshf(V.vector4_f32[1]), + coshf(V.vector4_f32[2]), + coshf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f } } }; // 1.0f / ln(2.0f) + + XMVECTOR V1 = vmlaq_f32(g_XMNegativeOne.v, V, Scale.v); + XMVECTOR V2 = vmlsq_f32(g_XMNegativeOne.v, V, Scale.v); + XMVECTOR E1 = XMVectorExp(V1); + XMVECTOR E2 = XMVectorExp(V2); + return vaddq_f32(E1, E2); +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_cosh_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f } } }; // 1.0f / ln(2.0f) + + XMVECTOR V1 = XM_FMADD_PS(V, Scale.v, g_XMNegativeOne.v); + XMVECTOR V2 = XM_FNMADD_PS(V, Scale.v, g_XMNegativeOne.v); + XMVECTOR E1 = XMVectorExp(V1); + XMVECTOR E2 = XMVectorExp(V2); + return _mm_add_ps(E1, E2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorTanH(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + tanhf(V.vector4_f32[0]), + tanhf(V.vector4_f32[1]), + tanhf(V.vector4_f32[2]), + tanhf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f } } }; // 2.0f / ln(2.0f) + + XMVECTOR E = vmulq_f32(V, Scale.v); + E = XMVectorExp(E); + E = vmlaq_f32(g_XMOneHalf.v, E, g_XMOneHalf.v); + E = XMVectorReciprocal(E); + return vsubq_f32(g_XMOne.v, E); +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_tanh_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f } } }; // 2.0f / ln(2.0f) + + XMVECTOR E = _mm_mul_ps(V, Scale.v); + E = XMVectorExp(E); + E = XM_FMADD_PS(E, g_XMOneHalf.v, g_XMOneHalf.v); + E = _mm_div_ps(g_XMOne.v, E); + return _mm_sub_ps(g_XMOne.v, E); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorASin(FXMVECTOR V) noexcept +{ + // 7-degree minimax approximation + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + asinf(V.vector4_f32[0]), + asinf(V.vector4_f32[1]), + asinf(V.vector4_f32[2]), + asinf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t nonnegative = vcgeq_f32(V, g_XMZero); + float32x4_t x = vabsq_f32(V); + + // Compute (1-|V|), clamp to zero to avoid sqrt of negative number. + float32x4_t oneMValue = vsubq_f32(g_XMOne, x); + float32x4_t clampOneMValue = vmaxq_f32(g_XMZero, oneMValue); + float32x4_t root = XMVectorSqrt(clampOneMValue); + + // Compute polynomial approximation + const XMVECTOR AC1 = g_XMArcCoefficients1; + XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(AC1), 0); + XMVECTOR t0 = vmlaq_lane_f32(vConstants, x, vget_high_f32(AC1), 1); + + vConstants = vdupq_lane_f32(vget_low_f32(AC1), 1); + t0 = vmlaq_f32(vConstants, t0, x); + + vConstants = vdupq_lane_f32(vget_low_f32(AC1), 0); + t0 = vmlaq_f32(vConstants, t0, x); + + const XMVECTOR AC0 = g_XMArcCoefficients0; + vConstants = vdupq_lane_f32(vget_high_f32(AC0), 1); + t0 = vmlaq_f32(vConstants, t0, x); + + vConstants = vdupq_lane_f32(vget_high_f32(AC0), 0); + t0 = vmlaq_f32(vConstants, t0, x); + + vConstants = vdupq_lane_f32(vget_low_f32(AC0), 1); + t0 = vmlaq_f32(vConstants, t0, x); + + vConstants = vdupq_lane_f32(vget_low_f32(AC0), 0); + t0 = vmlaq_f32(vConstants, t0, x); + t0 = vmulq_f32(t0, root); + + float32x4_t t1 = vsubq_f32(g_XMPi, t0); + t0 = vbslq_f32(nonnegative, t0, t1); + t0 = vsubq_f32(g_XMHalfPi, t0); + return t0; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_asin_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + __m128 nonnegative = _mm_cmpge_ps(V, g_XMZero); + __m128 mvalue = _mm_sub_ps(g_XMZero, V); + __m128 x = _mm_max_ps(V, mvalue); // |V| + + // Compute (1-|V|), clamp to zero to avoid sqrt of negative number. + __m128 oneMValue = _mm_sub_ps(g_XMOne, x); + __m128 clampOneMValue = _mm_max_ps(g_XMZero, oneMValue); + __m128 root = _mm_sqrt_ps(clampOneMValue); // sqrt(1-|V|) + + // Compute polynomial approximation + const XMVECTOR AC1 = g_XMArcCoefficients1; + __m128 vConstantsB = XM_PERMUTE_PS(AC1, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 vConstants = XM_PERMUTE_PS(AC1, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 t0 = XM_FMADD_PS(vConstantsB, x, vConstants); + + vConstants = XM_PERMUTE_PS(AC1, _MM_SHUFFLE(1, 1, 1, 1)); + t0 = XM_FMADD_PS(t0, x, vConstants); + + vConstants = XM_PERMUTE_PS(AC1, _MM_SHUFFLE(0, 0, 0, 0)); + t0 = XM_FMADD_PS(t0, x, vConstants); + + const XMVECTOR AC0 = g_XMArcCoefficients0; + vConstants = XM_PERMUTE_PS(AC0, _MM_SHUFFLE(3, 3, 3, 3)); + t0 = XM_FMADD_PS(t0, x, vConstants); + + vConstants = XM_PERMUTE_PS(AC0, _MM_SHUFFLE(2, 2, 2, 2)); + t0 = XM_FMADD_PS(t0, x, vConstants); + + vConstants = XM_PERMUTE_PS(AC0, _MM_SHUFFLE(1, 1, 1, 1)); + t0 = XM_FMADD_PS(t0, x, vConstants); + + vConstants = XM_PERMUTE_PS(AC0, _MM_SHUFFLE(0, 0, 0, 0)); + t0 = XM_FMADD_PS(t0, x, vConstants); + t0 = _mm_mul_ps(t0, root); + + __m128 t1 = _mm_sub_ps(g_XMPi, t0); + t0 = _mm_and_ps(nonnegative, t0); + t1 = _mm_andnot_ps(nonnegative, t1); + t0 = _mm_or_ps(t0, t1); + t0 = _mm_sub_ps(g_XMHalfPi, t0); + return t0; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorACos(FXMVECTOR V) noexcept +{ + // 7-degree minimax approximation + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + acosf(V.vector4_f32[0]), + acosf(V.vector4_f32[1]), + acosf(V.vector4_f32[2]), + acosf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t nonnegative = vcgeq_f32(V, g_XMZero); + float32x4_t x = vabsq_f32(V); + + // Compute (1-|V|), clamp to zero to avoid sqrt of negative number. + float32x4_t oneMValue = vsubq_f32(g_XMOne, x); + float32x4_t clampOneMValue = vmaxq_f32(g_XMZero, oneMValue); + float32x4_t root = XMVectorSqrt(clampOneMValue); + + // Compute polynomial approximation + const XMVECTOR AC1 = g_XMArcCoefficients1; + XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(AC1), 0); + XMVECTOR t0 = vmlaq_lane_f32(vConstants, x, vget_high_f32(AC1), 1); + + vConstants = vdupq_lane_f32(vget_low_f32(AC1), 1); + t0 = vmlaq_f32(vConstants, t0, x); + + vConstants = vdupq_lane_f32(vget_low_f32(AC1), 0); + t0 = vmlaq_f32(vConstants, t0, x); + + const XMVECTOR AC0 = g_XMArcCoefficients0; + vConstants = vdupq_lane_f32(vget_high_f32(AC0), 1); + t0 = vmlaq_f32(vConstants, t0, x); + + vConstants = vdupq_lane_f32(vget_high_f32(AC0), 0); + t0 = vmlaq_f32(vConstants, t0, x); + + vConstants = vdupq_lane_f32(vget_low_f32(AC0), 1); + t0 = vmlaq_f32(vConstants, t0, x); + + vConstants = vdupq_lane_f32(vget_low_f32(AC0), 0); + t0 = vmlaq_f32(vConstants, t0, x); + t0 = vmulq_f32(t0, root); + + float32x4_t t1 = vsubq_f32(g_XMPi, t0); + t0 = vbslq_f32(nonnegative, t0, t1); + return t0; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_acos_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + __m128 nonnegative = _mm_cmpge_ps(V, g_XMZero); + __m128 mvalue = _mm_sub_ps(g_XMZero, V); + __m128 x = _mm_max_ps(V, mvalue); // |V| + + // Compute (1-|V|), clamp to zero to avoid sqrt of negative number. + __m128 oneMValue = _mm_sub_ps(g_XMOne, x); + __m128 clampOneMValue = _mm_max_ps(g_XMZero, oneMValue); + __m128 root = _mm_sqrt_ps(clampOneMValue); // sqrt(1-|V|) + + // Compute polynomial approximation + const XMVECTOR AC1 = g_XMArcCoefficients1; + __m128 vConstantsB = XM_PERMUTE_PS(AC1, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 vConstants = XM_PERMUTE_PS(AC1, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 t0 = XM_FMADD_PS(vConstantsB, x, vConstants); + + vConstants = XM_PERMUTE_PS(AC1, _MM_SHUFFLE(1, 1, 1, 1)); + t0 = XM_FMADD_PS(t0, x, vConstants); + + vConstants = XM_PERMUTE_PS(AC1, _MM_SHUFFLE(0, 0, 0, 0)); + t0 = XM_FMADD_PS(t0, x, vConstants); + + const XMVECTOR AC0 = g_XMArcCoefficients0; + vConstants = XM_PERMUTE_PS(AC0, _MM_SHUFFLE(3, 3, 3, 3)); + t0 = XM_FMADD_PS(t0, x, vConstants); + + vConstants = XM_PERMUTE_PS(AC0, _MM_SHUFFLE(2, 2, 2, 2)); + t0 = XM_FMADD_PS(t0, x, vConstants); + + vConstants = XM_PERMUTE_PS(AC0, _MM_SHUFFLE(1, 1, 1, 1)); + t0 = XM_FMADD_PS(t0, x, vConstants); + + vConstants = XM_PERMUTE_PS(AC0, _MM_SHUFFLE(0, 0, 0, 0)); + t0 = XM_FMADD_PS(t0, x, vConstants); + t0 = _mm_mul_ps(t0, root); + + __m128 t1 = _mm_sub_ps(g_XMPi, t0); + t0 = _mm_and_ps(nonnegative, t0); + t1 = _mm_andnot_ps(nonnegative, t1); + t0 = _mm_or_ps(t0, t1); + return t0; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorATan(FXMVECTOR V) noexcept +{ + // 17-degree minimax approximation + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + atanf(V.vector4_f32[0]), + atanf(V.vector4_f32[1]), + atanf(V.vector4_f32[2]), + atanf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t absV = vabsq_f32(V); + float32x4_t invV = XMVectorReciprocal(V); + uint32x4_t comp = vcgtq_f32(V, g_XMOne); + float32x4_t sign = vbslq_f32(comp, g_XMOne, g_XMNegativeOne); + comp = vcleq_f32(absV, g_XMOne); + sign = vbslq_f32(comp, g_XMZero, sign); + float32x4_t x = vbslq_f32(comp, V, invV); + + float32x4_t x2 = vmulq_f32(x, x); + + // Compute polynomial approximation + const XMVECTOR TC1 = g_XMATanCoefficients1; + XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(TC1), 0); + XMVECTOR Result = vmlaq_lane_f32(vConstants, x2, vget_high_f32(TC1), 1); + + vConstants = vdupq_lane_f32(vget_low_f32(TC1), 1); + Result = vmlaq_f32(vConstants, Result, x2); + + vConstants = vdupq_lane_f32(vget_low_f32(TC1), 0); + Result = vmlaq_f32(vConstants, Result, x2); + + const XMVECTOR TC0 = g_XMATanCoefficients0; + vConstants = vdupq_lane_f32(vget_high_f32(TC0), 1); + Result = vmlaq_f32(vConstants, Result, x2); + + vConstants = vdupq_lane_f32(vget_high_f32(TC0), 0); + Result = vmlaq_f32(vConstants, Result, x2); + + vConstants = vdupq_lane_f32(vget_low_f32(TC0), 1); + Result = vmlaq_f32(vConstants, Result, x2); + + vConstants = vdupq_lane_f32(vget_low_f32(TC0), 0); + Result = vmlaq_f32(vConstants, Result, x2); + + Result = vmlaq_f32(g_XMOne, Result, x2); + Result = vmulq_f32(Result, x); + + float32x4_t result1 = vmulq_f32(sign, g_XMHalfPi); + result1 = vsubq_f32(result1, Result); + + comp = vceqq_f32(sign, g_XMZero); + Result = vbslq_f32(comp, Result, result1); + return Result; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_atan_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + __m128 absV = XMVectorAbs(V); + __m128 invV = _mm_div_ps(g_XMOne, V); + __m128 comp = _mm_cmpgt_ps(V, g_XMOne); + __m128 select0 = _mm_and_ps(comp, g_XMOne); + __m128 select1 = _mm_andnot_ps(comp, g_XMNegativeOne); + __m128 sign = _mm_or_ps(select0, select1); + comp = _mm_cmple_ps(absV, g_XMOne); + select0 = _mm_and_ps(comp, g_XMZero); + select1 = _mm_andnot_ps(comp, sign); + sign = _mm_or_ps(select0, select1); + select0 = _mm_and_ps(comp, V); + select1 = _mm_andnot_ps(comp, invV); + __m128 x = _mm_or_ps(select0, select1); + + __m128 x2 = _mm_mul_ps(x, x); + + // Compute polynomial approximation + const XMVECTOR TC1 = g_XMATanCoefficients1; + __m128 vConstantsB = XM_PERMUTE_PS(TC1, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 vConstants = XM_PERMUTE_PS(TC1, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Result = XM_FMADD_PS(vConstantsB, x2, vConstants); + + vConstants = XM_PERMUTE_PS(TC1, _MM_SHUFFLE(1, 1, 1, 1)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + vConstants = XM_PERMUTE_PS(TC1, _MM_SHUFFLE(0, 0, 0, 0)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + const XMVECTOR TC0 = g_XMATanCoefficients0; + vConstants = XM_PERMUTE_PS(TC0, _MM_SHUFFLE(3, 3, 3, 3)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + vConstants = XM_PERMUTE_PS(TC0, _MM_SHUFFLE(2, 2, 2, 2)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + vConstants = XM_PERMUTE_PS(TC0, _MM_SHUFFLE(1, 1, 1, 1)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + vConstants = XM_PERMUTE_PS(TC0, _MM_SHUFFLE(0, 0, 0, 0)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + Result = XM_FMADD_PS(Result, x2, g_XMOne); + + Result = _mm_mul_ps(Result, x); + __m128 result1 = _mm_mul_ps(sign, g_XMHalfPi); + result1 = _mm_sub_ps(result1, Result); + + comp = _mm_cmpeq_ps(sign, g_XMZero); + select0 = _mm_and_ps(comp, Result); + select1 = _mm_andnot_ps(comp, result1); + Result = _mm_or_ps(select0, select1); + return Result; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorATan2 +( + FXMVECTOR Y, + FXMVECTOR X +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + atan2f(Y.vector4_f32[0], X.vector4_f32[0]), + atan2f(Y.vector4_f32[1], X.vector4_f32[1]), + atan2f(Y.vector4_f32[2], X.vector4_f32[2]), + atan2f(Y.vector4_f32[3], X.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_atan2_ps(Y, X); + return Result; +#else + + // Return the inverse tangent of Y / X in the range of -Pi to Pi with the following exceptions: + + // Y == 0 and X is Negative -> Pi with the sign of Y + // y == 0 and x is positive -> 0 with the sign of y + // Y != 0 and X == 0 -> Pi / 2 with the sign of Y + // Y != 0 and X is Negative -> atan(y/x) + (PI with the sign of Y) + // X == -Infinity and Finite Y -> Pi with the sign of Y + // X == +Infinity and Finite Y -> 0 with the sign of Y + // Y == Infinity and X is Finite -> Pi / 2 with the sign of Y + // Y == Infinity and X == -Infinity -> 3Pi / 4 with the sign of Y + // Y == Infinity and X == +Infinity -> Pi / 4 with the sign of Y + + static const XMVECTORF32 ATan2Constants = { { { XM_PI, XM_PIDIV2, XM_PIDIV4, XM_PI * 3.0f / 4.0f } } }; + + XMVECTOR Zero = XMVectorZero(); + XMVECTOR ATanResultValid = XMVectorTrueInt(); + + XMVECTOR Pi = XMVectorSplatX(ATan2Constants); + XMVECTOR PiOverTwo = XMVectorSplatY(ATan2Constants); + XMVECTOR PiOverFour = XMVectorSplatZ(ATan2Constants); + XMVECTOR ThreePiOverFour = XMVectorSplatW(ATan2Constants); + + XMVECTOR YEqualsZero = XMVectorEqual(Y, Zero); + XMVECTOR XEqualsZero = XMVectorEqual(X, Zero); + XMVECTOR XIsPositive = XMVectorAndInt(X, g_XMNegativeZero.v); + XIsPositive = XMVectorEqualInt(XIsPositive, Zero); + XMVECTOR YEqualsInfinity = XMVectorIsInfinite(Y); + XMVECTOR XEqualsInfinity = XMVectorIsInfinite(X); + + XMVECTOR YSign = XMVectorAndInt(Y, g_XMNegativeZero.v); + Pi = XMVectorOrInt(Pi, YSign); + PiOverTwo = XMVectorOrInt(PiOverTwo, YSign); + PiOverFour = XMVectorOrInt(PiOverFour, YSign); + ThreePiOverFour = XMVectorOrInt(ThreePiOverFour, YSign); + + XMVECTOR R1 = XMVectorSelect(Pi, YSign, XIsPositive); + XMVECTOR R2 = XMVectorSelect(ATanResultValid, PiOverTwo, XEqualsZero); + XMVECTOR R3 = XMVectorSelect(R2, R1, YEqualsZero); + XMVECTOR R4 = XMVectorSelect(ThreePiOverFour, PiOverFour, XIsPositive); + XMVECTOR R5 = XMVectorSelect(PiOverTwo, R4, XEqualsInfinity); + XMVECTOR Result = XMVectorSelect(R3, R5, YEqualsInfinity); + ATanResultValid = XMVectorEqualInt(Result, ATanResultValid); + + XMVECTOR V = XMVectorDivide(Y, X); + + XMVECTOR R0 = XMVectorATan(V); + + R1 = XMVectorSelect(Pi, g_XMNegativeZero, XIsPositive); + R2 = XMVectorAdd(R0, R1); + + return XMVectorSelect(Result, R2, ATanResultValid); + +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorSinEst(FXMVECTOR V) noexcept +{ + // 7-degree minimax approximation + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + sinf(V.vector4_f32[0]), + sinf(V.vector4_f32[1]), + sinf(V.vector4_f32[2]), + sinf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Force the value within the bounds of pi + XMVECTOR x = XMVectorModAngles(V); + + // Map in [-pi/2,pi/2] with sin(y) = sin(x). + uint32x4_t sign = vandq_u32(vreinterpretq_u32_f32(x), g_XMNegativeZero); + uint32x4_t c = vorrq_u32(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 + float32x4_t absx = vabsq_f32(x); + float32x4_t rflx = vsubq_f32(vreinterpretq_f32_u32(c), x); + uint32x4_t comp = vcleq_f32(absx, g_XMHalfPi); + x = vbslq_f32(comp, x, rflx); + + float32x4_t x2 = vmulq_f32(x, x); + + // Compute polynomial approximation + const XMVECTOR SEC = g_XMSinCoefficients1; + XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(SEC), 0); + XMVECTOR Result = vmlaq_lane_f32(vConstants, x2, vget_high_f32(SEC), 1); + + vConstants = vdupq_lane_f32(vget_low_f32(SEC), 1); + Result = vmlaq_f32(vConstants, Result, x2); + + Result = vmlaq_f32(g_XMOne, Result, x2); + Result = vmulq_f32(Result, x); + return Result; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_sin_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + // Force the value within the bounds of pi + XMVECTOR x = XMVectorModAngles(V); + + // Map in [-pi/2,pi/2] with sin(y) = sin(x). + __m128 sign = _mm_and_ps(x, g_XMNegativeZero); + __m128 c = _mm_or_ps(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 + __m128 absx = _mm_andnot_ps(sign, x); // |x| + __m128 rflx = _mm_sub_ps(c, x); + __m128 comp = _mm_cmple_ps(absx, g_XMHalfPi); + __m128 select0 = _mm_and_ps(comp, x); + __m128 select1 = _mm_andnot_ps(comp, rflx); + x = _mm_or_ps(select0, select1); + + __m128 x2 = _mm_mul_ps(x, x); + + // Compute polynomial approximation + const XMVECTOR SEC = g_XMSinCoefficients1; + __m128 vConstantsB = XM_PERMUTE_PS(SEC, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 vConstants = XM_PERMUTE_PS(SEC, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Result = XM_FMADD_PS(vConstantsB, x2, vConstants); + + vConstants = XM_PERMUTE_PS(SEC, _MM_SHUFFLE(1, 1, 1, 1)); + Result = XM_FMADD_PS(Result, x2, vConstants); + Result = XM_FMADD_PS(Result, x2, g_XMOne); + Result = _mm_mul_ps(Result, x); + return Result; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorCosEst(FXMVECTOR V) noexcept +{ + // 6-degree minimax approximation + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + cosf(V.vector4_f32[0]), + cosf(V.vector4_f32[1]), + cosf(V.vector4_f32[2]), + cosf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Map V to x in [-pi,pi]. + XMVECTOR x = XMVectorModAngles(V); + + // Map in [-pi/2,pi/2] with cos(y) = sign*cos(x). + uint32x4_t sign = vandq_u32(vreinterpretq_u32_f32(x), g_XMNegativeZero); + uint32x4_t c = vorrq_u32(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 + float32x4_t absx = vabsq_f32(x); + float32x4_t rflx = vsubq_f32(vreinterpretq_f32_u32(c), x); + uint32x4_t comp = vcleq_f32(absx, g_XMHalfPi); + x = vbslq_f32(comp, x, rflx); + float32x4_t fsign = vbslq_f32(comp, g_XMOne, g_XMNegativeOne); + + float32x4_t x2 = vmulq_f32(x, x); + + // Compute polynomial approximation + const XMVECTOR CEC = g_XMCosCoefficients1; + XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(CEC), 0); + XMVECTOR Result = vmlaq_lane_f32(vConstants, x2, vget_high_f32(CEC), 1); + + vConstants = vdupq_lane_f32(vget_low_f32(CEC), 1); + Result = vmlaq_f32(vConstants, Result, x2); + + Result = vmlaq_f32(g_XMOne, Result, x2); + Result = vmulq_f32(Result, fsign); + return Result; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_cos_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + // Map V to x in [-pi,pi]. + XMVECTOR x = XMVectorModAngles(V); + + // Map in [-pi/2,pi/2] with cos(y) = sign*cos(x). + XMVECTOR sign = _mm_and_ps(x, g_XMNegativeZero); + __m128 c = _mm_or_ps(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 + __m128 absx = _mm_andnot_ps(sign, x); // |x| + __m128 rflx = _mm_sub_ps(c, x); + __m128 comp = _mm_cmple_ps(absx, g_XMHalfPi); + __m128 select0 = _mm_and_ps(comp, x); + __m128 select1 = _mm_andnot_ps(comp, rflx); + x = _mm_or_ps(select0, select1); + select0 = _mm_and_ps(comp, g_XMOne); + select1 = _mm_andnot_ps(comp, g_XMNegativeOne); + sign = _mm_or_ps(select0, select1); + + __m128 x2 = _mm_mul_ps(x, x); + + // Compute polynomial approximation + const XMVECTOR CEC = g_XMCosCoefficients1; + __m128 vConstantsB = XM_PERMUTE_PS(CEC, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 vConstants = XM_PERMUTE_PS(CEC, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Result = XM_FMADD_PS(vConstantsB, x2, vConstants); + + vConstants = XM_PERMUTE_PS(CEC, _MM_SHUFFLE(1, 1, 1, 1)); + Result = XM_FMADD_PS(Result, x2, vConstants); + Result = XM_FMADD_PS(Result, x2, g_XMOne); + Result = _mm_mul_ps(Result, sign); + return Result; +#endif +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline void XM_CALLCONV XMVectorSinCosEst +( + XMVECTOR* pSin, + XMVECTOR* pCos, + FXMVECTOR V +) noexcept +{ + assert(pSin != nullptr); + assert(pCos != nullptr); + + // 7/6-degree minimax approximation + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Sin = { { { + sinf(V.vector4_f32[0]), + sinf(V.vector4_f32[1]), + sinf(V.vector4_f32[2]), + sinf(V.vector4_f32[3]) + } } }; + + XMVECTORF32 Cos = { { { + cosf(V.vector4_f32[0]), + cosf(V.vector4_f32[1]), + cosf(V.vector4_f32[2]), + cosf(V.vector4_f32[3]) + } } }; + + *pSin = Sin.v; + *pCos = Cos.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Force the value within the bounds of pi + XMVECTOR x = XMVectorModAngles(V); + + // Map in [-pi/2,pi/2] with cos(y) = sign*cos(x). + uint32x4_t sign = vandq_u32(vreinterpretq_u32_f32(x), g_XMNegativeZero); + uint32x4_t c = vorrq_u32(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 + float32x4_t absx = vabsq_f32(x); + float32x4_t rflx = vsubq_f32(vreinterpretq_f32_u32(c), x); + uint32x4_t comp = vcleq_f32(absx, g_XMHalfPi); + x = vbslq_f32(comp, x, rflx); + float32x4_t fsign = vbslq_f32(comp, g_XMOne, g_XMNegativeOne); + + float32x4_t x2 = vmulq_f32(x, x); + + // Compute polynomial approximation for sine + const XMVECTOR SEC = g_XMSinCoefficients1; + XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(SEC), 0); + XMVECTOR Result = vmlaq_lane_f32(vConstants, x2, vget_high_f32(SEC), 1); + + vConstants = vdupq_lane_f32(vget_low_f32(SEC), 1); + Result = vmlaq_f32(vConstants, Result, x2); + + Result = vmlaq_f32(g_XMOne, Result, x2); + *pSin = vmulq_f32(Result, x); + + // Compute polynomial approximation + const XMVECTOR CEC = g_XMCosCoefficients1; + vConstants = vdupq_lane_f32(vget_high_f32(CEC), 0); + Result = vmlaq_lane_f32(vConstants, x2, vget_high_f32(CEC), 1); + + vConstants = vdupq_lane_f32(vget_low_f32(CEC), 1); + Result = vmlaq_f32(vConstants, Result, x2); + + Result = vmlaq_f32(g_XMOne, Result, x2); + *pCos = vmulq_f32(Result, fsign); +#elif defined(_XM_SSE_INTRINSICS_) + // Force the value within the bounds of pi + XMVECTOR x = XMVectorModAngles(V); + + // Map in [-pi/2,pi/2] with sin(y) = sin(x), cos(y) = sign*cos(x). + XMVECTOR sign = _mm_and_ps(x, g_XMNegativeZero); + __m128 c = _mm_or_ps(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 + __m128 absx = _mm_andnot_ps(sign, x); // |x| + __m128 rflx = _mm_sub_ps(c, x); + __m128 comp = _mm_cmple_ps(absx, g_XMHalfPi); + __m128 select0 = _mm_and_ps(comp, x); + __m128 select1 = _mm_andnot_ps(comp, rflx); + x = _mm_or_ps(select0, select1); + select0 = _mm_and_ps(comp, g_XMOne); + select1 = _mm_andnot_ps(comp, g_XMNegativeOne); + sign = _mm_or_ps(select0, select1); + + __m128 x2 = _mm_mul_ps(x, x); + + // Compute polynomial approximation for sine + const XMVECTOR SEC = g_XMSinCoefficients1; + __m128 vConstantsB = XM_PERMUTE_PS(SEC, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 vConstants = XM_PERMUTE_PS(SEC, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Result = XM_FMADD_PS(vConstantsB, x2, vConstants); + + vConstants = XM_PERMUTE_PS(SEC, _MM_SHUFFLE(1, 1, 1, 1)); + Result = XM_FMADD_PS(Result, x2, vConstants); + Result = XM_FMADD_PS(Result, x2, g_XMOne); + Result = _mm_mul_ps(Result, x); + *pSin = Result; + + // Compute polynomial approximation for cosine + const XMVECTOR CEC = g_XMCosCoefficients1; + vConstantsB = XM_PERMUTE_PS(CEC, _MM_SHUFFLE(3, 3, 3, 3)); + vConstants = XM_PERMUTE_PS(CEC, _MM_SHUFFLE(2, 2, 2, 2)); + Result = XM_FMADD_PS(vConstantsB, x2, vConstants); + + vConstants = XM_PERMUTE_PS(CEC, _MM_SHUFFLE(1, 1, 1, 1)); + Result = XM_FMADD_PS(Result, x2, vConstants); + Result = XM_FMADD_PS(Result, x2, g_XMOne); + Result = _mm_mul_ps(Result, sign); + *pCos = Result; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorTanEst(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + tanf(V.vector4_f32[0]), + tanf(V.vector4_f32[1]), + tanf(V.vector4_f32[2]), + tanf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_tan_ps(V); + return Result; +#else + + XMVECTOR OneOverPi = XMVectorSplatW(g_XMTanEstCoefficients.v); + + XMVECTOR V1 = XMVectorMultiply(V, OneOverPi); + V1 = XMVectorRound(V1); + + V1 = XMVectorNegativeMultiplySubtract(g_XMPi.v, V1, V); + + XMVECTOR T0 = XMVectorSplatX(g_XMTanEstCoefficients.v); + XMVECTOR T1 = XMVectorSplatY(g_XMTanEstCoefficients.v); + XMVECTOR T2 = XMVectorSplatZ(g_XMTanEstCoefficients.v); + + XMVECTOR V2T2 = XMVectorNegativeMultiplySubtract(V1, V1, T2); + XMVECTOR V2 = XMVectorMultiply(V1, V1); + XMVECTOR V1T0 = XMVectorMultiply(V1, T0); + XMVECTOR V1T1 = XMVectorMultiply(V1, T1); + + XMVECTOR D = XMVectorReciprocalEst(V2T2); + XMVECTOR N = XMVectorMultiplyAdd(V2, V1T1, V1T0); + + return XMVectorMultiply(N, D); + +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorASinEst(FXMVECTOR V) noexcept +{ + // 3-degree minimax approximation + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result; + Result.f[0] = asinf(V.vector4_f32[0]); + Result.f[1] = asinf(V.vector4_f32[1]); + Result.f[2] = asinf(V.vector4_f32[2]); + Result.f[3] = asinf(V.vector4_f32[3]); + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t nonnegative = vcgeq_f32(V, g_XMZero); + float32x4_t x = vabsq_f32(V); + + // Compute (1-|V|), clamp to zero to avoid sqrt of negative number. + float32x4_t oneMValue = vsubq_f32(g_XMOne, x); + float32x4_t clampOneMValue = vmaxq_f32(g_XMZero, oneMValue); + float32x4_t root = XMVectorSqrt(clampOneMValue); + + // Compute polynomial approximation + const XMVECTOR AEC = g_XMArcEstCoefficients; + XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(AEC), 0); + XMVECTOR t0 = vmlaq_lane_f32(vConstants, x, vget_high_f32(AEC), 1); + + vConstants = vdupq_lane_f32(vget_low_f32(AEC), 1); + t0 = vmlaq_f32(vConstants, t0, x); + + vConstants = vdupq_lane_f32(vget_low_f32(AEC), 0); + t0 = vmlaq_f32(vConstants, t0, x); + t0 = vmulq_f32(t0, root); + + float32x4_t t1 = vsubq_f32(g_XMPi, t0); + t0 = vbslq_f32(nonnegative, t0, t1); + t0 = vsubq_f32(g_XMHalfPi, t0); + return t0; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_asin_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + __m128 nonnegative = _mm_cmpge_ps(V, g_XMZero); + __m128 mvalue = _mm_sub_ps(g_XMZero, V); + __m128 x = _mm_max_ps(V, mvalue); // |V| + + // Compute (1-|V|), clamp to zero to avoid sqrt of negative number. + __m128 oneMValue = _mm_sub_ps(g_XMOne, x); + __m128 clampOneMValue = _mm_max_ps(g_XMZero, oneMValue); + __m128 root = _mm_sqrt_ps(clampOneMValue); // sqrt(1-|V|) + + // Compute polynomial approximation + const XMVECTOR AEC = g_XMArcEstCoefficients; + __m128 vConstantsB = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 t0 = XM_FMADD_PS(vConstantsB, x, vConstants); + + vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(1, 1, 1, 1)); + t0 = XM_FMADD_PS(t0, x, vConstants); + + vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(0, 0, 0, 0)); + t0 = XM_FMADD_PS(t0, x, vConstants); + t0 = _mm_mul_ps(t0, root); + + __m128 t1 = _mm_sub_ps(g_XMPi, t0); + t0 = _mm_and_ps(nonnegative, t0); + t1 = _mm_andnot_ps(nonnegative, t1); + t0 = _mm_or_ps(t0, t1); + t0 = _mm_sub_ps(g_XMHalfPi, t0); + return t0; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorACosEst(FXMVECTOR V) noexcept +{ + // 3-degree minimax approximation + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + acosf(V.vector4_f32[0]), + acosf(V.vector4_f32[1]), + acosf(V.vector4_f32[2]), + acosf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t nonnegative = vcgeq_f32(V, g_XMZero); + float32x4_t x = vabsq_f32(V); + + // Compute (1-|V|), clamp to zero to avoid sqrt of negative number. + float32x4_t oneMValue = vsubq_f32(g_XMOne, x); + float32x4_t clampOneMValue = vmaxq_f32(g_XMZero, oneMValue); + float32x4_t root = XMVectorSqrt(clampOneMValue); + + // Compute polynomial approximation + const XMVECTOR AEC = g_XMArcEstCoefficients; + XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(AEC), 0); + XMVECTOR t0 = vmlaq_lane_f32(vConstants, x, vget_high_f32(AEC), 1); + + vConstants = vdupq_lane_f32(vget_low_f32(AEC), 1); + t0 = vmlaq_f32(vConstants, t0, x); + + vConstants = vdupq_lane_f32(vget_low_f32(AEC), 0); + t0 = vmlaq_f32(vConstants, t0, x); + t0 = vmulq_f32(t0, root); + + float32x4_t t1 = vsubq_f32(g_XMPi, t0); + t0 = vbslq_f32(nonnegative, t0, t1); + return t0; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_acos_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + __m128 nonnegative = _mm_cmpge_ps(V, g_XMZero); + __m128 mvalue = _mm_sub_ps(g_XMZero, V); + __m128 x = _mm_max_ps(V, mvalue); // |V| + + // Compute (1-|V|), clamp to zero to avoid sqrt of negative number. + __m128 oneMValue = _mm_sub_ps(g_XMOne, x); + __m128 clampOneMValue = _mm_max_ps(g_XMZero, oneMValue); + __m128 root = _mm_sqrt_ps(clampOneMValue); // sqrt(1-|V|) + + // Compute polynomial approximation + const XMVECTOR AEC = g_XMArcEstCoefficients; + __m128 vConstantsB = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 t0 = XM_FMADD_PS(vConstantsB, x, vConstants); + + vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(1, 1, 1, 1)); + t0 = XM_FMADD_PS(t0, x, vConstants); + + vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(0, 0, 0, 0)); + t0 = XM_FMADD_PS(t0, x, vConstants); + t0 = _mm_mul_ps(t0, root); + + __m128 t1 = _mm_sub_ps(g_XMPi, t0); + t0 = _mm_and_ps(nonnegative, t0); + t1 = _mm_andnot_ps(nonnegative, t1); + t0 = _mm_or_ps(t0, t1); + return t0; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorATanEst(FXMVECTOR V) noexcept +{ + // 9-degree minimax approximation + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + atanf(V.vector4_f32[0]), + atanf(V.vector4_f32[1]), + atanf(V.vector4_f32[2]), + atanf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t absV = vabsq_f32(V); + float32x4_t invV = XMVectorReciprocalEst(V); + uint32x4_t comp = vcgtq_f32(V, g_XMOne); + float32x4_t sign = vbslq_f32(comp, g_XMOne, g_XMNegativeOne); + comp = vcleq_f32(absV, g_XMOne); + sign = vbslq_f32(comp, g_XMZero, sign); + float32x4_t x = vbslq_f32(comp, V, invV); + + float32x4_t x2 = vmulq_f32(x, x); + + // Compute polynomial approximation + const XMVECTOR AEC = g_XMATanEstCoefficients1; + XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(AEC), 0); + XMVECTOR Result = vmlaq_lane_f32(vConstants, x2, vget_high_f32(AEC), 1); + + vConstants = vdupq_lane_f32(vget_low_f32(AEC), 1); + Result = vmlaq_f32(vConstants, Result, x2); + + vConstants = vdupq_lane_f32(vget_low_f32(AEC), 0); + Result = vmlaq_f32(vConstants, Result, x2); + + // ATanEstCoefficients0 is already splatted + Result = vmlaq_f32(g_XMATanEstCoefficients0, Result, x2); + Result = vmulq_f32(Result, x); + + float32x4_t result1 = vmulq_f32(sign, g_XMHalfPi); + result1 = vsubq_f32(result1, Result); + + comp = vceqq_f32(sign, g_XMZero); + Result = vbslq_f32(comp, Result, result1); + return Result; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_atan_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + __m128 absV = XMVectorAbs(V); + __m128 invV = _mm_div_ps(g_XMOne, V); + __m128 comp = _mm_cmpgt_ps(V, g_XMOne); + __m128 select0 = _mm_and_ps(comp, g_XMOne); + __m128 select1 = _mm_andnot_ps(comp, g_XMNegativeOne); + __m128 sign = _mm_or_ps(select0, select1); + comp = _mm_cmple_ps(absV, g_XMOne); + select0 = _mm_and_ps(comp, g_XMZero); + select1 = _mm_andnot_ps(comp, sign); + sign = _mm_or_ps(select0, select1); + select0 = _mm_and_ps(comp, V); + select1 = _mm_andnot_ps(comp, invV); + __m128 x = _mm_or_ps(select0, select1); + + __m128 x2 = _mm_mul_ps(x, x); + + // Compute polynomial approximation + const XMVECTOR AEC = g_XMATanEstCoefficients1; + __m128 vConstantsB = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Result = XM_FMADD_PS(vConstantsB, x2, vConstants); + + vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(1, 1, 1, 1)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(0, 0, 0, 0)); + Result = XM_FMADD_PS(Result, x2, vConstants); + // ATanEstCoefficients0 is already splatted + Result = XM_FMADD_PS(Result, x2, g_XMATanEstCoefficients0); + Result = _mm_mul_ps(Result, x); + __m128 result1 = _mm_mul_ps(sign, g_XMHalfPi); + result1 = _mm_sub_ps(result1, Result); + + comp = _mm_cmpeq_ps(sign, g_XMZero); + select0 = _mm_and_ps(comp, Result); + select1 = _mm_andnot_ps(comp, result1); + Result = _mm_or_ps(select0, select1); + return Result; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorATan2Est +( + FXMVECTOR Y, + FXMVECTOR X +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + atan2f(Y.vector4_f32[0], X.vector4_f32[0]), + atan2f(Y.vector4_f32[1], X.vector4_f32[1]), + atan2f(Y.vector4_f32[2], X.vector4_f32[2]), + atan2f(Y.vector4_f32[3], X.vector4_f32[3]), + } } }; + return Result.v; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_atan2_ps(Y, X); + return Result; +#else + + static const XMVECTORF32 ATan2Constants = { { { XM_PI, XM_PIDIV2, XM_PIDIV4, 2.3561944905f /* Pi*3/4 */ } } }; + + const XMVECTOR Zero = XMVectorZero(); + XMVECTOR ATanResultValid = XMVectorTrueInt(); + + XMVECTOR Pi = XMVectorSplatX(ATan2Constants); + XMVECTOR PiOverTwo = XMVectorSplatY(ATan2Constants); + XMVECTOR PiOverFour = XMVectorSplatZ(ATan2Constants); + XMVECTOR ThreePiOverFour = XMVectorSplatW(ATan2Constants); + + XMVECTOR YEqualsZero = XMVectorEqual(Y, Zero); + XMVECTOR XEqualsZero = XMVectorEqual(X, Zero); + XMVECTOR XIsPositive = XMVectorAndInt(X, g_XMNegativeZero.v); + XIsPositive = XMVectorEqualInt(XIsPositive, Zero); + XMVECTOR YEqualsInfinity = XMVectorIsInfinite(Y); + XMVECTOR XEqualsInfinity = XMVectorIsInfinite(X); + + XMVECTOR YSign = XMVectorAndInt(Y, g_XMNegativeZero.v); + Pi = XMVectorOrInt(Pi, YSign); + PiOverTwo = XMVectorOrInt(PiOverTwo, YSign); + PiOverFour = XMVectorOrInt(PiOverFour, YSign); + ThreePiOverFour = XMVectorOrInt(ThreePiOverFour, YSign); + + XMVECTOR R1 = XMVectorSelect(Pi, YSign, XIsPositive); + XMVECTOR R2 = XMVectorSelect(ATanResultValid, PiOverTwo, XEqualsZero); + XMVECTOR R3 = XMVectorSelect(R2, R1, YEqualsZero); + XMVECTOR R4 = XMVectorSelect(ThreePiOverFour, PiOverFour, XIsPositive); + XMVECTOR R5 = XMVectorSelect(PiOverTwo, R4, XEqualsInfinity); + XMVECTOR Result = XMVectorSelect(R3, R5, YEqualsInfinity); + ATanResultValid = XMVectorEqualInt(Result, ATanResultValid); + + XMVECTOR Reciprocal = XMVectorReciprocalEst(X); + XMVECTOR V = XMVectorMultiply(Y, Reciprocal); + XMVECTOR R0 = XMVectorATanEst(V); + + R1 = XMVectorSelect(Pi, g_XMNegativeZero, XIsPositive); + R2 = XMVectorAdd(R0, R1); + + Result = XMVectorSelect(Result, R2, ATanResultValid); + + return Result; + +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorLerp +( + FXMVECTOR V0, + FXMVECTOR V1, + float t +) noexcept +{ + // V0 + t * (V1 - V0) + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Scale = XMVectorReplicate(t); + XMVECTOR Length = XMVectorSubtract(V1, V0); + return XMVectorMultiplyAdd(Length, Scale, V0); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMVECTOR L = vsubq_f32(V1, V0); + return vmlaq_n_f32(V0, L, t); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR L = _mm_sub_ps(V1, V0); + XMVECTOR S = _mm_set_ps1(t); + return XM_FMADD_PS(L, S, V0); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorLerpV +( + FXMVECTOR V0, + FXMVECTOR V1, + FXMVECTOR T +) noexcept +{ + // V0 + T * (V1 - V0) + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Length = XMVectorSubtract(V1, V0); + return XMVectorMultiplyAdd(Length, T, V0); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMVECTOR L = vsubq_f32(V1, V0); + return vmlaq_f32(V0, L, T); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR Length = _mm_sub_ps(V1, V0); + return XM_FMADD_PS(Length, T, V0); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorHermite +( + FXMVECTOR Position0, + FXMVECTOR Tangent0, + FXMVECTOR Position1, + GXMVECTOR Tangent1, + float t +) noexcept +{ + // Result = (2 * t^3 - 3 * t^2 + 1) * Position0 + + // (t^3 - 2 * t^2 + t) * Tangent0 + + // (-2 * t^3 + 3 * t^2) * Position1 + + // (t^3 - t^2) * Tangent1 + +#if defined(_XM_NO_INTRINSICS_) + + float t2 = t * t; + float t3 = t * t2; + + XMVECTOR P0 = XMVectorReplicate(2.0f * t3 - 3.0f * t2 + 1.0f); + XMVECTOR T0 = XMVectorReplicate(t3 - 2.0f * t2 + t); + XMVECTOR P1 = XMVectorReplicate(-2.0f * t3 + 3.0f * t2); + XMVECTOR T1 = XMVectorReplicate(t3 - t2); + + XMVECTOR Result = XMVectorMultiply(P0, Position0); + Result = XMVectorMultiplyAdd(T0, Tangent0, Result); + Result = XMVectorMultiplyAdd(P1, Position1, Result); + Result = XMVectorMultiplyAdd(T1, Tangent1, Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float t2 = t * t; + float t3 = t * t2; + + float p0 = 2.0f * t3 - 3.0f * t2 + 1.0f; + float t0 = t3 - 2.0f * t2 + t; + float p1 = -2.0f * t3 + 3.0f * t2; + float t1 = t3 - t2; + + XMVECTOR vResult = vmulq_n_f32(Position0, p0); + vResult = vmlaq_n_f32(vResult, Tangent0, t0); + vResult = vmlaq_n_f32(vResult, Position1, p1); + vResult = vmlaq_n_f32(vResult, Tangent1, t1); + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + float t2 = t * t; + float t3 = t * t2; + + XMVECTOR P0 = _mm_set_ps1(2.0f * t3 - 3.0f * t2 + 1.0f); + XMVECTOR T0 = _mm_set_ps1(t3 - 2.0f * t2 + t); + XMVECTOR P1 = _mm_set_ps1(-2.0f * t3 + 3.0f * t2); + XMVECTOR T1 = _mm_set_ps1(t3 - t2); + + XMVECTOR vResult = _mm_mul_ps(P0, Position0); + vResult = XM_FMADD_PS(Tangent0, T0, vResult); + vResult = XM_FMADD_PS(Position1, P1, vResult); + vResult = XM_FMADD_PS(Tangent1, T1, vResult); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorHermiteV +( + FXMVECTOR Position0, + FXMVECTOR Tangent0, + FXMVECTOR Position1, + GXMVECTOR Tangent1, + HXMVECTOR T +) noexcept +{ + // Result = (2 * t^3 - 3 * t^2 + 1) * Position0 + + // (t^3 - 2 * t^2 + t) * Tangent0 + + // (-2 * t^3 + 3 * t^2) * Position1 + + // (t^3 - t^2) * Tangent1 + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR T2 = XMVectorMultiply(T, T); + XMVECTOR T3 = XMVectorMultiply(T, T2); + + XMVECTOR P0 = XMVectorReplicate(2.0f * T3.vector4_f32[0] - 3.0f * T2.vector4_f32[0] + 1.0f); + XMVECTOR T0 = XMVectorReplicate(T3.vector4_f32[1] - 2.0f * T2.vector4_f32[1] + T.vector4_f32[1]); + XMVECTOR P1 = XMVectorReplicate(-2.0f * T3.vector4_f32[2] + 3.0f * T2.vector4_f32[2]); + XMVECTOR T1 = XMVectorReplicate(T3.vector4_f32[3] - T2.vector4_f32[3]); + + XMVECTOR Result = XMVectorMultiply(P0, Position0); + Result = XMVectorMultiplyAdd(T0, Tangent0, Result); + Result = XMVectorMultiplyAdd(P1, Position1, Result); + Result = XMVectorMultiplyAdd(T1, Tangent1, Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 CatMulT2 = { { { -3.0f, -2.0f, 3.0f, -1.0f } } }; + static const XMVECTORF32 CatMulT3 = { { { 2.0f, 1.0f, -2.0f, 1.0f } } }; + + XMVECTOR T2 = vmulq_f32(T, T); + XMVECTOR T3 = vmulq_f32(T, T2); + // Mul by the constants against t^2 + T2 = vmulq_f32(T2, CatMulT2); + // Mul by the constants against t^3 + T3 = vmlaq_f32(T2, T3, CatMulT3); + // T3 now has the pre-result. + // I need to add t.y only + T2 = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T), g_XMMaskY)); + T3 = vaddq_f32(T3, T2); + // Add 1.0f to x + T3 = vaddq_f32(T3, g_XMIdentityR0); + // Now, I have the constants created + // Mul the x constant to Position0 + XMVECTOR vResult = vmulq_lane_f32(Position0, vget_low_f32(T3), 0); // T3[0] + // Mul the y constant to Tangent0 + vResult = vmlaq_lane_f32(vResult, Tangent0, vget_low_f32(T3), 1); // T3[1] + // Mul the z constant to Position1 + vResult = vmlaq_lane_f32(vResult, Position1, vget_high_f32(T3), 0); // T3[2] + // Mul the w constant to Tangent1 + vResult = vmlaq_lane_f32(vResult, Tangent1, vget_high_f32(T3), 1); // T3[3] + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 CatMulT2 = { { { -3.0f, -2.0f, 3.0f, -1.0f } } }; + static const XMVECTORF32 CatMulT3 = { { { 2.0f, 1.0f, -2.0f, 1.0f } } }; + + XMVECTOR T2 = _mm_mul_ps(T, T); + XMVECTOR T3 = _mm_mul_ps(T, T2); + // Mul by the constants against t^2 + T2 = _mm_mul_ps(T2, CatMulT2); + // Mul by the constants against t^3 + T3 = XM_FMADD_PS(T3, CatMulT3, T2); + // T3 now has the pre-result. + // I need to add t.y only + T2 = _mm_and_ps(T, g_XMMaskY); + T3 = _mm_add_ps(T3, T2); + // Add 1.0f to x + T3 = _mm_add_ps(T3, g_XMIdentityR0); + // Now, I have the constants created + // Mul the x constant to Position0 + XMVECTOR vResult = XM_PERMUTE_PS(T3, _MM_SHUFFLE(0, 0, 0, 0)); + vResult = _mm_mul_ps(vResult, Position0); + // Mul the y constant to Tangent0 + T2 = XM_PERMUTE_PS(T3, _MM_SHUFFLE(1, 1, 1, 1)); + vResult = XM_FMADD_PS(T2, Tangent0, vResult); + // Mul the z constant to Position1 + T2 = XM_PERMUTE_PS(T3, _MM_SHUFFLE(2, 2, 2, 2)); + vResult = XM_FMADD_PS(T2, Position1, vResult); + // Mul the w constant to Tangent1 + T3 = XM_PERMUTE_PS(T3, _MM_SHUFFLE(3, 3, 3, 3)); + vResult = XM_FMADD_PS(T3, Tangent1, vResult); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorCatmullRom +( + FXMVECTOR Position0, + FXMVECTOR Position1, + FXMVECTOR Position2, + GXMVECTOR Position3, + float t +) noexcept +{ + // Result = ((-t^3 + 2 * t^2 - t) * Position0 + + // (3 * t^3 - 5 * t^2 + 2) * Position1 + + // (-3 * t^3 + 4 * t^2 + t) * Position2 + + // (t^3 - t^2) * Position3) * 0.5 + +#if defined(_XM_NO_INTRINSICS_) + + float t2 = t * t; + float t3 = t * t2; + + XMVECTOR P0 = XMVectorReplicate((-t3 + 2.0f * t2 - t) * 0.5f); + XMVECTOR P1 = XMVectorReplicate((3.0f * t3 - 5.0f * t2 + 2.0f) * 0.5f); + XMVECTOR P2 = XMVectorReplicate((-3.0f * t3 + 4.0f * t2 + t) * 0.5f); + XMVECTOR P3 = XMVectorReplicate((t3 - t2) * 0.5f); + + XMVECTOR Result = XMVectorMultiply(P0, Position0); + Result = XMVectorMultiplyAdd(P1, Position1, Result); + Result = XMVectorMultiplyAdd(P2, Position2, Result); + Result = XMVectorMultiplyAdd(P3, Position3, Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float t2 = t * t; + float t3 = t * t2; + + float p0 = (-t3 + 2.0f * t2 - t) * 0.5f; + float p1 = (3.0f * t3 - 5.0f * t2 + 2.0f) * 0.5f; + float p2 = (-3.0f * t3 + 4.0f * t2 + t) * 0.5f; + float p3 = (t3 - t2) * 0.5f; + + XMVECTOR P1 = vmulq_n_f32(Position1, p1); + XMVECTOR P0 = vmlaq_n_f32(P1, Position0, p0); + XMVECTOR P3 = vmulq_n_f32(Position3, p3); + XMVECTOR P2 = vmlaq_n_f32(P3, Position2, p2); + P0 = vaddq_f32(P0, P2); + return P0; +#elif defined(_XM_SSE_INTRINSICS_) + float t2 = t * t; + float t3 = t * t2; + + XMVECTOR P0 = _mm_set_ps1((-t3 + 2.0f * t2 - t) * 0.5f); + XMVECTOR P1 = _mm_set_ps1((3.0f * t3 - 5.0f * t2 + 2.0f) * 0.5f); + XMVECTOR P2 = _mm_set_ps1((-3.0f * t3 + 4.0f * t2 + t) * 0.5f); + XMVECTOR P3 = _mm_set_ps1((t3 - t2) * 0.5f); + + P1 = _mm_mul_ps(Position1, P1); + P0 = XM_FMADD_PS(Position0, P0, P1); + P3 = _mm_mul_ps(Position3, P3); + P2 = XM_FMADD_PS(Position2, P2, P3); + P0 = _mm_add_ps(P0, P2); + return P0; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorCatmullRomV +( + FXMVECTOR Position0, + FXMVECTOR Position1, + FXMVECTOR Position2, + GXMVECTOR Position3, + HXMVECTOR T +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + float fx = T.vector4_f32[0]; + float fy = T.vector4_f32[1]; + float fz = T.vector4_f32[2]; + float fw = T.vector4_f32[3]; + XMVECTORF32 vResult = { { { + 0.5f * ((-fx * fx * fx + 2 * fx * fx - fx) * Position0.vector4_f32[0] + + (3 * fx * fx * fx - 5 * fx * fx + 2) * Position1.vector4_f32[0] + + (-3 * fx * fx * fx + 4 * fx * fx + fx) * Position2.vector4_f32[0] + + (fx * fx * fx - fx * fx) * Position3.vector4_f32[0]), + + 0.5f * ((-fy * fy * fy + 2 * fy * fy - fy) * Position0.vector4_f32[1] + + (3 * fy * fy * fy - 5 * fy * fy + 2) * Position1.vector4_f32[1] + + (-3 * fy * fy * fy + 4 * fy * fy + fy) * Position2.vector4_f32[1] + + (fy * fy * fy - fy * fy) * Position3.vector4_f32[1]), + + 0.5f * ((-fz * fz * fz + 2 * fz * fz - fz) * Position0.vector4_f32[2] + + (3 * fz * fz * fz - 5 * fz * fz + 2) * Position1.vector4_f32[2] + + (-3 * fz * fz * fz + 4 * fz * fz + fz) * Position2.vector4_f32[2] + + (fz * fz * fz - fz * fz) * Position3.vector4_f32[2]), + + 0.5f * ((-fw * fw * fw + 2 * fw * fw - fw) * Position0.vector4_f32[3] + + (3 * fw * fw * fw - 5 * fw * fw + 2) * Position1.vector4_f32[3] + + (-3 * fw * fw * fw + 4 * fw * fw + fw) * Position2.vector4_f32[3] + + (fw * fw * fw - fw * fw) * Position3.vector4_f32[3]) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 Catmul2 = { { { 2.0f, 2.0f, 2.0f, 2.0f } } }; + static const XMVECTORF32 Catmul3 = { { { 3.0f, 3.0f, 3.0f, 3.0f } } }; + static const XMVECTORF32 Catmul4 = { { { 4.0f, 4.0f, 4.0f, 4.0f } } }; + static const XMVECTORF32 Catmul5 = { { { 5.0f, 5.0f, 5.0f, 5.0f } } }; + // Cache T^2 and T^3 + XMVECTOR T2 = vmulq_f32(T, T); + XMVECTOR T3 = vmulq_f32(T, T2); + // Perform the Position0 term + XMVECTOR vResult = vaddq_f32(T2, T2); + vResult = vsubq_f32(vResult, T); + vResult = vsubq_f32(vResult, T3); + vResult = vmulq_f32(vResult, Position0); + // Perform the Position1 term and add + XMVECTOR vTemp = vmulq_f32(T3, Catmul3); + vTemp = vmlsq_f32(vTemp, T2, Catmul5); + vTemp = vaddq_f32(vTemp, Catmul2); + vResult = vmlaq_f32(vResult, vTemp, Position1); + // Perform the Position2 term and add + vTemp = vmulq_f32(T2, Catmul4); + vTemp = vmlsq_f32(vTemp, T3, Catmul3); + vTemp = vaddq_f32(vTemp, T); + vResult = vmlaq_f32(vResult, vTemp, Position2); + // Position3 is the last term + T3 = vsubq_f32(T3, T2); + vResult = vmlaq_f32(vResult, T3, Position3); + // Multiply by 0.5f and exit + vResult = vmulq_f32(vResult, g_XMOneHalf); + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 Catmul2 = { { { 2.0f, 2.0f, 2.0f, 2.0f } } }; + static const XMVECTORF32 Catmul3 = { { { 3.0f, 3.0f, 3.0f, 3.0f } } }; + static const XMVECTORF32 Catmul4 = { { { 4.0f, 4.0f, 4.0f, 4.0f } } }; + static const XMVECTORF32 Catmul5 = { { { 5.0f, 5.0f, 5.0f, 5.0f } } }; + // Cache T^2 and T^3 + XMVECTOR T2 = _mm_mul_ps(T, T); + XMVECTOR T3 = _mm_mul_ps(T, T2); + // Perform the Position0 term + XMVECTOR vResult = _mm_add_ps(T2, T2); + vResult = _mm_sub_ps(vResult, T); + vResult = _mm_sub_ps(vResult, T3); + vResult = _mm_mul_ps(vResult, Position0); + // Perform the Position1 term and add + XMVECTOR vTemp = _mm_mul_ps(T3, Catmul3); + vTemp = XM_FNMADD_PS(T2, Catmul5, vTemp); + vTemp = _mm_add_ps(vTemp, Catmul2); + vResult = XM_FMADD_PS(vTemp, Position1, vResult); + // Perform the Position2 term and add + vTemp = _mm_mul_ps(T2, Catmul4); + vTemp = XM_FNMADD_PS(T3, Catmul3, vTemp); + vTemp = _mm_add_ps(vTemp, T); + vResult = XM_FMADD_PS(vTemp, Position2, vResult); + // Position3 is the last term + T3 = _mm_sub_ps(T3, T2); + vResult = XM_FMADD_PS(T3, Position3, vResult); + // Multiply by 0.5f and exit + vResult = _mm_mul_ps(vResult, g_XMOneHalf); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorBaryCentric +( + FXMVECTOR Position0, + FXMVECTOR Position1, + FXMVECTOR Position2, + float f, + float g +) noexcept +{ + // Result = Position0 + f * (Position1 - Position0) + g * (Position2 - Position0) + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR P10 = XMVectorSubtract(Position1, Position0); + XMVECTOR ScaleF = XMVectorReplicate(f); + + XMVECTOR P20 = XMVectorSubtract(Position2, Position0); + XMVECTOR ScaleG = XMVectorReplicate(g); + + XMVECTOR Result = XMVectorMultiplyAdd(P10, ScaleF, Position0); + Result = XMVectorMultiplyAdd(P20, ScaleG, Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMVECTOR R1 = vsubq_f32(Position1, Position0); + XMVECTOR R2 = vsubq_f32(Position2, Position0); + R1 = vmlaq_n_f32(Position0, R1, f); + return vmlaq_n_f32(R1, R2, g); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR R1 = _mm_sub_ps(Position1, Position0); + XMVECTOR R2 = _mm_sub_ps(Position2, Position0); + XMVECTOR SF = _mm_set_ps1(f); + R1 = XM_FMADD_PS(R1, SF, Position0); + XMVECTOR SG = _mm_set_ps1(g); + return XM_FMADD_PS(R2, SG, R1); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorBaryCentricV +( + FXMVECTOR Position0, + FXMVECTOR Position1, + FXMVECTOR Position2, + GXMVECTOR F, + HXMVECTOR G +) noexcept +{ + // Result = Position0 + f * (Position1 - Position0) + g * (Position2 - Position0) + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR P10 = XMVectorSubtract(Position1, Position0); + XMVECTOR P20 = XMVectorSubtract(Position2, Position0); + + XMVECTOR Result = XMVectorMultiplyAdd(P10, F, Position0); + Result = XMVectorMultiplyAdd(P20, G, Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMVECTOR R1 = vsubq_f32(Position1, Position0); + XMVECTOR R2 = vsubq_f32(Position2, Position0); + R1 = vmlaq_f32(Position0, R1, F); + return vmlaq_f32(R1, R2, G); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR R1 = _mm_sub_ps(Position1, Position0); + XMVECTOR R2 = _mm_sub_ps(Position2, Position0); + R1 = XM_FMADD_PS(R1, F, Position0); + return XM_FMADD_PS(R2, G, R1); +#endif +} + +/**************************************************************************** + * + * 2D Vector + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + // Comparison operations + //------------------------------------------------------------------------------ + + //------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector2Equal +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] == V2.vector4_f32[0]) && (V1.vector4_f32[1] == V2.vector4_f32[1])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vTemp = vceq_f32(vget_low_f32(V1), vget_low_f32(V2)); + return (vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) == 0xFFFFFFFFFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); + // z and w are don't care + return (((_mm_movemask_ps(vTemp) & 3) == 3) != 0); +#endif +} + + +//------------------------------------------------------------------------------ + +inline uint32_t XM_CALLCONV XMVector2EqualR +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + uint32_t CR = 0; + if ((V1.vector4_f32[0] == V2.vector4_f32[0]) && + (V1.vector4_f32[1] == V2.vector4_f32[1])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] != V2.vector4_f32[0]) && + (V1.vector4_f32[1] != V2.vector4_f32[1])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vTemp = vceq_f32(vget_low_f32(V1), vget_low_f32(V2)); + uint64_t r = vget_lane_u64(vreinterpret_u64_u32(vTemp), 0); + uint32_t CR = 0; + if (r == 0xFFFFFFFFFFFFFFFFU) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); + // z and w are don't care + int iTest = _mm_movemask_ps(vTemp) & 3; + uint32_t CR = 0; + if (iTest == 3) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector2EqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_u32[0] == V2.vector4_u32[0]) && (V1.vector4_u32[1] == V2.vector4_u32[1])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vTemp = vceq_u32(vget_low_u32(vreinterpretq_u32_f32(V1)), vget_low_u32(vreinterpretq_u32_f32(V2))); + return (vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) == 0xFFFFFFFFFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); + return (((_mm_movemask_ps(_mm_castsi128_ps(vTemp)) & 3) == 3) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline uint32_t XM_CALLCONV XMVector2EqualIntR +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + uint32_t CR = 0; + if ((V1.vector4_u32[0] == V2.vector4_u32[0]) && + (V1.vector4_u32[1] == V2.vector4_u32[1])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_u32[0] != V2.vector4_u32[0]) && + (V1.vector4_u32[1] != V2.vector4_u32[1])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vTemp = vceq_u32(vget_low_u32(vreinterpretq_u32_f32(V1)), vget_low_u32(vreinterpretq_u32_f32(V2))); + uint64_t r = vget_lane_u64(vreinterpret_u64_u32(vTemp), 0); + uint32_t CR = 0; + if (r == 0xFFFFFFFFFFFFFFFFU) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); + int iTest = _mm_movemask_ps(_mm_castsi128_ps(vTemp)) & 3; + uint32_t CR = 0; + if (iTest == 3) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector2NearEqual +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR Epsilon +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + float dx = fabsf(V1.vector4_f32[0] - V2.vector4_f32[0]); + float dy = fabsf(V1.vector4_f32[1] - V2.vector4_f32[1]); + return ((dx <= Epsilon.vector4_f32[0]) && + (dy <= Epsilon.vector4_f32[1])); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t vDelta = vsub_f32(vget_low_f32(V1), vget_low_f32(V2)); +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + uint32x2_t vTemp = vacle_f32(vDelta, vget_low_u32(Epsilon)); +#else + uint32x2_t vTemp = vcle_f32(vabs_f32(vDelta), vget_low_f32(Epsilon)); +#endif + uint64_t r = vget_lane_u64(vreinterpret_u64_u32(vTemp), 0); + return (r == 0xFFFFFFFFFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + // Get the difference + XMVECTOR vDelta = _mm_sub_ps(V1, V2); + // Get the absolute value of the difference + XMVECTOR vTemp = _mm_setzero_ps(); + vTemp = _mm_sub_ps(vTemp, vDelta); + vTemp = _mm_max_ps(vTemp, vDelta); + vTemp = _mm_cmple_ps(vTemp, Epsilon); + // z and w are don't care + return (((_mm_movemask_ps(vTemp) & 3) == 0x3) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector2NotEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] != V2.vector4_f32[0]) || (V1.vector4_f32[1] != V2.vector4_f32[1])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vTemp = vceq_f32(vget_low_f32(V1), vget_low_f32(V2)); + return (vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) != 0xFFFFFFFFFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); + // z and w are don't care + return (((_mm_movemask_ps(vTemp) & 3) != 3) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector2NotEqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_u32[0] != V2.vector4_u32[0]) || (V1.vector4_u32[1] != V2.vector4_u32[1])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vTemp = vceq_u32(vget_low_u32(vreinterpretq_u32_f32(V1)), vget_low_u32(vreinterpretq_u32_f32(V2))); + return (vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) != 0xFFFFFFFFFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); + return (((_mm_movemask_ps(_mm_castsi128_ps(vTemp)) & 3) != 3) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector2Greater +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] > V2.vector4_f32[0]) && (V1.vector4_f32[1] > V2.vector4_f32[1])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vTemp = vcgt_f32(vget_low_f32(V1), vget_low_f32(V2)); + return (vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) == 0xFFFFFFFFFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpgt_ps(V1, V2); + // z and w are don't care + return (((_mm_movemask_ps(vTemp) & 3) == 3) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline uint32_t XM_CALLCONV XMVector2GreaterR +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + uint32_t CR = 0; + if ((V1.vector4_f32[0] > V2.vector4_f32[0]) && + (V1.vector4_f32[1] > V2.vector4_f32[1])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] <= V2.vector4_f32[0]) && + (V1.vector4_f32[1] <= V2.vector4_f32[1])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vTemp = vcgt_f32(vget_low_f32(V1), vget_low_f32(V2)); + uint64_t r = vget_lane_u64(vreinterpret_u64_u32(vTemp), 0); + uint32_t CR = 0; + if (r == 0xFFFFFFFFFFFFFFFFU) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpgt_ps(V1, V2); + int iTest = _mm_movemask_ps(vTemp) & 3; + uint32_t CR = 0; + if (iTest == 3) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector2GreaterOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] >= V2.vector4_f32[0]) && (V1.vector4_f32[1] >= V2.vector4_f32[1])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vTemp = vcge_f32(vget_low_f32(V1), vget_low_f32(V2)); + return (vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) == 0xFFFFFFFFFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpge_ps(V1, V2); + return (((_mm_movemask_ps(vTemp) & 3) == 3) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline uint32_t XM_CALLCONV XMVector2GreaterOrEqualR +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + uint32_t CR = 0; + if ((V1.vector4_f32[0] >= V2.vector4_f32[0]) && + (V1.vector4_f32[1] >= V2.vector4_f32[1])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] < V2.vector4_f32[0]) && + (V1.vector4_f32[1] < V2.vector4_f32[1])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vTemp = vcge_f32(vget_low_f32(V1), vget_low_f32(V2)); + uint64_t r = vget_lane_u64(vreinterpret_u64_u32(vTemp), 0); + uint32_t CR = 0; + if (r == 0xFFFFFFFFFFFFFFFFU) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpge_ps(V1, V2); + int iTest = _mm_movemask_ps(vTemp) & 3; + uint32_t CR = 0; + if (iTest == 3) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector2Less +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] < V2.vector4_f32[0]) && (V1.vector4_f32[1] < V2.vector4_f32[1])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vTemp = vclt_f32(vget_low_f32(V1), vget_low_f32(V2)); + return (vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) == 0xFFFFFFFFFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmplt_ps(V1, V2); + return (((_mm_movemask_ps(vTemp) & 3) == 3) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector2LessOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] <= V2.vector4_f32[0]) && (V1.vector4_f32[1] <= V2.vector4_f32[1])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vTemp = vcle_f32(vget_low_f32(V1), vget_low_f32(V2)); + return (vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) == 0xFFFFFFFFFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmple_ps(V1, V2); + return (((_mm_movemask_ps(vTemp) & 3) == 3) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector2InBounds +( + FXMVECTOR V, + FXMVECTOR Bounds +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) && + (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + float32x2_t B = vget_low_f32(Bounds); + // Test if less than or equal + uint32x2_t ivTemp1 = vcle_f32(VL, B); + // Negate the bounds + float32x2_t vTemp2 = vneg_f32(B); + // Test if greater or equal (Reversed) + uint32x2_t ivTemp2 = vcle_f32(vTemp2, VL); + // Blend answers + ivTemp1 = vand_u32(ivTemp1, ivTemp2); + // x and y in bounds? + return (vget_lane_u64(vreinterpret_u64_u32(ivTemp1), 0) == 0xFFFFFFFFFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + // Test if less than or equal + XMVECTOR vTemp1 = _mm_cmple_ps(V, Bounds); + // Negate the bounds + XMVECTOR vTemp2 = _mm_mul_ps(Bounds, g_XMNegativeOne); + // Test if greater or equal (Reversed) + vTemp2 = _mm_cmple_ps(vTemp2, V); + // Blend answers + vTemp1 = _mm_and_ps(vTemp1, vTemp2); + // x and y in bounds? (z and w are don't care) + return (((_mm_movemask_ps(vTemp1) & 0x3) == 0x3) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) +#pragma float_control(push) +#pragma float_control(precise, on) +#endif + +inline bool XM_CALLCONV XMVector2IsNaN(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (XMISNAN(V.vector4_f32[0]) || + XMISNAN(V.vector4_f32[1])); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + // Test against itself. NaN is always not equal + uint32x2_t vTempNan = vceq_f32(VL, VL); + // If x or y are NaN, the mask is zero + return (vget_lane_u64(vreinterpret_u64_u32(vTempNan), 0) != 0xFFFFFFFFFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + // Test against itself. NaN is always not equal + XMVECTOR vTempNan = _mm_cmpneq_ps(V, V); + // If x or y are NaN, the mask is non-zero + return ((_mm_movemask_ps(vTempNan) & 3) != 0); +#endif +} + +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) +#pragma float_control(pop) +#endif + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector2IsInfinite(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + return (XMISINF(V.vector4_f32[0]) || + XMISINF(V.vector4_f32[1])); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Mask off the sign bit + uint32x2_t vTemp = vand_u32(vget_low_u32(vreinterpretq_u32_f32(V)), vget_low_u32(g_XMAbsMask)); + // Compare to infinity + vTemp = vceq_f32(vreinterpret_f32_u32(vTemp), vget_low_f32(g_XMInfinity)); + // If any are infinity, the signs are true. + return vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) != 0; +#elif defined(_XM_SSE_INTRINSICS_) + // Mask off the sign bit + __m128 vTemp = _mm_and_ps(V, g_XMAbsMask); + // Compare to infinity + vTemp = _mm_cmpeq_ps(vTemp, g_XMInfinity); + // If x or z are infinity, the signs are true. + return ((_mm_movemask_ps(vTemp) & 3) != 0); +#endif +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2Dot +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result; + Result.f[0] = + Result.f[1] = + Result.f[2] = + Result.f[3] = V1.vector4_f32[0] * V2.vector4_f32[0] + V1.vector4_f32[1] * V2.vector4_f32[1]; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Perform the dot product on x and y + float32x2_t vTemp = vmul_f32(vget_low_f32(V1), vget_low_f32(V2)); + vTemp = vpadd_f32(vTemp, vTemp); + return vcombine_f32(vTemp, vTemp); +#elif defined(_XM_SSE4_INTRINSICS_) + return _mm_dp_ps(V1, V2, 0x3f); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vDot = _mm_mul_ps(V1, V2); + vDot = _mm_hadd_ps(vDot, vDot); + vDot = _mm_moveldup_ps(vDot); + return vDot; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y + XMVECTOR vLengthSq = _mm_mul_ps(V1, V2); + // vTemp has y splatted + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 1, 1, 1)); + // x+y + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + return vLengthSq; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2Cross +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ + // [ V1.x*V2.y - V1.y*V2.x, V1.x*V2.y - V1.y*V2.x ] + +#if defined(_XM_NO_INTRINSICS_) + float fCross = (V1.vector4_f32[0] * V2.vector4_f32[1]) - (V1.vector4_f32[1] * V2.vector4_f32[0]); + XMVECTORF32 vResult; + vResult.f[0] = + vResult.f[1] = + vResult.f[2] = + vResult.f[3] = fCross; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 Negate = { { { 1.f, -1.f, 0, 0 } } }; + + float32x2_t vTemp = vmul_f32(vget_low_f32(V1), vrev64_f32(vget_low_f32(V2))); + vTemp = vmul_f32(vTemp, vget_low_f32(Negate)); + vTemp = vpadd_f32(vTemp, vTemp); + return vcombine_f32(vTemp, vTemp); +#elif defined(_XM_SSE_INTRINSICS_) + // Swap x and y + XMVECTOR vResult = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 1, 0, 1)); + // Perform the muls + vResult = _mm_mul_ps(vResult, V1); + // Splat y + XMVECTOR vTemp = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(1, 1, 1, 1)); + // Sub the values + vResult = _mm_sub_ss(vResult, vTemp); + // Splat the cross product + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(0, 0, 0, 0)); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2LengthSq(FXMVECTOR V) noexcept +{ + return XMVector2Dot(V, V); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2ReciprocalLengthEst(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result = XMVector2LengthSq(V); + Result = XMVectorReciprocalSqrtEst(Result); + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + // Dot2 + float32x2_t vTemp = vmul_f32(VL, VL); + vTemp = vpadd_f32(vTemp, vTemp); + // Reciprocal sqrt (estimate) + vTemp = vrsqrte_f32(vTemp); + return vcombine_f32(vTemp, vTemp); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0x3f); + return _mm_rsqrt_ps(vTemp); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + XMVECTOR vTemp = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_rsqrt_ss(vTemp); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + return vLengthSq; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has y splatted + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 1, 1, 1)); + // x+y + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + vLengthSq = _mm_rsqrt_ss(vLengthSq); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + return vLengthSq; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2ReciprocalLength(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result = XMVector2LengthSq(V); + Result = XMVectorReciprocalSqrt(Result); + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + // Dot2 + float32x2_t vTemp = vmul_f32(VL, VL); + vTemp = vpadd_f32(vTemp, vTemp); + // Reciprocal sqrt + float32x2_t S0 = vrsqrte_f32(vTemp); + float32x2_t P0 = vmul_f32(vTemp, S0); + float32x2_t R0 = vrsqrts_f32(P0, S0); + float32x2_t S1 = vmul_f32(S0, R0); + float32x2_t P1 = vmul_f32(vTemp, S1); + float32x2_t R1 = vrsqrts_f32(P1, S1); + float32x2_t Result = vmul_f32(S1, R1); + return vcombine_f32(Result, Result); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0x3f); + XMVECTOR vLengthSq = _mm_sqrt_ps(vTemp); + return _mm_div_ps(g_XMOne, vLengthSq); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + XMVECTOR vTemp = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_sqrt_ss(vTemp); + vLengthSq = _mm_div_ss(g_XMOne, vLengthSq); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + return vLengthSq; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has y splatted + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 1, 1, 1)); + // x+y + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + vLengthSq = _mm_sqrt_ss(vLengthSq); + vLengthSq = _mm_div_ss(g_XMOne, vLengthSq); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + return vLengthSq; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2LengthEst(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result = XMVector2LengthSq(V); + Result = XMVectorSqrtEst(Result); + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + // Dot2 + float32x2_t vTemp = vmul_f32(VL, VL); + vTemp = vpadd_f32(vTemp, vTemp); + const float32x2_t zero = vdup_n_f32(0); + uint32x2_t VEqualsZero = vceq_f32(vTemp, zero); + // Sqrt (estimate) + float32x2_t Result = vrsqrte_f32(vTemp); + Result = vmul_f32(vTemp, Result); + Result = vbsl_f32(VEqualsZero, zero, Result); + return vcombine_f32(Result, Result); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0x3f); + return _mm_sqrt_ps(vTemp); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + XMVECTOR vTemp = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_sqrt_ss(vTemp); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + return vLengthSq; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has y splatted + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 1, 1, 1)); + // x+y + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + vLengthSq = _mm_sqrt_ss(vLengthSq); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + return vLengthSq; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2Length(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result = XMVector2LengthSq(V); + Result = XMVectorSqrt(Result); + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + // Dot2 + float32x2_t vTemp = vmul_f32(VL, VL); + vTemp = vpadd_f32(vTemp, vTemp); + const float32x2_t zero = vdup_n_f32(0); + uint32x2_t VEqualsZero = vceq_f32(vTemp, zero); + // Sqrt + float32x2_t S0 = vrsqrte_f32(vTemp); + float32x2_t P0 = vmul_f32(vTemp, S0); + float32x2_t R0 = vrsqrts_f32(P0, S0); + float32x2_t S1 = vmul_f32(S0, R0); + float32x2_t P1 = vmul_f32(vTemp, S1); + float32x2_t R1 = vrsqrts_f32(P1, S1); + float32x2_t Result = vmul_f32(S1, R1); + Result = vmul_f32(vTemp, Result); + Result = vbsl_f32(VEqualsZero, zero, Result); + return vcombine_f32(Result, Result); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0x3f); + return _mm_sqrt_ps(vTemp); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + XMVECTOR vTemp = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_sqrt_ss(vTemp); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + return vLengthSq; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has y splatted + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 1, 1, 1)); + // x+y + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#endif +} + +//------------------------------------------------------------------------------ +// XMVector2NormalizeEst uses a reciprocal estimate and +// returns QNaN on zero and infinite vectors. + +inline XMVECTOR XM_CALLCONV XMVector2NormalizeEst(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result = XMVector2ReciprocalLength(V); + Result = XMVectorMultiply(V, Result); + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + // Dot2 + float32x2_t vTemp = vmul_f32(VL, VL); + vTemp = vpadd_f32(vTemp, vTemp); + // Reciprocal sqrt (estimate) + vTemp = vrsqrte_f32(vTemp); + // Normalize + float32x2_t Result = vmul_f32(VL, vTemp); + return vcombine_f32(Result, Result); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0x3f); + XMVECTOR vResult = _mm_rsqrt_ps(vTemp); + return _mm_mul_ps(vResult, V); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_rsqrt_ss(vLengthSq); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + vLengthSq = _mm_mul_ps(vLengthSq, V); + return vLengthSq; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has y splatted + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 1, 1, 1)); + // x+y + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + vLengthSq = _mm_rsqrt_ss(vLengthSq); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + vLengthSq = _mm_mul_ps(vLengthSq, V); + return vLengthSq; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2Normalize(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR vResult = XMVector2Length(V); + float fLength = vResult.vector4_f32[0]; + + // Prevent divide by zero + if (fLength > 0) + { + fLength = 1.0f / fLength; + } + + vResult.vector4_f32[0] = V.vector4_f32[0] * fLength; + vResult.vector4_f32[1] = V.vector4_f32[1] * fLength; + vResult.vector4_f32[2] = V.vector4_f32[2] * fLength; + vResult.vector4_f32[3] = V.vector4_f32[3] * fLength; + return vResult; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + // Dot2 + float32x2_t vTemp = vmul_f32(VL, VL); + vTemp = vpadd_f32(vTemp, vTemp); + uint32x2_t VEqualsZero = vceq_f32(vTemp, vdup_n_f32(0)); + uint32x2_t VEqualsInf = vceq_f32(vTemp, vget_low_f32(g_XMInfinity)); + // Reciprocal sqrt (2 iterations of Newton-Raphson) + float32x2_t S0 = vrsqrte_f32(vTemp); + float32x2_t P0 = vmul_f32(vTemp, S0); + float32x2_t R0 = vrsqrts_f32(P0, S0); + float32x2_t S1 = vmul_f32(S0, R0); + float32x2_t P1 = vmul_f32(vTemp, S1); + float32x2_t R1 = vrsqrts_f32(P1, S1); + vTemp = vmul_f32(S1, R1); + // Normalize + float32x2_t Result = vmul_f32(VL, vTemp); + Result = vbsl_f32(VEqualsZero, vdup_n_f32(0), Result); + Result = vbsl_f32(VEqualsInf, vget_low_f32(g_XMQNaN), Result); + return vcombine_f32(Result, Result); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vLengthSq = _mm_dp_ps(V, V, 0x3f); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Create zero with a single instruction + XMVECTOR vZeroMask = _mm_setzero_ps(); + // Test for a divide by zero (Must be FP to detect -0.0) + vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); + // Reciprocal mul to perform the normalization + vResult = _mm_div_ps(V, vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult, vZeroMask); + // Select qnan or result based on infinite length + XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); + XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); + vResult = _mm_or_ps(vTemp1, vTemp2); + return vResult; +#elif defined(_XM_SSE3_INTRINSICS_) + // Perform the dot product on x and y only + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_moveldup_ps(vLengthSq); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Create zero with a single instruction + XMVECTOR vZeroMask = _mm_setzero_ps(); + // Test for a divide by zero (Must be FP to detect -0.0) + vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); + // Reciprocal mul to perform the normalization + vResult = _mm_div_ps(V, vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult, vZeroMask); + // Select qnan or result based on infinite length + XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); + XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); + vResult = _mm_or_ps(vTemp1, vTemp2); + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y only + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 1, 1, 1)); + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Create zero with a single instruction + XMVECTOR vZeroMask = _mm_setzero_ps(); + // Test for a divide by zero (Must be FP to detect -0.0) + vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); + // Reciprocal mul to perform the normalization + vResult = _mm_div_ps(V, vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult, vZeroMask); + // Select qnan or result based on infinite length + XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); + XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); + vResult = _mm_or_ps(vTemp1, vTemp2); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2ClampLength +( + FXMVECTOR V, + float LengthMin, + float LengthMax +) noexcept +{ + XMVECTOR ClampMax = XMVectorReplicate(LengthMax); + XMVECTOR ClampMin = XMVectorReplicate(LengthMin); + return XMVector2ClampLengthV(V, ClampMin, ClampMax); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2ClampLengthV +( + FXMVECTOR V, + FXMVECTOR LengthMin, + FXMVECTOR LengthMax +) noexcept +{ + assert((XMVectorGetY(LengthMin) == XMVectorGetX(LengthMin))); + assert((XMVectorGetY(LengthMax) == XMVectorGetX(LengthMax))); + assert(XMVector2GreaterOrEqual(LengthMin, g_XMZero)); + assert(XMVector2GreaterOrEqual(LengthMax, g_XMZero)); + assert(XMVector2GreaterOrEqual(LengthMax, LengthMin)); + + XMVECTOR LengthSq = XMVector2LengthSq(V); + + const XMVECTOR Zero = XMVectorZero(); + + XMVECTOR RcpLength = XMVectorReciprocalSqrt(LengthSq); + + XMVECTOR InfiniteLength = XMVectorEqualInt(LengthSq, g_XMInfinity.v); + XMVECTOR ZeroLength = XMVectorEqual(LengthSq, Zero); + + XMVECTOR Length = XMVectorMultiply(LengthSq, RcpLength); + + XMVECTOR Normal = XMVectorMultiply(V, RcpLength); + + XMVECTOR Select = XMVectorEqualInt(InfiniteLength, ZeroLength); + Length = XMVectorSelect(LengthSq, Length, Select); + Normal = XMVectorSelect(LengthSq, Normal, Select); + + XMVECTOR ControlMax = XMVectorGreater(Length, LengthMax); + XMVECTOR ControlMin = XMVectorLess(Length, LengthMin); + + XMVECTOR ClampLength = XMVectorSelect(Length, LengthMax, ControlMax); + ClampLength = XMVectorSelect(ClampLength, LengthMin, ControlMin); + + XMVECTOR Result = XMVectorMultiply(Normal, ClampLength); + + // Preserve the original vector (with no precision loss) if the length falls within the given range + XMVECTOR Control = XMVectorEqualInt(ControlMax, ControlMin); + Result = XMVectorSelect(Result, V, Control); + + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2Reflect +( + FXMVECTOR Incident, + FXMVECTOR Normal +) noexcept +{ + // Result = Incident - (2 * dot(Incident, Normal)) * Normal + + XMVECTOR Result; + Result = XMVector2Dot(Incident, Normal); + Result = XMVectorAdd(Result, Result); + Result = XMVectorNegativeMultiplySubtract(Result, Normal, Incident); + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2Refract +( + FXMVECTOR Incident, + FXMVECTOR Normal, + float RefractionIndex +) noexcept +{ + XMVECTOR Index = XMVectorReplicate(RefractionIndex); + return XMVector2RefractV(Incident, Normal, Index); +} + +//------------------------------------------------------------------------------ + +// Return the refraction of a 2D vector +inline XMVECTOR XM_CALLCONV XMVector2RefractV +( + FXMVECTOR Incident, + FXMVECTOR Normal, + FXMVECTOR RefractionIndex +) noexcept +{ + // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + + // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) + +#if defined(_XM_NO_INTRINSICS_) + + float IDotN = (Incident.vector4_f32[0] * Normal.vector4_f32[0]) + (Incident.vector4_f32[1] * Normal.vector4_f32[1]); + // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + float RY = 1.0f - (IDotN * IDotN); + float RX = 1.0f - (RY * RefractionIndex.vector4_f32[0] * RefractionIndex.vector4_f32[0]); + RY = 1.0f - (RY * RefractionIndex.vector4_f32[1] * RefractionIndex.vector4_f32[1]); + if (RX >= 0.0f) + { + RX = (RefractionIndex.vector4_f32[0] * Incident.vector4_f32[0]) - (Normal.vector4_f32[0] * ((RefractionIndex.vector4_f32[0] * IDotN) + sqrtf(RX))); + } + else + { + RX = 0.0f; + } + if (RY >= 0.0f) + { + RY = (RefractionIndex.vector4_f32[1] * Incident.vector4_f32[1]) - (Normal.vector4_f32[1] * ((RefractionIndex.vector4_f32[1] * IDotN) + sqrtf(RY))); + } + else + { + RY = 0.0f; + } + + XMVECTOR vResult; + vResult.vector4_f32[0] = RX; + vResult.vector4_f32[1] = RY; + vResult.vector4_f32[2] = 0.0f; + vResult.vector4_f32[3] = 0.0f; + return vResult; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t IL = vget_low_f32(Incident); + float32x2_t NL = vget_low_f32(Normal); + float32x2_t RIL = vget_low_f32(RefractionIndex); + // Get the 2D Dot product of Incident-Normal + float32x2_t vTemp = vmul_f32(IL, NL); + float32x2_t IDotN = vpadd_f32(vTemp, vTemp); + // vTemp = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + vTemp = vmls_f32(vget_low_f32(g_XMOne), IDotN, IDotN); + vTemp = vmul_f32(vTemp, RIL); + vTemp = vmls_f32(vget_low_f32(g_XMOne), vTemp, RIL); + // If any terms are <=0, sqrt() will fail, punt to zero + uint32x2_t vMask = vcgt_f32(vTemp, vget_low_f32(g_XMZero)); + // Sqrt(vTemp) + float32x2_t S0 = vrsqrte_f32(vTemp); + float32x2_t P0 = vmul_f32(vTemp, S0); + float32x2_t R0 = vrsqrts_f32(P0, S0); + float32x2_t S1 = vmul_f32(S0, R0); + float32x2_t P1 = vmul_f32(vTemp, S1); + float32x2_t R1 = vrsqrts_f32(P1, S1); + float32x2_t S2 = vmul_f32(S1, R1); + vTemp = vmul_f32(vTemp, S2); + // R = RefractionIndex * IDotN + sqrt(R) + vTemp = vmla_f32(vTemp, RIL, IDotN); + // Result = RefractionIndex * Incident - Normal * R + float32x2_t vResult = vmul_f32(RIL, IL); + vResult = vmls_f32(vResult, vTemp, NL); + vResult = vreinterpret_f32_u32(vand_u32(vreinterpret_u32_f32(vResult), vMask)); + return vcombine_f32(vResult, vResult); +#elif defined(_XM_SSE_INTRINSICS_) + // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + + // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) + // Get the 2D Dot product of Incident-Normal + XMVECTOR IDotN = XMVector2Dot(Incident, Normal); + // vTemp = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + XMVECTOR vTemp = XM_FNMADD_PS(IDotN, IDotN, g_XMOne); + vTemp = _mm_mul_ps(vTemp, RefractionIndex); + vTemp = XM_FNMADD_PS(vTemp, RefractionIndex, g_XMOne); + // If any terms are <=0, sqrt() will fail, punt to zero + XMVECTOR vMask = _mm_cmpgt_ps(vTemp, g_XMZero); + // R = RefractionIndex * IDotN + sqrt(R) + vTemp = _mm_sqrt_ps(vTemp); + vTemp = XM_FMADD_PS(RefractionIndex, IDotN, vTemp); + // Result = RefractionIndex * Incident - Normal * R + XMVECTOR vResult = _mm_mul_ps(RefractionIndex, Incident); + vResult = XM_FNMADD_PS(vTemp, Normal, vResult); + vResult = _mm_and_ps(vResult, vMask); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2Orthogonal(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + -V.vector4_f32[1], + V.vector4_f32[0], + 0.f, + 0.f + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 Negate = { { { -1.f, 1.f, 0, 0 } } }; + const float32x2_t zero = vdup_n_f32(0); + + float32x2_t VL = vget_low_f32(V); + float32x2_t Result = vmul_f32(vrev64_f32(VL), vget_low_f32(Negate)); + return vcombine_f32(Result, zero); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 2, 0, 1)); + vResult = _mm_mul_ps(vResult, g_XMNegateX); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2AngleBetweenNormalsEst +( + FXMVECTOR N1, + FXMVECTOR N2 +) noexcept +{ + XMVECTOR Result = XMVector2Dot(N1, N2); + Result = XMVectorClamp(Result, g_XMNegativeOne.v, g_XMOne.v); + Result = XMVectorACosEst(Result); + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2AngleBetweenNormals +( + FXMVECTOR N1, + FXMVECTOR N2 +) noexcept +{ + XMVECTOR Result = XMVector2Dot(N1, N2); + Result = XMVectorClamp(Result, g_XMNegativeOne, g_XMOne); + Result = XMVectorACos(Result); + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2AngleBetweenVectors +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ + XMVECTOR L1 = XMVector2ReciprocalLength(V1); + XMVECTOR L2 = XMVector2ReciprocalLength(V2); + + XMVECTOR Dot = XMVector2Dot(V1, V2); + + L1 = XMVectorMultiply(L1, L2); + + XMVECTOR CosAngle = XMVectorMultiply(Dot, L1); + CosAngle = XMVectorClamp(CosAngle, g_XMNegativeOne.v, g_XMOne.v); + + return XMVectorACos(CosAngle); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2LinePointDistance +( + FXMVECTOR LinePoint1, + FXMVECTOR LinePoint2, + FXMVECTOR Point +) noexcept +{ + // Given a vector PointVector from LinePoint1 to Point and a vector + // LineVector from LinePoint1 to LinePoint2, the scaled distance + // PointProjectionScale from LinePoint1 to the perpendicular projection + // of PointVector onto the line is defined as: + // + // PointProjectionScale = dot(PointVector, LineVector) / LengthSq(LineVector) + + XMVECTOR PointVector = XMVectorSubtract(Point, LinePoint1); + XMVECTOR LineVector = XMVectorSubtract(LinePoint2, LinePoint1); + + XMVECTOR LengthSq = XMVector2LengthSq(LineVector); + + XMVECTOR PointProjectionScale = XMVector2Dot(PointVector, LineVector); + PointProjectionScale = XMVectorDivide(PointProjectionScale, LengthSq); + + XMVECTOR DistanceVector = XMVectorMultiply(LineVector, PointProjectionScale); + DistanceVector = XMVectorSubtract(PointVector, DistanceVector); + + return XMVector2Length(DistanceVector); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2IntersectLine +( + FXMVECTOR Line1Point1, + FXMVECTOR Line1Point2, + FXMVECTOR Line2Point1, + GXMVECTOR Line2Point2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) + + XMVECTOR V1 = XMVectorSubtract(Line1Point2, Line1Point1); + XMVECTOR V2 = XMVectorSubtract(Line2Point2, Line2Point1); + XMVECTOR V3 = XMVectorSubtract(Line1Point1, Line2Point1); + + XMVECTOR C1 = XMVector2Cross(V1, V2); + XMVECTOR C2 = XMVector2Cross(V2, V3); + + XMVECTOR Result; + const XMVECTOR Zero = XMVectorZero(); + if (XMVector2NearEqual(C1, Zero, g_XMEpsilon.v)) + { + if (XMVector2NearEqual(C2, Zero, g_XMEpsilon.v)) + { + // Coincident + Result = g_XMInfinity.v; + } + else + { + // Parallel + Result = g_XMQNaN.v; + } + } + else + { + // Intersection point = Line1Point1 + V1 * (C2 / C1) + XMVECTOR Scale = XMVectorReciprocal(C1); + Scale = XMVectorMultiply(C2, Scale); + Result = XMVectorMultiplyAdd(V1, Scale, Line1Point1); + } + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR V1 = _mm_sub_ps(Line1Point2, Line1Point1); + XMVECTOR V2 = _mm_sub_ps(Line2Point2, Line2Point1); + XMVECTOR V3 = _mm_sub_ps(Line1Point1, Line2Point1); + // Generate the cross products + XMVECTOR C1 = XMVector2Cross(V1, V2); + XMVECTOR C2 = XMVector2Cross(V2, V3); + // If C1 is not close to epsilon, use the calculated value + XMVECTOR vResultMask = _mm_setzero_ps(); + vResultMask = _mm_sub_ps(vResultMask, C1); + vResultMask = _mm_max_ps(vResultMask, C1); + // 0xFFFFFFFF if the calculated value is to be used + vResultMask = _mm_cmpgt_ps(vResultMask, g_XMEpsilon); + // If C1 is close to epsilon, which fail type is it? INFINITY or NAN? + XMVECTOR vFailMask = _mm_setzero_ps(); + vFailMask = _mm_sub_ps(vFailMask, C2); + vFailMask = _mm_max_ps(vFailMask, C2); + vFailMask = _mm_cmple_ps(vFailMask, g_XMEpsilon); + XMVECTOR vFail = _mm_and_ps(vFailMask, g_XMInfinity); + vFailMask = _mm_andnot_ps(vFailMask, g_XMQNaN); + // vFail is NAN or INF + vFail = _mm_or_ps(vFail, vFailMask); + // Intersection point = Line1Point1 + V1 * (C2 / C1) + XMVECTOR vResult = _mm_div_ps(C2, C1); + vResult = XM_FMADD_PS(vResult, V1, Line1Point1); + // Use result, or failure value + vResult = _mm_and_ps(vResult, vResultMask); + vResultMask = _mm_andnot_ps(vResultMask, vFail); + vResult = _mm_or_ps(vResult, vResultMask); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2Transform +( + FXMVECTOR V, + FXMMATRIX M +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Y = XMVectorSplatY(V); + XMVECTOR X = XMVectorSplatX(V); + + XMVECTOR Result = XMVectorMultiplyAdd(Y, M.r[1], M.r[3]); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + float32x4_t Result = vmlaq_lane_f32(M.r[3], M.r[1], VL, 1); // Y + return vmlaq_lane_f32(Result, M.r[0], VL, 0); // X +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); // Y + vResult = XM_FMADD_PS(vResult, M.r[1], M.r[3]); + XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); // X + vResult = XM_FMADD_PS(vTemp, M.r[0], vResult); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline XMFLOAT4* XM_CALLCONV XMVector2TransformStream +( + XMFLOAT4* pOutputStream, + size_t OutputStride, + const XMFLOAT2* pInputStream, + size_t InputStride, + size_t VectorCount, + FXMMATRIX M +) noexcept +{ + assert(pOutputStream != nullptr); + assert(pInputStream != nullptr); + + assert(InputStride >= sizeof(XMFLOAT2)); + _Analysis_assume_(InputStride >= sizeof(XMFLOAT2)); + + assert(OutputStride >= sizeof(XMFLOAT4)); + _Analysis_assume_(OutputStride >= sizeof(XMFLOAT4)); + +#if defined(_XM_NO_INTRINSICS_) + + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row3 = M.r[3]; + + for (size_t i = 0; i < VectorCount; i++) + { + XMVECTOR V = XMLoadFloat2(reinterpret_cast(pInputVector)); + XMVECTOR Y = XMVectorSplatY(V); + XMVECTOR X = XMVectorSplatX(V); + + XMVECTOR Result = XMVectorMultiplyAdd(Y, row1, row3); + Result = XMVectorMultiplyAdd(X, row0, Result); + +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable : 26015, "PREfast noise: Esp:1307" ) +#endif + + XMStoreFloat4(reinterpret_cast(pOutputVector), Result); + +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row3 = M.r[3]; + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if ((InputStride == sizeof(XMFLOAT2)) && (OutputStride == sizeof(XMFLOAT4))) + { + for (size_t j = 0; j < four; ++j) + { + float32x4x2_t V = vld2q_f32(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 4; + + float32x2_t r3 = vget_low_f32(row3); + float32x2_t r = vget_low_f32(row0); + XMVECTOR vResult0 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Ax+M + XMVECTOR vResult1 = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Bx+N + + XM_PREFETCH(pInputVector); + + r3 = vget_high_f32(row3); + r = vget_high_f32(row0); + XMVECTOR vResult2 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Cx+O + XMVECTOR vResult3 = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Dx+P + + XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); + + r = vget_low_f32(row1); + vResult0 = vmlaq_lane_f32(vResult0, V.val[1], r, 0); // Ax+Ey+M + vResult1 = vmlaq_lane_f32(vResult1, V.val[1], r, 1); // Bx+Fy+N + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); + + r = vget_high_f32(row1); + vResult2 = vmlaq_lane_f32(vResult2, V.val[1], r, 0); // Cx+Gy+O + vResult3 = vmlaq_lane_f32(vResult3, V.val[1], r, 1); // Dx+Hy+P + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); + + float32x4x4_t R; + R.val[0] = vResult0; + R.val[1] = vResult1; + R.val[2] = vResult2; + R.val[3] = vResult3; + + vst4q_f32(reinterpret_cast(pOutputVector), R); + pOutputVector += sizeof(XMFLOAT4) * 4; + + i += 4; + } + } + } + + for (; i < VectorCount; i++) + { + float32x2_t V = vld1_f32(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + XMVECTOR vResult = vmlaq_lane_f32(row3, row0, V, 0); // X + vResult = vmlaq_lane_f32(vResult, row1, V, 1); // Y + + vst1q_f32(reinterpret_cast(pOutputVector), vResult); + pOutputVector += OutputStride; + } + + return pOutputStream; +#elif defined(_XM_AVX2_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + __m256 row0 = _mm256_broadcast_ps(&M.r[0]); + __m256 row1 = _mm256_broadcast_ps(&M.r[1]); + __m256 row3 = _mm256_broadcast_ps(&M.r[3]); + + if (InputStride == sizeof(XMFLOAT2)) + { + if (OutputStride == sizeof(XMFLOAT4)) + { + if (!(reinterpret_cast(pOutputStream) & 0x1F)) + { + // Packed input, aligned & packed output + for (size_t j = 0; j < four; ++j) + { + __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 4; + + __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); + __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); + __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); + + __m256 vTempB = _mm256_fmadd_ps(Y1, row1, row3); + __m256 vTempB2 = _mm256_fmadd_ps(Y2, row1, row3); + __m256 vTempA = _mm256_mul_ps(X1, row0); + __m256 vTempA2 = _mm256_mul_ps(X2, row0); + vTempA = _mm256_add_ps(vTempA, vTempB); + vTempA2 = _mm256_add_ps(vTempA2, vTempB2); + + X1 = _mm256_insertf128_ps(vTempA, _mm256_castps256_ps128(vTempA2), 1); + XM256_STREAM_PS(reinterpret_cast(pOutputVector), X1); + pOutputVector += sizeof(XMFLOAT4) * 2; + + X2 = _mm256_insertf128_ps(vTempA2, _mm256_extractf128_ps(vTempA, 1), 0); + XM256_STREAM_PS(reinterpret_cast(pOutputVector), X2); + pOutputVector += sizeof(XMFLOAT4) * 2; + + i += 4; + } + } + else + { + // Packed input, packed output + for (size_t j = 0; j < four; ++j) + { + __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 4; + + __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); + __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); + __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); + + __m256 vTempB = _mm256_fmadd_ps(Y1, row1, row3); + __m256 vTempB2 = _mm256_fmadd_ps(Y2, row1, row3); + __m256 vTempA = _mm256_mul_ps(X1, row0); + __m256 vTempA2 = _mm256_mul_ps(X2, row0); + vTempA = _mm256_add_ps(vTempA, vTempB); + vTempA2 = _mm256_add_ps(vTempA2, vTempB2); + + X1 = _mm256_insertf128_ps(vTempA, _mm256_castps256_ps128(vTempA2), 1); + _mm256_storeu_ps(reinterpret_cast(pOutputVector), X1); + pOutputVector += sizeof(XMFLOAT4) * 2; + + X2 = _mm256_insertf128_ps(vTempA2, _mm256_extractf128_ps(vTempA, 1), 0); + _mm256_storeu_ps(reinterpret_cast(pOutputVector), X2); + pOutputVector += sizeof(XMFLOAT4) * 2; + + i += 4; + } + } + } + else + { + // Packed input, unpacked output + for (size_t j = 0; j < four; ++j) + { + __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 4; + + __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); + __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); + __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); + + __m256 vTempB = _mm256_fmadd_ps(Y1, row1, row3); + __m256 vTempB2 = _mm256_fmadd_ps(Y2, row1, row3); + __m256 vTempA = _mm256_mul_ps(X1, row0); + __m256 vTempA2 = _mm256_mul_ps(X2, row0); + vTempA = _mm256_add_ps(vTempA, vTempB); + vTempA2 = _mm256_add_ps(vTempA2, vTempB2); + + _mm_storeu_ps(reinterpret_cast(pOutputVector), _mm256_castps256_ps128(vTempA)); + pOutputVector += OutputStride; + + _mm_storeu_ps(reinterpret_cast(pOutputVector), _mm256_castps256_ps128(vTempA2)); + pOutputVector += OutputStride; + + _mm_storeu_ps(reinterpret_cast(pOutputVector), _mm256_extractf128_ps(vTempA, 1)); + pOutputVector += OutputStride; + + _mm_storeu_ps(reinterpret_cast(pOutputVector), _mm256_extractf128_ps(vTempA2, 1)); + pOutputVector += OutputStride; + + i += 4; + } + } + } + } + + if (i < VectorCount) + { + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row3 = M.r[3]; + + for (; i < VectorCount; i++) + { + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pInputVector))); + pInputVector += InputStride; + + XMVECTOR Y = XM_PERMUTE_PS(xy, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(xy, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); + XMVECTOR vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + } + } + + XM_SFENCE(); + + return pOutputStream; +#elif defined(_XM_SSE_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row3 = M.r[3]; + + size_t i = 0; + size_t two = VectorCount >> 1; + if (two > 0) + { + if (InputStride == sizeof(XMFLOAT2)) + { + if (!(reinterpret_cast(pOutputStream) & 0xF) && !(OutputStride & 0xF)) + { + // Packed input, aligned output + for (size_t j = 0; j < two; ++j) + { + XMVECTOR V = _mm_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 2; + + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); + XMVECTOR vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + X = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + + vTemp = XM_FMADD_PS(Y, row1, row3); + vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + i += 2; + } + } + else + { + // Packed input, unaligned output + for (size_t j = 0; j < two; ++j) + { + XMVECTOR V = _mm_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 2; + + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); + XMVECTOR vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + X = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + + vTemp = XM_FMADD_PS(Y, row1, row3); + vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + i += 2; + } + } + } + } + + if (!(reinterpret_cast(pInputVector) & 0xF) && !(InputStride & 0xF)) + { + if (!(reinterpret_cast(pOutputStream) & 0xF) && !(OutputStride & 0xF)) + { + // Aligned input, aligned output + for (; i < VectorCount; i++) + { + XMVECTOR V = _mm_castsi128_ps(_mm_loadl_epi64(reinterpret_cast(pInputVector))); + pInputVector += InputStride; + + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); + XMVECTOR vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + } + } + else + { + // Aligned input, unaligned output + for (; i < VectorCount; i++) + { + XMVECTOR V = _mm_castsi128_ps(_mm_loadl_epi64(reinterpret_cast(pInputVector))); + pInputVector += InputStride; + + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); + XMVECTOR vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + } + } + } + else + { + // Unaligned input + for (; i < VectorCount; i++) + { + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pInputVector))); + pInputVector += InputStride; + + XMVECTOR Y = XM_PERMUTE_PS(xy, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(xy, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); + XMVECTOR vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + } + } + + XM_SFENCE(); + + return pOutputStream; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2TransformCoord +( + FXMVECTOR V, + FXMMATRIX M +) noexcept +{ + XMVECTOR Y = XMVectorSplatY(V); + XMVECTOR X = XMVectorSplatX(V); + + XMVECTOR Result = XMVectorMultiplyAdd(Y, M.r[1], M.r[3]); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + XMVECTOR W = XMVectorSplatW(Result); + return XMVectorDivide(Result, W); +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline XMFLOAT2* XM_CALLCONV XMVector2TransformCoordStream +( + XMFLOAT2* pOutputStream, + size_t OutputStride, + const XMFLOAT2* pInputStream, + size_t InputStride, + size_t VectorCount, + FXMMATRIX M +) noexcept +{ + assert(pOutputStream != nullptr); + assert(pInputStream != nullptr); + + assert(InputStride >= sizeof(XMFLOAT2)); + _Analysis_assume_(InputStride >= sizeof(XMFLOAT2)); + + assert(OutputStride >= sizeof(XMFLOAT2)); + _Analysis_assume_(OutputStride >= sizeof(XMFLOAT2)); + +#if defined(_XM_NO_INTRINSICS_) + + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row3 = M.r[3]; + + for (size_t i = 0; i < VectorCount; i++) + { + XMVECTOR V = XMLoadFloat2(reinterpret_cast(pInputVector)); + XMVECTOR Y = XMVectorSplatY(V); + XMVECTOR X = XMVectorSplatX(V); + + XMVECTOR Result = XMVectorMultiplyAdd(Y, row1, row3); + Result = XMVectorMultiplyAdd(X, row0, Result); + + XMVECTOR W = XMVectorSplatW(Result); + + Result = XMVectorDivide(Result, W); + +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable : 26015, "PREfast noise: Esp:1307" ) +#endif + + XMStoreFloat2(reinterpret_cast(pOutputVector), Result); + +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row3 = M.r[3]; + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if ((InputStride == sizeof(XMFLOAT2)) && (OutputStride == sizeof(XMFLOAT2))) + { + for (size_t j = 0; j < four; ++j) + { + float32x4x2_t V = vld2q_f32(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 4; + + float32x2_t r3 = vget_low_f32(row3); + float32x2_t r = vget_low_f32(row0); + XMVECTOR vResult0 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Ax+M + XMVECTOR vResult1 = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Bx+N + + XM_PREFETCH(pInputVector); + + r3 = vget_high_f32(row3); + r = vget_high_f32(row0); + XMVECTOR W = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Dx+P + + XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); + + r = vget_low_f32(row1); + vResult0 = vmlaq_lane_f32(vResult0, V.val[1], r, 0); // Ax+Ey+M + vResult1 = vmlaq_lane_f32(vResult1, V.val[1], r, 1); // Bx+Fy+N + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); + + r = vget_high_f32(row1); + W = vmlaq_lane_f32(W, V.val[1], r, 1); // Dx+Hy+P + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); + +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + V.val[0] = vdivq_f32(vResult0, W); + V.val[1] = vdivq_f32(vResult1, W); +#else + // 2 iterations of Newton-Raphson refinement of reciprocal + float32x4_t Reciprocal = vrecpeq_f32(W); + float32x4_t S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + + V.val[0] = vmulq_f32(vResult0, Reciprocal); + V.val[1] = vmulq_f32(vResult1, Reciprocal); +#endif + + vst2q_f32(reinterpret_cast(pOutputVector), V); + pOutputVector += sizeof(XMFLOAT2) * 4; + + i += 4; + } + } + } + + for (; i < VectorCount; i++) + { + float32x2_t V = vld1_f32(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + XMVECTOR vResult = vmlaq_lane_f32(row3, row0, V, 0); // X + vResult = vmlaq_lane_f32(vResult, row1, V, 1); // Y + + V = vget_high_f32(vResult); + float32x2_t W = vdup_lane_f32(V, 1); + +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + V = vget_low_f32(vResult); + V = vdiv_f32(V, W); +#else + // 2 iterations of Newton-Raphson refinement of reciprocal for W + float32x2_t Reciprocal = vrecpe_f32(W); + float32x2_t S = vrecps_f32(Reciprocal, W); + Reciprocal = vmul_f32(S, Reciprocal); + S = vrecps_f32(Reciprocal, W); + Reciprocal = vmul_f32(S, Reciprocal); + + V = vget_low_f32(vResult); + V = vmul_f32(V, Reciprocal); +#endif + + vst1_f32(reinterpret_cast(pOutputVector), V); + pOutputVector += OutputStride; + } + + return pOutputStream; +#elif defined(_XM_AVX2_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + __m256 row0 = _mm256_broadcast_ps(&M.r[0]); + __m256 row1 = _mm256_broadcast_ps(&M.r[1]); + __m256 row3 = _mm256_broadcast_ps(&M.r[3]); + + if (InputStride == sizeof(XMFLOAT2)) + { + if (OutputStride == sizeof(XMFLOAT2)) + { + if (!(reinterpret_cast(pOutputStream) & 0x1F)) + { + // Packed input, aligned & packed output + for (size_t j = 0; j < four; ++j) + { + __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 4; + + __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); + __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); + __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); + + __m256 vTempB = _mm256_fmadd_ps(Y1, row1, row3); + __m256 vTempB2 = _mm256_fmadd_ps(Y2, row1, row3); + __m256 vTempA = _mm256_mul_ps(X1, row0); + __m256 vTempA2 = _mm256_mul_ps(X2, row0); + vTempA = _mm256_add_ps(vTempA, vTempB); + vTempA2 = _mm256_add_ps(vTempA2, vTempB2); + + __m256 W = _mm256_shuffle_ps(vTempA, vTempA, _MM_SHUFFLE(3, 3, 3, 3)); + vTempA = _mm256_div_ps(vTempA, W); + + W = _mm256_shuffle_ps(vTempA2, vTempA2, _MM_SHUFFLE(3, 3, 3, 3)); + vTempA2 = _mm256_div_ps(vTempA2, W); + + X1 = _mm256_shuffle_ps(vTempA, vTempA2, 0x44); + XM256_STREAM_PS(reinterpret_cast(pOutputVector), X1); + pOutputVector += sizeof(XMFLOAT2) * 4; + + i += 4; + } + } + else + { + // Packed input, packed output + for (size_t j = 0; j < four; ++j) + { + __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 4; + + __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); + __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); + __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); + + __m256 vTempB = _mm256_fmadd_ps(Y1, row1, row3); + __m256 vTempB2 = _mm256_fmadd_ps(Y2, row1, row3); + __m256 vTempA = _mm256_mul_ps(X1, row0); + __m256 vTempA2 = _mm256_mul_ps(X2, row0); + vTempA = _mm256_add_ps(vTempA, vTempB); + vTempA2 = _mm256_add_ps(vTempA2, vTempB2); + + __m256 W = _mm256_shuffle_ps(vTempA, vTempA, _MM_SHUFFLE(3, 3, 3, 3)); + vTempA = _mm256_div_ps(vTempA, W); + + W = _mm256_shuffle_ps(vTempA2, vTempA2, _MM_SHUFFLE(3, 3, 3, 3)); + vTempA2 = _mm256_div_ps(vTempA2, W); + + X1 = _mm256_shuffle_ps(vTempA, vTempA2, 0x44); + _mm256_storeu_ps(reinterpret_cast(pOutputVector), X1); + pOutputVector += sizeof(XMFLOAT2) * 4; + + i += 4; + } + } + } + else + { + // Packed input, unpacked output + for (size_t j = 0; j < four; ++j) + { + __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 4; + + __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); + __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); + __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); + + __m256 vTempB = _mm256_fmadd_ps(Y1, row1, row3); + __m256 vTempB2 = _mm256_fmadd_ps(Y2, row1, row3); + __m256 vTempA = _mm256_mul_ps(X1, row0); + __m256 vTempA2 = _mm256_mul_ps(X2, row0); + vTempA = _mm256_add_ps(vTempA, vTempB); + vTempA2 = _mm256_add_ps(vTempA2, vTempB2); + + __m256 W = _mm256_shuffle_ps(vTempA, vTempA, _MM_SHUFFLE(3, 3, 3, 3)); + vTempA = _mm256_div_ps(vTempA, W); + + W = _mm256_shuffle_ps(vTempA2, vTempA2, _MM_SHUFFLE(3, 3, 3, 3)); + vTempA2 = _mm256_div_ps(vTempA2, W); + + _mm_store_sd(reinterpret_cast(pOutputVector), + _mm_castps_pd(_mm256_castps256_ps128(vTempA))); + pOutputVector += OutputStride; + + _mm_store_sd(reinterpret_cast(pOutputVector), + _mm_castps_pd(_mm256_castps256_ps128(vTempA2))); + pOutputVector += OutputStride; + + _mm_store_sd(reinterpret_cast(pOutputVector), + _mm_castps_pd(_mm256_extractf128_ps(vTempA, 1))); + pOutputVector += OutputStride; + + _mm_store_sd(reinterpret_cast(pOutputVector), + _mm_castps_pd(_mm256_extractf128_ps(vTempA2, 1))); + pOutputVector += OutputStride; + + i += 4; + } + } + } + } + + if (i < VectorCount) + { + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row3 = M.r[3]; + + for (; i < VectorCount; i++) + { + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pInputVector))); + pInputVector += InputStride; + + XMVECTOR Y = XM_PERMUTE_PS(xy, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(xy, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); + XMVECTOR vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + + _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); + pOutputVector += OutputStride; + } + } + + XM_SFENCE(); + + return pOutputStream; +#elif defined(_XM_SSE_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row3 = M.r[3]; + + size_t i = 0; + size_t two = VectorCount >> 1; + if (two > 0) + { + if (InputStride == sizeof(XMFLOAT2)) + { + if (OutputStride == sizeof(XMFLOAT2)) + { + if (!(reinterpret_cast(pOutputStream) & 0xF)) + { + // Packed input, aligned & packed output + for (size_t j = 0; j < two; ++j) + { + XMVECTOR V = _mm_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 2; + + // Result 1 + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); + XMVECTOR vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + XMVECTOR V1 = _mm_div_ps(vTemp, W); + + // Result 2 + Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + X = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + + vTemp = XM_FMADD_PS(Y, row1, row3); + vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + XMVECTOR V2 = _mm_div_ps(vTemp, W); + + vTemp = _mm_movelh_ps(V1, V2); + + XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += sizeof(XMFLOAT2) * 2; + + i += 2; + } + } + else + { + // Packed input, unaligned & packed output + for (size_t j = 0; j < two; ++j) + { + XMVECTOR V = _mm_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 2; + + // Result 1 + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); + XMVECTOR vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + XMVECTOR V1 = _mm_div_ps(vTemp, W); + + // Result 2 + Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + X = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + + vTemp = XM_FMADD_PS(Y, row1, row3); + vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + XMVECTOR V2 = _mm_div_ps(vTemp, W); + + vTemp = _mm_movelh_ps(V1, V2); + + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += sizeof(XMFLOAT2) * 2; + + i += 2; + } + } + } + else + { + // Packed input, unpacked output + for (size_t j = 0; j < two; ++j) + { + XMVECTOR V = _mm_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 2; + + // Result 1 + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); + XMVECTOR vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + vTemp = _mm_div_ps(vTemp, W); + + _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); + pOutputVector += OutputStride; + + // Result 2 + Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + X = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + + vTemp = XM_FMADD_PS(Y, row1, row3); + vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + vTemp = _mm_div_ps(vTemp, W); + + _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); + pOutputVector += OutputStride; + + i += 2; + } + } + } + } + + if (!(reinterpret_cast(pInputVector) & 0xF) && !(InputStride & 0xF)) + { + // Aligned input + for (; i < VectorCount; i++) + { + XMVECTOR V = _mm_castsi128_ps(_mm_loadl_epi64(reinterpret_cast(pInputVector))); + pInputVector += InputStride; + + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); + XMVECTOR vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + vTemp = _mm_div_ps(vTemp, W); + + _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); + pOutputVector += OutputStride; + } + } + else + { + // Unaligned input + for (; i < VectorCount; i++) + { + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pInputVector))); + pInputVector += InputStride; + + XMVECTOR Y = XM_PERMUTE_PS(xy, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(xy, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); + XMVECTOR vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + vTemp = _mm_div_ps(vTemp, W); + + _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); + pOutputVector += OutputStride; + } + } + + XM_SFENCE(); + + return pOutputStream; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2TransformNormal +( + FXMVECTOR V, + FXMMATRIX M +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Y = XMVectorSplatY(V); + XMVECTOR X = XMVectorSplatX(V); + + XMVECTOR Result = XMVectorMultiply(Y, M.r[1]); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + float32x4_t Result = vmulq_lane_f32(M.r[1], VL, 1); // Y + return vmlaq_lane_f32(Result, M.r[0], VL, 0); // X +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); // Y + vResult = _mm_mul_ps(vResult, M.r[1]); + XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); // X + vResult = XM_FMADD_PS(vTemp, M.r[0], vResult); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline XMFLOAT2* XM_CALLCONV XMVector2TransformNormalStream +( + XMFLOAT2* pOutputStream, + size_t OutputStride, + const XMFLOAT2* pInputStream, + size_t InputStride, + size_t VectorCount, + FXMMATRIX M +) noexcept +{ + assert(pOutputStream != nullptr); + assert(pInputStream != nullptr); + + assert(InputStride >= sizeof(XMFLOAT2)); + _Analysis_assume_(InputStride >= sizeof(XMFLOAT2)); + + assert(OutputStride >= sizeof(XMFLOAT2)); + _Analysis_assume_(OutputStride >= sizeof(XMFLOAT2)); + +#if defined(_XM_NO_INTRINSICS_) + + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + + for (size_t i = 0; i < VectorCount; i++) + { + XMVECTOR V = XMLoadFloat2(reinterpret_cast(pInputVector)); + XMVECTOR Y = XMVectorSplatY(V); + XMVECTOR X = XMVectorSplatX(V); + + XMVECTOR Result = XMVectorMultiply(Y, row1); + Result = XMVectorMultiplyAdd(X, row0, Result); + +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable : 26015, "PREfast noise: Esp:1307" ) +#endif + + XMStoreFloat2(reinterpret_cast(pOutputVector), Result); + +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if ((InputStride == sizeof(XMFLOAT2)) && (OutputStride == sizeof(XMFLOAT2))) + { + for (size_t j = 0; j < four; ++j) + { + float32x4x2_t V = vld2q_f32(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 4; + + float32x2_t r = vget_low_f32(row0); + XMVECTOR vResult0 = vmulq_lane_f32(V.val[0], r, 0); // Ax + XMVECTOR vResult1 = vmulq_lane_f32(V.val[0], r, 1); // Bx + + XM_PREFETCH(pInputVector); + XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); + + r = vget_low_f32(row1); + vResult0 = vmlaq_lane_f32(vResult0, V.val[1], r, 0); // Ax+Ey + vResult1 = vmlaq_lane_f32(vResult1, V.val[1], r, 1); // Bx+Fy + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); + + V.val[0] = vResult0; + V.val[1] = vResult1; + + vst2q_f32(reinterpret_cast(pOutputVector), V); + pOutputVector += sizeof(XMFLOAT2) * 4; + + i += 4; + } + } + } + + for (; i < VectorCount; i++) + { + float32x2_t V = vld1_f32(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + XMVECTOR vResult = vmulq_lane_f32(row0, V, 0); // X + vResult = vmlaq_lane_f32(vResult, row1, V, 1); // Y + + V = vget_low_f32(vResult); + vst1_f32(reinterpret_cast(pOutputVector), V); + pOutputVector += OutputStride; + } + + return pOutputStream; +#elif defined(_XM_AVX2_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + __m256 row0 = _mm256_broadcast_ps(&M.r[0]); + __m256 row1 = _mm256_broadcast_ps(&M.r[1]); + + if (InputStride == sizeof(XMFLOAT2)) + { + if (OutputStride == sizeof(XMFLOAT2)) + { + if (!(reinterpret_cast(pOutputStream) & 0x1F)) + { + // Packed input, aligned & packed output + for (size_t j = 0; j < four; ++j) + { + __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 4; + + __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); + __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); + __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); + + __m256 vTempA = _mm256_mul_ps(Y1, row1); + __m256 vTempB = _mm256_mul_ps(Y2, row1); + vTempA = _mm256_fmadd_ps(X1, row0, vTempA); + vTempB = _mm256_fmadd_ps(X2, row0, vTempB); + + X1 = _mm256_shuffle_ps(vTempA, vTempB, 0x44); + XM256_STREAM_PS(reinterpret_cast(pOutputVector), X1); + pOutputVector += sizeof(XMFLOAT2) * 4; + + i += 4; + } + } + else + { + // Packed input, packed output + for (size_t j = 0; j < four; ++j) + { + __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 4; + + __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); + __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); + __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); + + __m256 vTempA = _mm256_mul_ps(Y1, row1); + __m256 vTempB = _mm256_mul_ps(Y2, row1); + vTempA = _mm256_fmadd_ps(X1, row0, vTempA); + vTempB = _mm256_fmadd_ps(X2, row0, vTempB); + + X1 = _mm256_shuffle_ps(vTempA, vTempB, 0x44); + _mm256_storeu_ps(reinterpret_cast(pOutputVector), X1); + pOutputVector += sizeof(XMFLOAT2) * 4; + + i += 4; + } + } + } + else + { + // Packed input, unpacked output + for (size_t j = 0; j < four; ++j) + { + __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 4; + + __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); + __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); + __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); + + __m256 vTempA = _mm256_mul_ps(Y1, row1); + __m256 vTempB = _mm256_mul_ps(Y2, row1); + vTempA = _mm256_fmadd_ps(X1, row0, vTempA); + vTempB = _mm256_fmadd_ps(X2, row0, vTempB); + + _mm_store_sd(reinterpret_cast(pOutputVector), + _mm_castps_pd(_mm256_castps256_ps128(vTempA))); + pOutputVector += OutputStride; + + _mm_store_sd(reinterpret_cast(pOutputVector), + _mm_castps_pd(_mm256_castps256_ps128(vTempB))); + pOutputVector += OutputStride; + + _mm_store_sd(reinterpret_cast(pOutputVector), + _mm_castps_pd(_mm256_extractf128_ps(vTempA, 1))); + pOutputVector += OutputStride; + + _mm_store_sd(reinterpret_cast(pOutputVector), + _mm_castps_pd(_mm256_extractf128_ps(vTempB, 1))); + pOutputVector += OutputStride; + + i += 4; + } + } + } + } + + if (i < VectorCount) + { + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + + for (; i < VectorCount; i++) + { + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pInputVector))); + pInputVector += InputStride; + + XMVECTOR Y = XM_PERMUTE_PS(xy, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(xy, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = _mm_mul_ps(Y, row1); + vTemp = XM_FMADD_PS(X, row0, vTemp); + + _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); + pOutputVector += OutputStride; + } + } + + XM_SFENCE(); + + return pOutputStream; +#elif defined(_XM_SSE_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + + size_t i = 0; + size_t two = VectorCount >> 1; + if (two > 0) + { + if (InputStride == sizeof(XMFLOAT2)) + { + if (OutputStride == sizeof(XMFLOAT2)) + { + if (!(reinterpret_cast(pOutputStream) & 0xF)) + { + // Packed input, aligned & packed output + for (size_t j = 0; j < two; ++j) + { + XMVECTOR V = _mm_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 2; + + // Result 1 + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = _mm_mul_ps(Y, row1); + XMVECTOR V1 = XM_FMADD_PS(X, row0, vTemp); + + // Result 2 + Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + X = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + + vTemp = _mm_mul_ps(Y, row1); + XMVECTOR V2 = XM_FMADD_PS(X, row0, vTemp); + + vTemp = _mm_movelh_ps(V1, V2); + + XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += sizeof(XMFLOAT2) * 2; + + i += 2; + } + } + else + { + // Packed input, unaligned & packed output + for (size_t j = 0; j < two; ++j) + { + XMVECTOR V = _mm_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 2; + + // Result 1 + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = _mm_mul_ps(Y, row1); + XMVECTOR V1 = XM_FMADD_PS(X, row0, vTemp); + + // Result 2 + Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + X = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + + vTemp = _mm_mul_ps(Y, row1); + XMVECTOR V2 = XM_FMADD_PS(X, row0, vTemp); + + vTemp = _mm_movelh_ps(V1, V2); + + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += sizeof(XMFLOAT2) * 2; + + i += 2; + } + } + } + else + { + // Packed input, unpacked output + for (size_t j = 0; j < two; ++j) + { + XMVECTOR V = _mm_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 2; + + // Result 1 + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = _mm_mul_ps(Y, row1); + vTemp = XM_FMADD_PS(X, row0, vTemp); + + _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); + pOutputVector += OutputStride; + + // Result 2 + Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + X = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + + vTemp = _mm_mul_ps(Y, row1); + vTemp = XM_FMADD_PS(X, row0, vTemp); + + _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); + pOutputVector += OutputStride; + + i += 2; + } + } + } + } + + if (!(reinterpret_cast(pInputVector) & 0xF) && !(InputStride & 0xF)) + { + // Aligned input + for (; i < VectorCount; i++) + { + XMVECTOR V = _mm_castsi128_ps(_mm_loadl_epi64(reinterpret_cast(pInputVector))); + pInputVector += InputStride; + + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = _mm_mul_ps(Y, row1); + vTemp = XM_FMADD_PS(X, row0, vTemp); + + _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); + pOutputVector += OutputStride; + } + } + else + { + // Unaligned input + for (; i < VectorCount; i++) + { + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pInputVector))); + pInputVector += InputStride; + + XMVECTOR Y = XM_PERMUTE_PS(xy, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(xy, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = _mm_mul_ps(Y, row1); + vTemp = XM_FMADD_PS(X, row0, vTemp); + + _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); + pOutputVector += OutputStride; + } + } + + XM_SFENCE(); + + return pOutputStream; +#endif +} + +/**************************************************************************** + * + * 3D Vector + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + // Comparison operations + //------------------------------------------------------------------------------ + + //------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector3Equal +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] == V2.vector4_f32[0]) && (V1.vector4_f32[1] == V2.vector4_f32[1]) && (V1.vector4_f32[2] == V2.vector4_f32[2])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) == 0xFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); + return (((_mm_movemask_ps(vTemp) & 7) == 7) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline uint32_t XM_CALLCONV XMVector3EqualR +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + uint32_t CR = 0; + if ((V1.vector4_f32[0] == V2.vector4_f32[0]) && + (V1.vector4_f32[1] == V2.vector4_f32[1]) && + (V1.vector4_f32[2] == V2.vector4_f32[2])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] != V2.vector4_f32[0]) && + (V1.vector4_f32[1] != V2.vector4_f32[1]) && + (V1.vector4_f32[2] != V2.vector4_f32[2])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU; + + uint32_t CR = 0; + if (r == 0xFFFFFFU) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); + int iTest = _mm_movemask_ps(vTemp) & 7; + uint32_t CR = 0; + if (iTest == 7) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector3EqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_u32[0] == V2.vector4_u32[0]) && (V1.vector4_u32[1] == V2.vector4_u32[1]) && (V1.vector4_u32[2] == V2.vector4_u32[2])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) == 0xFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); + return (((_mm_movemask_ps(_mm_castsi128_ps(vTemp)) & 7) == 7) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline uint32_t XM_CALLCONV XMVector3EqualIntR +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + uint32_t CR = 0; + if ((V1.vector4_u32[0] == V2.vector4_u32[0]) && + (V1.vector4_u32[1] == V2.vector4_u32[1]) && + (V1.vector4_u32[2] == V2.vector4_u32[2])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_u32[0] != V2.vector4_u32[0]) && + (V1.vector4_u32[1] != V2.vector4_u32[1]) && + (V1.vector4_u32[2] != V2.vector4_u32[2])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU; + + uint32_t CR = 0; + if (r == 0xFFFFFFU) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); + int iTemp = _mm_movemask_ps(_mm_castsi128_ps(vTemp)) & 7; + uint32_t CR = 0; + if (iTemp == 7) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTemp) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector3NearEqual +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR Epsilon +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + float dx, dy, dz; + + dx = fabsf(V1.vector4_f32[0] - V2.vector4_f32[0]); + dy = fabsf(V1.vector4_f32[1] - V2.vector4_f32[1]); + dz = fabsf(V1.vector4_f32[2] - V2.vector4_f32[2]); + return (((dx <= Epsilon.vector4_f32[0]) && + (dy <= Epsilon.vector4_f32[1]) && + (dz <= Epsilon.vector4_f32[2])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t vDelta = vsubq_f32(V1, V2); +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + uint32x4_t vResult = vacleq_f32(vDelta, Epsilon); +#else + uint32x4_t vResult = vcleq_f32(vabsq_f32(vDelta), Epsilon); +#endif + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) == 0xFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + // Get the difference + XMVECTOR vDelta = _mm_sub_ps(V1, V2); + // Get the absolute value of the difference + XMVECTOR vTemp = _mm_setzero_ps(); + vTemp = _mm_sub_ps(vTemp, vDelta); + vTemp = _mm_max_ps(vTemp, vDelta); + vTemp = _mm_cmple_ps(vTemp, Epsilon); + // w is don't care + return (((_mm_movemask_ps(vTemp) & 7) == 0x7) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector3NotEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] != V2.vector4_f32[0]) || (V1.vector4_f32[1] != V2.vector4_f32[1]) || (V1.vector4_f32[2] != V2.vector4_f32[2])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) != 0xFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); + return (((_mm_movemask_ps(vTemp) & 7) != 7) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector3NotEqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_u32[0] != V2.vector4_u32[0]) || (V1.vector4_u32[1] != V2.vector4_u32[1]) || (V1.vector4_u32[2] != V2.vector4_u32[2])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) != 0xFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); + return (((_mm_movemask_ps(_mm_castsi128_ps(vTemp)) & 7) != 7) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector3Greater +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] > V2.vector4_f32[0]) && (V1.vector4_f32[1] > V2.vector4_f32[1]) && (V1.vector4_f32[2] > V2.vector4_f32[2])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcgtq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) == 0xFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpgt_ps(V1, V2); + return (((_mm_movemask_ps(vTemp) & 7) == 7) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline uint32_t XM_CALLCONV XMVector3GreaterR +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + uint32_t CR = 0; + if ((V1.vector4_f32[0] > V2.vector4_f32[0]) && + (V1.vector4_f32[1] > V2.vector4_f32[1]) && + (V1.vector4_f32[2] > V2.vector4_f32[2])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] <= V2.vector4_f32[0]) && + (V1.vector4_f32[1] <= V2.vector4_f32[1]) && + (V1.vector4_f32[2] <= V2.vector4_f32[2])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcgtq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU; + + uint32_t CR = 0; + if (r == 0xFFFFFFU) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpgt_ps(V1, V2); + uint32_t CR = 0; + int iTest = _mm_movemask_ps(vTemp) & 7; + if (iTest == 7) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector3GreaterOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] >= V2.vector4_f32[0]) && (V1.vector4_f32[1] >= V2.vector4_f32[1]) && (V1.vector4_f32[2] >= V2.vector4_f32[2])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcgeq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) == 0xFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpge_ps(V1, V2); + return (((_mm_movemask_ps(vTemp) & 7) == 7) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline uint32_t XM_CALLCONV XMVector3GreaterOrEqualR +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + uint32_t CR = 0; + if ((V1.vector4_f32[0] >= V2.vector4_f32[0]) && + (V1.vector4_f32[1] >= V2.vector4_f32[1]) && + (V1.vector4_f32[2] >= V2.vector4_f32[2])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] < V2.vector4_f32[0]) && + (V1.vector4_f32[1] < V2.vector4_f32[1]) && + (V1.vector4_f32[2] < V2.vector4_f32[2])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcgeq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU; + + uint32_t CR = 0; + if (r == 0xFFFFFFU) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpge_ps(V1, V2); + uint32_t CR = 0; + int iTest = _mm_movemask_ps(vTemp) & 7; + if (iTest == 7) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector3Less +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] < V2.vector4_f32[0]) && (V1.vector4_f32[1] < V2.vector4_f32[1]) && (V1.vector4_f32[2] < V2.vector4_f32[2])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcltq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) == 0xFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmplt_ps(V1, V2); + return (((_mm_movemask_ps(vTemp) & 7) == 7) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector3LessOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] <= V2.vector4_f32[0]) && (V1.vector4_f32[1] <= V2.vector4_f32[1]) && (V1.vector4_f32[2] <= V2.vector4_f32[2])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcleq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) == 0xFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmple_ps(V1, V2); + return (((_mm_movemask_ps(vTemp) & 7) == 7) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector3InBounds +( + FXMVECTOR V, + FXMVECTOR Bounds +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) && + (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]) && + (V.vector4_f32[2] <= Bounds.vector4_f32[2] && V.vector4_f32[2] >= -Bounds.vector4_f32[2])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Test if less than or equal + uint32x4_t ivTemp1 = vcleq_f32(V, Bounds); + // Negate the bounds + float32x4_t vTemp2 = vnegq_f32(Bounds); + // Test if greater or equal (Reversed) + uint32x4_t ivTemp2 = vcleq_f32(vTemp2, V); + // Blend answers + ivTemp1 = vandq_u32(ivTemp1, ivTemp2); + // in bounds? + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(ivTemp1)), vget_high_u8(vreinterpretq_u8_u32(ivTemp1))); + uint16x4x2_t vTemp3 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return ((vget_lane_u32(vreinterpret_u32_u16(vTemp3.val[1]), 1) & 0xFFFFFFU) == 0xFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + // Test if less than or equal + XMVECTOR vTemp1 = _mm_cmple_ps(V, Bounds); + // Negate the bounds + XMVECTOR vTemp2 = _mm_mul_ps(Bounds, g_XMNegativeOne); + // Test if greater or equal (Reversed) + vTemp2 = _mm_cmple_ps(vTemp2, V); + // Blend answers + vTemp1 = _mm_and_ps(vTemp1, vTemp2); + // x,y and z in bounds? (w is don't care) + return (((_mm_movemask_ps(vTemp1) & 0x7) == 0x7) != 0); +#else + return XMComparisonAllInBounds(XMVector3InBoundsR(V, Bounds)); +#endif +} + +//------------------------------------------------------------------------------ + +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) +#pragma float_control(push) +#pragma float_control(precise, on) +#endif + +inline bool XM_CALLCONV XMVector3IsNaN(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + return (XMISNAN(V.vector4_f32[0]) || + XMISNAN(V.vector4_f32[1]) || + XMISNAN(V.vector4_f32[2])); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Test against itself. NaN is always not equal + uint32x4_t vTempNan = vceqq_f32(V, V); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vTempNan)), vget_high_u8(vreinterpretq_u8_u32(vTempNan))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + // If x or y or z are NaN, the mask is zero + return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) != 0xFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + // Test against itself. NaN is always not equal + XMVECTOR vTempNan = _mm_cmpneq_ps(V, V); + // If x or y or z are NaN, the mask is non-zero + return ((_mm_movemask_ps(vTempNan) & 7) != 0); +#endif +} + +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) +#pragma float_control(pop) +#endif + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector3IsInfinite(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (XMISINF(V.vector4_f32[0]) || + XMISINF(V.vector4_f32[1]) || + XMISINF(V.vector4_f32[2])); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Mask off the sign bit + uint32x4_t vTempInf = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); + // Compare to infinity + vTempInf = vceqq_f32(vreinterpretq_f32_u32(vTempInf), g_XMInfinity); + // If any are infinity, the signs are true. + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vTempInf)), vget_high_u8(vreinterpretq_u8_u32(vTempInf))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Mask off the sign bit + __m128 vTemp = _mm_and_ps(V, g_XMAbsMask); + // Compare to infinity + vTemp = _mm_cmpeq_ps(vTemp, g_XMInfinity); + // If x,y or z are infinity, the signs are true. + return ((_mm_movemask_ps(vTemp) & 7) != 0); +#endif +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3Dot +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + float fValue = V1.vector4_f32[0] * V2.vector4_f32[0] + V1.vector4_f32[1] * V2.vector4_f32[1] + V1.vector4_f32[2] * V2.vector4_f32[2]; + XMVECTORF32 vResult; + vResult.f[0] = + vResult.f[1] = + vResult.f[2] = + vResult.f[3] = fValue; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t vTemp = vmulq_f32(V1, V2); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vpadd_f32(v1, v1); + v2 = vdup_lane_f32(v2, 0); + v1 = vadd_f32(v1, v2); + return vcombine_f32(v1, v1); +#elif defined(_XM_SSE4_INTRINSICS_) + return _mm_dp_ps(V1, V2, 0x7f); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vTemp = _mm_mul_ps(V1, V2); + vTemp = _mm_and_ps(vTemp, g_XMMask3); + vTemp = _mm_hadd_ps(vTemp, vTemp); + return _mm_hadd_ps(vTemp, vTemp); +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product + XMVECTOR vDot = _mm_mul_ps(V1, V2); + // x=Dot.vector4_f32[1], y=Dot.vector4_f32[2] + XMVECTOR vTemp = XM_PERMUTE_PS(vDot, _MM_SHUFFLE(2, 1, 2, 1)); + // Result.vector4_f32[0] = x+y + vDot = _mm_add_ss(vDot, vTemp); + // x=Dot.vector4_f32[2] + vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); + // Result.vector4_f32[0] = (x+y)+z + vDot = _mm_add_ss(vDot, vTemp); + // Splat x + return XM_PERMUTE_PS(vDot, _MM_SHUFFLE(0, 0, 0, 0)); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3Cross +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ + // [ V1.y*V2.z - V1.z*V2.y, V1.z*V2.x - V1.x*V2.z, V1.x*V2.y - V1.y*V2.x ] + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + (V1.vector4_f32[1] * V2.vector4_f32[2]) - (V1.vector4_f32[2] * V2.vector4_f32[1]), + (V1.vector4_f32[2] * V2.vector4_f32[0]) - (V1.vector4_f32[0] * V2.vector4_f32[2]), + (V1.vector4_f32[0] * V2.vector4_f32[1]) - (V1.vector4_f32[1] * V2.vector4_f32[0]), + 0.0f + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t v1xy = vget_low_f32(V1); + float32x2_t v2xy = vget_low_f32(V2); + + float32x2_t v1yx = vrev64_f32(v1xy); + float32x2_t v2yx = vrev64_f32(v2xy); + + float32x2_t v1zz = vdup_lane_f32(vget_high_f32(V1), 0); + float32x2_t v2zz = vdup_lane_f32(vget_high_f32(V2), 0); + + XMVECTOR vResult = vmulq_f32(vcombine_f32(v1yx, v1xy), vcombine_f32(v2zz, v2yx)); + vResult = vmlsq_f32(vResult, vcombine_f32(v1zz, v1yx), vcombine_f32(v2yx, v2xy)); + vResult = vreinterpretq_f32_u32(veorq_u32(vreinterpretq_u32_f32(vResult), g_XMFlipY)); + return vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(vResult), g_XMMask3)); +#elif defined(_XM_SSE_INTRINSICS_) + // y1,z1,x1,w1 + XMVECTOR vTemp1 = XM_PERMUTE_PS(V1, _MM_SHUFFLE(3, 0, 2, 1)); + // z2,x2,y2,w2 + XMVECTOR vTemp2 = XM_PERMUTE_PS(V2, _MM_SHUFFLE(3, 1, 0, 2)); + // Perform the left operation + XMVECTOR vResult = _mm_mul_ps(vTemp1, vTemp2); + // z1,x1,y1,w1 + vTemp1 = XM_PERMUTE_PS(vTemp1, _MM_SHUFFLE(3, 0, 2, 1)); + // y2,z2,x2,w2 + vTemp2 = XM_PERMUTE_PS(vTemp2, _MM_SHUFFLE(3, 1, 0, 2)); + // Perform the right operation + vResult = XM_FNMADD_PS(vTemp1, vTemp2, vResult); + // Set w to zero + return _mm_and_ps(vResult, g_XMMask3); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3LengthSq(FXMVECTOR V) noexcept +{ + return XMVector3Dot(V, V); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3ReciprocalLengthEst(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector3LengthSq(V); + Result = XMVectorReciprocalSqrtEst(Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Dot3 + float32x4_t vTemp = vmulq_f32(V, V); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vpadd_f32(v1, v1); + v2 = vdup_lane_f32(v2, 0); + v1 = vadd_f32(v1, v2); + // Reciprocal sqrt (estimate) + v2 = vrsqrte_f32(v1); + return vcombine_f32(v2, v2); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0x7f); + return _mm_rsqrt_ps(vTemp); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + vLengthSq = _mm_and_ps(vLengthSq, g_XMMask3); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_rsqrt_ps(vLengthSq); + return vLengthSq; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y and z + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has z and y + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 2, 1, 2)); + // x+z, y + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + // y,y,y,y + vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); + // x+z+y,??,??,?? + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + // Splat the length squared + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + // Get the reciprocal + vLengthSq = _mm_rsqrt_ps(vLengthSq); + return vLengthSq; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3ReciprocalLength(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector3LengthSq(V); + Result = XMVectorReciprocalSqrt(Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Dot3 + float32x4_t vTemp = vmulq_f32(V, V); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vpadd_f32(v1, v1); + v2 = vdup_lane_f32(v2, 0); + v1 = vadd_f32(v1, v2); + // Reciprocal sqrt + float32x2_t S0 = vrsqrte_f32(v1); + float32x2_t P0 = vmul_f32(v1, S0); + float32x2_t R0 = vrsqrts_f32(P0, S0); + float32x2_t S1 = vmul_f32(S0, R0); + float32x2_t P1 = vmul_f32(v1, S1); + float32x2_t R1 = vrsqrts_f32(P1, S1); + float32x2_t Result = vmul_f32(S1, R1); + return vcombine_f32(Result, Result); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0x7f); + XMVECTOR vLengthSq = _mm_sqrt_ps(vTemp); + return _mm_div_ps(g_XMOne, vLengthSq); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vDot = _mm_mul_ps(V, V); + vDot = _mm_and_ps(vDot, g_XMMask3); + vDot = _mm_hadd_ps(vDot, vDot); + vDot = _mm_hadd_ps(vDot, vDot); + vDot = _mm_sqrt_ps(vDot); + vDot = _mm_div_ps(g_XMOne, vDot); + return vDot; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product + XMVECTOR vDot = _mm_mul_ps(V, V); + // x=Dot.y, y=Dot.z + XMVECTOR vTemp = XM_PERMUTE_PS(vDot, _MM_SHUFFLE(2, 1, 2, 1)); + // Result.x = x+y + vDot = _mm_add_ss(vDot, vTemp); + // x=Dot.z + vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); + // Result.x = (x+y)+z + vDot = _mm_add_ss(vDot, vTemp); + // Splat x + vDot = XM_PERMUTE_PS(vDot, _MM_SHUFFLE(0, 0, 0, 0)); + // Get the reciprocal + vDot = _mm_sqrt_ps(vDot); + // Get the reciprocal + vDot = _mm_div_ps(g_XMOne, vDot); + return vDot; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3LengthEst(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector3LengthSq(V); + Result = XMVectorSqrtEst(Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Dot3 + float32x4_t vTemp = vmulq_f32(V, V); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vpadd_f32(v1, v1); + v2 = vdup_lane_f32(v2, 0); + v1 = vadd_f32(v1, v2); + const float32x2_t zero = vdup_n_f32(0); + uint32x2_t VEqualsZero = vceq_f32(v1, zero); + // Sqrt (estimate) + float32x2_t Result = vrsqrte_f32(v1); + Result = vmul_f32(v1, Result); + Result = vbsl_f32(VEqualsZero, zero, Result); + return vcombine_f32(Result, Result); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0x7f); + return _mm_sqrt_ps(vTemp); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + vLengthSq = _mm_and_ps(vLengthSq, g_XMMask3); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y and z + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has z and y + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 2, 1, 2)); + // x+z, y + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + // y,y,y,y + vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); + // x+z+y,??,??,?? + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + // Splat the length squared + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + // Get the length + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3Length(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector3LengthSq(V); + Result = XMVectorSqrt(Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Dot3 + float32x4_t vTemp = vmulq_f32(V, V); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vpadd_f32(v1, v1); + v2 = vdup_lane_f32(v2, 0); + v1 = vadd_f32(v1, v2); + const float32x2_t zero = vdup_n_f32(0); + uint32x2_t VEqualsZero = vceq_f32(v1, zero); + // Sqrt + float32x2_t S0 = vrsqrte_f32(v1); + float32x2_t P0 = vmul_f32(v1, S0); + float32x2_t R0 = vrsqrts_f32(P0, S0); + float32x2_t S1 = vmul_f32(S0, R0); + float32x2_t P1 = vmul_f32(v1, S1); + float32x2_t R1 = vrsqrts_f32(P1, S1); + float32x2_t Result = vmul_f32(S1, R1); + Result = vmul_f32(v1, Result); + Result = vbsl_f32(VEqualsZero, zero, Result); + return vcombine_f32(Result, Result); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0x7f); + return _mm_sqrt_ps(vTemp); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + vLengthSq = _mm_and_ps(vLengthSq, g_XMMask3); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y and z + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has z and y + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 2, 1, 2)); + // x+z, y + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + // y,y,y,y + vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); + // x+z+y,??,??,?? + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + // Splat the length squared + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + // Get the length + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#endif +} + +//------------------------------------------------------------------------------ +// XMVector3NormalizeEst uses a reciprocal estimate and +// returns QNaN on zero and infinite vectors. + +inline XMVECTOR XM_CALLCONV XMVector3NormalizeEst(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result = XMVector3ReciprocalLength(V); + Result = XMVectorMultiply(V, Result); + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Dot3 + float32x4_t vTemp = vmulq_f32(V, V); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vpadd_f32(v1, v1); + v2 = vdup_lane_f32(v2, 0); + v1 = vadd_f32(v1, v2); + // Reciprocal sqrt (estimate) + v2 = vrsqrte_f32(v1); + // Normalize + return vmulq_f32(V, vcombine_f32(v2, v2)); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0x7f); + XMVECTOR vResult = _mm_rsqrt_ps(vTemp); + return _mm_mul_ps(vResult, V); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vDot = _mm_mul_ps(V, V); + vDot = _mm_and_ps(vDot, g_XMMask3); + vDot = _mm_hadd_ps(vDot, vDot); + vDot = _mm_hadd_ps(vDot, vDot); + vDot = _mm_rsqrt_ps(vDot); + vDot = _mm_mul_ps(vDot, V); + return vDot; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product + XMVECTOR vDot = _mm_mul_ps(V, V); + // x=Dot.y, y=Dot.z + XMVECTOR vTemp = XM_PERMUTE_PS(vDot, _MM_SHUFFLE(2, 1, 2, 1)); + // Result.x = x+y + vDot = _mm_add_ss(vDot, vTemp); + // x=Dot.z + vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); + // Result.x = (x+y)+z + vDot = _mm_add_ss(vDot, vTemp); + // Splat x + vDot = XM_PERMUTE_PS(vDot, _MM_SHUFFLE(0, 0, 0, 0)); + // Get the reciprocal + vDot = _mm_rsqrt_ps(vDot); + // Perform the normalization + vDot = _mm_mul_ps(vDot, V); + return vDot; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3Normalize(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + float fLength; + XMVECTOR vResult; + + vResult = XMVector3Length(V); + fLength = vResult.vector4_f32[0]; + + // Prevent divide by zero + if (fLength > 0) + { + fLength = 1.0f / fLength; + } + + vResult.vector4_f32[0] = V.vector4_f32[0] * fLength; + vResult.vector4_f32[1] = V.vector4_f32[1] * fLength; + vResult.vector4_f32[2] = V.vector4_f32[2] * fLength; + vResult.vector4_f32[3] = V.vector4_f32[3] * fLength; + return vResult; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Dot3 + float32x4_t vTemp = vmulq_f32(V, V); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vpadd_f32(v1, v1); + v2 = vdup_lane_f32(v2, 0); + v1 = vadd_f32(v1, v2); + uint32x2_t VEqualsZero = vceq_f32(v1, vdup_n_f32(0)); + uint32x2_t VEqualsInf = vceq_f32(v1, vget_low_f32(g_XMInfinity)); + // Reciprocal sqrt (2 iterations of Newton-Raphson) + float32x2_t S0 = vrsqrte_f32(v1); + float32x2_t P0 = vmul_f32(v1, S0); + float32x2_t R0 = vrsqrts_f32(P0, S0); + float32x2_t S1 = vmul_f32(S0, R0); + float32x2_t P1 = vmul_f32(v1, S1); + float32x2_t R1 = vrsqrts_f32(P1, S1); + v2 = vmul_f32(S1, R1); + // Normalize + XMVECTOR vResult = vmulq_f32(V, vcombine_f32(v2, v2)); + vResult = vbslq_f32(vcombine_u32(VEqualsZero, VEqualsZero), vdupq_n_f32(0), vResult); + return vbslq_f32(vcombine_u32(VEqualsInf, VEqualsInf), g_XMQNaN, vResult); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vLengthSq = _mm_dp_ps(V, V, 0x7f); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Create zero with a single instruction + XMVECTOR vZeroMask = _mm_setzero_ps(); + // Test for a divide by zero (Must be FP to detect -0.0) + vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); + // Divide to perform the normalization + vResult = _mm_div_ps(V, vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult, vZeroMask); + // Select qnan or result based on infinite length + XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); + XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); + vResult = _mm_or_ps(vTemp1, vTemp2); + return vResult; +#elif defined(_XM_SSE3_INTRINSICS_) + // Perform the dot product on x,y and z only + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + vLengthSq = _mm_and_ps(vLengthSq, g_XMMask3); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Create zero with a single instruction + XMVECTOR vZeroMask = _mm_setzero_ps(); + // Test for a divide by zero (Must be FP to detect -0.0) + vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); + // Divide to perform the normalization + vResult = _mm_div_ps(V, vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult, vZeroMask); + // Select qnan or result based on infinite length + XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); + XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); + vResult = _mm_or_ps(vTemp1, vTemp2); + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y and z only + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(2, 1, 2, 1)); + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Create zero with a single instruction + XMVECTOR vZeroMask = _mm_setzero_ps(); + // Test for a divide by zero (Must be FP to detect -0.0) + vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); + // Divide to perform the normalization + vResult = _mm_div_ps(V, vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult, vZeroMask); + // Select qnan or result based on infinite length + XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); + XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); + vResult = _mm_or_ps(vTemp1, vTemp2); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3ClampLength +( + FXMVECTOR V, + float LengthMin, + float LengthMax +) noexcept +{ + XMVECTOR ClampMax = XMVectorReplicate(LengthMax); + XMVECTOR ClampMin = XMVectorReplicate(LengthMin); + + return XMVector3ClampLengthV(V, ClampMin, ClampMax); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3ClampLengthV +( + FXMVECTOR V, + FXMVECTOR LengthMin, + FXMVECTOR LengthMax +) noexcept +{ + assert((XMVectorGetY(LengthMin) == XMVectorGetX(LengthMin)) && (XMVectorGetZ(LengthMin) == XMVectorGetX(LengthMin))); + assert((XMVectorGetY(LengthMax) == XMVectorGetX(LengthMax)) && (XMVectorGetZ(LengthMax) == XMVectorGetX(LengthMax))); + assert(XMVector3GreaterOrEqual(LengthMin, XMVectorZero())); + assert(XMVector3GreaterOrEqual(LengthMax, XMVectorZero())); + assert(XMVector3GreaterOrEqual(LengthMax, LengthMin)); + + XMVECTOR LengthSq = XMVector3LengthSq(V); + + const XMVECTOR Zero = XMVectorZero(); + + XMVECTOR RcpLength = XMVectorReciprocalSqrt(LengthSq); + + XMVECTOR InfiniteLength = XMVectorEqualInt(LengthSq, g_XMInfinity.v); + XMVECTOR ZeroLength = XMVectorEqual(LengthSq, Zero); + + XMVECTOR Normal = XMVectorMultiply(V, RcpLength); + + XMVECTOR Length = XMVectorMultiply(LengthSq, RcpLength); + + XMVECTOR Select = XMVectorEqualInt(InfiniteLength, ZeroLength); + Length = XMVectorSelect(LengthSq, Length, Select); + Normal = XMVectorSelect(LengthSq, Normal, Select); + + XMVECTOR ControlMax = XMVectorGreater(Length, LengthMax); + XMVECTOR ControlMin = XMVectorLess(Length, LengthMin); + + XMVECTOR ClampLength = XMVectorSelect(Length, LengthMax, ControlMax); + ClampLength = XMVectorSelect(ClampLength, LengthMin, ControlMin); + + XMVECTOR Result = XMVectorMultiply(Normal, ClampLength); + + // Preserve the original vector (with no precision loss) if the length falls within the given range + XMVECTOR Control = XMVectorEqualInt(ControlMax, ControlMin); + Result = XMVectorSelect(Result, V, Control); + + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3Reflect +( + FXMVECTOR Incident, + FXMVECTOR Normal +) noexcept +{ + // Result = Incident - (2 * dot(Incident, Normal)) * Normal + + XMVECTOR Result = XMVector3Dot(Incident, Normal); + Result = XMVectorAdd(Result, Result); + Result = XMVectorNegativeMultiplySubtract(Result, Normal, Incident); + + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3Refract +( + FXMVECTOR Incident, + FXMVECTOR Normal, + float RefractionIndex +) noexcept +{ + XMVECTOR Index = XMVectorReplicate(RefractionIndex); + return XMVector3RefractV(Incident, Normal, Index); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3RefractV +( + FXMVECTOR Incident, + FXMVECTOR Normal, + FXMVECTOR RefractionIndex +) noexcept +{ + // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + + // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) + +#if defined(_XM_NO_INTRINSICS_) + + const XMVECTOR Zero = XMVectorZero(); + + XMVECTOR IDotN = XMVector3Dot(Incident, Normal); + + // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + XMVECTOR R = XMVectorNegativeMultiplySubtract(IDotN, IDotN, g_XMOne.v); + R = XMVectorMultiply(R, RefractionIndex); + R = XMVectorNegativeMultiplySubtract(R, RefractionIndex, g_XMOne.v); + + if (XMVector4LessOrEqual(R, Zero)) + { + // Total internal reflection + return Zero; + } + else + { + // R = RefractionIndex * IDotN + sqrt(R) + R = XMVectorSqrt(R); + R = XMVectorMultiplyAdd(RefractionIndex, IDotN, R); + + // Result = RefractionIndex * Incident - Normal * R + XMVECTOR Result = XMVectorMultiply(RefractionIndex, Incident); + Result = XMVectorNegativeMultiplySubtract(Normal, R, Result); + + return Result; + } + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMVECTOR IDotN = XMVector3Dot(Incident, Normal); + + // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + float32x4_t R = vmlsq_f32(g_XMOne, IDotN, IDotN); + R = vmulq_f32(R, RefractionIndex); + R = vmlsq_f32(g_XMOne, R, RefractionIndex); + + uint32x4_t isrzero = vcleq_f32(R, g_XMZero); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(isrzero)), vget_high_u8(vreinterpretq_u8_u32(isrzero))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + + float32x4_t vResult; + if (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU) + { + // Total internal reflection + vResult = g_XMZero; + } + else + { + // Sqrt(R) + float32x4_t S0 = vrsqrteq_f32(R); + float32x4_t P0 = vmulq_f32(R, S0); + float32x4_t R0 = vrsqrtsq_f32(P0, S0); + float32x4_t S1 = vmulq_f32(S0, R0); + float32x4_t P1 = vmulq_f32(R, S1); + float32x4_t R1 = vrsqrtsq_f32(P1, S1); + float32x4_t S2 = vmulq_f32(S1, R1); + R = vmulq_f32(R, S2); + // R = RefractionIndex * IDotN + sqrt(R) + R = vmlaq_f32(R, RefractionIndex, IDotN); + // Result = RefractionIndex * Incident - Normal * R + vResult = vmulq_f32(RefractionIndex, Incident); + vResult = vmlsq_f32(vResult, R, Normal); + } + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + + // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) + XMVECTOR IDotN = XMVector3Dot(Incident, Normal); + // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + XMVECTOR R = XM_FNMADD_PS(IDotN, IDotN, g_XMOne); + XMVECTOR R2 = _mm_mul_ps(RefractionIndex, RefractionIndex); + R = XM_FNMADD_PS(R, R2, g_XMOne); + + XMVECTOR vResult = _mm_cmple_ps(R, g_XMZero); + if (_mm_movemask_ps(vResult) == 0x0f) + { + // Total internal reflection + vResult = g_XMZero; + } + else + { + // R = RefractionIndex * IDotN + sqrt(R) + R = _mm_sqrt_ps(R); + R = XM_FMADD_PS(RefractionIndex, IDotN, R); + // Result = RefractionIndex * Incident - Normal * R + vResult = _mm_mul_ps(RefractionIndex, Incident); + vResult = XM_FNMADD_PS(R, Normal, vResult); + } + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3Orthogonal(FXMVECTOR V) noexcept +{ + XMVECTOR Zero = XMVectorZero(); + XMVECTOR Z = XMVectorSplatZ(V); + XMVECTOR YZYY = XMVectorSwizzle(V); + + XMVECTOR NegativeV = XMVectorSubtract(Zero, V); + + XMVECTOR ZIsNegative = XMVectorLess(Z, Zero); + XMVECTOR YZYYIsNegative = XMVectorLess(YZYY, Zero); + + XMVECTOR S = XMVectorAdd(YZYY, Z); + XMVECTOR D = XMVectorSubtract(YZYY, Z); + + XMVECTOR Select = XMVectorEqualInt(ZIsNegative, YZYYIsNegative); + + XMVECTOR R0 = XMVectorPermute(NegativeV, S); + XMVECTOR R1 = XMVectorPermute(V, D); + + return XMVectorSelect(R1, R0, Select); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3AngleBetweenNormalsEst +( + FXMVECTOR N1, + FXMVECTOR N2 +) noexcept +{ + XMVECTOR Result = XMVector3Dot(N1, N2); + Result = XMVectorClamp(Result, g_XMNegativeOne.v, g_XMOne.v); + Result = XMVectorACosEst(Result); + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3AngleBetweenNormals +( + FXMVECTOR N1, + FXMVECTOR N2 +) noexcept +{ + XMVECTOR Result = XMVector3Dot(N1, N2); + Result = XMVectorClamp(Result, g_XMNegativeOne.v, g_XMOne.v); + Result = XMVectorACos(Result); + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3AngleBetweenVectors +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ + XMVECTOR L1 = XMVector3ReciprocalLength(V1); + XMVECTOR L2 = XMVector3ReciprocalLength(V2); + + XMVECTOR Dot = XMVector3Dot(V1, V2); + + L1 = XMVectorMultiply(L1, L2); + + XMVECTOR CosAngle = XMVectorMultiply(Dot, L1); + CosAngle = XMVectorClamp(CosAngle, g_XMNegativeOne.v, g_XMOne.v); + + return XMVectorACos(CosAngle); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3LinePointDistance +( + FXMVECTOR LinePoint1, + FXMVECTOR LinePoint2, + FXMVECTOR Point +) noexcept +{ + // Given a vector PointVector from LinePoint1 to Point and a vector + // LineVector from LinePoint1 to LinePoint2, the scaled distance + // PointProjectionScale from LinePoint1 to the perpendicular projection + // of PointVector onto the line is defined as: + // + // PointProjectionScale = dot(PointVector, LineVector) / LengthSq(LineVector) + + XMVECTOR PointVector = XMVectorSubtract(Point, LinePoint1); + XMVECTOR LineVector = XMVectorSubtract(LinePoint2, LinePoint1); + + XMVECTOR LengthSq = XMVector3LengthSq(LineVector); + + XMVECTOR PointProjectionScale = XMVector3Dot(PointVector, LineVector); + PointProjectionScale = XMVectorDivide(PointProjectionScale, LengthSq); + + XMVECTOR DistanceVector = XMVectorMultiply(LineVector, PointProjectionScale); + DistanceVector = XMVectorSubtract(PointVector, DistanceVector); + + return XMVector3Length(DistanceVector); +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline void XM_CALLCONV XMVector3ComponentsFromNormal +( + XMVECTOR* pParallel, + XMVECTOR* pPerpendicular, + FXMVECTOR V, + FXMVECTOR Normal +) noexcept +{ + assert(pParallel != nullptr); + assert(pPerpendicular != nullptr); + + XMVECTOR Scale = XMVector3Dot(V, Normal); + + XMVECTOR Parallel = XMVectorMultiply(Normal, Scale); + + *pParallel = Parallel; + *pPerpendicular = XMVectorSubtract(V, Parallel); +} + +//------------------------------------------------------------------------------ +// Transform a vector using a rotation expressed as a unit quaternion + +inline XMVECTOR XM_CALLCONV XMVector3Rotate +( + FXMVECTOR V, + FXMVECTOR RotationQuaternion +) noexcept +{ + XMVECTOR A = XMVectorSelect(g_XMSelect1110.v, V, g_XMSelect1110.v); + XMVECTOR Q = XMQuaternionConjugate(RotationQuaternion); + XMVECTOR Result = XMQuaternionMultiply(Q, A); + return XMQuaternionMultiply(Result, RotationQuaternion); +} + +//------------------------------------------------------------------------------ +// Transform a vector using the inverse of a rotation expressed as a unit quaternion + +inline XMVECTOR XM_CALLCONV XMVector3InverseRotate +( + FXMVECTOR V, + FXMVECTOR RotationQuaternion +) noexcept +{ + XMVECTOR A = XMVectorSelect(g_XMSelect1110.v, V, g_XMSelect1110.v); + XMVECTOR Result = XMQuaternionMultiply(RotationQuaternion, A); + XMVECTOR Q = XMQuaternionConjugate(RotationQuaternion); + return XMQuaternionMultiply(Result, Q); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3Transform +( + FXMVECTOR V, + FXMMATRIX M +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Z = XMVectorSplatZ(V); + XMVECTOR Y = XMVectorSplatY(V); + XMVECTOR X = XMVectorSplatX(V); + + XMVECTOR Result = XMVectorMultiplyAdd(Z, M.r[2], M.r[3]); + Result = XMVectorMultiplyAdd(Y, M.r[1], Result); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + XMVECTOR vResult = vmlaq_lane_f32(M.r[3], M.r[0], VL, 0); // X + vResult = vmlaq_lane_f32(vResult, M.r[1], VL, 1); // Y + return vmlaq_lane_f32(vResult, M.r[2], vget_high_f32(V), 0); // Z +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); // Z + vResult = XM_FMADD_PS(vResult, M.r[2], M.r[3]); + XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); // Y + vResult = XM_FMADD_PS(vTemp, M.r[1], vResult); + vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); // X + vResult = XM_FMADD_PS(vTemp, M.r[0], vResult); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable : 26015 26019, "PREfast noise: Esp:1307" ) +#endif + +_Use_decl_annotations_ +inline XMFLOAT4* XM_CALLCONV XMVector3TransformStream +( + XMFLOAT4* pOutputStream, + size_t OutputStride, + const XMFLOAT3* pInputStream, + size_t InputStride, + size_t VectorCount, + FXMMATRIX M +) noexcept +{ + assert(pOutputStream != nullptr); + assert(pInputStream != nullptr); + + assert(InputStride >= sizeof(XMFLOAT3)); + _Analysis_assume_(InputStride >= sizeof(XMFLOAT3)); + + assert(OutputStride >= sizeof(XMFLOAT4)); + _Analysis_assume_(OutputStride >= sizeof(XMFLOAT4)); + +#if defined(_XM_NO_INTRINSICS_) + + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row2 = M.r[2]; + const XMVECTOR row3 = M.r[3]; + + for (size_t i = 0; i < VectorCount; i++) + { + XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); + XMVECTOR Z = XMVectorSplatZ(V); + XMVECTOR Y = XMVectorSplatY(V); + XMVECTOR X = XMVectorSplatX(V); + + XMVECTOR Result = XMVectorMultiplyAdd(Z, row2, row3); + Result = XMVectorMultiplyAdd(Y, row1, Result); + Result = XMVectorMultiplyAdd(X, row0, Result); + + XMStoreFloat4(reinterpret_cast(pOutputVector), Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row2 = M.r[2]; + const XMVECTOR row3 = M.r[3]; + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if ((InputStride == sizeof(XMFLOAT3)) && (OutputStride == sizeof(XMFLOAT4))) + { + for (size_t j = 0; j < four; ++j) + { + float32x4x3_t V = vld3q_f32(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT3) * 4; + + float32x2_t r3 = vget_low_f32(row3); + float32x2_t r = vget_low_f32(row0); + XMVECTOR vResult0 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Ax+M + XMVECTOR vResult1 = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Bx+N + + XM_PREFETCH(pInputVector); + + r3 = vget_high_f32(row3); + r = vget_high_f32(row0); + XMVECTOR vResult2 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Cx+O + XMVECTOR vResult3 = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Dx+P + + XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); + + r = vget_low_f32(row1); + vResult0 = vmlaq_lane_f32(vResult0, V.val[1], r, 0); // Ax+Ey+M + vResult1 = vmlaq_lane_f32(vResult1, V.val[1], r, 1); // Bx+Fy+N + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); + + r = vget_high_f32(row1); + vResult2 = vmlaq_lane_f32(vResult2, V.val[1], r, 0); // Cx+Gy+O + vResult3 = vmlaq_lane_f32(vResult3, V.val[1], r, 1); // Dx+Hy+P + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); + + r = vget_low_f32(row2); + vResult0 = vmlaq_lane_f32(vResult0, V.val[2], r, 0); // Ax+Ey+Iz+M + vResult1 = vmlaq_lane_f32(vResult1, V.val[2], r, 1); // Bx+Fy+Jz+N + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 4)); + + r = vget_high_f32(row2); + vResult2 = vmlaq_lane_f32(vResult2, V.val[2], r, 0); // Cx+Gy+Kz+O + vResult3 = vmlaq_lane_f32(vResult3, V.val[2], r, 1); // Dx+Hy+Lz+P + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 5)); + + float32x4x4_t R; + R.val[0] = vResult0; + R.val[1] = vResult1; + R.val[2] = vResult2; + R.val[3] = vResult3; + + vst4q_f32(reinterpret_cast(pOutputVector), R); + pOutputVector += sizeof(XMFLOAT4) * 4; + + i += 4; + } + } + } + + for (; i < VectorCount; i++) + { + float32x2_t VL = vld1_f32(reinterpret_cast(pInputVector)); + float32x2_t zero = vdup_n_f32(0); + float32x2_t VH = vld1_lane_f32(reinterpret_cast(pInputVector) + 2, zero, 0); + pInputVector += InputStride; + + XMVECTOR vResult = vmlaq_lane_f32(row3, row0, VL, 0); // X + vResult = vmlaq_lane_f32(vResult, row1, VL, 1); // Y + vResult = vmlaq_lane_f32(vResult, row2, VH, 0); // Z + + vst1q_f32(reinterpret_cast(pOutputVector), vResult); + pOutputVector += OutputStride; + } + + return pOutputStream; +#elif defined(_XM_SSE_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row2 = M.r[2]; + const XMVECTOR row3 = M.r[3]; + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if (InputStride == sizeof(XMFLOAT3)) + { + if (!(reinterpret_cast(pOutputStream) & 0xF) && !(OutputStride & 0xF)) + { + // Packed input, aligned output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, row2, row3); + XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); + XMVECTOR vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 2 + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 3 + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 4 + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + i += 4; + } + } + else + { + // Packed input, unaligned output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, row2, row3); + XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); + XMVECTOR vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 2 + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 3 + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 4 + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + i += 4; + } + } + } + } + + if (!(reinterpret_cast(pOutputStream) & 0xF) && !(OutputStride & 0xF)) + { + // Aligned output + for (; i < VectorCount; ++i) + { + XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + XMVECTOR Z = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, row2, row3); + XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); + XMVECTOR vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + } + } + else + { + // Unaligned output + for (; i < VectorCount; ++i) + { + XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + XMVECTOR Z = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, row2, row3); + XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); + XMVECTOR vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + } + } + + XM_SFENCE(); + + return pOutputStream; +#endif +} + +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3TransformCoord +( + FXMVECTOR V, + FXMMATRIX M +) noexcept +{ + XMVECTOR Z = XMVectorSplatZ(V); + XMVECTOR Y = XMVectorSplatY(V); + XMVECTOR X = XMVectorSplatX(V); + + XMVECTOR Result = XMVectorMultiplyAdd(Z, M.r[2], M.r[3]); + Result = XMVectorMultiplyAdd(Y, M.r[1], Result); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + XMVECTOR W = XMVectorSplatW(Result); + return XMVectorDivide(Result, W); +} + +//------------------------------------------------------------------------------ + +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable : 26015 26019, "PREfast noise: Esp:1307" ) +#endif + +_Use_decl_annotations_ +inline XMFLOAT3* XM_CALLCONV XMVector3TransformCoordStream +( + XMFLOAT3* pOutputStream, + size_t OutputStride, + const XMFLOAT3* pInputStream, + size_t InputStride, + size_t VectorCount, + FXMMATRIX M +) noexcept +{ + assert(pOutputStream != nullptr); + assert(pInputStream != nullptr); + + assert(InputStride >= sizeof(XMFLOAT3)); + _Analysis_assume_(InputStride >= sizeof(XMFLOAT3)); + + assert(OutputStride >= sizeof(XMFLOAT3)); + _Analysis_assume_(OutputStride >= sizeof(XMFLOAT3)); + +#if defined(_XM_NO_INTRINSICS_) + + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row2 = M.r[2]; + const XMVECTOR row3 = M.r[3]; + + for (size_t i = 0; i < VectorCount; i++) + { + XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); + XMVECTOR Z = XMVectorSplatZ(V); + XMVECTOR Y = XMVectorSplatY(V); + XMVECTOR X = XMVectorSplatX(V); + + XMVECTOR Result = XMVectorMultiplyAdd(Z, row2, row3); + Result = XMVectorMultiplyAdd(Y, row1, Result); + Result = XMVectorMultiplyAdd(X, row0, Result); + + XMVECTOR W = XMVectorSplatW(Result); + + Result = XMVectorDivide(Result, W); + + XMStoreFloat3(reinterpret_cast(pOutputVector), Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row2 = M.r[2]; + const XMVECTOR row3 = M.r[3]; + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if ((InputStride == sizeof(XMFLOAT3)) && (OutputStride == sizeof(XMFLOAT3))) + { + for (size_t j = 0; j < four; ++j) + { + float32x4x3_t V = vld3q_f32(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT3) * 4; + + float32x2_t r3 = vget_low_f32(row3); + float32x2_t r = vget_low_f32(row0); + XMVECTOR vResult0 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Ax+M + XMVECTOR vResult1 = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Bx+N + + XM_PREFETCH(pInputVector); + + r3 = vget_high_f32(row3); + r = vget_high_f32(row0); + XMVECTOR vResult2 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Cx+O + XMVECTOR W = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Dx+P + + XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); + + r = vget_low_f32(row1); + vResult0 = vmlaq_lane_f32(vResult0, V.val[1], r, 0); // Ax+Ey+M + vResult1 = vmlaq_lane_f32(vResult1, V.val[1], r, 1); // Bx+Fy+N + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); + + r = vget_high_f32(row1); + vResult2 = vmlaq_lane_f32(vResult2, V.val[1], r, 0); // Cx+Gy+O + W = vmlaq_lane_f32(W, V.val[1], r, 1); // Dx+Hy+P + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); + + r = vget_low_f32(row2); + vResult0 = vmlaq_lane_f32(vResult0, V.val[2], r, 0); // Ax+Ey+Iz+M + vResult1 = vmlaq_lane_f32(vResult1, V.val[2], r, 1); // Bx+Fy+Jz+N + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 4)); + + r = vget_high_f32(row2); + vResult2 = vmlaq_lane_f32(vResult2, V.val[2], r, 0); // Cx+Gy+Kz+O + W = vmlaq_lane_f32(W, V.val[2], r, 1); // Dx+Hy+Lz+P + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 5)); + +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + V.val[0] = vdivq_f32(vResult0, W); + V.val[1] = vdivq_f32(vResult1, W); + V.val[2] = vdivq_f32(vResult2, W); +#else + // 2 iterations of Newton-Raphson refinement of reciprocal + float32x4_t Reciprocal = vrecpeq_f32(W); + float32x4_t S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + + V.val[0] = vmulq_f32(vResult0, Reciprocal); + V.val[1] = vmulq_f32(vResult1, Reciprocal); + V.val[2] = vmulq_f32(vResult2, Reciprocal); +#endif + + vst3q_f32(reinterpret_cast(pOutputVector), V); + pOutputVector += sizeof(XMFLOAT3) * 4; + + i += 4; + } + } + } + + for (; i < VectorCount; i++) + { + float32x2_t VL = vld1_f32(reinterpret_cast(pInputVector)); + float32x2_t zero = vdup_n_f32(0); + float32x2_t VH = vld1_lane_f32(reinterpret_cast(pInputVector) + 2, zero, 0); + pInputVector += InputStride; + + XMVECTOR vResult = vmlaq_lane_f32(row3, row0, VL, 0); // X + vResult = vmlaq_lane_f32(vResult, row1, VL, 1); // Y + vResult = vmlaq_lane_f32(vResult, row2, VH, 0); // Z + + VH = vget_high_f32(vResult); + XMVECTOR W = vdupq_lane_f32(VH, 1); + +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + vResult = vdivq_f32(vResult, W); +#else + // 2 iterations of Newton-Raphson refinement of reciprocal for W + float32x4_t Reciprocal = vrecpeq_f32(W); + float32x4_t S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + + vResult = vmulq_f32(vResult, Reciprocal); +#endif + + VL = vget_low_f32(vResult); + vst1_f32(reinterpret_cast(pOutputVector), VL); + vst1q_lane_f32(reinterpret_cast(pOutputVector) + 2, vResult, 2); + pOutputVector += OutputStride; + } + + return pOutputStream; +#elif defined(_XM_SSE_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row2 = M.r[2]; + const XMVECTOR row3 = M.r[3]; + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if (InputStride == sizeof(XMFLOAT3)) + { + if (OutputStride == sizeof(XMFLOAT3)) + { + if (!(reinterpret_cast(pOutputStream) & 0xF)) + { + // Packed input, aligned & packed output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, row2, row3); + XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); + XMVECTOR vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + V1 = _mm_div_ps(vTemp, W); + + // Result 2 + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + V2 = _mm_div_ps(vTemp, W); + + // Result 3 + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + V3 = _mm_div_ps(vTemp, W); + + // Result 4 + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + V4 = _mm_div_ps(vTemp, W); + + // Pack and store the vectors + XM3PACK4INTO3(vTemp); + XM_STREAM_PS(reinterpret_cast(pOutputVector), V1); + XM_STREAM_PS(reinterpret_cast(pOutputVector + 16), vTemp); + XM_STREAM_PS(reinterpret_cast(pOutputVector + 32), V3); + pOutputVector += sizeof(XMFLOAT3) * 4; + i += 4; + } + } + else + { + // Packed input, unaligned & packed output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, row2, row3); + XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); + XMVECTOR vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + V1 = _mm_div_ps(vTemp, W); + + // Result 2 + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + V2 = _mm_div_ps(vTemp, W); + + // Result 3 + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + V3 = _mm_div_ps(vTemp, W); + + // Result 4 + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + V4 = _mm_div_ps(vTemp, W); + + // Pack and store the vectors + XM3PACK4INTO3(vTemp); + _mm_storeu_ps(reinterpret_cast(pOutputVector), V1); + _mm_storeu_ps(reinterpret_cast(pOutputVector + 16), vTemp); + _mm_storeu_ps(reinterpret_cast(pOutputVector + 32), V3); + pOutputVector += sizeof(XMFLOAT3) * 4; + i += 4; + } + } + } + else + { + // Packed input, unpacked output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, row2, row3); + XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); + XMVECTOR vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + vTemp = _mm_div_ps(vTemp, W); + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 2 + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + vTemp = _mm_div_ps(vTemp, W); + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 3 + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + vTemp = _mm_div_ps(vTemp, W); + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 4 + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + vTemp = _mm_div_ps(vTemp, W); + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + i += 4; + } + } + } + } + + for (; i < VectorCount; i++) + { + XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + XMVECTOR Z = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, row2, row3); + XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); + XMVECTOR vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + vTemp = _mm_div_ps(vTemp, W); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + } + + XM_SFENCE(); + + return pOutputStream; +#endif +} + +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3TransformNormal +( + FXMVECTOR V, + FXMMATRIX M +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Z = XMVectorSplatZ(V); + XMVECTOR Y = XMVectorSplatY(V); + XMVECTOR X = XMVectorSplatX(V); + + XMVECTOR Result = XMVectorMultiply(Z, M.r[2]); + Result = XMVectorMultiplyAdd(Y, M.r[1], Result); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + XMVECTOR vResult = vmulq_lane_f32(M.r[0], VL, 0); // X + vResult = vmlaq_lane_f32(vResult, M.r[1], VL, 1); // Y + return vmlaq_lane_f32(vResult, M.r[2], vget_high_f32(V), 0); // Z +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); // Z + vResult = _mm_mul_ps(vResult, M.r[2]); + XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); // Y + vResult = XM_FMADD_PS(vTemp, M.r[1], vResult); + vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); // X + vResult = XM_FMADD_PS(vTemp, M.r[0], vResult); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable : 26015 26019, "PREfast noise: Esp:1307" ) +#endif + +_Use_decl_annotations_ +inline XMFLOAT3* XM_CALLCONV XMVector3TransformNormalStream +( + XMFLOAT3* pOutputStream, + size_t OutputStride, + const XMFLOAT3* pInputStream, + size_t InputStride, + size_t VectorCount, + FXMMATRIX M +) noexcept +{ + assert(pOutputStream != nullptr); + assert(pInputStream != nullptr); + + assert(InputStride >= sizeof(XMFLOAT3)); + _Analysis_assume_(InputStride >= sizeof(XMFLOAT3)); + + assert(OutputStride >= sizeof(XMFLOAT3)); + _Analysis_assume_(OutputStride >= sizeof(XMFLOAT3)); + +#if defined(_XM_NO_INTRINSICS_) + + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row2 = M.r[2]; + + for (size_t i = 0; i < VectorCount; i++) + { + XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); + XMVECTOR Z = XMVectorSplatZ(V); + XMVECTOR Y = XMVectorSplatY(V); + XMVECTOR X = XMVectorSplatX(V); + + XMVECTOR Result = XMVectorMultiply(Z, row2); + Result = XMVectorMultiplyAdd(Y, row1, Result); + Result = XMVectorMultiplyAdd(X, row0, Result); + + XMStoreFloat3(reinterpret_cast(pOutputVector), Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row2 = M.r[2]; + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if ((InputStride == sizeof(XMFLOAT3)) && (OutputStride == sizeof(XMFLOAT3))) + { + for (size_t j = 0; j < four; ++j) + { + float32x4x3_t V = vld3q_f32(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT3) * 4; + + float32x2_t r = vget_low_f32(row0); + XMVECTOR vResult0 = vmulq_lane_f32(V.val[0], r, 0); // Ax + XMVECTOR vResult1 = vmulq_lane_f32(V.val[0], r, 1); // Bx + + XM_PREFETCH(pInputVector); + + r = vget_high_f32(row0); + XMVECTOR vResult2 = vmulq_lane_f32(V.val[0], r, 0); // Cx + + XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); + + r = vget_low_f32(row1); + vResult0 = vmlaq_lane_f32(vResult0, V.val[1], r, 0); // Ax+Ey + vResult1 = vmlaq_lane_f32(vResult1, V.val[1], r, 1); // Bx+Fy + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); + + r = vget_high_f32(row1); + vResult2 = vmlaq_lane_f32(vResult2, V.val[1], r, 0); // Cx+Gy + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); + + r = vget_low_f32(row2); + vResult0 = vmlaq_lane_f32(vResult0, V.val[2], r, 0); // Ax+Ey+Iz + vResult1 = vmlaq_lane_f32(vResult1, V.val[2], r, 1); // Bx+Fy+Jz + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 4)); + + r = vget_high_f32(row2); + vResult2 = vmlaq_lane_f32(vResult2, V.val[2], r, 0); // Cx+Gy+Kz + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 5)); + + V.val[0] = vResult0; + V.val[1] = vResult1; + V.val[2] = vResult2; + + vst3q_f32(reinterpret_cast(pOutputVector), V); + pOutputVector += sizeof(XMFLOAT3) * 4; + + i += 4; + } + } + } + + for (; i < VectorCount; i++) + { + float32x2_t VL = vld1_f32(reinterpret_cast(pInputVector)); + float32x2_t zero = vdup_n_f32(0); + float32x2_t VH = vld1_lane_f32(reinterpret_cast(pInputVector) + 2, zero, 0); + pInputVector += InputStride; + + XMVECTOR vResult = vmulq_lane_f32(row0, VL, 0); // X + vResult = vmlaq_lane_f32(vResult, row1, VL, 1); // Y + vResult = vmlaq_lane_f32(vResult, row2, VH, 0); // Z + + VL = vget_low_f32(vResult); + vst1_f32(reinterpret_cast(pOutputVector), VL); + vst1q_lane_f32(reinterpret_cast(pOutputVector) + 2, vResult, 2); + pOutputVector += OutputStride; + } + + return pOutputStream; +#elif defined(_XM_SSE_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row2 = M.r[2]; + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if (InputStride == sizeof(XMFLOAT3)) + { + if (OutputStride == sizeof(XMFLOAT3)) + { + if (!(reinterpret_cast(pOutputStream) & 0xF)) + { + // Packed input, aligned & packed output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = _mm_mul_ps(Z, row2); + XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); + XMVECTOR vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + V1 = _mm_add_ps(vTemp, vTemp3); + + // Result 2 + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = _mm_mul_ps(Z, row2); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + V2 = _mm_add_ps(vTemp, vTemp3); + + // Result 3 + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = _mm_mul_ps(Z, row2); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + V3 = _mm_add_ps(vTemp, vTemp3); + + // Result 4 + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = _mm_mul_ps(Z, row2); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + V4 = _mm_add_ps(vTemp, vTemp3); + + // Pack and store the vectors + XM3PACK4INTO3(vTemp); + XM_STREAM_PS(reinterpret_cast(pOutputVector), V1); + XM_STREAM_PS(reinterpret_cast(pOutputVector + 16), vTemp); + XM_STREAM_PS(reinterpret_cast(pOutputVector + 32), V3); + pOutputVector += sizeof(XMFLOAT3) * 4; + i += 4; + } + } + else + { + // Packed input, unaligned & packed output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = _mm_mul_ps(Z, row2); + XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); + XMVECTOR vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + V1 = _mm_add_ps(vTemp, vTemp3); + + // Result 2 + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = _mm_mul_ps(Z, row2); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + V2 = _mm_add_ps(vTemp, vTemp3); + + // Result 3 + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = _mm_mul_ps(Z, row2); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + V3 = _mm_add_ps(vTemp, vTemp3); + + // Result 4 + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = _mm_mul_ps(Z, row2); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + V4 = _mm_add_ps(vTemp, vTemp3); + + // Pack and store the vectors + XM3PACK4INTO3(vTemp); + _mm_storeu_ps(reinterpret_cast(pOutputVector), V1); + _mm_storeu_ps(reinterpret_cast(pOutputVector + 16), vTemp); + _mm_storeu_ps(reinterpret_cast(pOutputVector + 32), V3); + pOutputVector += sizeof(XMFLOAT3) * 4; + i += 4; + } + } + } + else + { + // Packed input, unpacked output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = _mm_mul_ps(Z, row2); + XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); + XMVECTOR vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 2 + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = _mm_mul_ps(Z, row2); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 3 + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = _mm_mul_ps(Z, row2); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 4 + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = _mm_mul_ps(Z, row2); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + i += 4; + } + } + } + } + + for (; i < VectorCount; i++) + { + XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + XMVECTOR Z = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = _mm_mul_ps(Z, row2); + XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); + XMVECTOR vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + } + + XM_SFENCE(); + + return pOutputStream; +#endif +} + +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3Project +( + FXMVECTOR V, + float ViewportX, + float ViewportY, + float ViewportWidth, + float ViewportHeight, + float ViewportMinZ, + float ViewportMaxZ, + FXMMATRIX Projection, + CXMMATRIX View, + CXMMATRIX World +) noexcept +{ + const float HalfViewportWidth = ViewportWidth * 0.5f; + const float HalfViewportHeight = ViewportHeight * 0.5f; + + XMVECTOR Scale = XMVectorSet(HalfViewportWidth, -HalfViewportHeight, ViewportMaxZ - ViewportMinZ, 0.0f); + XMVECTOR Offset = XMVectorSet(ViewportX + HalfViewportWidth, ViewportY + HalfViewportHeight, ViewportMinZ, 0.0f); + + XMMATRIX Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + + XMVECTOR Result = XMVector3TransformCoord(V, Transform); + + Result = XMVectorMultiplyAdd(Result, Scale, Offset); + + return Result; +} + +//------------------------------------------------------------------------------ + +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable : 26015 26019, "PREfast noise: Esp:1307" ) +#endif + +_Use_decl_annotations_ +inline XMFLOAT3* XM_CALLCONV XMVector3ProjectStream +( + XMFLOAT3* pOutputStream, + size_t OutputStride, + const XMFLOAT3* pInputStream, + size_t InputStride, + size_t VectorCount, + float ViewportX, + float ViewportY, + float ViewportWidth, + float ViewportHeight, + float ViewportMinZ, + float ViewportMaxZ, + FXMMATRIX Projection, + CXMMATRIX View, + CXMMATRIX World +) noexcept +{ + assert(pOutputStream != nullptr); + assert(pInputStream != nullptr); + + assert(InputStride >= sizeof(XMFLOAT3)); + _Analysis_assume_(InputStride >= sizeof(XMFLOAT3)); + + assert(OutputStride >= sizeof(XMFLOAT3)); + _Analysis_assume_(OutputStride >= sizeof(XMFLOAT3)); + +#if defined(_XM_NO_INTRINSICS_) + + const float HalfViewportWidth = ViewportWidth * 0.5f; + const float HalfViewportHeight = ViewportHeight * 0.5f; + + XMVECTOR Scale = XMVectorSet(HalfViewportWidth, -HalfViewportHeight, ViewportMaxZ - ViewportMinZ, 1.0f); + XMVECTOR Offset = XMVectorSet(ViewportX + HalfViewportWidth, ViewportY + HalfViewportHeight, ViewportMinZ, 0.0f); + + XMMATRIX Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + for (size_t i = 0; i < VectorCount; i++) + { + XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); + + XMVECTOR Result = XMVector3TransformCoord(V, Transform); + Result = XMVectorMultiplyAdd(Result, Scale, Offset); + + XMStoreFloat3(reinterpret_cast(pOutputVector), Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + const float HalfViewportWidth = ViewportWidth * 0.5f; + const float HalfViewportHeight = ViewportHeight * 0.5f; + + XMMATRIX Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if ((InputStride == sizeof(XMFLOAT3)) && (OutputStride == sizeof(XMFLOAT3))) + { + XMVECTOR ScaleX = vdupq_n_f32(HalfViewportWidth); + XMVECTOR ScaleY = vdupq_n_f32(-HalfViewportHeight); + XMVECTOR ScaleZ = vdupq_n_f32(ViewportMaxZ - ViewportMinZ); + + XMVECTOR OffsetX = vdupq_n_f32(ViewportX + HalfViewportWidth); + XMVECTOR OffsetY = vdupq_n_f32(ViewportY + HalfViewportHeight); + XMVECTOR OffsetZ = vdupq_n_f32(ViewportMinZ); + + for (size_t j = 0; j < four; ++j) + { + float32x4x3_t V = vld3q_f32(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT3) * 4; + + float32x2_t r3 = vget_low_f32(Transform.r[3]); + float32x2_t r = vget_low_f32(Transform.r[0]); + XMVECTOR vResult0 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Ax+M + XMVECTOR vResult1 = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Bx+N + + XM_PREFETCH(pInputVector); + + r3 = vget_high_f32(Transform.r[3]); + r = vget_high_f32(Transform.r[0]); + XMVECTOR vResult2 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Cx+O + XMVECTOR W = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Dx+P + + XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); + + r = vget_low_f32(Transform.r[1]); + vResult0 = vmlaq_lane_f32(vResult0, V.val[1], r, 0); // Ax+Ey+M + vResult1 = vmlaq_lane_f32(vResult1, V.val[1], r, 1); // Bx+Fy+N + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); + + r = vget_high_f32(Transform.r[1]); + vResult2 = vmlaq_lane_f32(vResult2, V.val[1], r, 0); // Cx+Gy+O + W = vmlaq_lane_f32(W, V.val[1], r, 1); // Dx+Hy+P + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); + + r = vget_low_f32(Transform.r[2]); + vResult0 = vmlaq_lane_f32(vResult0, V.val[2], r, 0); // Ax+Ey+Iz+M + vResult1 = vmlaq_lane_f32(vResult1, V.val[2], r, 1); // Bx+Fy+Jz+N + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 4)); + + r = vget_high_f32(Transform.r[2]); + vResult2 = vmlaq_lane_f32(vResult2, V.val[2], r, 0); // Cx+Gy+Kz+O + W = vmlaq_lane_f32(W, V.val[2], r, 1); // Dx+Hy+Lz+P + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 5)); + +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + vResult0 = vdivq_f32(vResult0, W); + vResult1 = vdivq_f32(vResult1, W); + vResult2 = vdivq_f32(vResult2, W); +#else + // 2 iterations of Newton-Raphson refinement of reciprocal + float32x4_t Reciprocal = vrecpeq_f32(W); + float32x4_t S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + + vResult0 = vmulq_f32(vResult0, Reciprocal); + vResult1 = vmulq_f32(vResult1, Reciprocal); + vResult2 = vmulq_f32(vResult2, Reciprocal); +#endif + + V.val[0] = vmlaq_f32(OffsetX, vResult0, ScaleX); + V.val[1] = vmlaq_f32(OffsetY, vResult1, ScaleY); + V.val[2] = vmlaq_f32(OffsetZ, vResult2, ScaleZ); + + vst3q_f32(reinterpret_cast(pOutputVector), V); + pOutputVector += sizeof(XMFLOAT3) * 4; + + i += 4; + } + } + } + + if (i < VectorCount) + { + XMVECTOR Scale = XMVectorSet(HalfViewportWidth, -HalfViewportHeight, ViewportMaxZ - ViewportMinZ, 1.0f); + XMVECTOR Offset = XMVectorSet(ViewportX + HalfViewportWidth, ViewportY + HalfViewportHeight, ViewportMinZ, 0.0f); + + for (; i < VectorCount; i++) + { + float32x2_t VL = vld1_f32(reinterpret_cast(pInputVector)); + float32x2_t zero = vdup_n_f32(0); + float32x2_t VH = vld1_lane_f32(reinterpret_cast(pInputVector) + 2, zero, 0); + pInputVector += InputStride; + + XMVECTOR vResult = vmlaq_lane_f32(Transform.r[3], Transform.r[0], VL, 0); // X + vResult = vmlaq_lane_f32(vResult, Transform.r[1], VL, 1); // Y + vResult = vmlaq_lane_f32(vResult, Transform.r[2], VH, 0); // Z + + VH = vget_high_f32(vResult); + XMVECTOR W = vdupq_lane_f32(VH, 1); + +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + vResult = vdivq_f32(vResult, W); +#else + // 2 iterations of Newton-Raphson refinement of reciprocal for W + float32x4_t Reciprocal = vrecpeq_f32(W); + float32x4_t S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + + vResult = vmulq_f32(vResult, Reciprocal); +#endif + + vResult = vmlaq_f32(Offset, vResult, Scale); + + VL = vget_low_f32(vResult); + vst1_f32(reinterpret_cast(pOutputVector), VL); + vst1q_lane_f32(reinterpret_cast(pOutputVector) + 2, vResult, 2); + pOutputVector += OutputStride; + } + } + + return pOutputStream; +#elif defined(_XM_SSE_INTRINSICS_) + const float HalfViewportWidth = ViewportWidth * 0.5f; + const float HalfViewportHeight = ViewportHeight * 0.5f; + + XMVECTOR Scale = XMVectorSet(HalfViewportWidth, -HalfViewportHeight, ViewportMaxZ - ViewportMinZ, 1.0f); + XMVECTOR Offset = XMVectorSet(ViewportX + HalfViewportWidth, ViewportY + HalfViewportHeight, ViewportMinZ, 0.0f); + + XMMATRIX Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if (InputStride == sizeof(XMFLOAT3)) + { + if (OutputStride == sizeof(XMFLOAT3)) + { + if (!(reinterpret_cast(pOutputStream) & 0xF)) + { + // Packed input, aligned & packed output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + XMVECTOR vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + XMVECTOR vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + V1 = XM_FMADD_PS(vTemp, Scale, Offset); + + // Result 2 + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + V2 = XM_FMADD_PS(vTemp, Scale, Offset); + + // Result 3 + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + V3 = XM_FMADD_PS(vTemp, Scale, Offset); + + // Result 4 + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + V4 = XM_FMADD_PS(vTemp, Scale, Offset); + + // Pack and store the vectors + XM3PACK4INTO3(vTemp); + XM_STREAM_PS(reinterpret_cast(pOutputVector), V1); + XM_STREAM_PS(reinterpret_cast(pOutputVector + 16), vTemp); + XM_STREAM_PS(reinterpret_cast(pOutputVector + 32), V3); + pOutputVector += sizeof(XMFLOAT3) * 4; + i += 4; + } + } + else + { + // Packed input, unaligned & packed output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + XMVECTOR vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + XMVECTOR vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + V1 = XM_FMADD_PS(vTemp, Scale, Offset); + + // Result 2 + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + V2 = XM_FMADD_PS(vTemp, Scale, Offset); + + // Result 3 + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + V3 = XM_FMADD_PS(vTemp, Scale, Offset); + + // Result 4 + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + V4 = XM_FMADD_PS(vTemp, Scale, Offset); + + // Pack and store the vectors + XM3PACK4INTO3(vTemp); + _mm_storeu_ps(reinterpret_cast(pOutputVector), V1); + _mm_storeu_ps(reinterpret_cast(pOutputVector + 16), vTemp); + _mm_storeu_ps(reinterpret_cast(pOutputVector + 32), V3); + pOutputVector += sizeof(XMFLOAT3) * 4; + i += 4; + } + } + } + else + { + // Packed input, unpacked output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + XMVECTOR vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + XMVECTOR vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + vTemp = XM_FMADD_PS(vTemp, Scale, Offset); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 2 + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + vTemp = XM_FMADD_PS(vTemp, Scale, Offset); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 3 + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + vTemp = XM_FMADD_PS(vTemp, Scale, Offset); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 4 + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + vTemp = XM_FMADD_PS(vTemp, Scale, Offset); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + i += 4; + } + } + } + } + + for (; i < VectorCount; i++) + { + XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + XMVECTOR Z = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + XMVECTOR vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + XMVECTOR vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + vTemp = XM_FMADD_PS(vTemp, Scale, Offset); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + } + + XM_SFENCE(); + + return pOutputStream; +#endif +} + +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3Unproject +( + FXMVECTOR V, + float ViewportX, + float ViewportY, + float ViewportWidth, + float ViewportHeight, + float ViewportMinZ, + float ViewportMaxZ, + FXMMATRIX Projection, + CXMMATRIX View, + CXMMATRIX World +) noexcept +{ + static const XMVECTORF32 D = { { { -1.0f, 1.0f, 0.0f, 0.0f } } }; + + XMVECTOR Scale = XMVectorSet(ViewportWidth * 0.5f, -ViewportHeight * 0.5f, ViewportMaxZ - ViewportMinZ, 1.0f); + Scale = XMVectorReciprocal(Scale); + + XMVECTOR Offset = XMVectorSet(-ViewportX, -ViewportY, -ViewportMinZ, 0.0f); + Offset = XMVectorMultiplyAdd(Scale, Offset, D.v); + + XMMATRIX Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + Transform = XMMatrixInverse(nullptr, Transform); + + XMVECTOR Result = XMVectorMultiplyAdd(V, Scale, Offset); + + return XMVector3TransformCoord(Result, Transform); +} + +//------------------------------------------------------------------------------ + +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable : 26015 26019, "PREfast noise: Esp:1307" ) +#endif + +_Use_decl_annotations_ +inline XMFLOAT3* XM_CALLCONV XMVector3UnprojectStream +( + XMFLOAT3* pOutputStream, + size_t OutputStride, + const XMFLOAT3* pInputStream, + size_t InputStride, + size_t VectorCount, + float ViewportX, + float ViewportY, + float ViewportWidth, + float ViewportHeight, + float ViewportMinZ, + float ViewportMaxZ, + FXMMATRIX Projection, + CXMMATRIX View, + CXMMATRIX World +) noexcept +{ + assert(pOutputStream != nullptr); + assert(pInputStream != nullptr); + + assert(InputStride >= sizeof(XMFLOAT3)); + _Analysis_assume_(InputStride >= sizeof(XMFLOAT3)); + + assert(OutputStride >= sizeof(XMFLOAT3)); + _Analysis_assume_(OutputStride >= sizeof(XMFLOAT3)); + +#if defined(_XM_NO_INTRINSICS_) + + static const XMVECTORF32 D = { { { -1.0f, 1.0f, 0.0f, 0.0f } } }; + + XMVECTOR Scale = XMVectorSet(ViewportWidth * 0.5f, -ViewportHeight * 0.5f, ViewportMaxZ - ViewportMinZ, 1.0f); + Scale = XMVectorReciprocal(Scale); + + XMVECTOR Offset = XMVectorSet(-ViewportX, -ViewportY, -ViewportMinZ, 0.0f); + Offset = XMVectorMultiplyAdd(Scale, Offset, D.v); + + XMMATRIX Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + Transform = XMMatrixInverse(nullptr, Transform); + + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + for (size_t i = 0; i < VectorCount; i++) + { + XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); + + XMVECTOR Result = XMVectorMultiplyAdd(V, Scale, Offset); + + Result = XMVector3TransformCoord(Result, Transform); + + XMStoreFloat3(reinterpret_cast(pOutputVector), Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMMATRIX Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + Transform = XMMatrixInverse(nullptr, Transform); + + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + float sx = 1.f / (ViewportWidth * 0.5f); + float sy = 1.f / (-ViewportHeight * 0.5f); + float sz = 1.f / (ViewportMaxZ - ViewportMinZ); + + float ox = (-ViewportX * sx) - 1.f; + float oy = (-ViewportY * sy) + 1.f; + float oz = (-ViewportMinZ * sz); + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if ((InputStride == sizeof(XMFLOAT3)) && (OutputStride == sizeof(XMFLOAT3))) + { + for (size_t j = 0; j < four; ++j) + { + float32x4x3_t V = vld3q_f32(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT3) * 4; + + XMVECTOR ScaleX = vdupq_n_f32(sx); + XMVECTOR OffsetX = vdupq_n_f32(ox); + XMVECTOR VX = vmlaq_f32(OffsetX, ScaleX, V.val[0]); + + float32x2_t r3 = vget_low_f32(Transform.r[3]); + float32x2_t r = vget_low_f32(Transform.r[0]); + XMVECTOR vResult0 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), VX, r, 0); // Ax+M + XMVECTOR vResult1 = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), VX, r, 1); // Bx+N + + XM_PREFETCH(pInputVector); + + r3 = vget_high_f32(Transform.r[3]); + r = vget_high_f32(Transform.r[0]); + XMVECTOR vResult2 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), VX, r, 0); // Cx+O + XMVECTOR W = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), VX, r, 1); // Dx+P + + XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); + + XMVECTOR ScaleY = vdupq_n_f32(sy); + XMVECTOR OffsetY = vdupq_n_f32(oy); + XMVECTOR VY = vmlaq_f32(OffsetY, ScaleY, V.val[1]); + + r = vget_low_f32(Transform.r[1]); + vResult0 = vmlaq_lane_f32(vResult0, VY, r, 0); // Ax+Ey+M + vResult1 = vmlaq_lane_f32(vResult1, VY, r, 1); // Bx+Fy+N + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); + + r = vget_high_f32(Transform.r[1]); + vResult2 = vmlaq_lane_f32(vResult2, VY, r, 0); // Cx+Gy+O + W = vmlaq_lane_f32(W, VY, r, 1); // Dx+Hy+P + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); + + XMVECTOR ScaleZ = vdupq_n_f32(sz); + XMVECTOR OffsetZ = vdupq_n_f32(oz); + XMVECTOR VZ = vmlaq_f32(OffsetZ, ScaleZ, V.val[2]); + + r = vget_low_f32(Transform.r[2]); + vResult0 = vmlaq_lane_f32(vResult0, VZ, r, 0); // Ax+Ey+Iz+M + vResult1 = vmlaq_lane_f32(vResult1, VZ, r, 1); // Bx+Fy+Jz+N + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 4)); + + r = vget_high_f32(Transform.r[2]); + vResult2 = vmlaq_lane_f32(vResult2, VZ, r, 0); // Cx+Gy+Kz+O + W = vmlaq_lane_f32(W, VZ, r, 1); // Dx+Hy+Lz+P + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 5)); + +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + V.val[0] = vdivq_f32(vResult0, W); + V.val[1] = vdivq_f32(vResult1, W); + V.val[2] = vdivq_f32(vResult2, W); +#else + // 2 iterations of Newton-Raphson refinement of reciprocal + float32x4_t Reciprocal = vrecpeq_f32(W); + float32x4_t S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + + V.val[0] = vmulq_f32(vResult0, Reciprocal); + V.val[1] = vmulq_f32(vResult1, Reciprocal); + V.val[2] = vmulq_f32(vResult2, Reciprocal); +#endif + + vst3q_f32(reinterpret_cast(pOutputVector), V); + pOutputVector += sizeof(XMFLOAT3) * 4; + + i += 4; + } + } + } + + if (i < VectorCount) + { + float32x2_t ScaleL = vcreate_f32( + static_cast(*reinterpret_cast(&sx)) + | (static_cast(*reinterpret_cast(&sy)) << 32)); + float32x2_t ScaleH = vcreate_f32(static_cast(*reinterpret_cast(&sz))); + + float32x2_t OffsetL = vcreate_f32( + static_cast(*reinterpret_cast(&ox)) + | (static_cast(*reinterpret_cast(&oy)) << 32)); + float32x2_t OffsetH = vcreate_f32(static_cast(*reinterpret_cast(&oz))); + + for (; i < VectorCount; i++) + { + float32x2_t VL = vld1_f32(reinterpret_cast(pInputVector)); + float32x2_t zero = vdup_n_f32(0); + float32x2_t VH = vld1_lane_f32(reinterpret_cast(pInputVector) + 2, zero, 0); + pInputVector += InputStride; + + VL = vmla_f32(OffsetL, VL, ScaleL); + VH = vmla_f32(OffsetH, VH, ScaleH); + + XMVECTOR vResult = vmlaq_lane_f32(Transform.r[3], Transform.r[0], VL, 0); // X + vResult = vmlaq_lane_f32(vResult, Transform.r[1], VL, 1); // Y + vResult = vmlaq_lane_f32(vResult, Transform.r[2], VH, 0); // Z + + VH = vget_high_f32(vResult); + XMVECTOR W = vdupq_lane_f32(VH, 1); + +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + vResult = vdivq_f32(vResult, W); +#else + // 2 iterations of Newton-Raphson refinement of reciprocal for W + float32x4_t Reciprocal = vrecpeq_f32(W); + float32x4_t S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + + vResult = vmulq_f32(vResult, Reciprocal); +#endif + + VL = vget_low_f32(vResult); + vst1_f32(reinterpret_cast(pOutputVector), VL); + vst1q_lane_f32(reinterpret_cast(pOutputVector) + 2, vResult, 2); + pOutputVector += OutputStride; + } + } + + return pOutputStream; +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 D = { { { -1.0f, 1.0f, 0.0f, 0.0f } } }; + + XMVECTOR Scale = XMVectorSet(ViewportWidth * 0.5f, -ViewportHeight * 0.5f, ViewportMaxZ - ViewportMinZ, 1.0f); + Scale = XMVectorReciprocal(Scale); + + XMVECTOR Offset = XMVectorSet(-ViewportX, -ViewportY, -ViewportMinZ, 0.0f); + Offset = _mm_mul_ps(Scale, Offset); + Offset = _mm_add_ps(Offset, D); + + XMMATRIX Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + Transform = XMMatrixInverse(nullptr, Transform); + + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if (InputStride == sizeof(XMFLOAT3)) + { + if (OutputStride == sizeof(XMFLOAT3)) + { + if (!(reinterpret_cast(pOutputStream) & 0xF)) + { + // Packed input, aligned & packed output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + V1 = XM_FMADD_PS(V1, Scale, Offset); + + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + XMVECTOR vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + XMVECTOR vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + V1 = _mm_div_ps(vTemp, W); + + // Result 2 + V2 = XM_FMADD_PS(V2, Scale, Offset); + + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + V2 = _mm_div_ps(vTemp, W); + + // Result 3 + V3 = XM_FMADD_PS(V3, Scale, Offset); + + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + V3 = _mm_div_ps(vTemp, W); + + // Result 4 + V4 = XM_FMADD_PS(V4, Scale, Offset); + + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + V4 = _mm_div_ps(vTemp, W); + + // Pack and store the vectors + XM3PACK4INTO3(vTemp); + XM_STREAM_PS(reinterpret_cast(pOutputVector), V1); + XM_STREAM_PS(reinterpret_cast(pOutputVector + 16), vTemp); + XM_STREAM_PS(reinterpret_cast(pOutputVector + 32), V3); + pOutputVector += sizeof(XMFLOAT3) * 4; + i += 4; + } + } + else + { + // Packed input, unaligned & packed output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + V1 = XM_FMADD_PS(V1, Scale, Offset); + + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + XMVECTOR vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + XMVECTOR vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + V1 = _mm_div_ps(vTemp, W); + + // Result 2 + V2 = XM_FMADD_PS(V2, Scale, Offset); + + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + V2 = _mm_div_ps(vTemp, W); + + // Result 3 + V3 = XM_FMADD_PS(V3, Scale, Offset); + + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + V3 = _mm_div_ps(vTemp, W); + + // Result 4 + V4 = XM_FMADD_PS(V4, Scale, Offset); + + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + V4 = _mm_div_ps(vTemp, W); + + // Pack and store the vectors + XM3PACK4INTO3(vTemp); + _mm_storeu_ps(reinterpret_cast(pOutputVector), V1); + _mm_storeu_ps(reinterpret_cast(pOutputVector + 16), vTemp); + _mm_storeu_ps(reinterpret_cast(pOutputVector + 32), V3); + pOutputVector += sizeof(XMFLOAT3) * 4; + i += 4; + } + } + } + else + { + // Packed input, unpacked output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + V1 = XM_FMADD_PS(V1, Scale, Offset); + + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + XMVECTOR vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + XMVECTOR vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 2 + V2 = XM_FMADD_PS(V2, Scale, Offset); + + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 3 + V3 = XM_FMADD_PS(V3, Scale, Offset); + + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 4 + V4 = XM_FMADD_PS(V4, Scale, Offset); + + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + i += 4; + } + } + } + } + + for (; i < VectorCount; i++) + { + XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + V = _mm_mul_ps(V, Scale); + V = _mm_add_ps(V, Offset); + + XMVECTOR Z = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + XMVECTOR vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + XMVECTOR vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + } + + XM_SFENCE(); + + return pOutputStream; +#endif +} + +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif + +/**************************************************************************** + * + * 4D Vector + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + // Comparison operations + //------------------------------------------------------------------------------ + + //------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector4Equal +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] == V2.vector4_f32[0]) && (V1.vector4_f32[1] == V2.vector4_f32[1]) && (V1.vector4_f32[2] == V2.vector4_f32[2]) && (V1.vector4_f32[3] == V2.vector4_f32[3])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); + return ((_mm_movemask_ps(vTemp) == 0x0f) != 0); +#else + return XMComparisonAllTrue(XMVector4EqualR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +inline uint32_t XM_CALLCONV XMVector4EqualR +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + uint32_t CR = 0; + + if ((V1.vector4_f32[0] == V2.vector4_f32[0]) && + (V1.vector4_f32[1] == V2.vector4_f32[1]) && + (V1.vector4_f32[2] == V2.vector4_f32[2]) && + (V1.vector4_f32[3] == V2.vector4_f32[3])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] != V2.vector4_f32[0]) && + (V1.vector4_f32[1] != V2.vector4_f32[1]) && + (V1.vector4_f32[2] != V2.vector4_f32[2]) && + (V1.vector4_f32[3] != V2.vector4_f32[3])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); + + uint32_t CR = 0; + if (r == 0xFFFFFFFFU) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); + int iTest = _mm_movemask_ps(vTemp); + uint32_t CR = 0; + if (iTest == 0xf) // All equal? + { + CR = XM_CRMASK_CR6TRUE; + } + else if (iTest == 0) // All not equal? + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector4EqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_u32[0] == V2.vector4_u32[0]) && (V1.vector4_u32[1] == V2.vector4_u32[1]) && (V1.vector4_u32[2] == V2.vector4_u32[2]) && (V1.vector4_u32[3] == V2.vector4_u32[3])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); + return ((_mm_movemask_ps(_mm_castsi128_ps(vTemp)) == 0xf) != 0); +#else + return XMComparisonAllTrue(XMVector4EqualIntR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +inline uint32_t XM_CALLCONV XMVector4EqualIntR +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + uint32_t CR = 0; + if (V1.vector4_u32[0] == V2.vector4_u32[0] && + V1.vector4_u32[1] == V2.vector4_u32[1] && + V1.vector4_u32[2] == V2.vector4_u32[2] && + V1.vector4_u32[3] == V2.vector4_u32[3]) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (V1.vector4_u32[0] != V2.vector4_u32[0] && + V1.vector4_u32[1] != V2.vector4_u32[1] && + V1.vector4_u32[2] != V2.vector4_u32[2] && + V1.vector4_u32[3] != V2.vector4_u32[3]) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); + + uint32_t CR = 0; + if (r == 0xFFFFFFFFU) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); + int iTest = _mm_movemask_ps(_mm_castsi128_ps(vTemp)); + uint32_t CR = 0; + if (iTest == 0xf) // All equal? + { + CR = XM_CRMASK_CR6TRUE; + } + else if (iTest == 0) // All not equal? + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#endif +} + +inline bool XM_CALLCONV XMVector4NearEqual +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR Epsilon +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + float dx, dy, dz, dw; + + dx = fabsf(V1.vector4_f32[0] - V2.vector4_f32[0]); + dy = fabsf(V1.vector4_f32[1] - V2.vector4_f32[1]); + dz = fabsf(V1.vector4_f32[2] - V2.vector4_f32[2]); + dw = fabsf(V1.vector4_f32[3] - V2.vector4_f32[3]); + return (((dx <= Epsilon.vector4_f32[0]) && + (dy <= Epsilon.vector4_f32[1]) && + (dz <= Epsilon.vector4_f32[2]) && + (dw <= Epsilon.vector4_f32[3])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t vDelta = vsubq_f32(V1, V2); +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + uint32x4_t vResult = vacleq_f32(vDelta, Epsilon); +#else + uint32x4_t vResult = vcleq_f32(vabsq_f32(vDelta), Epsilon); +#endif + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + // Get the difference + XMVECTOR vDelta = _mm_sub_ps(V1, V2); + // Get the absolute value of the difference + XMVECTOR vTemp = _mm_setzero_ps(); + vTemp = _mm_sub_ps(vTemp, vDelta); + vTemp = _mm_max_ps(vTemp, vDelta); + vTemp = _mm_cmple_ps(vTemp, Epsilon); + return ((_mm_movemask_ps(vTemp) == 0xf) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector4NotEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] != V2.vector4_f32[0]) || (V1.vector4_f32[1] != V2.vector4_f32[1]) || (V1.vector4_f32[2] != V2.vector4_f32[2]) || (V1.vector4_f32[3] != V2.vector4_f32[3])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) != 0xFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpneq_ps(V1, V2); + return ((_mm_movemask_ps(vTemp)) != 0); +#else + return XMComparisonAnyFalse(XMVector4EqualR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector4NotEqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_u32[0] != V2.vector4_u32[0]) || (V1.vector4_u32[1] != V2.vector4_u32[1]) || (V1.vector4_u32[2] != V2.vector4_u32[2]) || (V1.vector4_u32[3] != V2.vector4_u32[3])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) != 0xFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); + return ((_mm_movemask_ps(_mm_castsi128_ps(vTemp)) != 0xF) != 0); +#else + return XMComparisonAnyFalse(XMVector4EqualIntR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector4Greater +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] > V2.vector4_f32[0]) && (V1.vector4_f32[1] > V2.vector4_f32[1]) && (V1.vector4_f32[2] > V2.vector4_f32[2]) && (V1.vector4_f32[3] > V2.vector4_f32[3])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcgtq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpgt_ps(V1, V2); + return ((_mm_movemask_ps(vTemp) == 0x0f) != 0); +#else + return XMComparisonAllTrue(XMVector4GreaterR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +inline uint32_t XM_CALLCONV XMVector4GreaterR +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + uint32_t CR = 0; + if (V1.vector4_f32[0] > V2.vector4_f32[0] && + V1.vector4_f32[1] > V2.vector4_f32[1] && + V1.vector4_f32[2] > V2.vector4_f32[2] && + V1.vector4_f32[3] > V2.vector4_f32[3]) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (V1.vector4_f32[0] <= V2.vector4_f32[0] && + V1.vector4_f32[1] <= V2.vector4_f32[1] && + V1.vector4_f32[2] <= V2.vector4_f32[2] && + V1.vector4_f32[3] <= V2.vector4_f32[3]) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcgtq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); + + uint32_t CR = 0; + if (r == 0xFFFFFFFFU) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + uint32_t CR = 0; + XMVECTOR vTemp = _mm_cmpgt_ps(V1, V2); + int iTest = _mm_movemask_ps(vTemp); + if (iTest == 0xf) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector4GreaterOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] >= V2.vector4_f32[0]) && (V1.vector4_f32[1] >= V2.vector4_f32[1]) && (V1.vector4_f32[2] >= V2.vector4_f32[2]) && (V1.vector4_f32[3] >= V2.vector4_f32[3])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcgeq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpge_ps(V1, V2); + return ((_mm_movemask_ps(vTemp) == 0x0f) != 0); +#else + return XMComparisonAllTrue(XMVector4GreaterOrEqualR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +inline uint32_t XM_CALLCONV XMVector4GreaterOrEqualR +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + uint32_t CR = 0; + if ((V1.vector4_f32[0] >= V2.vector4_f32[0]) && + (V1.vector4_f32[1] >= V2.vector4_f32[1]) && + (V1.vector4_f32[2] >= V2.vector4_f32[2]) && + (V1.vector4_f32[3] >= V2.vector4_f32[3])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] < V2.vector4_f32[0]) && + (V1.vector4_f32[1] < V2.vector4_f32[1]) && + (V1.vector4_f32[2] < V2.vector4_f32[2]) && + (V1.vector4_f32[3] < V2.vector4_f32[3])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcgeq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); + + uint32_t CR = 0; + if (r == 0xFFFFFFFFU) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + uint32_t CR = 0; + XMVECTOR vTemp = _mm_cmpge_ps(V1, V2); + int iTest = _mm_movemask_ps(vTemp); + if (iTest == 0x0f) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector4Less +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] < V2.vector4_f32[0]) && (V1.vector4_f32[1] < V2.vector4_f32[1]) && (V1.vector4_f32[2] < V2.vector4_f32[2]) && (V1.vector4_f32[3] < V2.vector4_f32[3])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcltq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmplt_ps(V1, V2); + return ((_mm_movemask_ps(vTemp) == 0x0f) != 0); +#else + return XMComparisonAllTrue(XMVector4GreaterR(V2, V1)); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector4LessOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] <= V2.vector4_f32[0]) && (V1.vector4_f32[1] <= V2.vector4_f32[1]) && (V1.vector4_f32[2] <= V2.vector4_f32[2]) && (V1.vector4_f32[3] <= V2.vector4_f32[3])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcleq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmple_ps(V1, V2); + return ((_mm_movemask_ps(vTemp) == 0x0f) != 0); +#else + return XMComparisonAllTrue(XMVector4GreaterOrEqualR(V2, V1)); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector4InBounds +( + FXMVECTOR V, + FXMVECTOR Bounds +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) && + (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]) && + (V.vector4_f32[2] <= Bounds.vector4_f32[2] && V.vector4_f32[2] >= -Bounds.vector4_f32[2]) && + (V.vector4_f32[3] <= Bounds.vector4_f32[3] && V.vector4_f32[3] >= -Bounds.vector4_f32[3])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Test if less than or equal + uint32x4_t ivTemp1 = vcleq_f32(V, Bounds); + // Negate the bounds + float32x4_t vTemp2 = vnegq_f32(Bounds); + // Test if greater or equal (Reversed) + uint32x4_t ivTemp2 = vcleq_f32(vTemp2, V); + // Blend answers + ivTemp1 = vandq_u32(ivTemp1, ivTemp2); + // in bounds? + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(ivTemp1)), vget_high_u8(vreinterpretq_u8_u32(ivTemp1))); + uint16x4x2_t vTemp3 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return (vget_lane_u32(vreinterpret_u32_u16(vTemp3.val[1]), 1) == 0xFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + // Test if less than or equal + XMVECTOR vTemp1 = _mm_cmple_ps(V, Bounds); + // Negate the bounds + XMVECTOR vTemp2 = _mm_mul_ps(Bounds, g_XMNegativeOne); + // Test if greater or equal (Reversed) + vTemp2 = _mm_cmple_ps(vTemp2, V); + // Blend answers + vTemp1 = _mm_and_ps(vTemp1, vTemp2); + // All in bounds? + return ((_mm_movemask_ps(vTemp1) == 0x0f) != 0); +#else + return XMComparisonAllInBounds(XMVector4InBoundsR(V, Bounds)); +#endif +} + +//------------------------------------------------------------------------------ + +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) +#pragma float_control(push) +#pragma float_control(precise, on) +#endif + +inline bool XM_CALLCONV XMVector4IsNaN(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (XMISNAN(V.vector4_f32[0]) || + XMISNAN(V.vector4_f32[1]) || + XMISNAN(V.vector4_f32[2]) || + XMISNAN(V.vector4_f32[3])); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Test against itself. NaN is always not equal + uint32x4_t vTempNan = vceqq_f32(V, V); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vTempNan)), vget_high_u8(vreinterpretq_u8_u32(vTempNan))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + // If any are NaN, the mask is zero + return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) != 0xFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + // Test against itself. NaN is always not equal + XMVECTOR vTempNan = _mm_cmpneq_ps(V, V); + // If any are NaN, the mask is non-zero + return (_mm_movemask_ps(vTempNan) != 0); +#endif +} + +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) +#pragma float_control(pop) +#endif + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector4IsInfinite(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + return (XMISINF(V.vector4_f32[0]) || + XMISINF(V.vector4_f32[1]) || + XMISINF(V.vector4_f32[2]) || + XMISINF(V.vector4_f32[3])); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Mask off the sign bit + uint32x4_t vTempInf = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); + // Compare to infinity + vTempInf = vceqq_f32(vreinterpretq_f32_u32(vTempInf), g_XMInfinity); + // If any are infinity, the signs are true. + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vTempInf)), vget_high_u8(vreinterpretq_u8_u32(vTempInf))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Mask off the sign bit + XMVECTOR vTemp = _mm_and_ps(V, g_XMAbsMask); + // Compare to infinity + vTemp = _mm_cmpeq_ps(vTemp, g_XMInfinity); + // If any are infinity, the signs are true. + return (_mm_movemask_ps(vTemp) != 0); +#endif +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4Dot +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result; + Result.f[0] = + Result.f[1] = + Result.f[2] = + Result.f[3] = V1.vector4_f32[0] * V2.vector4_f32[0] + V1.vector4_f32[1] * V2.vector4_f32[1] + V1.vector4_f32[2] * V2.vector4_f32[2] + V1.vector4_f32[3] * V2.vector4_f32[3]; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t vTemp = vmulq_f32(V1, V2); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vadd_f32(v1, v2); + v1 = vpadd_f32(v1, v1); + return vcombine_f32(v1, v1); +#elif defined(_XM_SSE4_INTRINSICS_) + return _mm_dp_ps(V1, V2, 0xff); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vTemp = _mm_mul_ps(V1, V2); + vTemp = _mm_hadd_ps(vTemp, vTemp); + return _mm_hadd_ps(vTemp, vTemp); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp2 = V2; + XMVECTOR vTemp = _mm_mul_ps(V1, vTemp2); + vTemp2 = _mm_shuffle_ps(vTemp2, vTemp, _MM_SHUFFLE(1, 0, 0, 0)); // Copy X to the Z position and Y to the W position + vTemp2 = _mm_add_ps(vTemp2, vTemp); // Add Z = X+Z; W = Y+W; + vTemp = _mm_shuffle_ps(vTemp, vTemp2, _MM_SHUFFLE(0, 3, 0, 0)); // Copy W to the Z position + vTemp = _mm_add_ps(vTemp, vTemp2); // Add Z and W together + return XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(2, 2, 2, 2)); // Splat Z and return +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4Cross +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR V3 +) noexcept +{ + // [ ((v2.z*v3.w-v2.w*v3.z)*v1.y)-((v2.y*v3.w-v2.w*v3.y)*v1.z)+((v2.y*v3.z-v2.z*v3.y)*v1.w), + // ((v2.w*v3.z-v2.z*v3.w)*v1.x)-((v2.w*v3.x-v2.x*v3.w)*v1.z)+((v2.z*v3.x-v2.x*v3.z)*v1.w), + // ((v2.y*v3.w-v2.w*v3.y)*v1.x)-((v2.x*v3.w-v2.w*v3.x)*v1.y)+((v2.x*v3.y-v2.y*v3.x)*v1.w), + // ((v2.z*v3.y-v2.y*v3.z)*v1.x)-((v2.z*v3.x-v2.x*v3.z)*v1.y)+((v2.y*v3.x-v2.x*v3.y)*v1.z) ] + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + (((V2.vector4_f32[2] * V3.vector4_f32[3]) - (V2.vector4_f32[3] * V3.vector4_f32[2])) * V1.vector4_f32[1]) - (((V2.vector4_f32[1] * V3.vector4_f32[3]) - (V2.vector4_f32[3] * V3.vector4_f32[1])) * V1.vector4_f32[2]) + (((V2.vector4_f32[1] * V3.vector4_f32[2]) - (V2.vector4_f32[2] * V3.vector4_f32[1])) * V1.vector4_f32[3]), + (((V2.vector4_f32[3] * V3.vector4_f32[2]) - (V2.vector4_f32[2] * V3.vector4_f32[3])) * V1.vector4_f32[0]) - (((V2.vector4_f32[3] * V3.vector4_f32[0]) - (V2.vector4_f32[0] * V3.vector4_f32[3])) * V1.vector4_f32[2]) + (((V2.vector4_f32[2] * V3.vector4_f32[0]) - (V2.vector4_f32[0] * V3.vector4_f32[2])) * V1.vector4_f32[3]), + (((V2.vector4_f32[1] * V3.vector4_f32[3]) - (V2.vector4_f32[3] * V3.vector4_f32[1])) * V1.vector4_f32[0]) - (((V2.vector4_f32[0] * V3.vector4_f32[3]) - (V2.vector4_f32[3] * V3.vector4_f32[0])) * V1.vector4_f32[1]) + (((V2.vector4_f32[0] * V3.vector4_f32[1]) - (V2.vector4_f32[1] * V3.vector4_f32[0])) * V1.vector4_f32[3]), + (((V2.vector4_f32[2] * V3.vector4_f32[1]) - (V2.vector4_f32[1] * V3.vector4_f32[2])) * V1.vector4_f32[0]) - (((V2.vector4_f32[2] * V3.vector4_f32[0]) - (V2.vector4_f32[0] * V3.vector4_f32[2])) * V1.vector4_f32[1]) + (((V2.vector4_f32[1] * V3.vector4_f32[0]) - (V2.vector4_f32[0] * V3.vector4_f32[1])) * V1.vector4_f32[2]), + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + const uint32x2_t select = vget_low_u32(g_XMMaskX); + + // Term1: V2zwyz * V3wzwy + const float32x2_t v2xy = vget_low_f32(V2); + const float32x2_t v2zw = vget_high_f32(V2); + const float32x2_t v2yx = vrev64_f32(v2xy); + const float32x2_t v2wz = vrev64_f32(v2zw); + const float32x2_t v2yz = vbsl_f32(select, v2yx, v2wz); + + const float32x2_t v3zw = vget_high_f32(V3); + const float32x2_t v3wz = vrev64_f32(v3zw); + const float32x2_t v3xy = vget_low_f32(V3); + const float32x2_t v3wy = vbsl_f32(select, v3wz, v3xy); + + float32x4_t vTemp1 = vcombine_f32(v2zw, v2yz); + float32x4_t vTemp2 = vcombine_f32(v3wz, v3wy); + XMVECTOR vResult = vmulq_f32(vTemp1, vTemp2); + + // - V2wzwy * V3zwyz + const float32x2_t v2wy = vbsl_f32(select, v2wz, v2xy); + + const float32x2_t v3yx = vrev64_f32(v3xy); + const float32x2_t v3yz = vbsl_f32(select, v3yx, v3wz); + + vTemp1 = vcombine_f32(v2wz, v2wy); + vTemp2 = vcombine_f32(v3zw, v3yz); + vResult = vmlsq_f32(vResult, vTemp1, vTemp2); + + // term1 * V1yxxx + const float32x2_t v1xy = vget_low_f32(V1); + const float32x2_t v1yx = vrev64_f32(v1xy); + + vTemp1 = vcombine_f32(v1yx, vdup_lane_f32(v1yx, 1)); + vResult = vmulq_f32(vResult, vTemp1); + + // Term2: V2ywxz * V3wxwx + const float32x2_t v2yw = vrev64_f32(v2wy); + const float32x2_t v2xz = vbsl_f32(select, v2xy, v2wz); + + const float32x2_t v3wx = vbsl_f32(select, v3wz, v3yx); + + vTemp1 = vcombine_f32(v2yw, v2xz); + vTemp2 = vcombine_f32(v3wx, v3wx); + float32x4_t vTerm = vmulq_f32(vTemp1, vTemp2); + + // - V2wxwx * V3ywxz + const float32x2_t v2wx = vbsl_f32(select, v2wz, v2yx); + + const float32x2_t v3yw = vrev64_f32(v3wy); + const float32x2_t v3xz = vbsl_f32(select, v3xy, v3wz); + + vTemp1 = vcombine_f32(v2wx, v2wx); + vTemp2 = vcombine_f32(v3yw, v3xz); + vTerm = vmlsq_f32(vTerm, vTemp1, vTemp2); + + // vResult - term2 * V1zzyy + const float32x2_t v1zw = vget_high_f32(V1); + + vTemp1 = vcombine_f32(vdup_lane_f32(v1zw, 0), vdup_lane_f32(v1yx, 0)); + vResult = vmlsq_f32(vResult, vTerm, vTemp1); + + // Term3: V2yzxy * V3zxyx + const float32x2_t v3zx = vrev64_f32(v3xz); + + vTemp1 = vcombine_f32(v2yz, v2xy); + vTemp2 = vcombine_f32(v3zx, v3yx); + vTerm = vmulq_f32(vTemp1, vTemp2); + + // - V2zxyx * V3yzxy + const float32x2_t v2zx = vrev64_f32(v2xz); + + vTemp1 = vcombine_f32(v2zx, v2yx); + vTemp2 = vcombine_f32(v3yz, v3xy); + vTerm = vmlsq_f32(vTerm, vTemp1, vTemp2); + + // vResult + term3 * V1wwwz + const float32x2_t v1wz = vrev64_f32(v1zw); + + vTemp1 = vcombine_f32(vdup_lane_f32(v1wz, 0), v1wz); + return vmlaq_f32(vResult, vTerm, vTemp1); +#elif defined(_XM_SSE_INTRINSICS_) + // V2zwyz * V3wzwy + XMVECTOR vResult = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 1, 3, 2)); + XMVECTOR vTemp3 = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 3, 2, 3)); + vResult = _mm_mul_ps(vResult, vTemp3); + // - V2wzwy * V3zwyz + XMVECTOR vTemp2 = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 3, 2, 3)); + vTemp3 = XM_PERMUTE_PS(vTemp3, _MM_SHUFFLE(1, 3, 0, 1)); + vResult = XM_FNMADD_PS(vTemp2, vTemp3, vResult); + // term1 * V1yxxx + XMVECTOR vTemp1 = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 1)); + vResult = _mm_mul_ps(vResult, vTemp1); + + // V2ywxz * V3wxwx + vTemp2 = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 0, 3, 1)); + vTemp3 = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 3, 0, 3)); + vTemp3 = _mm_mul_ps(vTemp3, vTemp2); + // - V2wxwx * V3ywxz + vTemp2 = XM_PERMUTE_PS(vTemp2, _MM_SHUFFLE(2, 1, 2, 1)); + vTemp1 = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 0, 3, 1)); + vTemp3 = XM_FNMADD_PS(vTemp2, vTemp1, vTemp3); + // vResult - temp * V1zzyy + vTemp1 = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 2, 2)); + vResult = XM_FNMADD_PS(vTemp1, vTemp3, vResult); + + // V2yzxy * V3zxyx + vTemp2 = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 0, 2, 1)); + vTemp3 = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 1, 0, 2)); + vTemp3 = _mm_mul_ps(vTemp3, vTemp2); + // - V2zxyx * V3yzxy + vTemp2 = XM_PERMUTE_PS(vTemp2, _MM_SHUFFLE(2, 0, 2, 1)); + vTemp1 = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 0, 2, 1)); + vTemp3 = XM_FNMADD_PS(vTemp1, vTemp2, vTemp3); + // vResult + term * V1wwwz + vTemp1 = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 3, 3, 3)); + vResult = XM_FMADD_PS(vTemp3, vTemp1, vResult); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4LengthSq(FXMVECTOR V) noexcept +{ + return XMVector4Dot(V, V); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4ReciprocalLengthEst(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector4LengthSq(V); + Result = XMVectorReciprocalSqrtEst(Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Dot4 + float32x4_t vTemp = vmulq_f32(V, V); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vadd_f32(v1, v2); + v1 = vpadd_f32(v1, v1); + // Reciprocal sqrt (estimate) + v2 = vrsqrte_f32(v1); + return vcombine_f32(v2, v2); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0xff); + return _mm_rsqrt_ps(vTemp); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_rsqrt_ps(vLengthSq); + return vLengthSq; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y,z and w + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has z and w + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(3, 2, 3, 2)); + // x+z, y+w + vLengthSq = _mm_add_ps(vLengthSq, vTemp); + // x+z,x+z,x+z,y+w + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 0, 0, 0)); + // ??,??,y+w,y+w + vTemp = _mm_shuffle_ps(vTemp, vLengthSq, _MM_SHUFFLE(3, 3, 0, 0)); + // ??,??,x+z+y+w,?? + vLengthSq = _mm_add_ps(vLengthSq, vTemp); + // Splat the length + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(2, 2, 2, 2)); + // Get the reciprocal + vLengthSq = _mm_rsqrt_ps(vLengthSq); + return vLengthSq; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4ReciprocalLength(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector4LengthSq(V); + Result = XMVectorReciprocalSqrt(Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Dot4 + float32x4_t vTemp = vmulq_f32(V, V); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vadd_f32(v1, v2); + v1 = vpadd_f32(v1, v1); + // Reciprocal sqrt + float32x2_t S0 = vrsqrte_f32(v1); + float32x2_t P0 = vmul_f32(v1, S0); + float32x2_t R0 = vrsqrts_f32(P0, S0); + float32x2_t S1 = vmul_f32(S0, R0); + float32x2_t P1 = vmul_f32(v1, S1); + float32x2_t R1 = vrsqrts_f32(P1, S1); + float32x2_t Result = vmul_f32(S1, R1); + return vcombine_f32(Result, Result); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0xff); + XMVECTOR vLengthSq = _mm_sqrt_ps(vTemp); + return _mm_div_ps(g_XMOne, vLengthSq); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_sqrt_ps(vLengthSq); + vLengthSq = _mm_div_ps(g_XMOne, vLengthSq); + return vLengthSq; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y,z and w + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has z and w + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(3, 2, 3, 2)); + // x+z, y+w + vLengthSq = _mm_add_ps(vLengthSq, vTemp); + // x+z,x+z,x+z,y+w + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 0, 0, 0)); + // ??,??,y+w,y+w + vTemp = _mm_shuffle_ps(vTemp, vLengthSq, _MM_SHUFFLE(3, 3, 0, 0)); + // ??,??,x+z+y+w,?? + vLengthSq = _mm_add_ps(vLengthSq, vTemp); + // Splat the length + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(2, 2, 2, 2)); + // Get the reciprocal + vLengthSq = _mm_sqrt_ps(vLengthSq); + // Accurate! + vLengthSq = _mm_div_ps(g_XMOne, vLengthSq); + return vLengthSq; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4LengthEst(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector4LengthSq(V); + Result = XMVectorSqrtEst(Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Dot4 + float32x4_t vTemp = vmulq_f32(V, V); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vadd_f32(v1, v2); + v1 = vpadd_f32(v1, v1); + const float32x2_t zero = vdup_n_f32(0); + uint32x2_t VEqualsZero = vceq_f32(v1, zero); + // Sqrt (estimate) + float32x2_t Result = vrsqrte_f32(v1); + Result = vmul_f32(v1, Result); + Result = vbsl_f32(VEqualsZero, zero, Result); + return vcombine_f32(Result, Result); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0xff); + return _mm_sqrt_ps(vTemp); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y,z and w + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has z and w + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(3, 2, 3, 2)); + // x+z, y+w + vLengthSq = _mm_add_ps(vLengthSq, vTemp); + // x+z,x+z,x+z,y+w + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 0, 0, 0)); + // ??,??,y+w,y+w + vTemp = _mm_shuffle_ps(vTemp, vLengthSq, _MM_SHUFFLE(3, 3, 0, 0)); + // ??,??,x+z+y+w,?? + vLengthSq = _mm_add_ps(vLengthSq, vTemp); + // Splat the length + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(2, 2, 2, 2)); + // Get the length + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4Length(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector4LengthSq(V); + Result = XMVectorSqrt(Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Dot4 + float32x4_t vTemp = vmulq_f32(V, V); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vadd_f32(v1, v2); + v1 = vpadd_f32(v1, v1); + const float32x2_t zero = vdup_n_f32(0); + uint32x2_t VEqualsZero = vceq_f32(v1, zero); + // Sqrt + float32x2_t S0 = vrsqrte_f32(v1); + float32x2_t P0 = vmul_f32(v1, S0); + float32x2_t R0 = vrsqrts_f32(P0, S0); + float32x2_t S1 = vmul_f32(S0, R0); + float32x2_t P1 = vmul_f32(v1, S1); + float32x2_t R1 = vrsqrts_f32(P1, S1); + float32x2_t Result = vmul_f32(S1, R1); + Result = vmul_f32(v1, Result); + Result = vbsl_f32(VEqualsZero, zero, Result); + return vcombine_f32(Result, Result); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0xff); + return _mm_sqrt_ps(vTemp); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y,z and w + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has z and w + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(3, 2, 3, 2)); + // x+z, y+w + vLengthSq = _mm_add_ps(vLengthSq, vTemp); + // x+z,x+z,x+z,y+w + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 0, 0, 0)); + // ??,??,y+w,y+w + vTemp = _mm_shuffle_ps(vTemp, vLengthSq, _MM_SHUFFLE(3, 3, 0, 0)); + // ??,??,x+z+y+w,?? + vLengthSq = _mm_add_ps(vLengthSq, vTemp); + // Splat the length + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(2, 2, 2, 2)); + // Get the length + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#endif +} + +//------------------------------------------------------------------------------ +// XMVector4NormalizeEst uses a reciprocal estimate and +// returns QNaN on zero and infinite vectors. + +inline XMVECTOR XM_CALLCONV XMVector4NormalizeEst(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result = XMVector4ReciprocalLength(V); + Result = XMVectorMultiply(V, Result); + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Dot4 + float32x4_t vTemp = vmulq_f32(V, V); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vadd_f32(v1, v2); + v1 = vpadd_f32(v1, v1); + // Reciprocal sqrt (estimate) + v2 = vrsqrte_f32(v1); + // Normalize + return vmulq_f32(V, vcombine_f32(v2, v2)); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0xff); + XMVECTOR vResult = _mm_rsqrt_ps(vTemp); + return _mm_mul_ps(vResult, V); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vDot = _mm_mul_ps(V, V); + vDot = _mm_hadd_ps(vDot, vDot); + vDot = _mm_hadd_ps(vDot, vDot); + vDot = _mm_rsqrt_ps(vDot); + vDot = _mm_mul_ps(vDot, V); + return vDot; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y,z and w + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has z and w + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(3, 2, 3, 2)); + // x+z, y+w + vLengthSq = _mm_add_ps(vLengthSq, vTemp); + // x+z,x+z,x+z,y+w + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 0, 0, 0)); + // ??,??,y+w,y+w + vTemp = _mm_shuffle_ps(vTemp, vLengthSq, _MM_SHUFFLE(3, 3, 0, 0)); + // ??,??,x+z+y+w,?? + vLengthSq = _mm_add_ps(vLengthSq, vTemp); + // Splat the length + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(2, 2, 2, 2)); + // Get the reciprocal + XMVECTOR vResult = _mm_rsqrt_ps(vLengthSq); + // Reciprocal mul to perform the normalization + vResult = _mm_mul_ps(vResult, V); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4Normalize(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + float fLength; + XMVECTOR vResult; + + vResult = XMVector4Length(V); + fLength = vResult.vector4_f32[0]; + + // Prevent divide by zero + if (fLength > 0) + { + fLength = 1.0f / fLength; + } + + vResult.vector4_f32[0] = V.vector4_f32[0] * fLength; + vResult.vector4_f32[1] = V.vector4_f32[1] * fLength; + vResult.vector4_f32[2] = V.vector4_f32[2] * fLength; + vResult.vector4_f32[3] = V.vector4_f32[3] * fLength; + return vResult; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Dot4 + float32x4_t vTemp = vmulq_f32(V, V); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vadd_f32(v1, v2); + v1 = vpadd_f32(v1, v1); + uint32x2_t VEqualsZero = vceq_f32(v1, vdup_n_f32(0)); + uint32x2_t VEqualsInf = vceq_f32(v1, vget_low_f32(g_XMInfinity)); + // Reciprocal sqrt (2 iterations of Newton-Raphson) + float32x2_t S0 = vrsqrte_f32(v1); + float32x2_t P0 = vmul_f32(v1, S0); + float32x2_t R0 = vrsqrts_f32(P0, S0); + float32x2_t S1 = vmul_f32(S0, R0); + float32x2_t P1 = vmul_f32(v1, S1); + float32x2_t R1 = vrsqrts_f32(P1, S1); + v2 = vmul_f32(S1, R1); + // Normalize + XMVECTOR vResult = vmulq_f32(V, vcombine_f32(v2, v2)); + vResult = vbslq_f32(vcombine_u32(VEqualsZero, VEqualsZero), vdupq_n_f32(0), vResult); + return vbslq_f32(vcombine_u32(VEqualsInf, VEqualsInf), g_XMQNaN, vResult); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vLengthSq = _mm_dp_ps(V, V, 0xff); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Create zero with a single instruction + XMVECTOR vZeroMask = _mm_setzero_ps(); + // Test for a divide by zero (Must be FP to detect -0.0) + vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); + // Divide to perform the normalization + vResult = _mm_div_ps(V, vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult, vZeroMask); + // Select qnan or result based on infinite length + XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); + XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); + vResult = _mm_or_ps(vTemp1, vTemp2); + return vResult; +#elif defined(_XM_SSE3_INTRINSICS_) + // Perform the dot product on x,y,z and w + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Create zero with a single instruction + XMVECTOR vZeroMask = _mm_setzero_ps(); + // Test for a divide by zero (Must be FP to detect -0.0) + vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); + // Divide to perform the normalization + vResult = _mm_div_ps(V, vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult, vZeroMask); + // Select qnan or result based on infinite length + XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); + XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); + vResult = _mm_or_ps(vTemp1, vTemp2); + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y,z and w + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has z and w + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(3, 2, 3, 2)); + // x+z, y+w + vLengthSq = _mm_add_ps(vLengthSq, vTemp); + // x+z,x+z,x+z,y+w + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 0, 0, 0)); + // ??,??,y+w,y+w + vTemp = _mm_shuffle_ps(vTemp, vLengthSq, _MM_SHUFFLE(3, 3, 0, 0)); + // ??,??,x+z+y+w,?? + vLengthSq = _mm_add_ps(vLengthSq, vTemp); + // Splat the length + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(2, 2, 2, 2)); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Create zero with a single instruction + XMVECTOR vZeroMask = _mm_setzero_ps(); + // Test for a divide by zero (Must be FP to detect -0.0) + vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); + // Divide to perform the normalization + vResult = _mm_div_ps(V, vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult, vZeroMask); + // Select qnan or result based on infinite length + XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); + XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); + vResult = _mm_or_ps(vTemp1, vTemp2); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4ClampLength +( + FXMVECTOR V, + float LengthMin, + float LengthMax +) noexcept +{ + XMVECTOR ClampMax = XMVectorReplicate(LengthMax); + XMVECTOR ClampMin = XMVectorReplicate(LengthMin); + + return XMVector4ClampLengthV(V, ClampMin, ClampMax); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4ClampLengthV +( + FXMVECTOR V, + FXMVECTOR LengthMin, + FXMVECTOR LengthMax +) noexcept +{ + assert((XMVectorGetY(LengthMin) == XMVectorGetX(LengthMin)) && (XMVectorGetZ(LengthMin) == XMVectorGetX(LengthMin)) && (XMVectorGetW(LengthMin) == XMVectorGetX(LengthMin))); + assert((XMVectorGetY(LengthMax) == XMVectorGetX(LengthMax)) && (XMVectorGetZ(LengthMax) == XMVectorGetX(LengthMax)) && (XMVectorGetW(LengthMax) == XMVectorGetX(LengthMax))); + assert(XMVector4GreaterOrEqual(LengthMin, XMVectorZero())); + assert(XMVector4GreaterOrEqual(LengthMax, XMVectorZero())); + assert(XMVector4GreaterOrEqual(LengthMax, LengthMin)); + + XMVECTOR LengthSq = XMVector4LengthSq(V); + + const XMVECTOR Zero = XMVectorZero(); + + XMVECTOR RcpLength = XMVectorReciprocalSqrt(LengthSq); + + XMVECTOR InfiniteLength = XMVectorEqualInt(LengthSq, g_XMInfinity.v); + XMVECTOR ZeroLength = XMVectorEqual(LengthSq, Zero); + + XMVECTOR Normal = XMVectorMultiply(V, RcpLength); + + XMVECTOR Length = XMVectorMultiply(LengthSq, RcpLength); + + XMVECTOR Select = XMVectorEqualInt(InfiniteLength, ZeroLength); + Length = XMVectorSelect(LengthSq, Length, Select); + Normal = XMVectorSelect(LengthSq, Normal, Select); + + XMVECTOR ControlMax = XMVectorGreater(Length, LengthMax); + XMVECTOR ControlMin = XMVectorLess(Length, LengthMin); + + XMVECTOR ClampLength = XMVectorSelect(Length, LengthMax, ControlMax); + ClampLength = XMVectorSelect(ClampLength, LengthMin, ControlMin); + + XMVECTOR Result = XMVectorMultiply(Normal, ClampLength); + + // Preserve the original vector (with no precision loss) if the length falls within the given range + XMVECTOR Control = XMVectorEqualInt(ControlMax, ControlMin); + Result = XMVectorSelect(Result, V, Control); + + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4Reflect +( + FXMVECTOR Incident, + FXMVECTOR Normal +) noexcept +{ + // Result = Incident - (2 * dot(Incident, Normal)) * Normal + + XMVECTOR Result = XMVector4Dot(Incident, Normal); + Result = XMVectorAdd(Result, Result); + Result = XMVectorNegativeMultiplySubtract(Result, Normal, Incident); + + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4Refract +( + FXMVECTOR Incident, + FXMVECTOR Normal, + float RefractionIndex +) noexcept +{ + XMVECTOR Index = XMVectorReplicate(RefractionIndex); + return XMVector4RefractV(Incident, Normal, Index); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4RefractV +( + FXMVECTOR Incident, + FXMVECTOR Normal, + FXMVECTOR RefractionIndex +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR IDotN; + XMVECTOR R; + const XMVECTOR Zero = XMVectorZero(); + + // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + + // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) + + IDotN = XMVector4Dot(Incident, Normal); + + // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + R = XMVectorNegativeMultiplySubtract(IDotN, IDotN, g_XMOne.v); + R = XMVectorMultiply(R, RefractionIndex); + R = XMVectorNegativeMultiplySubtract(R, RefractionIndex, g_XMOne.v); + + if (XMVector4LessOrEqual(R, Zero)) + { + // Total internal reflection + return Zero; + } + else + { + XMVECTOR Result; + + // R = RefractionIndex * IDotN + sqrt(R) + R = XMVectorSqrt(R); + R = XMVectorMultiplyAdd(RefractionIndex, IDotN, R); + + // Result = RefractionIndex * Incident - Normal * R + Result = XMVectorMultiply(RefractionIndex, Incident); + Result = XMVectorNegativeMultiplySubtract(Normal, R, Result); + + return Result; + } + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMVECTOR IDotN = XMVector4Dot(Incident, Normal); + + // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + float32x4_t R = vmlsq_f32(g_XMOne, IDotN, IDotN); + R = vmulq_f32(R, RefractionIndex); + R = vmlsq_f32(g_XMOne, R, RefractionIndex); + + uint32x4_t isrzero = vcleq_f32(R, g_XMZero); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(isrzero)), vget_high_u8(vreinterpretq_u8_u32(isrzero))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + + float32x4_t vResult; + if (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU) + { + // Total internal reflection + vResult = g_XMZero; + } + else + { + // Sqrt(R) + float32x4_t S0 = vrsqrteq_f32(R); + float32x4_t P0 = vmulq_f32(R, S0); + float32x4_t R0 = vrsqrtsq_f32(P0, S0); + float32x4_t S1 = vmulq_f32(S0, R0); + float32x4_t P1 = vmulq_f32(R, S1); + float32x4_t R1 = vrsqrtsq_f32(P1, S1); + float32x4_t S2 = vmulq_f32(S1, R1); + R = vmulq_f32(R, S2); + // R = RefractionIndex * IDotN + sqrt(R) + R = vmlaq_f32(R, RefractionIndex, IDotN); + // Result = RefractionIndex * Incident - Normal * R + vResult = vmulq_f32(RefractionIndex, Incident); + vResult = vmlsq_f32(vResult, R, Normal); + } + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR IDotN = XMVector4Dot(Incident, Normal); + + // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + XMVECTOR R = XM_FNMADD_PS(IDotN, IDotN, g_XMOne); + XMVECTOR R2 = _mm_mul_ps(RefractionIndex, RefractionIndex); + R = XM_FNMADD_PS(R, R2, g_XMOne); + + XMVECTOR vResult = _mm_cmple_ps(R, g_XMZero); + if (_mm_movemask_ps(vResult) == 0x0f) + { + // Total internal reflection + vResult = g_XMZero; + } + else + { + // R = RefractionIndex * IDotN + sqrt(R) + R = _mm_sqrt_ps(R); + R = XM_FMADD_PS(RefractionIndex, IDotN, R); + // Result = RefractionIndex * Incident - Normal * R + vResult = _mm_mul_ps(RefractionIndex, Incident); + vResult = XM_FNMADD_PS(R, Normal, vResult); + } + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4Orthogonal(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + V.vector4_f32[2], + V.vector4_f32[3], + -V.vector4_f32[0], + -V.vector4_f32[1] + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 Negate = { { { 1.f, 1.f, -1.f, -1.f } } }; + + float32x4_t Result = vcombine_f32(vget_high_f32(V), vget_low_f32(V)); + return vmulq_f32(Result, Negate); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 FlipZW = { { { 1.0f, 1.0f, -1.0f, -1.0f } } }; + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 0, 3, 2)); + vResult = _mm_mul_ps(vResult, FlipZW); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4AngleBetweenNormalsEst +( + FXMVECTOR N1, + FXMVECTOR N2 +) noexcept +{ + XMVECTOR Result = XMVector4Dot(N1, N2); + Result = XMVectorClamp(Result, g_XMNegativeOne.v, g_XMOne.v); + Result = XMVectorACosEst(Result); + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4AngleBetweenNormals +( + FXMVECTOR N1, + FXMVECTOR N2 +) noexcept +{ + XMVECTOR Result = XMVector4Dot(N1, N2); + Result = XMVectorClamp(Result, g_XMNegativeOne.v, g_XMOne.v); + Result = XMVectorACos(Result); + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4AngleBetweenVectors +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ + XMVECTOR L1 = XMVector4ReciprocalLength(V1); + XMVECTOR L2 = XMVector4ReciprocalLength(V2); + + XMVECTOR Dot = XMVector4Dot(V1, V2); + + L1 = XMVectorMultiply(L1, L2); + + XMVECTOR CosAngle = XMVectorMultiply(Dot, L1); + CosAngle = XMVectorClamp(CosAngle, g_XMNegativeOne.v, g_XMOne.v); + + return XMVectorACos(CosAngle); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4Transform +( + FXMVECTOR V, + FXMMATRIX M +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + float fX = (M.m[0][0] * V.vector4_f32[0]) + (M.m[1][0] * V.vector4_f32[1]) + (M.m[2][0] * V.vector4_f32[2]) + (M.m[3][0] * V.vector4_f32[3]); + float fY = (M.m[0][1] * V.vector4_f32[0]) + (M.m[1][1] * V.vector4_f32[1]) + (M.m[2][1] * V.vector4_f32[2]) + (M.m[3][1] * V.vector4_f32[3]); + float fZ = (M.m[0][2] * V.vector4_f32[0]) + (M.m[1][2] * V.vector4_f32[1]) + (M.m[2][2] * V.vector4_f32[2]) + (M.m[3][2] * V.vector4_f32[3]); + float fW = (M.m[0][3] * V.vector4_f32[0]) + (M.m[1][3] * V.vector4_f32[1]) + (M.m[2][3] * V.vector4_f32[2]) + (M.m[3][3] * V.vector4_f32[3]); + XMVECTORF32 vResult = { { { fX, fY, fZ, fW } } }; + return vResult.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + XMVECTOR vResult = vmulq_lane_f32(M.r[0], VL, 0); // X + vResult = vmlaq_lane_f32(vResult, M.r[1], VL, 1); // Y + float32x2_t VH = vget_high_f32(V); + vResult = vmlaq_lane_f32(vResult, M.r[2], VH, 0); // Z + return vmlaq_lane_f32(vResult, M.r[3], VH, 1); // W +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); // W + vResult = _mm_mul_ps(vResult, M.r[3]); + XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); // Z + vResult = XM_FMADD_PS(vTemp, M.r[2], vResult); + vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); // Y + vResult = XM_FMADD_PS(vTemp, M.r[1], vResult); + vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); // X + vResult = XM_FMADD_PS(vTemp, M.r[0], vResult); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMFLOAT4* XM_CALLCONV XMVector4TransformStream +( + XMFLOAT4* pOutputStream, + size_t OutputStride, + const XMFLOAT4* pInputStream, + size_t InputStride, + size_t VectorCount, + FXMMATRIX M +) noexcept +{ + assert(pOutputStream != nullptr); + assert(pInputStream != nullptr); + + assert(InputStride >= sizeof(XMFLOAT4)); + _Analysis_assume_(InputStride >= sizeof(XMFLOAT4)); + + assert(OutputStride >= sizeof(XMFLOAT4)); + _Analysis_assume_(OutputStride >= sizeof(XMFLOAT4)); + +#if defined(_XM_NO_INTRINSICS_) + + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row2 = M.r[2]; + const XMVECTOR row3 = M.r[3]; + + for (size_t i = 0; i < VectorCount; i++) + { + XMVECTOR V = XMLoadFloat4(reinterpret_cast(pInputVector)); + XMVECTOR W = XMVectorSplatW(V); + XMVECTOR Z = XMVectorSplatZ(V); + XMVECTOR Y = XMVectorSplatY(V); + XMVECTOR X = XMVectorSplatX(V); + + XMVECTOR Result = XMVectorMultiply(W, row3); + Result = XMVectorMultiplyAdd(Z, row2, Result); + Result = XMVectorMultiplyAdd(Y, row1, Result); + Result = XMVectorMultiplyAdd(X, row0, Result); + +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable : 26015, "PREfast noise: Esp:1307" ) +#endif + + XMStoreFloat4(reinterpret_cast(pOutputVector), Result); + +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row2 = M.r[2]; + const XMVECTOR row3 = M.r[3]; + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if ((InputStride == sizeof(XMFLOAT4)) && (OutputStride == sizeof(XMFLOAT4))) + { + for (size_t j = 0; j < four; ++j) + { + float32x4x4_t V = vld4q_f32(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT4) * 4; + + float32x2_t r = vget_low_f32(row0); + XMVECTOR vResult0 = vmulq_lane_f32(V.val[0], r, 0); // Ax + XMVECTOR vResult1 = vmulq_lane_f32(V.val[0], r, 1); // Bx + + XM_PREFETCH(pInputVector); + + r = vget_high_f32(row0); + XMVECTOR vResult2 = vmulq_lane_f32(V.val[0], r, 0); // Cx + XMVECTOR vResult3 = vmulq_lane_f32(V.val[0], r, 1); // Dx + + XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); + + r = vget_low_f32(row1); + vResult0 = vmlaq_lane_f32(vResult0, V.val[1], r, 0); // Ax+Ey + vResult1 = vmlaq_lane_f32(vResult1, V.val[1], r, 1); // Bx+Fy + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); + + r = vget_high_f32(row1); + vResult2 = vmlaq_lane_f32(vResult2, V.val[1], r, 0); // Cx+Gy + vResult3 = vmlaq_lane_f32(vResult3, V.val[1], r, 1); // Dx+Hy + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); + + r = vget_low_f32(row2); + vResult0 = vmlaq_lane_f32(vResult0, V.val[2], r, 0); // Ax+Ey+Iz + vResult1 = vmlaq_lane_f32(vResult1, V.val[2], r, 1); // Bx+Fy+Jz + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 4)); + + r = vget_high_f32(row2); + vResult2 = vmlaq_lane_f32(vResult2, V.val[2], r, 0); // Cx+Gy+Kz + vResult3 = vmlaq_lane_f32(vResult3, V.val[2], r, 1); // Dx+Hy+Lz + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 5)); + + r = vget_low_f32(row3); + vResult0 = vmlaq_lane_f32(vResult0, V.val[3], r, 0); // Ax+Ey+Iz+Mw + vResult1 = vmlaq_lane_f32(vResult1, V.val[3], r, 1); // Bx+Fy+Jz+Nw + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 6)); + + r = vget_high_f32(row3); + vResult2 = vmlaq_lane_f32(vResult2, V.val[3], r, 0); // Cx+Gy+Kz+Ow + vResult3 = vmlaq_lane_f32(vResult3, V.val[3], r, 1); // Dx+Hy+Lz+Pw + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 7)); + + V.val[0] = vResult0; + V.val[1] = vResult1; + V.val[2] = vResult2; + V.val[3] = vResult3; + + vst4q_f32(reinterpret_cast(pOutputVector), V); + pOutputVector += sizeof(XMFLOAT4) * 4; + + i += 4; + } + } + } + + for (; i < VectorCount; i++) + { + XMVECTOR V = vld1q_f32(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + float32x2_t VL = vget_low_f32(V); + XMVECTOR vResult = vmulq_lane_f32(row0, VL, 0); // X + vResult = vmlaq_lane_f32(vResult, row1, VL, 1); // Y + float32x2_t VH = vget_high_f32(V); + vResult = vmlaq_lane_f32(vResult, row2, VH, 0); // Z + vResult = vmlaq_lane_f32(vResult, row3, VH, 1); // W + + vst1q_f32(reinterpret_cast(pOutputVector), vResult); + pOutputVector += OutputStride; + } + + return pOutputStream; +#elif defined(_XM_AVX2_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + size_t i = 0; + size_t two = VectorCount >> 1; + if (two > 0) + { + __m256 row0 = _mm256_broadcast_ps(&M.r[0]); + __m256 row1 = _mm256_broadcast_ps(&M.r[1]); + __m256 row2 = _mm256_broadcast_ps(&M.r[2]); + __m256 row3 = _mm256_broadcast_ps(&M.r[3]); + + if (InputStride == sizeof(XMFLOAT4)) + { + if (OutputStride == sizeof(XMFLOAT4)) + { + if (!(reinterpret_cast(pOutputStream) & 0x1F)) + { + // Packed input, aligned & packed output + for (size_t j = 0; j < two; ++j) + { + __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT4) * 2; + + __m256 vTempX = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); + __m256 vTempY = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); + __m256 vTempZ = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 vTempW = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); + + vTempX = _mm256_mul_ps(vTempX, row0); + vTempY = _mm256_mul_ps(vTempY, row1); + vTempZ = _mm256_fmadd_ps(vTempZ, row2, vTempX); + vTempW = _mm256_fmadd_ps(vTempW, row3, vTempY); + vTempX = _mm256_add_ps(vTempZ, vTempW); + + XM256_STREAM_PS(reinterpret_cast(pOutputVector), vTempX); + pOutputVector += sizeof(XMFLOAT4) * 2; + + i += 2; + } + } + else + { + // Packed input, packed output + for (size_t j = 0; j < two; ++j) + { + __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT4) * 2; + + __m256 vTempX = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); + __m256 vTempY = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); + __m256 vTempZ = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 vTempW = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); + + vTempX = _mm256_mul_ps(vTempX, row0); + vTempY = _mm256_mul_ps(vTempY, row1); + vTempZ = _mm256_fmadd_ps(vTempZ, row2, vTempX); + vTempW = _mm256_fmadd_ps(vTempW, row3, vTempY); + vTempX = _mm256_add_ps(vTempZ, vTempW); + + _mm256_storeu_ps(reinterpret_cast(pOutputVector), vTempX); + pOutputVector += sizeof(XMFLOAT4) * 2; + + i += 2; + } + } + } + else + { + // Packed input, unpacked output + for (size_t j = 0; j < two; ++j) + { + __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT4) * 2; + + __m256 vTempX = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); + __m256 vTempY = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); + __m256 vTempZ = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 vTempW = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); + + vTempX = _mm256_mul_ps(vTempX, row0); + vTempY = _mm256_mul_ps(vTempY, row1); + vTempZ = _mm256_fmadd_ps(vTempZ, row2, vTempX); + vTempW = _mm256_fmadd_ps(vTempW, row3, vTempY); + vTempX = _mm256_add_ps(vTempZ, vTempW); + + _mm_storeu_ps(reinterpret_cast(pOutputVector), _mm256_castps256_ps128(vTempX)); + pOutputVector += OutputStride; + + _mm_storeu_ps(reinterpret_cast(pOutputVector), _mm256_extractf128_ps(vTempX, 1)); + pOutputVector += OutputStride; + i += 2; + } + } + } + } + + if (i < VectorCount) + { + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row2 = M.r[2]; + const XMVECTOR row3 = M.r[3]; + + for (; i < VectorCount; i++) + { + __m128 V = _mm_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + XMVECTOR vTempX = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + XMVECTOR vTempY = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR vTempZ = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR vTempW = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + + vTempX = _mm_mul_ps(vTempX, row0); + vTempY = _mm_mul_ps(vTempY, row1); + vTempZ = XM_FMADD_PS(vTempZ, row2, vTempX); + vTempW = XM_FMADD_PS(vTempW, row3, vTempY); + vTempX = _mm_add_ps(vTempZ, vTempW); + + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTempX); + pOutputVector += OutputStride; + } + } + + XM_SFENCE(); + + return pOutputStream; +#elif defined(_XM_SSE_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row2 = M.r[2]; + const XMVECTOR row3 = M.r[3]; + + if (!(reinterpret_cast(pOutputStream) & 0xF) && !(OutputStride & 0xF)) + { + if (!(reinterpret_cast(pInputStream) & 0xF) && !(InputStride & 0xF)) + { + // Aligned input, aligned output + for (size_t i = 0; i < VectorCount; i++) + { + __m128 V = _mm_load_ps(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + XMVECTOR vTempX = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + XMVECTOR vTempY = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR vTempZ = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR vTempW = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + + vTempX = _mm_mul_ps(vTempX, row0); + vTempY = _mm_mul_ps(vTempY, row1); + vTempZ = XM_FMADD_PS(vTempZ, row2, vTempX); + vTempW = XM_FMADD_PS(vTempW, row3, vTempY); + vTempX = _mm_add_ps(vTempZ, vTempW); + + XM_STREAM_PS(reinterpret_cast(pOutputVector), vTempX); + pOutputVector += OutputStride; + } + } + else + { + // Unaligned input, aligned output + for (size_t i = 0; i < VectorCount; i++) + { + __m128 V = _mm_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + XMVECTOR vTempX = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + XMVECTOR vTempY = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR vTempZ = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR vTempW = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + + vTempX = _mm_mul_ps(vTempX, row0); + vTempY = _mm_mul_ps(vTempY, row1); + vTempZ = XM_FMADD_PS(vTempZ, row2, vTempX); + vTempW = XM_FMADD_PS(vTempW, row3, vTempY); + vTempX = _mm_add_ps(vTempZ, vTempW); + + XM_STREAM_PS(reinterpret_cast(pOutputVector), vTempX); + pOutputVector += OutputStride; + } + } + } + else + { + if (!(reinterpret_cast(pInputStream) & 0xF) && !(InputStride & 0xF)) + { + // Aligned input, unaligned output + for (size_t i = 0; i < VectorCount; i++) + { + __m128 V = _mm_load_ps(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + XMVECTOR vTempX = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + XMVECTOR vTempY = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR vTempZ = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR vTempW = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + + vTempX = _mm_mul_ps(vTempX, row0); + vTempY = _mm_mul_ps(vTempY, row1); + vTempZ = XM_FMADD_PS(vTempZ, row2, vTempX); + vTempW = XM_FMADD_PS(vTempW, row3, vTempY); + vTempX = _mm_add_ps(vTempZ, vTempW); + + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTempX); + pOutputVector += OutputStride; + } + } + else + { + // Unaligned input, unaligned output + for (size_t i = 0; i < VectorCount; i++) + { + __m128 V = _mm_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + XMVECTOR vTempX = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + XMVECTOR vTempY = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR vTempZ = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR vTempW = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + + vTempX = _mm_mul_ps(vTempX, row0); + vTempY = _mm_mul_ps(vTempY, row1); + vTempZ = XM_FMADD_PS(vTempZ, row2, vTempX); + vTempW = XM_FMADD_PS(vTempW, row3, vTempY); + vTempX = _mm_add_ps(vTempZ, vTempW); + + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTempX); + pOutputVector += OutputStride; + } + } + } + + XM_SFENCE(); + + return pOutputStream; +#endif +} + +/**************************************************************************** + * + * XMVECTOR operators + * + ****************************************************************************/ + +#ifndef _XM_NO_XMVECTOR_OVERLOADS_ + + //------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV operator+ (FXMVECTOR V) noexcept +{ + return V; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV operator- (FXMVECTOR V) noexcept +{ + return XMVectorNegate(V); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR& XM_CALLCONV operator+= +( + XMVECTOR& V1, + FXMVECTOR V2 +) noexcept +{ + V1 = XMVectorAdd(V1, V2); + return V1; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR& XM_CALLCONV operator-= +( + XMVECTOR& V1, + FXMVECTOR V2 +) noexcept +{ + V1 = XMVectorSubtract(V1, V2); + return V1; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR& XM_CALLCONV operator*= +( + XMVECTOR& V1, + FXMVECTOR V2 +) noexcept +{ + V1 = XMVectorMultiply(V1, V2); + return V1; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR& XM_CALLCONV operator/= +( + XMVECTOR& V1, + FXMVECTOR V2 +) noexcept +{ + V1 = XMVectorDivide(V1, V2); + return V1; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR& operator*= +( + XMVECTOR& V, + const float S +) noexcept +{ + V = XMVectorScale(V, S); + return V; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR& operator/= +( + XMVECTOR& V, + const float S +) noexcept +{ + XMVECTOR vS = XMVectorReplicate(S); + V = XMVectorDivide(V, vS); + return V; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV operator+ +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ + return XMVectorAdd(V1, V2); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV operator- +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ + return XMVectorSubtract(V1, V2); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV operator* +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ + return XMVectorMultiply(V1, V2); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV operator/ +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ + return XMVectorDivide(V1, V2); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV operator* +( + FXMVECTOR V, + const float S +) noexcept +{ + return XMVectorScale(V, S); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV operator/ +( + FXMVECTOR V, + const float S +) noexcept +{ + XMVECTOR vS = XMVectorReplicate(S); + return XMVectorDivide(V, vS); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV operator* +( + float S, + FXMVECTOR V +) noexcept +{ + return XMVectorScale(V, S); +} + +#endif /* !_XM_NO_XMVECTOR_OVERLOADS_ */ + +#if defined(_XM_NO_INTRINSICS_) +#undef XMISNAN +#undef XMISINF +#endif + +#if defined(_XM_SSE_INTRINSICS_) +#undef XM3UNPACK3INTO4 +#undef XM3PACK4INTO3 +#endif + diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXPackedVector.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXPackedVector.h new file mode 100644 index 0000000..1484b47 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXPackedVector.h @@ -0,0 +1,1224 @@ +//------------------------------------------------------------------------------------- +// DirectXPackedVector.h -- SIMD C++ Math library +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +// +// http://go.microsoft.com/fwlink/?LinkID=615560 +//------------------------------------------------------------------------------------- + +#pragma once + +#include "DirectXMath.h" + +namespace DirectX +{ + + namespace PackedVector + { +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4201 4365 4324 4996) + // C4201: nonstandard extension used + // C4365: Off by default noise + // C4324: alignment padding warnings + // C4996: deprecation warnings +#endif + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu-anonymous-struct" +#pragma clang diagnostic ignored "-Wnested-anon-types" +#endif + + //------------------------------------------------------------------------------ + // ARGB Color; 8-8-8-8 bit unsigned normalized integer components packed into + // a 32 bit integer. The normalized color is packed into 32 bits using 8 bit + // unsigned, normalized integers for the alpha, red, green, and blue components. + // The alpha component is stored in the most significant bits and the blue + // component in the least significant bits (A8R8G8B8): + // [32] aaaaaaaa rrrrrrrr gggggggg bbbbbbbb [0] + struct XMCOLOR + { + union + { + struct + { + uint8_t b; // Blue: 0/255 to 255/255 + uint8_t g; // Green: 0/255 to 255/255 + uint8_t r; // Red: 0/255 to 255/255 + uint8_t a; // Alpha: 0/255 to 255/255 + }; + uint32_t c; + }; + + XMCOLOR() = default; + + XMCOLOR(const XMCOLOR&) = default; + XMCOLOR& operator=(const XMCOLOR&) = default; + + XMCOLOR(XMCOLOR&&) = default; + XMCOLOR& operator=(XMCOLOR&&) = default; + + constexpr XMCOLOR(uint32_t Color) noexcept : c(Color) {} + XMCOLOR(float _r, float _g, float _b, float _a) noexcept; + explicit XMCOLOR(_In_reads_(4) const float* pArray) noexcept; + + operator uint32_t () const noexcept { return c; } + + XMCOLOR& operator= (const uint32_t Color) noexcept { c = Color; return *this; } + }; + + //------------------------------------------------------------------------------ + // 16 bit floating point number consisting of a sign bit, a 5 bit biased + // exponent, and a 10 bit mantissa + using HALF = uint16_t; + + //------------------------------------------------------------------------------ + // 2D Vector; 16 bit floating point components + struct XMHALF2 + { + union + { + struct + { + HALF x; + HALF y; + }; + uint32_t v; + }; + + XMHALF2() = default; + + XMHALF2(const XMHALF2&) = default; + XMHALF2& operator=(const XMHALF2&) = default; + + XMHALF2(XMHALF2&&) = default; + XMHALF2& operator=(XMHALF2&&) = default; + + explicit constexpr XMHALF2(uint32_t Packed) noexcept : v(Packed) {} + constexpr XMHALF2(HALF _x, HALF _y) noexcept : x(_x), y(_y) {} + explicit XMHALF2(_In_reads_(2) const HALF* pArray) noexcept : x(pArray[0]), y(pArray[1]) {} + XMHALF2(float _x, float _y) noexcept; + explicit XMHALF2(_In_reads_(2) const float* pArray) noexcept; + + XMHALF2& operator= (uint32_t Packed) noexcept { v = Packed; return *this; } + }; + + //------------------------------------------------------------------------------ + // 2D Vector; 16 bit signed normalized integer components + struct XMSHORTN2 + { + union + { + struct + { + int16_t x; + int16_t y; + }; + uint32_t v; + }; + + XMSHORTN2() = default; + + XMSHORTN2(const XMSHORTN2&) = default; + XMSHORTN2& operator=(const XMSHORTN2&) = default; + + XMSHORTN2(XMSHORTN2&&) = default; + XMSHORTN2& operator=(XMSHORTN2&&) = default; + + explicit constexpr XMSHORTN2(uint32_t Packed) noexcept : v(Packed) {} + constexpr XMSHORTN2(int16_t _x, int16_t _y) noexcept : x(_x), y(_y) {} + explicit XMSHORTN2(_In_reads_(2) const int16_t* pArray) noexcept : x(pArray[0]), y(pArray[1]) {} + XMSHORTN2(float _x, float _y) noexcept; + explicit XMSHORTN2(_In_reads_(2) const float* pArray) noexcept; + + XMSHORTN2& operator= (uint32_t Packed) noexcept { v = Packed; return *this; } + }; + + // 2D Vector; 16 bit signed integer components + struct XMSHORT2 + { + union + { + struct + { + int16_t x; + int16_t y; + }; + uint32_t v; + }; + + XMSHORT2() = default; + + XMSHORT2(const XMSHORT2&) = default; + XMSHORT2& operator=(const XMSHORT2&) = default; + + XMSHORT2(XMSHORT2&&) = default; + XMSHORT2& operator=(XMSHORT2&&) = default; + + explicit constexpr XMSHORT2(uint32_t Packed) noexcept : v(Packed) {} + constexpr XMSHORT2(int16_t _x, int16_t _y) noexcept : x(_x), y(_y) {} + explicit XMSHORT2(_In_reads_(2) const int16_t* pArray) noexcept : x(pArray[0]), y(pArray[1]) {} + XMSHORT2(float _x, float _y) noexcept; + explicit XMSHORT2(_In_reads_(2) const float* pArray) noexcept; + + XMSHORT2& operator= (uint32_t Packed) noexcept { v = Packed; return *this; } + }; + + // 2D Vector; 16 bit unsigned normalized integer components + struct XMUSHORTN2 + { + union + { + struct + { + uint16_t x; + uint16_t y; + }; + uint32_t v; + }; + + XMUSHORTN2() = default; + + XMUSHORTN2(const XMUSHORTN2&) = default; + XMUSHORTN2& operator=(const XMUSHORTN2&) = default; + + XMUSHORTN2(XMUSHORTN2&&) = default; + XMUSHORTN2& operator=(XMUSHORTN2&&) = default; + + explicit constexpr XMUSHORTN2(uint32_t Packed) noexcept : v(Packed) {} + constexpr XMUSHORTN2(uint16_t _x, uint16_t _y) noexcept : x(_x), y(_y) {} + explicit XMUSHORTN2(_In_reads_(2) const uint16_t* pArray) noexcept : x(pArray[0]), y(pArray[1]) {} + XMUSHORTN2(float _x, float _y) noexcept; + explicit XMUSHORTN2(_In_reads_(2) const float* pArray) noexcept; + + XMUSHORTN2& operator= (uint32_t Packed) noexcept { v = Packed; return *this; } + }; + + // 2D Vector; 16 bit unsigned integer components + struct XMUSHORT2 + { + union + { + struct + { + uint16_t x; + uint16_t y; + }; + uint32_t v; + }; + + XMUSHORT2() = default; + + XMUSHORT2(const XMUSHORT2&) = default; + XMUSHORT2& operator=(const XMUSHORT2&) = default; + + XMUSHORT2(XMUSHORT2&&) = default; + XMUSHORT2& operator=(XMUSHORT2&&) = default; + + explicit constexpr XMUSHORT2(uint32_t Packed) noexcept : v(Packed) {} + constexpr XMUSHORT2(uint16_t _x, uint16_t _y) noexcept : x(_x), y(_y) {} + explicit XMUSHORT2(_In_reads_(2) const uint16_t* pArray) noexcept : x(pArray[0]), y(pArray[1]) {} + XMUSHORT2(float _x, float _y) noexcept; + explicit XMUSHORT2(_In_reads_(2) const float* pArray) noexcept; + + XMUSHORT2& operator= (uint32_t Packed) noexcept { v = Packed; return *this; } + }; + + //------------------------------------------------------------------------------ + // 2D Vector; 8 bit signed normalized integer components + struct XMBYTEN2 + { + union + { + struct + { + int8_t x; + int8_t y; + }; + uint16_t v; + }; + + XMBYTEN2() = default; + + XMBYTEN2(const XMBYTEN2&) = default; + XMBYTEN2& operator=(const XMBYTEN2&) = default; + + XMBYTEN2(XMBYTEN2&&) = default; + XMBYTEN2& operator=(XMBYTEN2&&) = default; + + explicit constexpr XMBYTEN2(uint16_t Packed) noexcept : v(Packed) {} + constexpr XMBYTEN2(int8_t _x, int8_t _y) noexcept : x(_x), y(_y) {} + explicit XMBYTEN2(_In_reads_(2) const int8_t* pArray) noexcept : x(pArray[0]), y(pArray[1]) {} + XMBYTEN2(float _x, float _y) noexcept; + explicit XMBYTEN2(_In_reads_(2) const float* pArray) noexcept; + + XMBYTEN2& operator= (uint16_t Packed) noexcept { v = Packed; return *this; } + }; + + // 2D Vector; 8 bit signed integer components + struct XMBYTE2 + { + union + { + struct + { + int8_t x; + int8_t y; + }; + uint16_t v; + }; + + XMBYTE2() = default; + + XMBYTE2(const XMBYTE2&) = default; + XMBYTE2& operator=(const XMBYTE2&) = default; + + XMBYTE2(XMBYTE2&&) = default; + XMBYTE2& operator=(XMBYTE2&&) = default; + + explicit constexpr XMBYTE2(uint16_t Packed) noexcept : v(Packed) {} + constexpr XMBYTE2(int8_t _x, int8_t _y) noexcept : x(_x), y(_y) {} + explicit XMBYTE2(_In_reads_(2) const int8_t* pArray) noexcept : x(pArray[0]), y(pArray[1]) {} + XMBYTE2(float _x, float _y) noexcept; + explicit XMBYTE2(_In_reads_(2) const float* pArray) noexcept; + + XMBYTE2& operator= (uint16_t Packed) noexcept { v = Packed; return *this; } + }; + + // 2D Vector; 8 bit unsigned normalized integer components + struct XMUBYTEN2 + { + union + { + struct + { + uint8_t x; + uint8_t y; + }; + uint16_t v; + }; + + XMUBYTEN2() = default; + + XMUBYTEN2(const XMUBYTEN2&) = default; + XMUBYTEN2& operator=(const XMUBYTEN2&) = default; + + XMUBYTEN2(XMUBYTEN2&&) = default; + XMUBYTEN2& operator=(XMUBYTEN2&&) = default; + + explicit constexpr XMUBYTEN2(uint16_t Packed) noexcept : v(Packed) {} + constexpr XMUBYTEN2(uint8_t _x, uint8_t _y) noexcept : x(_x), y(_y) {} + explicit XMUBYTEN2(_In_reads_(2) const uint8_t* pArray) noexcept : x(pArray[0]), y(pArray[1]) {} + XMUBYTEN2(float _x, float _y) noexcept; + explicit XMUBYTEN2(_In_reads_(2) const float* pArray) noexcept; + + XMUBYTEN2& operator= (uint16_t Packed) noexcept { v = Packed; return *this; } + }; + + // 2D Vector; 8 bit unsigned integer components + struct XMUBYTE2 + { + union + { + struct + { + uint8_t x; + uint8_t y; + }; + uint16_t v; + }; + + XMUBYTE2() = default; + + XMUBYTE2(const XMUBYTE2&) = default; + XMUBYTE2& operator=(const XMUBYTE2&) = default; + + XMUBYTE2(XMUBYTE2&&) = default; + XMUBYTE2& operator=(XMUBYTE2&&) = default; + + explicit constexpr XMUBYTE2(uint16_t Packed) noexcept : v(Packed) {} + constexpr XMUBYTE2(uint8_t _x, uint8_t _y) noexcept : x(_x), y(_y) {} + explicit XMUBYTE2(_In_reads_(2) const uint8_t* pArray) noexcept : x(pArray[0]), y(pArray[1]) {} + XMUBYTE2(float _x, float _y) noexcept; + explicit XMUBYTE2(_In_reads_(2) const float* pArray) noexcept; + + XMUBYTE2& operator= (uint16_t Packed) noexcept { v = Packed; return *this; } + }; + + //------------------------------------------------------------------------------ + // 3D vector: 5/6/5 unsigned integer components + struct XMU565 + { + union + { + struct + { + uint16_t x : 5; // 0 to 31 + uint16_t y : 6; // 0 to 63 + uint16_t z : 5; // 0 to 31 + }; + uint16_t v; + }; + + XMU565() = default; + + XMU565(const XMU565&) = default; + XMU565& operator=(const XMU565&) = default; + + XMU565(XMU565&&) = default; + XMU565& operator=(XMU565&&) = default; + + explicit constexpr XMU565(uint16_t Packed) noexcept : v(Packed) {} + constexpr XMU565(uint8_t _x, uint8_t _y, uint8_t _z) noexcept : x(_x), y(_y), z(_z) {} + explicit XMU565(_In_reads_(3) const uint8_t* pArray) noexcept : x(pArray[0]), y(pArray[1]), z(pArray[2]) {} + XMU565(float _x, float _y, float _z) noexcept; + explicit XMU565(_In_reads_(3) const float* pArray) noexcept; + + operator uint16_t () const noexcept { return v; } + + XMU565& operator= (uint16_t Packed) noexcept { v = Packed; return *this; } + }; + + //------------------------------------------------------------------------------ + // 3D vector: 11/11/10 floating-point components + // The 3D vector is packed into 32 bits as follows: a 5-bit biased exponent + // and 6-bit mantissa for x component, a 5-bit biased exponent and + // 6-bit mantissa for y component, a 5-bit biased exponent and a 5-bit + // mantissa for z. The z component is stored in the most significant bits + // and the x component in the least significant bits. No sign bits so + // all partial-precision numbers are positive. + // (Z10Y11X11): [32] ZZZZZzzz zzzYYYYY yyyyyyXX XXXxxxxx [0] + struct XMFLOAT3PK + { + union + { + struct + { + uint32_t xm : 6; // x-mantissa + uint32_t xe : 5; // x-exponent + uint32_t ym : 6; // y-mantissa + uint32_t ye : 5; // y-exponent + uint32_t zm : 5; // z-mantissa + uint32_t ze : 5; // z-exponent + }; + uint32_t v; + }; + + XMFLOAT3PK() = default; + + XMFLOAT3PK(const XMFLOAT3PK&) = default; + XMFLOAT3PK& operator=(const XMFLOAT3PK&) = default; + + XMFLOAT3PK(XMFLOAT3PK&&) = default; + XMFLOAT3PK& operator=(XMFLOAT3PK&&) = default; + + explicit constexpr XMFLOAT3PK(uint32_t Packed) noexcept : v(Packed) {} + XMFLOAT3PK(float _x, float _y, float _z) noexcept; + explicit XMFLOAT3PK(_In_reads_(3) const float* pArray) noexcept; + + operator uint32_t () const noexcept { return v; } + + XMFLOAT3PK& operator= (uint32_t Packed) noexcept { v = Packed; return *this; } + }; + + //------------------------------------------------------------------------------ + // 3D vector: 9/9/9 floating-point components with shared 5-bit exponent + // The 3D vector is packed into 32 bits as follows: a 5-bit biased exponent + // with 9-bit mantissa for the x, y, and z component. The shared exponent + // is stored in the most significant bits and the x component mantissa is in + // the least significant bits. No sign bits so all partial-precision numbers + // are positive. + // (E5Z9Y9X9): [32] EEEEEzzz zzzzzzyy yyyyyyyx xxxxxxxx [0] + struct XMFLOAT3SE + { + union + { + struct + { + uint32_t xm : 9; // x-mantissa + uint32_t ym : 9; // y-mantissa + uint32_t zm : 9; // z-mantissa + uint32_t e : 5; // shared exponent + }; + uint32_t v; + }; + + XMFLOAT3SE() = default; + + XMFLOAT3SE(const XMFLOAT3SE&) = default; + XMFLOAT3SE& operator=(const XMFLOAT3SE&) = default; + + XMFLOAT3SE(XMFLOAT3SE&&) = default; + XMFLOAT3SE& operator=(XMFLOAT3SE&&) = default; + + explicit constexpr XMFLOAT3SE(uint32_t Packed) noexcept : v(Packed) {} + XMFLOAT3SE(float _x, float _y, float _z) noexcept; + explicit XMFLOAT3SE(_In_reads_(3) const float* pArray) noexcept; + + operator uint32_t () const noexcept { return v; } + + XMFLOAT3SE& operator= (uint32_t Packed) noexcept { v = Packed; return *this; } + }; + + //------------------------------------------------------------------------------ + // 4D Vector; 16 bit floating point components + struct XMHALF4 + { + union + { + struct + { + HALF x; + HALF y; + HALF z; + HALF w; + }; + uint64_t v; + }; + + XMHALF4() = default; + + XMHALF4(const XMHALF4&) = default; + XMHALF4& operator=(const XMHALF4&) = default; + + XMHALF4(XMHALF4&&) = default; + XMHALF4& operator=(XMHALF4&&) = default; + + explicit constexpr XMHALF4(uint64_t Packed) noexcept : v(Packed) {} + constexpr XMHALF4(HALF _x, HALF _y, HALF _z, HALF _w) noexcept : x(_x), y(_y), z(_z), w(_w) {} + explicit XMHALF4(_In_reads_(4) const HALF* pArray) noexcept : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} + XMHALF4(float _x, float _y, float _z, float _w) noexcept; + explicit XMHALF4(_In_reads_(4) const float* pArray) noexcept; + + XMHALF4& operator= (uint64_t Packed) noexcept { v = Packed; return *this; } + }; + + //------------------------------------------------------------------------------ + // 4D Vector; 16 bit signed normalized integer components + struct XMSHORTN4 + { + union + { + struct + { + int16_t x; + int16_t y; + int16_t z; + int16_t w; + }; + uint64_t v; + }; + + XMSHORTN4() = default; + + XMSHORTN4(const XMSHORTN4&) = default; + XMSHORTN4& operator=(const XMSHORTN4&) = default; + + XMSHORTN4(XMSHORTN4&&) = default; + XMSHORTN4& operator=(XMSHORTN4&&) = default; + + explicit constexpr XMSHORTN4(uint64_t Packed) noexcept : v(Packed) {} + constexpr XMSHORTN4(int16_t _x, int16_t _y, int16_t _z, int16_t _w) noexcept : x(_x), y(_y), z(_z), w(_w) {} + explicit XMSHORTN4(_In_reads_(4) const int16_t* pArray) noexcept : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} + XMSHORTN4(float _x, float _y, float _z, float _w) noexcept; + explicit XMSHORTN4(_In_reads_(4) const float* pArray) noexcept; + + XMSHORTN4& operator= (uint64_t Packed) noexcept { v = Packed; return *this; } + }; + + // 4D Vector; 16 bit signed integer components + struct XMSHORT4 + { + union + { + struct + { + int16_t x; + int16_t y; + int16_t z; + int16_t w; + }; + uint64_t v; + }; + + XMSHORT4() = default; + + XMSHORT4(const XMSHORT4&) = default; + XMSHORT4& operator=(const XMSHORT4&) = default; + + XMSHORT4(XMSHORT4&&) = default; + XMSHORT4& operator=(XMSHORT4&&) = default; + + explicit constexpr XMSHORT4(uint64_t Packed) noexcept : v(Packed) {} + constexpr XMSHORT4(int16_t _x, int16_t _y, int16_t _z, int16_t _w) noexcept : x(_x), y(_y), z(_z), w(_w) {} + explicit XMSHORT4(_In_reads_(4) const int16_t* pArray) noexcept : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} + XMSHORT4(float _x, float _y, float _z, float _w) noexcept; + explicit XMSHORT4(_In_reads_(4) const float* pArray) noexcept; + + XMSHORT4& operator= (uint64_t Packed) noexcept { v = Packed; return *this; } + }; + + // 4D Vector; 16 bit unsigned normalized integer components + struct XMUSHORTN4 + { + union + { + struct + { + uint16_t x; + uint16_t y; + uint16_t z; + uint16_t w; + }; + uint64_t v; + }; + + XMUSHORTN4() = default; + + XMUSHORTN4(const XMUSHORTN4&) = default; + XMUSHORTN4& operator=(const XMUSHORTN4&) = default; + + XMUSHORTN4(XMUSHORTN4&&) = default; + XMUSHORTN4& operator=(XMUSHORTN4&&) = default; + + explicit constexpr XMUSHORTN4(uint64_t Packed) noexcept : v(Packed) {} + constexpr XMUSHORTN4(uint16_t _x, uint16_t _y, uint16_t _z, uint16_t _w) noexcept : x(_x), y(_y), z(_z), w(_w) {} + explicit XMUSHORTN4(_In_reads_(4) const uint16_t* pArray) noexcept : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} + XMUSHORTN4(float _x, float _y, float _z, float _w) noexcept; + explicit XMUSHORTN4(_In_reads_(4) const float* pArray) noexcept; + + XMUSHORTN4& operator= (uint64_t Packed) noexcept { v = Packed; return *this; } + }; + + // 4D Vector; 16 bit unsigned integer components + struct XMUSHORT4 + { + union + { + struct + { + uint16_t x; + uint16_t y; + uint16_t z; + uint16_t w; + }; + uint64_t v; + }; + + XMUSHORT4() = default; + + XMUSHORT4(const XMUSHORT4&) = default; + XMUSHORT4& operator=(const XMUSHORT4&) = default; + + XMUSHORT4(XMUSHORT4&&) = default; + XMUSHORT4& operator=(XMUSHORT4&&) = default; + + explicit constexpr XMUSHORT4(uint64_t Packed) noexcept : v(Packed) {} + constexpr XMUSHORT4(uint16_t _x, uint16_t _y, uint16_t _z, uint16_t _w) noexcept : x(_x), y(_y), z(_z), w(_w) {} + explicit XMUSHORT4(_In_reads_(4) const uint16_t* pArray) noexcept : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} + XMUSHORT4(float _x, float _y, float _z, float _w) noexcept; + explicit XMUSHORT4(_In_reads_(4) const float* pArray) noexcept; + + XMUSHORT4& operator= (uint32_t Packed) noexcept { v = Packed; return *this; } + }; + + //------------------------------------------------------------------------------ + // 4D Vector; 10-10-10-2 bit normalized components packed into a 32 bit integer + // The normalized 4D Vector is packed into 32 bits as follows: a 2 bit unsigned, + // normalized integer for the w component and 10 bit signed, normalized + // integers for the z, y, and x components. The w component is stored in the + // most significant bits and the x component in the least significant bits + // (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] + struct XMXDECN4 + { + union + { + struct + { + int32_t x : 10; // -511/511 to 511/511 + int32_t y : 10; // -511/511 to 511/511 + int32_t z : 10; // -511/511 to 511/511 + uint32_t w : 2; // 0/3 to 3/3 + }; + uint32_t v; + }; + + XMXDECN4() = default; + + XMXDECN4(const XMXDECN4&) = default; + XMXDECN4& operator=(const XMXDECN4&) = default; + + XMXDECN4(XMXDECN4&&) = default; + XMXDECN4& operator=(XMXDECN4&&) = default; + + explicit constexpr XMXDECN4(uint32_t Packed) : v(Packed) {} + XMXDECN4(float _x, float _y, float _z, float _w) noexcept; + explicit XMXDECN4(_In_reads_(4) const float* pArray) noexcept; + + operator uint32_t () const noexcept { return v; } + + XMXDECN4& operator= (uint32_t Packed) noexcept { v = Packed; return *this; } + }; + + // 4D Vector; 10-10-10-2 bit components packed into a 32 bit integer + // The normalized 4D Vector is packed into 32 bits as follows: a 2 bit unsigned + // integer for the w component and 10 bit signed integers for the + // z, y, and x components. The w component is stored in the + // most significant bits and the x component in the least significant bits + // (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] + struct XM_DEPRECATED XMXDEC4 + { + union + { + struct + { + int32_t x : 10; // -511 to 511 + int32_t y : 10; // -511 to 511 + int32_t z : 10; // -511 to 511 + uint32_t w : 2; // 0 to 3 + }; + uint32_t v; + }; + + XMXDEC4() = default; + + XMXDEC4(const XMXDEC4&) = default; + XMXDEC4& operator=(const XMXDEC4&) = default; + + XMXDEC4(XMXDEC4&&) = default; + XMXDEC4& operator=(XMXDEC4&&) = default; + + explicit constexpr XMXDEC4(uint32_t Packed) noexcept : v(Packed) {} + XMXDEC4(float _x, float _y, float _z, float _w) noexcept; + explicit XMXDEC4(_In_reads_(4) const float* pArray) noexcept; + + operator uint32_t () const noexcept { return v; } + + XMXDEC4& operator= (uint32_t Packed) noexcept { v = Packed; return *this; } + }; + + // 4D Vector; 10-10-10-2 bit normalized components packed into a 32 bit integer + // The normalized 4D Vector is packed into 32 bits as follows: a 2 bit signed, + // normalized integer for the w component and 10 bit signed, normalized + // integers for the z, y, and x components. The w component is stored in the + // most significant bits and the x component in the least significant bits + // (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] + struct XM_DEPRECATED XMDECN4 + { + union + { + struct + { + int32_t x : 10; // -511/511 to 511/511 + int32_t y : 10; // -511/511 to 511/511 + int32_t z : 10; // -511/511 to 511/511 + int32_t w : 2; // -1/1 to 1/1 + }; + uint32_t v; + }; + + XMDECN4() = default; + + XMDECN4(const XMDECN4&) = default; + XMDECN4& operator=(const XMDECN4&) = default; + + XMDECN4(XMDECN4&&) = default; + XMDECN4& operator=(XMDECN4&&) = default; + + explicit constexpr XMDECN4(uint32_t Packed) noexcept : v(Packed) {} + XMDECN4(float _x, float _y, float _z, float _w) noexcept; + explicit XMDECN4(_In_reads_(4) const float* pArray) noexcept; + + operator uint32_t () const noexcept { return v; } + + XMDECN4& operator= (uint32_t Packed) noexcept { v = Packed; return *this; } + }; + + // 4D Vector; 10-10-10-2 bit components packed into a 32 bit integer + // The 4D Vector is packed into 32 bits as follows: a 2 bit signed, + // integer for the w component and 10 bit signed integers for the + // z, y, and x components. The w component is stored in the + // most significant bits and the x component in the least significant bits + // (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] + struct XM_DEPRECATED XMDEC4 + { + union + { + struct + { + int32_t x : 10; // -511 to 511 + int32_t y : 10; // -511 to 511 + int32_t z : 10; // -511 to 511 + int32_t w : 2; // -1 to 1 + }; + uint32_t v; + }; + + XMDEC4() = default; + + XMDEC4(const XMDEC4&) = default; + XMDEC4& operator=(const XMDEC4&) = default; + + XMDEC4(XMDEC4&&) = default; + XMDEC4& operator=(XMDEC4&&) = default; + + explicit constexpr XMDEC4(uint32_t Packed) noexcept : v(Packed) {} + XMDEC4(float _x, float _y, float _z, float _w) noexcept; + explicit XMDEC4(_In_reads_(4) const float* pArray) noexcept; + + operator uint32_t () const noexcept { return v; } + + XMDEC4& operator= (uint32_t Packed) noexcept { v = Packed; return *this; } + }; + + // 4D Vector; 10-10-10-2 bit normalized components packed into a 32 bit integer + // The normalized 4D Vector is packed into 32 bits as follows: a 2 bit unsigned, + // normalized integer for the w component and 10 bit unsigned, normalized + // integers for the z, y, and x components. The w component is stored in the + // most significant bits and the x component in the least significant bits + // (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] + struct XMUDECN4 + { + union + { + struct + { + uint32_t x : 10; // 0/1023 to 1023/1023 + uint32_t y : 10; // 0/1023 to 1023/1023 + uint32_t z : 10; // 0/1023 to 1023/1023 + uint32_t w : 2; // 0/3 to 3/3 + }; + uint32_t v; + }; + + XMUDECN4() = default; + + XMUDECN4(const XMUDECN4&) = default; + XMUDECN4& operator=(const XMUDECN4&) = default; + + XMUDECN4(XMUDECN4&&) = default; + XMUDECN4& operator=(XMUDECN4&&) = default; + + explicit constexpr XMUDECN4(uint32_t Packed) noexcept : v(Packed) {} + XMUDECN4(float _x, float _y, float _z, float _w) noexcept; + explicit XMUDECN4(_In_reads_(4) const float* pArray) noexcept; + + operator uint32_t () const noexcept { return v; } + + XMUDECN4& operator= (uint32_t Packed) noexcept { v = Packed; return *this; } + }; + + // 4D Vector; 10-10-10-2 bit components packed into a 32 bit integer + // The 4D Vector is packed into 32 bits as follows: a 2 bit unsigned, + // integer for the w component and 10 bit unsigned integers + // for the z, y, and x components. The w component is stored in the + // most significant bits and the x component in the least significant bits + // (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] + struct XMUDEC4 + { + union + { + struct + { + uint32_t x : 10; // 0 to 1023 + uint32_t y : 10; // 0 to 1023 + uint32_t z : 10; // 0 to 1023 + uint32_t w : 2; // 0 to 3 + }; + uint32_t v; + }; + + XMUDEC4() = default; + + XMUDEC4(const XMUDEC4&) = default; + XMUDEC4& operator=(const XMUDEC4&) = default; + + XMUDEC4(XMUDEC4&&) = default; + XMUDEC4& operator=(XMUDEC4&&) = default; + + explicit constexpr XMUDEC4(uint32_t Packed) noexcept : v(Packed) {} + XMUDEC4(float _x, float _y, float _z, float _w) noexcept; + explicit XMUDEC4(_In_reads_(4) const float* pArray) noexcept; + + operator uint32_t () const noexcept { return v; } + + XMUDEC4& operator= (uint32_t Packed) noexcept { v = Packed; return *this; } + }; + + //------------------------------------------------------------------------------ + // 4D Vector; 8 bit signed normalized integer components + struct XMBYTEN4 + { + union + { + struct + { + int8_t x; + int8_t y; + int8_t z; + int8_t w; + }; + uint32_t v; + }; + + XMBYTEN4() = default; + + XMBYTEN4(const XMBYTEN4&) = default; + XMBYTEN4& operator=(const XMBYTEN4&) = default; + + XMBYTEN4(XMBYTEN4&&) = default; + XMBYTEN4& operator=(XMBYTEN4&&) = default; + + constexpr XMBYTEN4(int8_t _x, int8_t _y, int8_t _z, int8_t _w) noexcept : x(_x), y(_y), z(_z), w(_w) {} + explicit constexpr XMBYTEN4(uint32_t Packed) noexcept : v(Packed) {} + explicit XMBYTEN4(_In_reads_(4) const int8_t* pArray) noexcept : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} + XMBYTEN4(float _x, float _y, float _z, float _w) noexcept; + explicit XMBYTEN4(_In_reads_(4) const float* pArray) noexcept; + + XMBYTEN4& operator= (uint32_t Packed) noexcept { v = Packed; return *this; } + }; + + // 4D Vector; 8 bit signed integer components + struct XMBYTE4 + { + union + { + struct + { + int8_t x; + int8_t y; + int8_t z; + int8_t w; + }; + uint32_t v; + }; + + XMBYTE4() = default; + + XMBYTE4(const XMBYTE4&) = default; + XMBYTE4& operator=(const XMBYTE4&) = default; + + XMBYTE4(XMBYTE4&&) = default; + XMBYTE4& operator=(XMBYTE4&&) = default; + + constexpr XMBYTE4(int8_t _x, int8_t _y, int8_t _z, int8_t _w) noexcept : x(_x), y(_y), z(_z), w(_w) {} + explicit constexpr XMBYTE4(uint32_t Packed) noexcept : v(Packed) {} + explicit XMBYTE4(_In_reads_(4) const int8_t* pArray) noexcept : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} + XMBYTE4(float _x, float _y, float _z, float _w) noexcept; + explicit XMBYTE4(_In_reads_(4) const float* pArray) noexcept; + + XMBYTE4& operator= (uint32_t Packed) noexcept { v = Packed; return *this; } + }; + + // 4D Vector; 8 bit unsigned normalized integer components + struct XMUBYTEN4 + { + union + { + struct + { + uint8_t x; + uint8_t y; + uint8_t z; + uint8_t w; + }; + uint32_t v; + }; + + XMUBYTEN4() = default; + + XMUBYTEN4(const XMUBYTEN4&) = default; + XMUBYTEN4& operator=(const XMUBYTEN4&) = default; + + XMUBYTEN4(XMUBYTEN4&&) = default; + XMUBYTEN4& operator=(XMUBYTEN4&&) = default; + + constexpr XMUBYTEN4(uint8_t _x, uint8_t _y, uint8_t _z, uint8_t _w) noexcept : x(_x), y(_y), z(_z), w(_w) {} + explicit constexpr XMUBYTEN4(uint32_t Packed) noexcept : v(Packed) {} + explicit XMUBYTEN4(_In_reads_(4) const uint8_t* pArray) noexcept : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} + XMUBYTEN4(float _x, float _y, float _z, float _w) noexcept; + explicit XMUBYTEN4(_In_reads_(4) const float* pArray) noexcept; + + XMUBYTEN4& operator= (uint32_t Packed) noexcept { v = Packed; return *this; } + }; + + // 4D Vector; 8 bit unsigned integer components + struct XMUBYTE4 + { + union + { + struct + { + uint8_t x; + uint8_t y; + uint8_t z; + uint8_t w; + }; + uint32_t v; + }; + + XMUBYTE4() = default; + + XMUBYTE4(const XMUBYTE4&) = default; + XMUBYTE4& operator=(const XMUBYTE4&) = default; + + XMUBYTE4(XMUBYTE4&&) = default; + XMUBYTE4& operator=(XMUBYTE4&&) = default; + + constexpr XMUBYTE4(uint8_t _x, uint8_t _y, uint8_t _z, uint8_t _w) noexcept : x(_x), y(_y), z(_z), w(_w) {} + explicit constexpr XMUBYTE4(uint32_t Packed) noexcept : v(Packed) {} + explicit XMUBYTE4(_In_reads_(4) const uint8_t* pArray) noexcept : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} + XMUBYTE4(float _x, float _y, float _z, float _w) noexcept; + explicit XMUBYTE4(_In_reads_(4) const float* pArray) noexcept; + + XMUBYTE4& operator= (uint32_t Packed) noexcept { v = Packed; return *this; } + }; + + //------------------------------------------------------------------------------ + // 4D vector; 4 bit unsigned integer components + struct XMUNIBBLE4 + { + union + { + struct + { + uint16_t x : 4; // 0 to 15 + uint16_t y : 4; // 0 to 15 + uint16_t z : 4; // 0 to 15 + uint16_t w : 4; // 0 to 15 + }; + uint16_t v; + }; + + XMUNIBBLE4() = default; + + XMUNIBBLE4(const XMUNIBBLE4&) = default; + XMUNIBBLE4& operator=(const XMUNIBBLE4&) = default; + + XMUNIBBLE4(XMUNIBBLE4&&) = default; + XMUNIBBLE4& operator=(XMUNIBBLE4&&) = default; + + explicit constexpr XMUNIBBLE4(uint16_t Packed) noexcept : v(Packed) {} + constexpr XMUNIBBLE4(uint8_t _x, uint8_t _y, uint8_t _z, uint8_t _w) noexcept : x(_x), y(_y), z(_z), w(_w) {} + explicit XMUNIBBLE4(_In_reads_(4) const uint8_t* pArray) noexcept : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} + XMUNIBBLE4(float _x, float _y, float _z, float _w) noexcept; + explicit XMUNIBBLE4(_In_reads_(4) const float* pArray) noexcept; + + operator uint16_t () const noexcept { return v; } + + XMUNIBBLE4& operator= (uint16_t Packed) noexcept { v = Packed; return *this; } + }; + + //------------------------------------------------------------------------------ + // 4D vector: 5/5/5/1 unsigned integer components + struct XMU555 + { + union + { + struct + { + uint16_t x : 5; // 0 to 31 + uint16_t y : 5; // 0 to 31 + uint16_t z : 5; // 0 to 31 + uint16_t w : 1; // 0 or 1 + }; + uint16_t v; + }; + + XMU555() = default; + + XMU555(const XMU555&) = default; + XMU555& operator=(const XMU555&) = default; + + XMU555(XMU555&&) = default; + XMU555& operator=(XMU555&&) = default; + + explicit constexpr XMU555(uint16_t Packed) noexcept : v(Packed) {} + constexpr XMU555(uint8_t _x, uint8_t _y, uint8_t _z, bool _w) noexcept : x(_x), y(_y), z(_z), w(_w ? 0x1 : 0) {} + XMU555(_In_reads_(3) const uint8_t* pArray, _In_ bool _w) noexcept : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(_w ? 0x1 : 0) {} + XMU555(float _x, float _y, float _z, bool _w) noexcept; + XMU555(_In_reads_(3) const float* pArray, _In_ bool _w) noexcept; + + operator uint16_t () const noexcept { return v; } + + XMU555& operator= (uint16_t Packed) noexcept { v = Packed; return *this; } + }; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif + + /**************************************************************************** + * + * Data conversion operations + * + ****************************************************************************/ + + float XMConvertHalfToFloat(HALF Value) noexcept; + float* XMConvertHalfToFloatStream(_Out_writes_bytes_(sizeof(float) + OutputStride * (HalfCount - 1)) float* pOutputStream, + _In_ size_t OutputStride, + _In_reads_bytes_(sizeof(HALF) + InputStride * (HalfCount - 1)) const HALF* pInputStream, + _In_ size_t InputStride, _In_ size_t HalfCount) noexcept; + HALF XMConvertFloatToHalf(float Value) noexcept; + HALF* XMConvertFloatToHalfStream(_Out_writes_bytes_(sizeof(HALF) + OutputStride * (FloatCount - 1)) HALF* pOutputStream, + _In_ size_t OutputStride, + _In_reads_bytes_(sizeof(float) + InputStride * (FloatCount - 1)) const float* pInputStream, + _In_ size_t InputStride, _In_ size_t FloatCount) noexcept; + + /**************************************************************************** + * + * Load operations + * + ****************************************************************************/ + + XMVECTOR XM_CALLCONV XMLoadColor(_In_ const XMCOLOR* pSource) noexcept; + + XMVECTOR XM_CALLCONV XMLoadHalf2(_In_ const XMHALF2* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadShortN2(_In_ const XMSHORTN2* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadShort2(_In_ const XMSHORT2* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadUShortN2(_In_ const XMUSHORTN2* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadUShort2(_In_ const XMUSHORT2* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadByteN2(_In_ const XMBYTEN2* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadByte2(_In_ const XMBYTE2* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadUByteN2(_In_ const XMUBYTEN2* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadUByte2(_In_ const XMUBYTE2* pSource) noexcept; + + XMVECTOR XM_CALLCONV XMLoadU565(_In_ const XMU565* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadFloat3PK(_In_ const XMFLOAT3PK* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadFloat3SE(_In_ const XMFLOAT3SE* pSource) noexcept; + + XMVECTOR XM_CALLCONV XMLoadHalf4(_In_ const XMHALF4* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadShortN4(_In_ const XMSHORTN4* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadShort4(_In_ const XMSHORT4* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadUShortN4(_In_ const XMUSHORTN4* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadUShort4(_In_ const XMUSHORT4* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadXDecN4(_In_ const XMXDECN4* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadUDecN4(_In_ const XMUDECN4* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadUDecN4_XR(_In_ const XMUDECN4* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadUDec4(_In_ const XMUDEC4* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadByteN4(_In_ const XMBYTEN4* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadByte4(_In_ const XMBYTE4* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadUByteN4(_In_ const XMUBYTEN4* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadUByte4(_In_ const XMUBYTE4* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadUNibble4(_In_ const XMUNIBBLE4* pSource) noexcept; + XMVECTOR XM_CALLCONV XMLoadU555(_In_ const XMU555* pSource) noexcept; + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4996) + // C4996: ignore deprecation warning +#endif + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + + XMVECTOR XM_DEPRECATED XM_CALLCONV XMLoadDecN4(_In_ const XMDECN4* pSource) noexcept; + XMVECTOR XM_DEPRECATED XM_CALLCONV XMLoadDec4(_In_ const XMDEC4* pSource) noexcept; + XMVECTOR XM_DEPRECATED XM_CALLCONV XMLoadXDec4(_In_ const XMXDEC4* pSource) noexcept; + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif + + /**************************************************************************** + * + * Store operations + * + ****************************************************************************/ + + void XM_CALLCONV XMStoreColor(_Out_ XMCOLOR* pDestination, _In_ FXMVECTOR V) noexcept; + + void XM_CALLCONV XMStoreHalf2(_Out_ XMHALF2* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreShortN2(_Out_ XMSHORTN2* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreShort2(_Out_ XMSHORT2* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreUShortN2(_Out_ XMUSHORTN2* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreUShort2(_Out_ XMUSHORT2* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreByteN2(_Out_ XMBYTEN2* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreByte2(_Out_ XMBYTE2* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreUByteN2(_Out_ XMUBYTEN2* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreUByte2(_Out_ XMUBYTE2* pDestination, _In_ FXMVECTOR V) noexcept; + + void XM_CALLCONV XMStoreU565(_Out_ XMU565* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreFloat3PK(_Out_ XMFLOAT3PK* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreFloat3SE(_Out_ XMFLOAT3SE* pDestination, _In_ FXMVECTOR V) noexcept; + + void XM_CALLCONV XMStoreHalf4(_Out_ XMHALF4* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreShortN4(_Out_ XMSHORTN4* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreShort4(_Out_ XMSHORT4* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreUShortN4(_Out_ XMUSHORTN4* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreUShort4(_Out_ XMUSHORT4* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreXDecN4(_Out_ XMXDECN4* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreUDecN4(_Out_ XMUDECN4* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreUDecN4_XR(_Out_ XMUDECN4* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreUDec4(_Out_ XMUDEC4* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreByteN4(_Out_ XMBYTEN4* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreByte4(_Out_ XMBYTE4* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreUByteN4(_Out_ XMUBYTEN4* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreUByte4(_Out_ XMUBYTE4* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreUNibble4(_Out_ XMUNIBBLE4* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_CALLCONV XMStoreU555(_Out_ XMU555* pDestination, _In_ FXMVECTOR V) noexcept; + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4996) + // C4996: ignore deprecation warning +#endif + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + + void XM_DEPRECATED XM_CALLCONV XMStoreDecN4(_Out_ XMDECN4* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_DEPRECATED XM_CALLCONV XMStoreDec4(_Out_ XMDEC4* pDestination, _In_ FXMVECTOR V) noexcept; + void XM_DEPRECATED XM_CALLCONV XMStoreXDec4(_Out_ XMXDEC4* pDestination, _In_ FXMVECTOR V) noexcept; + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif + + /**************************************************************************** + * + * Implementation + * + ****************************************************************************/ +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4068 4214 4204 4365 4616 6001 6101) + // C4068/4616: ignore unknown pragmas + // C4214/4204: nonstandard extension used + // C4365: Off by default noise + // C6001/6101: False positives +#endif + +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable : 25000, "FXMVECTOR is 16 bytes") +#pragma prefast(disable : 26495, "Union initialization confuses /analyze") +#endif + +#include "DirectXPackedVector.inl" + +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif + } // namespace PackedVector + +} // namespace DirectX + diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXPackedVector.inl b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXPackedVector.inl new file mode 100644 index 0000000..5f7e5d7 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/directxmath/DirectXPackedVector.inl @@ -0,0 +1,4459 @@ +//------------------------------------------------------------------------------------- +// DirectXPackedVector.inl -- SIMD C++ Math library +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +// +// http://go.microsoft.com/fwlink/?LinkID=615560 +//------------------------------------------------------------------------------------- + +#pragma once + +/**************************************************************************** + * + * Data conversion + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline float XMConvertHalfToFloat(HALF Value) noexcept +{ +#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + __m128i V1 = _mm_cvtsi32_si128(static_cast(Value)); + __m128 V2 = _mm_cvtph_ps(V1); + return _mm_cvtss_f32(V2); +#elif defined(_XM_ARM_NEON_INTRINSICS_) && (defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__) && !defined(_XM_NO_INTRINSICS_) && (!defined(__GNUC__) || (__ARM_FP & 2)) + uint16x4_t vHalf = vdup_n_u16(Value); + float32x4_t vFloat = vcvt_f32_f16(vreinterpret_f16_u16(vHalf)); + return vgetq_lane_f32(vFloat, 0); +#else + auto Mantissa = static_cast(Value & 0x03FF); + + uint32_t Exponent = (Value & 0x7C00); + if (Exponent == 0x7C00) // INF/NAN + { + Exponent = 0x8f; + } + else if (Exponent != 0) // The value is normalized + { + Exponent = static_cast((static_cast(Value) >> 10) & 0x1F); + } + else if (Mantissa != 0) // The value is denormalized + { + // Normalize the value in the resulting float + Exponent = 1; + + do + { + Exponent--; + Mantissa <<= 1; + } while ((Mantissa & 0x0400) == 0); + + Mantissa &= 0x03FF; + } + else // The value is zero + { + Exponent = static_cast(-112); + } + + uint32_t Result = + ((static_cast(Value) & 0x8000) << 16) // Sign + | ((Exponent + 112) << 23) // Exponent + | (Mantissa << 13); // Mantissa + + return reinterpret_cast(&Result)[0]; +#endif // !_XM_F16C_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable : 26015 26019, "PREfast noise: Esp:1307" ) +#endif + +_Use_decl_annotations_ +inline float* XMConvertHalfToFloatStream +( + float* pOutputStream, + size_t OutputStride, + const HALF* pInputStream, + size_t InputStride, + size_t HalfCount +) noexcept +{ + assert(pOutputStream); + assert(pInputStream); + + assert(InputStride >= sizeof(HALF)); + _Analysis_assume_(InputStride >= sizeof(HALF)); + + assert(OutputStride >= sizeof(float)); + _Analysis_assume_(OutputStride >= sizeof(float)); + +#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + auto pHalf = reinterpret_cast(pInputStream); + auto pFloat = reinterpret_cast(pOutputStream); + + size_t i = 0; + size_t four = HalfCount >> 2; + if (four > 0) + { + if (InputStride == sizeof(HALF)) + { + if (OutputStride == sizeof(float)) + { + if ((reinterpret_cast(pFloat) & 0xF) == 0) + { + // Packed input, aligned & packed output + for (size_t j = 0; j < four; ++j) + { + __m128i HV = _mm_loadl_epi64(reinterpret_cast(pHalf)); + pHalf += InputStride * 4; + + __m128 FV = _mm_cvtph_ps(HV); + + XM_STREAM_PS(reinterpret_cast(pFloat), FV); + pFloat += OutputStride * 4; + i += 4; + } + } + else + { + // Packed input, packed output + for (size_t j = 0; j < four; ++j) + { + __m128i HV = _mm_loadl_epi64(reinterpret_cast(pHalf)); + pHalf += InputStride * 4; + + __m128 FV = _mm_cvtph_ps(HV); + + _mm_storeu_ps(reinterpret_cast(pFloat), FV); + pFloat += OutputStride * 4; + i += 4; + } + } + } + else + { + // Packed input, scattered output + for (size_t j = 0; j < four; ++j) + { + __m128i HV = _mm_loadl_epi64(reinterpret_cast(pHalf)); + pHalf += InputStride * 4; + + __m128 FV = _mm_cvtph_ps(HV); + + _mm_store_ss(reinterpret_cast(pFloat), FV); + pFloat += OutputStride; + *reinterpret_cast(pFloat) = _mm_extract_ps(FV, 1); + pFloat += OutputStride; + *reinterpret_cast(pFloat) = _mm_extract_ps(FV, 2); + pFloat += OutputStride; + *reinterpret_cast(pFloat) = _mm_extract_ps(FV, 3); + pFloat += OutputStride; + i += 4; + } + } + } + else if (OutputStride == sizeof(float)) + { + if ((reinterpret_cast(pFloat) & 0xF) == 0) + { + // Scattered input, aligned & packed output + for (size_t j = 0; j < four; ++j) + { + uint16_t H1 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H2 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H3 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H4 = *reinterpret_cast(pHalf); + pHalf += InputStride; + + __m128i HV = _mm_setzero_si128(); + HV = _mm_insert_epi16(HV, H1, 0); + HV = _mm_insert_epi16(HV, H2, 1); + HV = _mm_insert_epi16(HV, H3, 2); + HV = _mm_insert_epi16(HV, H4, 3); + __m128 FV = _mm_cvtph_ps(HV); + + XM_STREAM_PS(reinterpret_cast(pFloat), FV); + pFloat += OutputStride * 4; + i += 4; + } + } + else + { + // Scattered input, packed output + for (size_t j = 0; j < four; ++j) + { + uint16_t H1 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H2 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H3 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H4 = *reinterpret_cast(pHalf); + pHalf += InputStride; + + __m128i HV = _mm_setzero_si128(); + HV = _mm_insert_epi16(HV, H1, 0); + HV = _mm_insert_epi16(HV, H2, 1); + HV = _mm_insert_epi16(HV, H3, 2); + HV = _mm_insert_epi16(HV, H4, 3); + __m128 FV = _mm_cvtph_ps(HV); + + _mm_storeu_ps(reinterpret_cast(pFloat), FV); + pFloat += OutputStride * 4; + i += 4; + } + } + } + else + { + // Scattered input, scattered output + for (size_t j = 0; j < four; ++j) + { + uint16_t H1 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H2 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H3 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H4 = *reinterpret_cast(pHalf); + pHalf += InputStride; + + __m128i HV = _mm_setzero_si128(); + HV = _mm_insert_epi16(HV, H1, 0); + HV = _mm_insert_epi16(HV, H2, 1); + HV = _mm_insert_epi16(HV, H3, 2); + HV = _mm_insert_epi16(HV, H4, 3); + __m128 FV = _mm_cvtph_ps(HV); + + _mm_store_ss(reinterpret_cast(pFloat), FV); + pFloat += OutputStride; + *reinterpret_cast(pFloat) = _mm_extract_ps(FV, 1); + pFloat += OutputStride; + *reinterpret_cast(pFloat) = _mm_extract_ps(FV, 2); + pFloat += OutputStride; + *reinterpret_cast(pFloat) = _mm_extract_ps(FV, 3); + pFloat += OutputStride; + i += 4; + } + } + } + + for (; i < HalfCount; ++i) + { + *reinterpret_cast(pFloat) = XMConvertHalfToFloat(reinterpret_cast(pHalf)[0]); + pHalf += InputStride; + pFloat += OutputStride; + } + + XM_SFENCE(); + + return pOutputStream; +#elif defined(_XM_ARM_NEON_INTRINSICS_) && (defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) ||__aarch64__) && !defined(_XM_NO_INTRINSICS_) && (!defined(__GNUC__) || (__ARM_FP & 2)) + auto pHalf = reinterpret_cast(pInputStream); + auto pFloat = reinterpret_cast(pOutputStream); + + size_t i = 0; + size_t four = HalfCount >> 2; + if (four > 0) + { + if (InputStride == sizeof(HALF)) + { + if (OutputStride == sizeof(float)) + { + // Packed input, packed output + for (size_t j = 0; j < four; ++j) + { + uint16x4_t vHalf = vld1_u16(reinterpret_cast(pHalf)); + pHalf += InputStride * 4; + + float32x4_t vFloat = vcvt_f32_f16(vreinterpret_f16_u16(vHalf)); + + vst1q_f32(reinterpret_cast(pFloat), vFloat); + pFloat += OutputStride * 4; + i += 4; + } + } + else + { + // Packed input, scattered output + for (size_t j = 0; j < four; ++j) + { + uint16x4_t vHalf = vld1_u16(reinterpret_cast(pHalf)); + pHalf += InputStride * 4; + + float32x4_t vFloat = vcvt_f32_f16(vreinterpret_f16_u16(vHalf)); + + vst1q_lane_f32(reinterpret_cast(pFloat), vFloat, 0); + pFloat += OutputStride; + vst1q_lane_f32(reinterpret_cast(pFloat), vFloat, 1); + pFloat += OutputStride; + vst1q_lane_f32(reinterpret_cast(pFloat), vFloat, 2); + pFloat += OutputStride; + vst1q_lane_f32(reinterpret_cast(pFloat), vFloat, 3); + pFloat += OutputStride; + i += 4; + } + } + } + else if (OutputStride == sizeof(float)) + { + // Scattered input, packed output + for (size_t j = 0; j < four; ++j) + { + uint16_t H1 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H2 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H3 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H4 = *reinterpret_cast(pHalf); + pHalf += InputStride; + + uint64_t iHalf = uint64_t(H1) | (uint64_t(H2) << 16) | (uint64_t(H3) << 32) | (uint64_t(H4) << 48); + uint16x4_t vHalf = vcreate_u16(iHalf); + + float32x4_t vFloat = vcvt_f32_f16(vreinterpret_f16_u16(vHalf)); + + vst1q_f32(reinterpret_cast(pFloat), vFloat); + pFloat += OutputStride * 4; + i += 4; + } + } + else + { + // Scattered input, scattered output + for (size_t j = 0; j < four; ++j) + { + uint16_t H1 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H2 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H3 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H4 = *reinterpret_cast(pHalf); + pHalf += InputStride; + + uint64_t iHalf = uint64_t(H1) | (uint64_t(H2) << 16) | (uint64_t(H3) << 32) | (uint64_t(H4) << 48); + uint16x4_t vHalf = vcreate_u16(iHalf); + + float32x4_t vFloat = vcvt_f32_f16(vreinterpret_f16_u16(vHalf)); + + vst1q_lane_f32(reinterpret_cast(pFloat), vFloat, 0); + pFloat += OutputStride; + vst1q_lane_f32(reinterpret_cast(pFloat), vFloat, 1); + pFloat += OutputStride; + vst1q_lane_f32(reinterpret_cast(pFloat), vFloat, 2); + pFloat += OutputStride; + vst1q_lane_f32(reinterpret_cast(pFloat), vFloat, 3); + pFloat += OutputStride; + i += 4; + } + } + } + + for (; i < HalfCount; ++i) + { + *reinterpret_cast(pFloat) = XMConvertHalfToFloat(reinterpret_cast(pHalf)[0]); + pHalf += InputStride; + pFloat += OutputStride; + } + + return pOutputStream; +#else + auto pHalf = reinterpret_cast(pInputStream); + auto pFloat = reinterpret_cast(pOutputStream); + + for (size_t i = 0; i < HalfCount; i++) + { + *reinterpret_cast(pFloat) = XMConvertHalfToFloat(reinterpret_cast(pHalf)[0]); + pHalf += InputStride; + pFloat += OutputStride; + } + + return pOutputStream; +#endif // !_XM_F16C_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +inline HALF XMConvertFloatToHalf(float Value) noexcept +{ +#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + __m128 V1 = _mm_set_ss(Value); + __m128i V2 = _mm_cvtps_ph(V1, _MM_FROUND_TO_NEAREST_INT); + return static_cast(_mm_extract_epi16(V2, 0)); +#elif defined(_XM_ARM_NEON_INTRINSICS_) && (defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__) && !defined(_XM_NO_INTRINSICS_) && (!defined(__GNUC__) || (__ARM_FP & 2)) + float32x4_t vFloat = vdupq_n_f32(Value); + float16x4_t vHalf = vcvt_f16_f32(vFloat); + return vget_lane_u16(vreinterpret_u16_f16(vHalf), 0); +#else + uint32_t Result; + + auto IValue = reinterpret_cast(&Value)[0]; + uint32_t Sign = (IValue & 0x80000000U) >> 16U; + IValue = IValue & 0x7FFFFFFFU; // Hack off the sign + if (IValue >= 0x47800000 /*e+16*/) + { + // The number is too large to be represented as a half. Return infinity or NaN + Result = 0x7C00U | ((IValue > 0x7F800000) ? (0x200 | ((IValue >> 13U) & 0x3FFU)) : 0U); + } + else if (IValue <= 0x33000000U /*e-25*/) + { + Result = 0; + } + else if (IValue < 0x38800000U /*e-14*/) + { + // The number is too small to be represented as a normalized half. + // Convert it to a denormalized value. + uint32_t Shift = 125U - (IValue >> 23U); + IValue = 0x800000U | (IValue & 0x7FFFFFU); + Result = IValue >> (Shift + 1); + uint32_t s = (IValue & ((1U << Shift) - 1)) != 0; + Result += (Result | s) & ((IValue >> Shift) & 1U); + } + else + { + // Rebias the exponent to represent the value as a normalized half. + IValue += 0xC8000000U; + Result = ((IValue + 0x0FFFU + ((IValue >> 13U) & 1U)) >> 13U) & 0x7FFFU; + } + return static_cast(Result | Sign); +#endif // !_XM_F16C_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline HALF* XMConvertFloatToHalfStream +( + HALF* pOutputStream, + size_t OutputStride, + const float* pInputStream, + size_t InputStride, + size_t FloatCount +) noexcept +{ + assert(pOutputStream); + assert(pInputStream); + + assert(InputStride >= sizeof(float)); + _Analysis_assume_(InputStride >= sizeof(float)); + + assert(OutputStride >= sizeof(HALF)); + _Analysis_assume_(OutputStride >= sizeof(HALF)); + +#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + auto pFloat = reinterpret_cast(pInputStream); + auto pHalf = reinterpret_cast(pOutputStream); + + size_t i = 0; + size_t four = FloatCount >> 2; + if (four > 0) + { + if (InputStride == sizeof(float)) + { + if (OutputStride == sizeof(HALF)) + { + if ((reinterpret_cast(pFloat) & 0xF) == 0) + { + // Aligned and packed input, packed output + for (size_t j = 0; j < four; ++j) + { + __m128 FV = _mm_load_ps(reinterpret_cast(pFloat)); + pFloat += InputStride * 4; + + __m128i HV = _mm_cvtps_ph(FV, _MM_FROUND_TO_NEAREST_INT); + + _mm_storel_epi64(reinterpret_cast<__m128i*>(pHalf), HV); + pHalf += OutputStride * 4; + i += 4; + } + } + else + { + // Packed input, packed output + for (size_t j = 0; j < four; ++j) + { + __m128 FV = _mm_loadu_ps(reinterpret_cast(pFloat)); + pFloat += InputStride * 4; + + __m128i HV = _mm_cvtps_ph(FV, _MM_FROUND_TO_NEAREST_INT); + + _mm_storel_epi64(reinterpret_cast<__m128i*>(pHalf), HV); + pHalf += OutputStride * 4; + i += 4; + } + } + } + else + { + if ((reinterpret_cast(pFloat) & 0xF) == 0) + { + // Aligned & packed input, scattered output + for (size_t j = 0; j < four; ++j) + { + __m128 FV = _mm_load_ps(reinterpret_cast(pFloat)); + pFloat += InputStride * 4; + + __m128i HV = _mm_cvtps_ph(FV, _MM_FROUND_TO_NEAREST_INT); + + *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 0)); + pHalf += OutputStride; + *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 1)); + pHalf += OutputStride; + *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 2)); + pHalf += OutputStride; + *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 3)); + pHalf += OutputStride; + i += 4; + } + } + else + { + // Packed input, scattered output + for (size_t j = 0; j < four; ++j) + { + __m128 FV = _mm_loadu_ps(reinterpret_cast(pFloat)); + pFloat += InputStride * 4; + + __m128i HV = _mm_cvtps_ph(FV, _MM_FROUND_TO_NEAREST_INT); + + *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 0)); + pHalf += OutputStride; + *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 1)); + pHalf += OutputStride; + *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 2)); + pHalf += OutputStride; + *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 3)); + pHalf += OutputStride; + i += 4; + } + } + } + } + else if (OutputStride == sizeof(HALF)) + { + // Scattered input, packed output + for (size_t j = 0; j < four; ++j) + { + __m128 FV1 = _mm_load_ss(reinterpret_cast(pFloat)); + pFloat += InputStride; + + __m128 FV2 = _mm_broadcast_ss(reinterpret_cast(pFloat)); + pFloat += InputStride; + + __m128 FV3 = _mm_broadcast_ss(reinterpret_cast(pFloat)); + pFloat += InputStride; + + __m128 FV4 = _mm_broadcast_ss(reinterpret_cast(pFloat)); + pFloat += InputStride; + + __m128 FV = _mm_blend_ps(FV1, FV2, 0x2); + __m128 FT = _mm_blend_ps(FV3, FV4, 0x8); + FV = _mm_blend_ps(FV, FT, 0xC); + + __m128i HV = _mm_cvtps_ph(FV, _MM_FROUND_TO_NEAREST_INT); + + _mm_storel_epi64(reinterpret_cast<__m128i*>(pHalf), HV); + pHalf += OutputStride * 4; + i += 4; + } + } + else + { + // Scattered input, scattered output + for (size_t j = 0; j < four; ++j) + { + __m128 FV1 = _mm_load_ss(reinterpret_cast(pFloat)); + pFloat += InputStride; + + __m128 FV2 = _mm_broadcast_ss(reinterpret_cast(pFloat)); + pFloat += InputStride; + + __m128 FV3 = _mm_broadcast_ss(reinterpret_cast(pFloat)); + pFloat += InputStride; + + __m128 FV4 = _mm_broadcast_ss(reinterpret_cast(pFloat)); + pFloat += InputStride; + + __m128 FV = _mm_blend_ps(FV1, FV2, 0x2); + __m128 FT = _mm_blend_ps(FV3, FV4, 0x8); + FV = _mm_blend_ps(FV, FT, 0xC); + + __m128i HV = _mm_cvtps_ph(FV, _MM_FROUND_TO_NEAREST_INT); + + *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 0)); + pHalf += OutputStride; + *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 1)); + pHalf += OutputStride; + *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 2)); + pHalf += OutputStride; + *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 3)); + pHalf += OutputStride; + i += 4; + } + } + } + + for (; i < FloatCount; ++i) + { + *reinterpret_cast(pHalf) = XMConvertFloatToHalf(reinterpret_cast(pFloat)[0]); + pFloat += InputStride; + pHalf += OutputStride; + } + + return pOutputStream; +#elif defined(_XM_ARM_NEON_INTRINSICS_) && (defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__) && !defined(_XM_NO_INTRINSICS_) && (!defined(__GNUC__) || (__ARM_FP & 2)) + auto pFloat = reinterpret_cast(pInputStream); + auto pHalf = reinterpret_cast(pOutputStream); + + size_t i = 0; + size_t four = FloatCount >> 2; + if (four > 0) + { + if (InputStride == sizeof(float)) + { + if (OutputStride == sizeof(HALF)) + { + // Packed input, packed output + for (size_t j = 0; j < four; ++j) + { + float32x4_t vFloat = vld1q_f32(reinterpret_cast(pFloat)); + pFloat += InputStride * 4; + + uint16x4_t vHalf = vreinterpret_u16_f16(vcvt_f16_f32(vFloat)); + + vst1_u16(reinterpret_cast(pHalf), vHalf); + pHalf += OutputStride * 4; + i += 4; + } + } + else + { + // Packed input, scattered output + for (size_t j = 0; j < four; ++j) + { + float32x4_t vFloat = vld1q_f32(reinterpret_cast(pFloat)); + pFloat += InputStride * 4; + + uint16x4_t vHalf = vreinterpret_u16_f16(vcvt_f16_f32(vFloat)); + + vst1_lane_u16(reinterpret_cast(pHalf), vHalf, 0); + pHalf += OutputStride; + vst1_lane_u16(reinterpret_cast(pHalf), vHalf, 1); + pHalf += OutputStride; + vst1_lane_u16(reinterpret_cast(pHalf), vHalf, 2); + pHalf += OutputStride; + vst1_lane_u16(reinterpret_cast(pHalf), vHalf, 3); + pHalf += OutputStride; + i += 4; + } + } + } + else if (OutputStride == sizeof(HALF)) + { + // Scattered input, packed output + for (size_t j = 0; j < four; ++j) + { + float32x4_t vFloat = vdupq_n_f32(0); + vFloat = vld1q_lane_f32(reinterpret_cast(pFloat), vFloat, 0); + pFloat += InputStride; + + vFloat = vld1q_lane_f32(reinterpret_cast(pFloat), vFloat, 1); + pFloat += InputStride; + + vFloat = vld1q_lane_f32(reinterpret_cast(pFloat), vFloat, 2); + pFloat += InputStride; + + vFloat = vld1q_lane_f32(reinterpret_cast(pFloat), vFloat, 3); + pFloat += InputStride; + + uint16x4_t vHalf = vreinterpret_u16_f16(vcvt_f16_f32(vFloat)); + + vst1_u16(reinterpret_cast(pHalf), vHalf); + pHalf += OutputStride * 4; + i += 4; + } + } + else + { + // Scattered input, scattered output + for (size_t j = 0; j < four; ++j) + { + float32x4_t vFloat = vdupq_n_f32(0); + vFloat = vld1q_lane_f32(reinterpret_cast(pFloat), vFloat, 0); + pFloat += InputStride; + + vFloat = vld1q_lane_f32(reinterpret_cast(pFloat), vFloat, 1); + pFloat += InputStride; + + vFloat = vld1q_lane_f32(reinterpret_cast(pFloat), vFloat, 2); + pFloat += InputStride; + + vFloat = vld1q_lane_f32(reinterpret_cast(pFloat), vFloat, 3); + pFloat += InputStride; + + uint16x4_t vHalf = vreinterpret_u16_f16(vcvt_f16_f32(vFloat)); + + vst1_lane_u16(reinterpret_cast(pHalf), vHalf, 0); + pHalf += OutputStride; + vst1_lane_u16(reinterpret_cast(pHalf), vHalf, 1); + pHalf += OutputStride; + vst1_lane_u16(reinterpret_cast(pHalf), vHalf, 2); + pHalf += OutputStride; + vst1_lane_u16(reinterpret_cast(pHalf), vHalf, 3); + pHalf += OutputStride; + i += 4; + } + } + } + + for (; i < FloatCount; ++i) + { + *reinterpret_cast(pHalf) = XMConvertFloatToHalf(reinterpret_cast(pFloat)[0]); + pFloat += InputStride; + pHalf += OutputStride; + } + + return pOutputStream; +#else + auto pFloat = reinterpret_cast(pInputStream); + auto pHalf = reinterpret_cast(pOutputStream); + + for (size_t i = 0; i < FloatCount; i++) + { + *reinterpret_cast(pHalf) = XMConvertFloatToHalf(reinterpret_cast(pFloat)[0]); + pFloat += InputStride; + pHalf += OutputStride; + } + return pOutputStream; +#endif // !_XM_F16C_INTRINSICS_ +} + +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif + +/**************************************************************************** + * + * Vector and matrix load operations + * + ****************************************************************************/ + +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable:28931, "PREfast noise: Esp:1266") +#endif + +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadColor(const XMCOLOR* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + // int32_t -> Float conversions are done in one instruction. + // uint32_t -> Float calls a runtime function. Keep in int32_t + auto iColor = static_cast(pSource->c); + XMVECTORF32 vColor = { { { + static_cast((iColor >> 16) & 0xFF)* (1.0f / 255.0f), + static_cast((iColor >> 8) & 0xFF)* (1.0f / 255.0f), + static_cast(iColor & 0xFF)* (1.0f / 255.0f), + static_cast((iColor >> 24) & 0xFF)* (1.0f / 255.0f) + } } }; + return vColor.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32_t bgra = pSource->c; + uint32_t rgba = (bgra & 0xFF00FF00) | ((bgra >> 16) & 0xFF) | ((bgra << 16) & 0xFF0000); + uint32x2_t vInt8 = vdup_n_u32(rgba); + uint16x8_t vInt16 = vmovl_u8(vreinterpret_u8_u32(vInt8)); + uint32x4_t vInt = vmovl_u16(vget_low_u16(vInt16)); + float32x4_t R = vcvtq_f32_u32(vInt); + return vmulq_n_f32(R, 1.0f / 255.0f); +#elif defined(_XM_SSE_INTRINSICS_) + // Splat the color in all four entries + __m128i vInt = _mm_set1_epi32(static_cast(pSource->c)); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vInt = _mm_and_si128(vInt, g_XMMaskA8R8G8B8); + // a is unsigned! Flip the bit to convert the order to signed + vInt = _mm_xor_si128(vInt, g_XMFlipA8R8G8B8); + // Convert to floating point numbers + XMVECTOR vTemp = _mm_cvtepi32_ps(vInt); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp, g_XMFixAA8R8G8B8); + // Convert 0-255 to 0.0f-1.0f + return _mm_mul_ps(vTemp, g_XMNormalizeA8R8G8B8); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadHalf2(const XMHALF2* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + __m128 V = _mm_load_ss(reinterpret_cast(pSource)); + return _mm_cvtph_ps(_mm_castps_si128(V)); +#else + XMVECTORF32 vResult = { { { + XMConvertHalfToFloat(pSource->x), + XMConvertHalfToFloat(pSource->y), + 0.0f, + 0.0f + } } }; + return vResult.v; +#endif // !_XM_F16C_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadShortN2(const XMSHORTN2* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + (pSource->x == -32768) ? -1.f : (static_cast(pSource->x)* (1.0f / 32767.0f)), + (pSource->y == -32768) ? -1.f : (static_cast(pSource->y)* (1.0f / 32767.0f)), + 0.0f, + 0.0f + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vInt16 = vld1_dup_u32(reinterpret_cast(pSource)); + int32x4_t vInt = vmovl_s16(vreinterpret_s16_u32(vInt16)); + vInt = vandq_s32(vInt, g_XMMaskXY); + float32x4_t R = vcvtq_f32_s32(vInt); + R = vmulq_n_f32(R, 1.0f / 32767.0f); + return vmaxq_f32(R, vdupq_n_f32(-1.f)); +#elif defined(_XM_SSE_INTRINSICS_) + // Splat the two shorts in all four entries (WORD alignment okay, + // DWORD alignment preferred) + __m128 vTemp = _mm_load_ps1(reinterpret_cast(&pSource->x)); + // Mask x&0xFFFF, y&0xFFFF0000,z&0,w&0 + vTemp = _mm_and_ps(vTemp, g_XMMaskX16Y16); + // x needs to be sign extended + vTemp = _mm_xor_ps(vTemp, g_XMFlipX16Y16); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // x - 0x8000 to undo the signed order. + vTemp = _mm_add_ps(vTemp, g_XMFixX16Y16); + // Convert -1.0f - 1.0f + vTemp = _mm_mul_ps(vTemp, g_XMNormalizeX16Y16); + // Clamp result (for case of -32768) + return _mm_max_ps(vTemp, g_XMNegativeOne); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadShort2(const XMSHORT2* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + static_cast(pSource->x), + static_cast(pSource->y), + 0.f, + 0.f + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vInt16 = vld1_dup_u32(reinterpret_cast(pSource)); + int32x4_t vInt = vmovl_s16(vreinterpret_s16_u32(vInt16)); + vInt = vandq_s32(vInt, g_XMMaskXY); + return vcvtq_f32_s32(vInt); +#elif defined(_XM_SSE_INTRINSICS_) + // Splat the two shorts in all four entries (WORD alignment okay, + // DWORD alignment preferred) + __m128 vTemp = _mm_load_ps1(reinterpret_cast(&pSource->x)); + // Mask x&0xFFFF, y&0xFFFF0000,z&0,w&0 + vTemp = _mm_and_ps(vTemp, g_XMMaskX16Y16); + // x needs to be sign extended + vTemp = _mm_xor_ps(vTemp, g_XMFlipX16Y16); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // x - 0x8000 to undo the signed order. + vTemp = _mm_add_ps(vTemp, g_XMFixX16Y16); + // Y is 65536 too large + return _mm_mul_ps(vTemp, g_XMFixupY16); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUShortN2(const XMUSHORTN2* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + static_cast(pSource->x) / 65535.0f, + static_cast(pSource->y) / 65535.0f, + 0.f, + 0.f + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vInt16 = vld1_dup_u32(reinterpret_cast(pSource)); + uint32x4_t vInt = vmovl_u16(vreinterpret_u16_u32(vInt16)); + vInt = vandq_u32(vInt, g_XMMaskXY); + float32x4_t R = vcvtq_f32_u32(vInt); + R = vmulq_n_f32(R, 1.0f / 65535.0f); + return vmaxq_f32(R, vdupq_n_f32(-1.f)); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 FixupY16 = { { { 1.0f / 65535.0f, 1.0f / (65535.0f * 65536.0f), 0.0f, 0.0f } } }; + static const XMVECTORF32 FixaddY16 = { { { 0, 32768.0f * 65536.0f, 0, 0 } } }; + // Splat the two shorts in all four entries (WORD alignment okay, + // DWORD alignment preferred) + __m128 vTemp = _mm_load_ps1(reinterpret_cast(&pSource->x)); + // Mask x&0xFFFF, y&0xFFFF0000,z&0,w&0 + vTemp = _mm_and_ps(vTemp, g_XMMaskX16Y16); + // y needs to be sign flipped + vTemp = _mm_xor_ps(vTemp, g_XMFlipY); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // y + 0x8000 to undo the signed order. + vTemp = _mm_add_ps(vTemp, FixaddY16); + // Y is 65536 times too large + vTemp = _mm_mul_ps(vTemp, FixupY16); + return vTemp; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUShort2(const XMUSHORT2* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + static_cast(pSource->x), + static_cast(pSource->y), + 0.f, + 0.f + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vInt16 = vld1_dup_u32(reinterpret_cast(pSource)); + uint32x4_t vInt = vmovl_u16(vreinterpret_u16_u32(vInt16)); + vInt = vandq_u32(vInt, g_XMMaskXY); + return vcvtq_f32_u32(vInt); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 FixaddY16 = { { { 0, 32768.0f, 0, 0 } } }; + // Splat the two shorts in all four entries (WORD alignment okay, + // DWORD alignment preferred) + __m128 vTemp = _mm_load_ps1(reinterpret_cast(&pSource->x)); + // Mask x&0xFFFF, y&0xFFFF0000,z&0,w&0 + vTemp = _mm_and_ps(vTemp, g_XMMaskX16Y16); + // y needs to be sign flipped + vTemp = _mm_xor_ps(vTemp, g_XMFlipY); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // Y is 65536 times too large + vTemp = _mm_mul_ps(vTemp, g_XMFixupY16); + // y + 0x8000 to undo the signed order. + vTemp = _mm_add_ps(vTemp, FixaddY16); + return vTemp; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadByteN2(const XMBYTEN2* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + (pSource->x == -128) ? -1.f : (static_cast(pSource->x)* (1.0f / 127.0f)), + (pSource->y == -128) ? -1.f : (static_cast(pSource->y)* (1.0f / 127.0f)), + 0.0f, + 0.0f + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint16x4_t vInt8 = vld1_dup_u16(reinterpret_cast(pSource)); + int16x8_t vInt16 = vmovl_s8(vreinterpret_s8_u16(vInt8)); + int32x4_t vInt = vmovl_s16(vget_low_s16(vInt16)); + vInt = vandq_s32(vInt, g_XMMaskXY); + float32x4_t R = vcvtq_f32_s32(vInt); + R = vmulq_n_f32(R, 1.0f / 127.0f); + return vmaxq_f32(R, vdupq_n_f32(-1.f)); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 1.0f / 127.0f, 1.0f / (127.0f * 256.0f), 0, 0 } } }; + static const XMVECTORU32 Mask = { { { 0xFF, 0xFF00, 0, 0 } } }; + // Splat the color in all four entries (x,z,y,w) + __m128i vInt = XM_LOADU_SI16(&pSource->v); + XMVECTOR vTemp = XM_PERMUTE_PS(_mm_castsi128_ps(vInt), _MM_SHUFFLE(0, 0, 0, 0)); + // Mask + vTemp = _mm_and_ps(vTemp, Mask); + // x,y and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp, g_XMXorByte4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // x, y and z - 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp, g_XMAddByte4); + // Fix y, z and w because they are too large + vTemp = _mm_mul_ps(vTemp, Scale); + // Clamp result (for case of -128) + return _mm_max_ps(vTemp, g_XMNegativeOne); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadByte2(const XMBYTE2* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + static_cast(pSource->x), + static_cast(pSource->y), + 0.0f, + 0.0f + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint16x4_t vInt8 = vld1_dup_u16(reinterpret_cast(pSource)); + int16x8_t vInt16 = vmovl_s8(vreinterpret_s8_u16(vInt8)); + int32x4_t vInt = vmovl_s16(vget_low_s16(vInt16)); + vInt = vandq_s32(vInt, g_XMMaskXY); + return vcvtq_f32_s32(vInt); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 1.0f, 1.0f / 256.0f, 1.0f / 65536.0f, 1.0f / (65536.0f * 256.0f) } } }; + static const XMVECTORU32 Mask = { { { 0xFF, 0xFF00, 0, 0 } } }; + // Splat the color in all four entries (x,z,y,w) + __m128i vInt = XM_LOADU_SI16(&pSource->v); + XMVECTOR vTemp = XM_PERMUTE_PS(_mm_castsi128_ps(vInt), _MM_SHUFFLE(0, 0, 0, 0)); + // Mask + vTemp = _mm_and_ps(vTemp, Mask); + // x,y and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp, g_XMXorByte4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // x, y and z - 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp, g_XMAddByte4); + // Fix y, z and w because they are too large + return _mm_mul_ps(vTemp, Scale); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUByteN2(const XMUBYTEN2* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + static_cast(pSource->x)* (1.0f / 255.0f), + static_cast(pSource->y)* (1.0f / 255.0f), + 0.0f, + 0.0f + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint16x4_t vInt8 = vld1_dup_u16(reinterpret_cast(pSource)); + uint16x8_t vInt16 = vmovl_u8(vreinterpret_u8_u16(vInt8)); + uint32x4_t vInt = vmovl_u16(vget_low_u16(vInt16)); + vInt = vandq_u32(vInt, g_XMMaskXY); + float32x4_t R = vcvtq_f32_u32(vInt); + return vmulq_n_f32(R, 1.0f / 255.0f); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 1.0f / 255.0f, 1.0f / (255.0f * 256.0f), 0, 0 } } }; + static const XMVECTORU32 Mask = { { { 0xFF, 0xFF00, 0, 0 } } }; + // Splat the color in all four entries (x,z,y,w) + __m128i vInt = XM_LOADU_SI16(&pSource->v); + XMVECTOR vTemp = XM_PERMUTE_PS(_mm_castsi128_ps(vInt), _MM_SHUFFLE(0, 0, 0, 0)); + // Mask + vTemp = _mm_and_ps(vTemp, Mask); + // w is signed! Flip the bits to convert the order to unsigned + vTemp = _mm_xor_ps(vTemp, g_XMFlipW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // w + 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp, g_XMAddUDec4); + // Fix y, z and w because they are too large + return _mm_mul_ps(vTemp, Scale); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUByte2(const XMUBYTE2* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + static_cast(pSource->x), + static_cast(pSource->y), + 0.0f, + 0.0f + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint16x4_t vInt8 = vld1_dup_u16(reinterpret_cast(pSource)); + uint16x8_t vInt16 = vmovl_u8(vreinterpret_u8_u16(vInt8)); + uint32x4_t vInt = vmovl_u16(vget_low_u16(vInt16)); + vInt = vandq_u32(vInt, g_XMMaskXY); + return vcvtq_f32_u32(vInt); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 1.0f, 1.0f / 256.0f, 0, 0 } } }; + static const XMVECTORU32 Mask = { { { 0xFF, 0xFF00, 0, 0 } } }; + // Splat the color in all four entries (x,z,y,w) + __m128i vInt = XM_LOADU_SI16(&pSource->v); + XMVECTOR vTemp = XM_PERMUTE_PS(_mm_castsi128_ps(vInt), _MM_SHUFFLE(0, 0, 0, 0)); + // Mask + vTemp = _mm_and_ps(vTemp, Mask); + // w is signed! Flip the bits to convert the order to unsigned + vTemp = _mm_xor_ps(vTemp, g_XMFlipW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // w + 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp, g_XMAddUDec4); + // Fix y, z and w because they are too large + return _mm_mul_ps(vTemp, Scale); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadU565(const XMU565* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + float(pSource->v & 0x1F), + float((pSource->v >> 5) & 0x3F), + float((pSource->v >> 11) & 0x1F), + 0.f, + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORI32 U565And = { { { 0x1F, 0x3F << 5, 0x1F << 11, 0 } } }; + static const XMVECTORF32 U565Mul = { { { 1.0f, 1.0f / 32.0f, 1.0f / 2048.f, 0 } } }; + uint16x4_t vInt16 = vld1_dup_u16(reinterpret_cast(pSource)); + uint32x4_t vInt = vmovl_u16(vInt16); + vInt = vandq_u32(vInt, U565And); + float32x4_t R = vcvtq_f32_u32(vInt); + return vmulq_f32(R, U565Mul); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORI32 U565And = { { { 0x1F, 0x3F << 5, 0x1F << 11, 0 } } }; + static const XMVECTORF32 U565Mul = { { { 1.0f, 1.0f / 32.0f, 1.0f / 2048.f, 0 } } }; + // Get the 16 bit value and splat it + __m128i vInt = XM_LOADU_SI16(&pSource->v); + XMVECTOR vResult = XM_PERMUTE_PS(_mm_castsi128_ps(vInt), _MM_SHUFFLE(0, 0, 0, 0)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult, U565And); + // Convert to float + vResult = _mm_cvtepi32_ps(_mm_castps_si128(vResult)); + // Normalize x, y, and z + vResult = _mm_mul_ps(vResult, U565Mul); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadFloat3PK(const XMFLOAT3PK* pSource) noexcept +{ + assert(pSource); + + XM_ALIGNED_DATA(16) uint32_t Result[4]; + uint32_t Mantissa; + uint32_t Exponent; + + // X Channel (6-bit mantissa) + Mantissa = pSource->xm; + + if (pSource->xe == 0x1f) // INF or NAN + { + Result[0] = static_cast(0x7f800000 | (static_cast(pSource->xm) << 17)); + } + else + { + if (pSource->xe != 0) // The value is normalized + { + Exponent = pSource->xe; + } + else if (Mantissa != 0) // The value is denormalized + { + // Normalize the value in the resulting float + Exponent = 1; + + do + { + Exponent--; + Mantissa <<= 1; + } while ((Mantissa & 0x40) == 0); + + Mantissa &= 0x3F; + } + else // The value is zero + { + Exponent = static_cast(-112); + } + + Result[0] = ((Exponent + 112) << 23) | (Mantissa << 17); + } + + // Y Channel (6-bit mantissa) + Mantissa = pSource->ym; + + if (pSource->ye == 0x1f) // INF or NAN + { + Result[1] = static_cast(0x7f800000 | (static_cast(pSource->ym) << 17)); + } + else + { + if (pSource->ye != 0) // The value is normalized + { + Exponent = pSource->ye; + } + else if (Mantissa != 0) // The value is denormalized + { + // Normalize the value in the resulting float + Exponent = 1; + + do + { + Exponent--; + Mantissa <<= 1; + } while ((Mantissa & 0x40) == 0); + + Mantissa &= 0x3F; + } + else // The value is zero + { + Exponent = static_cast(-112); + } + + Result[1] = ((Exponent + 112) << 23) | (Mantissa << 17); + } + + // Z Channel (5-bit mantissa) + Mantissa = pSource->zm; + + if (pSource->ze == 0x1f) // INF or NAN + { + Result[2] = static_cast(0x7f800000 | (static_cast(pSource->zm) << 17)); + } + else + { + if (pSource->ze != 0) // The value is normalized + { + Exponent = pSource->ze; + } + else if (Mantissa != 0) // The value is denormalized + { + // Normalize the value in the resulting float + Exponent = 1; + + do + { + Exponent--; + Mantissa <<= 1; + } while ((Mantissa & 0x20) == 0); + + Mantissa &= 0x1F; + } + else // The value is zero + { + Exponent = static_cast(-112); + } + + Result[2] = ((Exponent + 112) << 23) | (Mantissa << 18); + } + + return XMLoadFloat3A(reinterpret_cast(&Result)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadFloat3SE(const XMFLOAT3SE* pSource) noexcept +{ + assert(pSource); + + union { float f; int32_t i; } fi; + fi.i = 0x33800000 + (pSource->e << 23); + float Scale = fi.f; + + XMVECTORF32 v = { { { + Scale * float(pSource->xm), + Scale * float(pSource->ym), + Scale * float(pSource->zm), + 1.0f } } }; + return v; +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadHalf4(const XMHALF4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + __m128i V = _mm_loadl_epi64(reinterpret_cast(pSource)); + return _mm_cvtph_ps(V); +#else + XMVECTORF32 vResult = { { { + XMConvertHalfToFloat(pSource->x), + XMConvertHalfToFloat(pSource->y), + XMConvertHalfToFloat(pSource->z), + XMConvertHalfToFloat(pSource->w) + } } }; + return vResult.v; +#endif // !_XM_F16C_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadShortN4(const XMSHORTN4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + (pSource->x == -32768) ? -1.f : (static_cast(pSource->x)* (1.0f / 32767.0f)), + (pSource->y == -32768) ? -1.f : (static_cast(pSource->y)* (1.0f / 32767.0f)), + (pSource->z == -32768) ? -1.f : (static_cast(pSource->z)* (1.0f / 32767.0f)), + (pSource->w == -32768) ? -1.f : (static_cast(pSource->w)* (1.0f / 32767.0f)) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + int16x4_t vInt = vld1_s16(reinterpret_cast(pSource)); + int32x4_t V = vmovl_s16(vInt); + float32x4_t vResult = vcvtq_f32_s32(V); + vResult = vmulq_n_f32(vResult, 1.0f / 32767.0f); + return vmaxq_f32(vResult, vdupq_n_f32(-1.f)); +#elif defined(_XM_SSE_INTRINSICS_) + // Splat the color in all four entries (x,z,y,w) + __m128d vIntd = _mm_load1_pd(reinterpret_cast(&pSource->x)); + // Shift x&0ffff,z&0xffff,y&0xffff0000,w&0xffff0000 + __m128 vTemp = _mm_and_ps(_mm_castpd_ps(vIntd), g_XMMaskX16Y16Z16W16); + // x and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp, g_XMFlipX16Y16Z16W16); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // x and z - 0x8000 to complete the conversion + vTemp = _mm_add_ps(vTemp, g_XMFixX16Y16Z16W16); + // Convert to -1.0f - 1.0f + vTemp = _mm_mul_ps(vTemp, g_XMNormalizeX16Y16Z16W16); + // Very important! The entries are x,z,y,w, flip it to x,y,z,w + vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 1, 2, 0)); + // Clamp result (for case of -32768) + return _mm_max_ps(vTemp, g_XMNegativeOne); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadShort4(const XMSHORT4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + static_cast(pSource->x), + static_cast(pSource->y), + static_cast(pSource->z), + static_cast(pSource->w) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + int16x4_t vInt = vld1_s16(reinterpret_cast(pSource)); + int32x4_t V = vmovl_s16(vInt); + return vcvtq_f32_s32(V); +#elif defined(_XM_SSE_INTRINSICS_) + // Splat the color in all four entries (x,z,y,w) + __m128d vIntd = _mm_load1_pd(reinterpret_cast(&pSource->x)); + // Shift x&0ffff,z&0xffff,y&0xffff0000,w&0xffff0000 + __m128 vTemp = _mm_and_ps(_mm_castpd_ps(vIntd), g_XMMaskX16Y16Z16W16); + // x and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp, g_XMFlipX16Y16Z16W16); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // x and z - 0x8000 to complete the conversion + vTemp = _mm_add_ps(vTemp, g_XMFixX16Y16Z16W16); + // Fix y and w because they are 65536 too large + vTemp = _mm_mul_ps(vTemp, g_XMFixupY16W16); + // Very important! The entries are x,z,y,w, flip it to x,y,z,w + return XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 1, 2, 0)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUShortN4(const XMUSHORTN4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + static_cast(pSource->x) / 65535.0f, + static_cast(pSource->y) / 65535.0f, + static_cast(pSource->z) / 65535.0f, + static_cast(pSource->w) / 65535.0f + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint16x4_t vInt = vld1_u16(reinterpret_cast(pSource)); + uint32x4_t V = vmovl_u16(vInt); + float32x4_t vResult = vcvtq_f32_u32(V); + return vmulq_n_f32(vResult, 1.0f / 65535.0f); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 FixupY16W16 = { { { 1.0f / 65535.0f, 1.0f / 65535.0f, 1.0f / (65535.0f * 65536.0f), 1.0f / (65535.0f * 65536.0f) } } }; + static const XMVECTORF32 FixaddY16W16 = { { { 0, 0, 32768.0f * 65536.0f, 32768.0f * 65536.0f } } }; + // Splat the color in all four entries (x,z,y,w) + __m128d vIntd = _mm_load1_pd(reinterpret_cast(&pSource->x)); + // Shift x&0ffff,z&0xffff,y&0xffff0000,w&0xffff0000 + __m128 vTemp = _mm_and_ps(_mm_castpd_ps(vIntd), g_XMMaskX16Y16Z16W16); + // y and w are signed! Flip the bits to convert the order to unsigned + vTemp = _mm_xor_ps(vTemp, g_XMFlipZW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // y and w + 0x8000 to complete the conversion + vTemp = _mm_add_ps(vTemp, FixaddY16W16); + // Fix y and w because they are 65536 too large + vTemp = _mm_mul_ps(vTemp, FixupY16W16); + // Very important! The entries are x,z,y,w, flip it to x,y,z,w + return XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 1, 2, 0)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUShort4(const XMUSHORT4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + static_cast(pSource->x), + static_cast(pSource->y), + static_cast(pSource->z), + static_cast(pSource->w) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint16x4_t vInt = vld1_u16(reinterpret_cast(pSource)); + uint32x4_t V = vmovl_u16(vInt); + return vcvtq_f32_u32(V); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 FixaddY16W16 = { { { 0, 0, 32768.0f, 32768.0f } } }; + // Splat the color in all four entries (x,z,y,w) + __m128d vIntd = _mm_load1_pd(reinterpret_cast(&pSource->x)); + // Shift x&0ffff,z&0xffff,y&0xffff0000,w&0xffff0000 + __m128 vTemp = _mm_and_ps(_mm_castpd_ps(vIntd), g_XMMaskX16Y16Z16W16); + // y and w are signed! Flip the bits to convert the order to unsigned + vTemp = _mm_xor_ps(vTemp, g_XMFlipZW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // Fix y and w because they are 65536 too large + vTemp = _mm_mul_ps(vTemp, g_XMFixupY16W16); + // y and w + 0x8000 to complete the conversion + vTemp = _mm_add_ps(vTemp, FixaddY16W16); + // Very important! The entries are x,z,y,w, flip it to x,y,z,w + return XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 1, 2, 0)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadXDecN4(const XMXDECN4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + static const uint32_t SignExtend[] = { 0x00000000, 0xFFFFFC00 }; + + uint32_t ElementX = pSource->v & 0x3FF; + uint32_t ElementY = (pSource->v >> 10) & 0x3FF; + uint32_t ElementZ = (pSource->v >> 20) & 0x3FF; + + XMVECTORF32 vResult = { { { + (ElementX == 0x200) ? -1.f : (static_cast(static_cast(ElementX | SignExtend[ElementX >> 9])) / 511.0f), + (ElementY == 0x200) ? -1.f : (static_cast(static_cast(ElementY | SignExtend[ElementY >> 9])) / 511.0f), + (ElementZ == 0x200) ? -1.f : (static_cast(static_cast(ElementZ | SignExtend[ElementZ >> 9])) / 511.0f), + static_cast(pSource->v >> 30) / 3.0f + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vInt = vld1q_dup_u32(reinterpret_cast(pSource)); + vInt = vandq_u32(vInt, g_XMMaskA2B10G10R10); + vInt = veorq_u32(vInt, g_XMFlipA2B10G10R10); + float32x4_t R = vcvtq_f32_s32(vreinterpretq_s32_u32(vInt)); + R = vaddq_f32(R, g_XMFixAA2B10G10R10); + R = vmulq_f32(R, g_XMNormalizeA2B10G10R10); + return vmaxq_f32(R, vdupq_n_f32(-1.0f)); +#elif defined(_XM_SSE_INTRINSICS_) + // Splat the color in all four entries + __m128 vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vTemp = _mm_and_ps(vTemp, g_XMMaskA2B10G10R10); + // a is unsigned! Flip the bit to convert the order to signed + vTemp = _mm_xor_ps(vTemp, g_XMFlipA2B10G10R10); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp, g_XMFixAA2B10G10R10); + // Convert 0-255 to 0.0f-1.0f + vTemp = _mm_mul_ps(vTemp, g_XMNormalizeA2B10G10R10); + // Clamp result (for case of -512) + return _mm_max_ps(vTemp, g_XMNegativeOne); +#endif +} + +//------------------------------------------------------------------------------ +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4996) +// C4996: ignore deprecation warning +#endif + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadXDec4(const XMXDEC4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + static const uint32_t SignExtend[] = { 0x00000000, 0xFFFFFC00 }; + + uint32_t ElementX = pSource->v & 0x3FF; + uint32_t ElementY = (pSource->v >> 10) & 0x3FF; + uint32_t ElementZ = (pSource->v >> 20) & 0x3FF; + + XMVECTORF32 vResult = { { { + static_cast(static_cast(ElementX | SignExtend[ElementX >> 9])), + static_cast(static_cast(ElementY | SignExtend[ElementY >> 9])), + static_cast(static_cast(ElementZ | SignExtend[ElementZ >> 9])), + static_cast(pSource->v >> 30) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORU32 XDec4Xor = { { { 0x200, 0x200 << 10, 0x200 << 20, 0x80000000 } } }; + static const XMVECTORF32 XDec4Add = { { { -512.0f, -512.0f * 1024.0f, -512.0f * 1024.0f * 1024.0f, 32768 * 65536.0f } } }; + uint32x4_t vInt = vld1q_dup_u32(reinterpret_cast(pSource)); + vInt = vandq_u32(vInt, g_XMMaskDec4); + vInt = veorq_u32(vInt, XDec4Xor); + float32x4_t R = vcvtq_f32_s32(vreinterpretq_s32_u32(vInt)); + R = vaddq_f32(R, XDec4Add); + return vmulq_f32(R, g_XMMulDec4); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORU32 XDec4Xor = { { { 0x200, 0x200 << 10, 0x200 << 20, 0x80000000 } } }; + static const XMVECTORF32 XDec4Add = { { { -512.0f, -512.0f * 1024.0f, -512.0f * 1024.0f * 1024.0f, 32768 * 65536.0f } } }; + // Splat the color in all four entries + XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vTemp = _mm_and_ps(vTemp, g_XMMaskDec4); + // a is unsigned! Flip the bit to convert the order to signed + vTemp = _mm_xor_ps(vTemp, XDec4Xor); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp, XDec4Add); + // Convert 0-255 to 0.0f-1.0f + vTemp = _mm_mul_ps(vTemp, g_XMMulDec4); + return vTemp; +#endif +} + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUDecN4(const XMUDECN4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + + uint32_t ElementX = pSource->v & 0x3FF; + uint32_t ElementY = (pSource->v >> 10) & 0x3FF; + uint32_t ElementZ = (pSource->v >> 20) & 0x3FF; + + XMVECTORF32 vResult = { { { + static_cast(ElementX) / 1023.0f, + static_cast(ElementY) / 1023.0f, + static_cast(ElementZ) / 1023.0f, + static_cast(pSource->v >> 30) / 3.0f + } } }; + return vResult.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 UDecN4Mul = { { { 1.0f / 1023.0f, 1.0f / (1023.0f * 1024.0f), 1.0f / (1023.0f * 1024.0f * 1024.0f), 1.0f / (3.0f * 1024.0f * 1024.0f * 1024.0f) } } }; + uint32x4_t vInt = vld1q_dup_u32(reinterpret_cast(pSource)); + vInt = vandq_u32(vInt, g_XMMaskDec4); + float32x4_t R = vcvtq_f32_u32(vInt); + return vmulq_f32(R, UDecN4Mul); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 UDecN4Mul = { { { 1.0f / 1023.0f, 1.0f / (1023.0f * 1024.0f), 1.0f / (1023.0f * 1024.0f * 1024.0f), 1.0f / (3.0f * 1024.0f * 1024.0f * 1024.0f) } } }; + // Splat the color in all four entries + XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vTemp = _mm_and_ps(vTemp, g_XMMaskDec4); + // a is unsigned! Flip the bit to convert the order to signed + vTemp = _mm_xor_ps(vTemp, g_XMFlipW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp, g_XMAddUDec4); + // Convert 0-255 to 0.0f-1.0f + vTemp = _mm_mul_ps(vTemp, UDecN4Mul); + return vTemp; +#endif +} + + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUDecN4_XR(const XMUDECN4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + + int32_t ElementX = pSource->v & 0x3FF; + int32_t ElementY = (pSource->v >> 10) & 0x3FF; + int32_t ElementZ = (pSource->v >> 20) & 0x3FF; + + XMVECTORF32 vResult = { { { + static_cast(ElementX - 0x180) / 510.0f, + static_cast(ElementY - 0x180) / 510.0f, + static_cast(ElementZ - 0x180) / 510.0f, + static_cast(pSource->v >> 30) / 3.0f + } } }; + + return vResult.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 XRMul = { { { 1.0f / 510.0f, 1.0f / (510.0f * 1024.0f), 1.0f / (510.0f * 1024.0f * 1024.0f), 1.0f / (3.0f * 1024.0f * 1024.0f * 1024.0f) } } }; + static const XMVECTORI32 XRBias = { { { 0x180, 0x180 * 1024, 0x180 * 1024 * 1024, 0 } } }; + uint32x4_t vInt = vld1q_dup_u32(reinterpret_cast(pSource)); + vInt = vandq_u32(vInt, g_XMMaskDec4); + int32x4_t vTemp = vsubq_s32(vreinterpretq_s32_u32(vInt), XRBias); + vTemp = veorq_s32(vTemp, g_XMFlipW); + float32x4_t R = vcvtq_f32_s32(vTemp); + R = vaddq_f32(R, g_XMAddUDec4); + return vmulq_f32(R, XRMul); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 XRMul = { { { 1.0f / 510.0f, 1.0f / (510.0f * 1024.0f), 1.0f / (510.0f * 1024.0f * 1024.0f), 1.0f / (3.0f * 1024.0f * 1024.0f * 1024.0f) } } }; + static const XMVECTORI32 XRBias = { { { 0x180, 0x180 * 1024, 0x180 * 1024 * 1024, 0 } } }; + // Splat the color in all four entries + XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Mask channels + vTemp = _mm_and_ps(vTemp, g_XMMaskDec4); + // Subtract bias + vTemp = _mm_castsi128_ps(_mm_sub_epi32(_mm_castps_si128(vTemp), XRBias)); + // a is unsigned! Flip the bit to convert the order to signed + vTemp = _mm_xor_ps(vTemp, g_XMFlipW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp, g_XMAddUDec4); + // Convert to 0.0f-1.0f + return _mm_mul_ps(vTemp, XRMul); +#endif +} + + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUDec4(const XMUDEC4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + uint32_t ElementX = pSource->v & 0x3FF; + uint32_t ElementY = (pSource->v >> 10) & 0x3FF; + uint32_t ElementZ = (pSource->v >> 20) & 0x3FF; + + XMVECTORF32 vResult = { { { + static_cast(ElementX), + static_cast(ElementY), + static_cast(ElementZ), + static_cast(pSource->v >> 30) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vInt = vld1q_dup_u32(reinterpret_cast(pSource)); + vInt = vandq_u32(vInt, g_XMMaskDec4); + float32x4_t R = vcvtq_f32_u32(vInt); + return vmulq_f32(R, g_XMMulDec4); +#elif defined(_XM_SSE_INTRINSICS_) + // Splat the color in all four entries + XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vTemp = _mm_and_ps(vTemp, g_XMMaskDec4); + // a is unsigned! Flip the bit to convert the order to signed + vTemp = _mm_xor_ps(vTemp, g_XMFlipW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp, g_XMAddUDec4); + // Convert 0-255 to 0.0f-1.0f + vTemp = _mm_mul_ps(vTemp, g_XMMulDec4); + return vTemp; +#endif +} + +//------------------------------------------------------------------------------ +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4996) +// C4996: ignore deprecation warning +#endif + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadDecN4(const XMDECN4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + static const uint32_t SignExtend[] = { 0x00000000, 0xFFFFFC00 }; + static const uint32_t SignExtendW[] = { 0x00000000, 0xFFFFFFFC }; + + uint32_t ElementX = pSource->v & 0x3FF; + uint32_t ElementY = (pSource->v >> 10) & 0x3FF; + uint32_t ElementZ = (pSource->v >> 20) & 0x3FF; + uint32_t ElementW = pSource->v >> 30; + + XMVECTORF32 vResult = { { { + (ElementX == 0x200) ? -1.f : (static_cast(static_cast(ElementX | SignExtend[ElementX >> 9])) / 511.0f), + (ElementY == 0x200) ? -1.f : (static_cast(static_cast(ElementY | SignExtend[ElementY >> 9])) / 511.0f), + (ElementZ == 0x200) ? -1.f : (static_cast(static_cast(ElementZ | SignExtend[ElementZ >> 9])) / 511.0f), + (ElementW == 0x2) ? -1.f : static_cast(static_cast(ElementW | SignExtendW[(ElementW >> 1) & 1])) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 DecN4Mul = { { { 1.0f / 511.0f, 1.0f / (511.0f * 1024.0f), 1.0f / (511.0f * 1024.0f * 1024.0f), 1.0f / (1024.0f * 1024.0f * 1024.0f) } } }; + uint32x4_t vInt = vld1q_dup_u32(reinterpret_cast(pSource)); + vInt = vandq_u32(vInt, g_XMMaskDec4); + vInt = veorq_u32(vInt, g_XMXorDec4); + float32x4_t R = vcvtq_f32_s32(vreinterpretq_s32_u32(vInt)); + R = vaddq_f32(R, g_XMAddDec4); + R = vmulq_f32(R, DecN4Mul); + return vmaxq_f32(R, vdupq_n_f32(-1.0f)); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 DecN4Mul = { { { 1.0f / 511.0f, 1.0f / (511.0f * 1024.0f), 1.0f / (511.0f * 1024.0f * 1024.0f), 1.0f / (1024.0f * 1024.0f * 1024.0f) } } }; + // Splat the color in all four entries + XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vTemp = _mm_and_ps(vTemp, g_XMMaskDec4); + // a is unsigned! Flip the bit to convert the order to signed + vTemp = _mm_xor_ps(vTemp, g_XMXorDec4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp, g_XMAddDec4); + // Convert 0-255 to 0.0f-1.0f + vTemp = _mm_mul_ps(vTemp, DecN4Mul); + // Clamp result (for case of -512/-1) + return _mm_max_ps(vTemp, g_XMNegativeOne); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadDec4(const XMDEC4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + static const uint32_t SignExtend[] = { 0x00000000, 0xFFFFFC00 }; + static const uint32_t SignExtendW[] = { 0x00000000, 0xFFFFFFFC }; + + uint32_t ElementX = pSource->v & 0x3FF; + uint32_t ElementY = (pSource->v >> 10) & 0x3FF; + uint32_t ElementZ = (pSource->v >> 20) & 0x3FF; + uint32_t ElementW = pSource->v >> 30; + + XMVECTORF32 vResult = { { { + static_cast(static_cast(ElementX | SignExtend[ElementX >> 9])), + static_cast(static_cast(ElementY | SignExtend[ElementY >> 9])), + static_cast(static_cast(ElementZ | SignExtend[ElementZ >> 9])), + static_cast(static_cast(ElementW | SignExtendW[ElementW >> 1])) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vInt = vld1q_dup_u32(reinterpret_cast(pSource)); + vInt = vandq_u32(vInt, g_XMMaskDec4); + vInt = veorq_u32(vInt, g_XMXorDec4); + float32x4_t R = vcvtq_f32_s32(vreinterpretq_s32_u32(vInt)); + R = vaddq_f32(R, g_XMAddDec4); + return vmulq_f32(R, g_XMMulDec4); +#elif defined(_XM_SSE_INTRINSICS_) + // Splat the color in all four entries + XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vTemp = _mm_and_ps(vTemp, g_XMMaskDec4); + // a is unsigned! Flip the bit to convert the order to signed + vTemp = _mm_xor_ps(vTemp, g_XMXorDec4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp, g_XMAddDec4); + // Convert 0-255 to 0.0f-1.0f + vTemp = _mm_mul_ps(vTemp, g_XMMulDec4); + return vTemp; +#endif +} + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUByteN4(const XMUBYTEN4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + static_cast(pSource->x) / 255.0f, + static_cast(pSource->y) / 255.0f, + static_cast(pSource->z) / 255.0f, + static_cast(pSource->w) / 255.0f + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vInt8 = vld1_dup_u32(reinterpret_cast(pSource)); + uint16x8_t vInt16 = vmovl_u8(vreinterpret_u8_u32(vInt8)); + uint32x4_t vInt = vmovl_u16(vget_low_u16(vInt16)); + float32x4_t R = vcvtq_f32_u32(vInt); + return vmulq_n_f32(R, 1.0f / 255.0f); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 LoadUByteN4Mul = { { { 1.0f / 255.0f, 1.0f / (255.0f * 256.0f), 1.0f / (255.0f * 65536.0f), 1.0f / (255.0f * 65536.0f * 256.0f) } } }; + // Splat the color in all four entries (x,z,y,w) + XMVECTOR vTemp = _mm_load1_ps(reinterpret_cast(&pSource->x)); + // Mask x&0ff,y&0xff00,z&0xff0000,w&0xff000000 + vTemp = _mm_and_ps(vTemp, g_XMMaskByte4); + // w is signed! Flip the bits to convert the order to unsigned + vTemp = _mm_xor_ps(vTemp, g_XMFlipW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // w + 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp, g_XMAddUDec4); + // Fix y, z and w because they are too large + vTemp = _mm_mul_ps(vTemp, LoadUByteN4Mul); + return vTemp; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUByte4(const XMUBYTE4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + static_cast(pSource->x), + static_cast(pSource->y), + static_cast(pSource->z), + static_cast(pSource->w) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vInt8 = vld1_dup_u32(reinterpret_cast(pSource)); + uint16x8_t vInt16 = vmovl_u8(vreinterpret_u8_u32(vInt8)); + uint32x4_t vInt = vmovl_u16(vget_low_u16(vInt16)); + return vcvtq_f32_u32(vInt); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 LoadUByte4Mul = { { { 1.0f, 1.0f / 256.0f, 1.0f / 65536.0f, 1.0f / (65536.0f * 256.0f) } } }; + // Splat the color in all four entries (x,z,y,w) + XMVECTOR vTemp = _mm_load1_ps(reinterpret_cast(&pSource->x)); + // Mask x&0ff,y&0xff00,z&0xff0000,w&0xff000000 + vTemp = _mm_and_ps(vTemp, g_XMMaskByte4); + // w is signed! Flip the bits to convert the order to unsigned + vTemp = _mm_xor_ps(vTemp, g_XMFlipW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // w + 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp, g_XMAddUDec4); + // Fix y, z and w because they are too large + vTemp = _mm_mul_ps(vTemp, LoadUByte4Mul); + return vTemp; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadByteN4(const XMBYTEN4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + (pSource->x == -128) ? -1.f : (static_cast(pSource->x) / 127.0f), + (pSource->y == -128) ? -1.f : (static_cast(pSource->y) / 127.0f), + (pSource->z == -128) ? -1.f : (static_cast(pSource->z) / 127.0f), + (pSource->w == -128) ? -1.f : (static_cast(pSource->w) / 127.0f) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vInt8 = vld1_dup_u32(reinterpret_cast(pSource)); + int16x8_t vInt16 = vmovl_s8(vreinterpret_s8_u32(vInt8)); + int32x4_t vInt = vmovl_s16(vget_low_s16(vInt16)); + float32x4_t R = vcvtq_f32_s32(vInt); + R = vmulq_n_f32(R, 1.0f / 127.0f); + return vmaxq_f32(R, vdupq_n_f32(-1.f)); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 LoadByteN4Mul = { { { 1.0f / 127.0f, 1.0f / (127.0f * 256.0f), 1.0f / (127.0f * 65536.0f), 1.0f / (127.0f * 65536.0f * 256.0f) } } }; + // Splat the color in all four entries (x,z,y,w) + XMVECTOR vTemp = _mm_load1_ps(reinterpret_cast(&pSource->x)); + // Mask x&0ff,y&0xff00,z&0xff0000,w&0xff000000 + vTemp = _mm_and_ps(vTemp, g_XMMaskByte4); + // x,y and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp, g_XMXorByte4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // x, y and z - 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp, g_XMAddByte4); + // Fix y, z and w because they are too large + vTemp = _mm_mul_ps(vTemp, LoadByteN4Mul); + // Clamp result (for case of -128) + return _mm_max_ps(vTemp, g_XMNegativeOne); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadByte4(const XMBYTE4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + static_cast(pSource->x), + static_cast(pSource->y), + static_cast(pSource->z), + static_cast(pSource->w) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vInt8 = vld1_dup_u32(reinterpret_cast(pSource)); + int16x8_t vInt16 = vmovl_s8(vreinterpret_s8_u32(vInt8)); + int32x4_t vInt = vmovl_s16(vget_low_s16(vInt16)); + return vcvtq_f32_s32(vInt); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 LoadByte4Mul = { { { 1.0f, 1.0f / 256.0f, 1.0f / 65536.0f, 1.0f / (65536.0f * 256.0f) } } }; + // Splat the color in all four entries (x,z,y,w) + XMVECTOR vTemp = _mm_load1_ps(reinterpret_cast(&pSource->x)); + // Mask x&0ff,y&0xff00,z&0xff0000,w&0xff000000 + vTemp = _mm_and_ps(vTemp, g_XMMaskByte4); + // x,y and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp, g_XMXorByte4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // x, y and z - 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp, g_XMAddByte4); + // Fix y, z and w because they are too large + vTemp = _mm_mul_ps(vTemp, LoadByte4Mul); + return vTemp; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUNibble4(const XMUNIBBLE4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + float(pSource->v & 0xF), + float((pSource->v >> 4) & 0xF), + float((pSource->v >> 8) & 0xF), + float((pSource->v >> 12) & 0xF) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORI32 UNibble4And = { { { 0xF, 0xF0, 0xF00, 0xF000 } } }; + static const XMVECTORF32 UNibble4Mul = { { { 1.0f, 1.0f / 16.f, 1.0f / 256.f, 1.0f / 4096.f } } }; + uint16x4_t vInt16 = vld1_dup_u16(reinterpret_cast(pSource)); + uint32x4_t vInt = vmovl_u16(vInt16); + vInt = vandq_u32(vInt, UNibble4And); + float32x4_t R = vcvtq_f32_u32(vInt); + return vmulq_f32(R, UNibble4Mul); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORI32 UNibble4And = { { { 0xF, 0xF0, 0xF00, 0xF000 } } }; + static const XMVECTORF32 UNibble4Mul = { { { 1.0f, 1.0f / 16.f, 1.0f / 256.f, 1.0f / 4096.f } } }; + // Get the 16 bit value and splat it + __m128i vInt = XM_LOADU_SI16(&pSource->v); + XMVECTOR vResult = XM_PERMUTE_PS(_mm_castsi128_ps(vInt), _MM_SHUFFLE(0,0,0,0)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult, UNibble4And); + // Convert to float + vResult = _mm_cvtepi32_ps(_mm_castps_si128(vResult)); + // Normalize x, y, and z + vResult = _mm_mul_ps(vResult, UNibble4Mul); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadU555(const XMU555* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + float(pSource->v & 0x1F), + float((pSource->v >> 5) & 0x1F), + float((pSource->v >> 10) & 0x1F), + float((pSource->v >> 15) & 0x1) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORI32 U555And = { { { 0x1F, 0x1F << 5, 0x1F << 10, 0x8000 } } }; + static const XMVECTORF32 U555Mul = { { { 1.0f, 1.0f / 32.f, 1.0f / 1024.f, 1.0f / 32768.f } } }; + uint16x4_t vInt16 = vld1_dup_u16(reinterpret_cast(pSource)); + uint32x4_t vInt = vmovl_u16(vInt16); + vInt = vandq_u32(vInt, U555And); + float32x4_t R = vcvtq_f32_u32(vInt); + return vmulq_f32(R, U555Mul); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORI32 U555And = { { { 0x1F, 0x1F << 5, 0x1F << 10, 0x8000 } } }; + static const XMVECTORF32 U555Mul = { { { 1.0f, 1.0f / 32.f, 1.0f / 1024.f, 1.0f / 32768.f } } }; + // Get the 16bit value and splat it + __m128i vInt = XM_LOADU_SI16(&pSource->v); + XMVECTOR vResult = XM_PERMUTE_PS(_mm_castsi128_ps(vInt), _MM_SHUFFLE(0, 0, 0, 0)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult, U555And); + // Convert to float + vResult = _mm_cvtepi32_ps(_mm_castps_si128(vResult)); + // Normalize x, y, and z + vResult = _mm_mul_ps(vResult, U555Mul); + return vResult; +#endif +} + +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif + +/**************************************************************************** + * + * Vector and matrix store operations + * + ****************************************************************************/ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreColor +( + XMCOLOR* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorSaturate(V); + N = XMVectorMultiply(N, g_UByteMax); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->c = (static_cast(tmp.w) << 24) | + (static_cast(tmp.x) << 16) | + (static_cast(tmp.y) << 8) | + static_cast(tmp.z); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t R = vmaxq_f32(V, vdupq_n_f32(0)); + R = vminq_f32(R, vdupq_n_f32(1.0f)); + R = vmulq_n_f32(R, 255.0f); + R = XMVectorRound(R); + uint32x4_t vInt32 = vcvtq_u32_f32(R); + uint16x4_t vInt16 = vqmovn_u32(vInt32); + uint8x8_t vInt8 = vqmovn_u16(vcombine_u16(vInt16, vInt16)); + uint32_t rgba = vget_lane_u32(vreinterpret_u32_u8(vInt8), 0); + pDestination->c = (rgba & 0xFF00FF00) | ((rgba >> 16) & 0xFF) | ((rgba << 16) & 0xFF0000); +#elif defined(_XM_SSE_INTRINSICS_) + // Set <0 to 0 + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + // Set>1 to 1 + vResult = _mm_min_ps(vResult, g_XMOne); + // Convert to 0-255 + vResult = _mm_mul_ps(vResult, g_UByteMax); + // Shuffle RGBA to ARGB + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 0, 1, 2)); + // Convert to int + __m128i vInt = _mm_cvtps_epi32(vResult); + // Mash to shorts + vInt = _mm_packs_epi32(vInt, vInt); + // Mash to bytes + vInt = _mm_packus_epi16(vInt, vInt); + // Store the color + _mm_store_ss(reinterpret_cast(&pDestination->c), _mm_castsi128_ps(vInt)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreHalf2 +( + XMHALF2* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + __m128i V1 = _mm_cvtps_ph(V, _MM_FROUND_TO_NEAREST_INT); + _mm_store_ss(reinterpret_cast(pDestination), _mm_castsi128_ps(V1)); +#else + pDestination->x = XMConvertFloatToHalf(XMVectorGetX(V)); + pDestination->y = XMConvertFloatToHalf(XMVectorGetY(V)); +#endif // !_XM_F16C_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreShortN2 +( + XMSHORTN2* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); + N = XMVectorMultiply(N, g_ShortMax); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t R = vmaxq_f32(V, vdupq_n_f32(-1.f)); + R = vminq_f32(R, vdupq_n_f32(1.0f)); + R = vmulq_n_f32(R, 32767.0f); + int32x4_t vInt32 = vcvtq_s32_f32(R); + int16x4_t vInt16 = vqmovn_s32(vInt32); + vst1_lane_u32(&pDestination->v, vreinterpret_u32_s16(vInt16), 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_max_ps(V, g_XMNegativeOne); + vResult = _mm_min_ps(vResult, g_XMOne); + vResult = _mm_mul_ps(vResult, g_ShortMax); + __m128i vResulti = _mm_cvtps_epi32(vResult); + vResulti = _mm_packs_epi32(vResulti, vResulti); + _mm_store_ss(reinterpret_cast(&pDestination->x), _mm_castsi128_ps(vResulti)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreShort2 +( + XMSHORT2* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, g_ShortMin, g_ShortMax); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t R = vmaxq_f32(V, vdupq_n_f32(-32767.f)); + R = vminq_f32(R, vdupq_n_f32(32767.0f)); + int32x4_t vInt32 = vcvtq_s32_f32(R); + int16x4_t vInt16 = vqmovn_s32(vInt32); + vst1_lane_u32(&pDestination->v, vreinterpret_u32_s16(vInt16), 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Bounds check + XMVECTOR vResult = _mm_max_ps(V, g_ShortMin); + vResult = _mm_min_ps(vResult, g_ShortMax); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // Pack the ints into shorts + vInt = _mm_packs_epi32(vInt, vInt); + _mm_store_ss(reinterpret_cast(&pDestination->x), _mm_castsi128_ps(vInt)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUShortN2 +( + XMUSHORTN2* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorSaturate(V); + N = XMVectorMultiplyAdd(N, g_UShortMax, g_XMOneHalf.v); + N = XMVectorTruncate(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t R = vmaxq_f32(V, vdupq_n_f32(0.f)); + R = vminq_f32(R, vdupq_n_f32(1.0f)); + R = vmulq_n_f32(R, 65535.0f); + R = vaddq_f32(R, g_XMOneHalf); + uint32x4_t vInt32 = vcvtq_u32_f32(R); + uint16x4_t vInt16 = vqmovn_u32(vInt32); + vst1_lane_u32(&pDestination->v, vreinterpret_u32_u16(vInt16), 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Bounds check + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + vResult = _mm_min_ps(vResult, g_XMOne); + vResult = _mm_mul_ps(vResult, g_UShortMax); + vResult = _mm_add_ps(vResult, g_XMOneHalf); + // Convert to int + __m128i vInt = _mm_cvttps_epi32(vResult); + // Since the SSE pack instruction clamps using signed rules, + // manually extract the values to store them to memory + pDestination->x = static_cast(_mm_extract_epi16(vInt, 0)); + pDestination->y = static_cast(_mm_extract_epi16(vInt, 2)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUShort2 +( + XMUSHORT2* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, XMVectorZero(), g_UShortMax); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t R = vmaxq_f32(V, vdupq_n_f32(0.f)); + R = vminq_f32(R, vdupq_n_f32(65535.0f)); + uint32x4_t vInt32 = vcvtq_u32_f32(R); + uint16x4_t vInt16 = vqmovn_u32(vInt32); + vst1_lane_u32(&pDestination->v, vreinterpret_u32_u16(vInt16), 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Bounds check + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + vResult = _mm_min_ps(vResult, g_UShortMax); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // Since the SSE pack instruction clamps using signed rules, + // manually extract the values to store them to memory + pDestination->x = static_cast(_mm_extract_epi16(vInt, 0)); + pDestination->y = static_cast(_mm_extract_epi16(vInt, 2)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreByteN2 +( + XMBYTEN2* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); + N = XMVectorMultiply(N, g_ByteMax); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t R = vmaxq_f32(V, vdupq_n_f32(-1.f)); + R = vminq_f32(R, vdupq_n_f32(1.0f)); + R = vmulq_n_f32(R, 127.0f); + int32x4_t vInt32 = vcvtq_s32_f32(R); + int16x4_t vInt16 = vqmovn_s32(vInt32); + int8x8_t vInt8 = vqmovn_s16(vcombine_s16(vInt16, vInt16)); + vst1_lane_u16(reinterpret_cast(pDestination), vreinterpret_u16_s8(vInt8), 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V, g_XMNegativeOne); + vResult = _mm_min_ps(vResult, g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult, g_ByteMax); + // Convert to int by rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // No SSE operations will write to 16-bit values, so we have to extract them manually + auto x = static_cast(_mm_extract_epi16(vInt, 0)); + auto y = static_cast(_mm_extract_epi16(vInt, 2)); + pDestination->v = static_cast(((static_cast(y) & 0xFF) << 8) | (static_cast(x) & 0xFF)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreByte2 +( + XMBYTE2* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, g_ByteMin, g_ByteMax); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t R = vmaxq_f32(V, vdupq_n_f32(-127.f)); + R = vminq_f32(R, vdupq_n_f32(127.0f)); + int32x4_t vInt32 = vcvtq_s32_f32(R); + int16x4_t vInt16 = vqmovn_s32(vInt32); + int8x8_t vInt8 = vqmovn_s16(vcombine_s16(vInt16, vInt16)); + vst1_lane_u16(reinterpret_cast(pDestination), vreinterpret_u16_s8(vInt8), 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V, g_ByteMin); + vResult = _mm_min_ps(vResult, g_ByteMax); + // Convert to int by rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // No SSE operations will write to 16-bit values, so we have to extract them manually + auto x = static_cast(_mm_extract_epi16(vInt, 0)); + auto y = static_cast(_mm_extract_epi16(vInt, 2)); + pDestination->v = static_cast(((static_cast(y) & 0xFF) << 8) | (static_cast(x) & 0xFF)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUByteN2 +( + XMUBYTEN2* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorSaturate(V); + N = XMVectorMultiplyAdd(N, g_UByteMax, g_XMOneHalf.v); + N = XMVectorTruncate(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t R = vmaxq_f32(V, vdupq_n_f32(0.f)); + R = vminq_f32(R, vdupq_n_f32(1.0f)); + R = vmulq_n_f32(R, 255.0f); + R = vaddq_f32(R, g_XMOneHalf); + uint32x4_t vInt32 = vcvtq_u32_f32(R); + uint16x4_t vInt16 = vqmovn_u32(vInt32); + uint8x8_t vInt8 = vqmovn_u16(vcombine_u16(vInt16, vInt16)); + vst1_lane_u16(reinterpret_cast(pDestination), vreinterpret_u16_u8(vInt8), 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + vResult = _mm_min_ps(vResult, g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult, g_UByteMax); + vResult = _mm_add_ps(vResult, g_XMOneHalf); + // Convert to int + __m128i vInt = _mm_cvttps_epi32(vResult); + // No SSE operations will write to 16-bit values, so we have to extract them manually + auto x = static_cast(_mm_extract_epi16(vInt, 0)); + auto y = static_cast(_mm_extract_epi16(vInt, 2)); + pDestination->v = static_cast(((static_cast(y) & 0xFF) << 8) | (static_cast(x) & 0xFF)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUByte2 +( + XMUBYTE2* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, XMVectorZero(), g_UByteMax); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t R = vmaxq_f32(V, vdupq_n_f32(0.f)); + R = vminq_f32(R, vdupq_n_f32(255.0f)); + uint32x4_t vInt32 = vcvtq_u32_f32(R); + uint16x4_t vInt16 = vqmovn_u32(vInt32); + uint8x8_t vInt8 = vqmovn_u16(vcombine_u16(vInt16, vInt16)); + vst1_lane_u16(reinterpret_cast(pDestination), vreinterpret_u16_u8(vInt8), 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + vResult = _mm_min_ps(vResult, g_UByteMax); + // Convert to int by rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // No SSE operations will write to 16-bit values, so we have to extract them manually + auto x = static_cast(_mm_extract_epi16(vInt, 0)); + auto y = static_cast(_mm_extract_epi16(vInt, 2)); + pDestination->v = static_cast(((static_cast(y) & 0xFF) << 8) | (static_cast(x) & 0xFF)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreU565 +( + XMU565* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + static const XMVECTORF32 Max = { { { 31.0f, 63.0f, 31.0f, 0.0f } } }; + +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR N = XMVectorClamp(V, XMVectorZero(), Max.v); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->v = static_cast( + ((static_cast(tmp.z) & 0x1F) << 11) + | ((static_cast(tmp.y) & 0x3F) << 5) + | ((static_cast(tmp.x) & 0x1F))); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 1.0f, 32.f, 32.f * 64.f, 0.f } } }; + static const XMVECTORU32 Mask = { { { 0x1F, 0x3F << 5, 0x1F << 11, 0 } } }; + float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(0)); + vResult = vminq_f32(vResult, Max); + vResult = vmulq_f32(vResult, Scale); + uint32x4_t vResulti = vcvtq_u32_f32(vResult); + vResulti = vandq_u32(vResulti, Mask); + // Do a horizontal or of 4 entries + uint32x2_t vTemp = vget_low_u32(vResulti); + uint32x2_t vhi = vget_high_u32(vResulti); + vTemp = vorr_u32(vTemp, vhi); + vTemp = vpadd_u32(vTemp, vTemp); + vst1_lane_u16(&pDestination->v, vreinterpret_u16_u32(vTemp), 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Bounds check + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + vResult = _mm_min_ps(vResult, Max); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // No SSE operations will write to 16-bit values, so we have to extract them manually + auto x = static_cast(_mm_extract_epi16(vInt, 0)); + auto y = static_cast(_mm_extract_epi16(vInt, 2)); + auto z = static_cast(_mm_extract_epi16(vInt, 4)); + pDestination->v = static_cast( + ((static_cast(z) & 0x1F) << 11) + | ((static_cast(y) & 0x3F) << 5) + | ((static_cast(x) & 0x1F))); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat3PK +( + XMFLOAT3PK* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + + XM_ALIGNED_DATA(16) uint32_t IValue[4]; + XMStoreFloat3A(reinterpret_cast(&IValue), V); + + uint32_t Result[3]; + + // X & Y Channels (5-bit exponent, 6-bit mantissa) + for (uint32_t j = 0; j < 2; ++j) + { + uint32_t Sign = IValue[j] & 0x80000000; + uint32_t I = IValue[j] & 0x7FFFFFFF; + + if ((I & 0x7F800000) == 0x7F800000) + { + // INF or NAN + Result[j] = 0x7C0U; + if ((I & 0x7FFFFF) != 0) + { + Result[j] = 0x7FFU; + } + else if (Sign) + { + // -INF is clamped to 0 since 3PK is positive only + Result[j] = 0; + } + } + else if (Sign || I < 0x35800000) + { + // 3PK is positive only, so clamp to zero + Result[j] = 0; + } + else if (I > 0x477E0000U) + { + // The number is too large to be represented as a float11, set to max + Result[j] = 0x7BFU; + } + else + { + if (I < 0x38800000U) + { + // The number is too small to be represented as a normalized float11 + // Convert it to a denormalized value. + uint32_t Shift = 113U - (I >> 23U); + I = (0x800000U | (I & 0x7FFFFFU)) >> Shift; + } + else + { + // Rebias the exponent to represent the value as a normalized float11 + I += 0xC8000000U; + } + + Result[j] = ((I + 0xFFFFU + ((I >> 17U) & 1U)) >> 17U) & 0x7ffU; + } + } + + // Z Channel (5-bit exponent, 5-bit mantissa) + uint32_t Sign = IValue[2] & 0x80000000; + uint32_t I = IValue[2] & 0x7FFFFFFF; + + if ((I & 0x7F800000) == 0x7F800000) + { + // INF or NAN + Result[2] = 0x3E0U; + if (I & 0x7FFFFF) + { + Result[2] = 0x3FFU; + } + else if (Sign || I < 0x36000000) + { + // -INF is clamped to 0 since 3PK is positive only + Result[2] = 0; + } + } + else if (Sign) + { + // 3PK is positive only, so clamp to zero + Result[2] = 0; + } + else if (I > 0x477C0000U) + { + // The number is too large to be represented as a float10, set to max + Result[2] = 0x3DFU; + } + else + { + if (I < 0x38800000U) + { + // The number is too small to be represented as a normalized float10 + // Convert it to a denormalized value. + uint32_t Shift = 113U - (I >> 23U); + I = (0x800000U | (I & 0x7FFFFFU)) >> Shift; + } + else + { + // Rebias the exponent to represent the value as a normalized float10 + I += 0xC8000000U; + } + + Result[2] = ((I + 0x1FFFFU + ((I >> 18U) & 1U)) >> 18U) & 0x3ffU; + } + + // Pack Result into memory + pDestination->v = (Result[0] & 0x7ff) + | ((Result[1] & 0x7ff) << 11) + | ((Result[2] & 0x3ff) << 22); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat3SE +( + XMFLOAT3SE* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + + XMFLOAT3A tmp; + XMStoreFloat3A(&tmp, V); + + static constexpr float maxf9 = float(0x1FF << 7); + static constexpr float minf9 = float(1.f / (1 << 16)); + + float x = (tmp.x >= 0.f) ? ((tmp.x > maxf9) ? maxf9 : tmp.x) : 0.f; + float y = (tmp.y >= 0.f) ? ((tmp.y > maxf9) ? maxf9 : tmp.y) : 0.f; + float z = (tmp.z >= 0.f) ? ((tmp.z > maxf9) ? maxf9 : tmp.z) : 0.f; + + const float max_xy = (x > y) ? x : y; + const float max_xyz = (max_xy > z) ? max_xy : z; + + const float maxColor = (max_xyz > minf9) ? max_xyz : minf9; + + union { float f; int32_t i; } fi; + fi.f = maxColor; + fi.i += 0x00004000; // round up leaving 9 bits in fraction (including assumed 1) + + auto exp = static_cast(fi.i) >> 23; + pDestination->e = exp - 0x6f; + + fi.i = static_cast(0x83000000 - (exp << 23)); + float ScaleR = fi.f; + + pDestination->xm = static_cast(Internal::round_to_nearest(x * ScaleR)); + pDestination->ym = static_cast(Internal::round_to_nearest(y * ScaleR)); + pDestination->zm = static_cast(Internal::round_to_nearest(z * ScaleR)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreHalf4 +( + XMHALF4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + __m128i V1 = _mm_cvtps_ph(V, _MM_FROUND_TO_NEAREST_INT); + _mm_storel_epi64(reinterpret_cast<__m128i*>(pDestination), V1); +#else + XMFLOAT4A t; + XMStoreFloat4A(&t, V); + + pDestination->x = XMConvertFloatToHalf(t.x); + pDestination->y = XMConvertFloatToHalf(t.y); + pDestination->z = XMConvertFloatToHalf(t.z); + pDestination->w = XMConvertFloatToHalf(t.w); +#endif // !_XM_F16C_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreShortN4 +( + XMSHORTN4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); + N = XMVectorMultiply(N, g_ShortMax); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + pDestination->z = static_cast(tmp.z); + pDestination->w = static_cast(tmp.w); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(-1.f)); + vResult = vminq_f32(vResult, vdupq_n_f32(1.0f)); + vResult = vmulq_n_f32(vResult, 32767.0f); + int16x4_t vInt = vmovn_s32(vcvtq_s32_f32(vResult)); + vst1_s16(reinterpret_cast(pDestination), vInt); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_max_ps(V, g_XMNegativeOne); + vResult = _mm_min_ps(vResult, g_XMOne); + vResult = _mm_mul_ps(vResult, g_ShortMax); + __m128i vResulti = _mm_cvtps_epi32(vResult); + vResulti = _mm_packs_epi32(vResulti, vResulti); + _mm_store_sd(reinterpret_cast(&pDestination->x), _mm_castsi128_pd(vResulti)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreShort4 +( + XMSHORT4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, g_ShortMin, g_ShortMax); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + pDestination->z = static_cast(tmp.z); + pDestination->w = static_cast(tmp.w); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t vResult = vmaxq_f32(V, g_ShortMin); + vResult = vminq_f32(vResult, g_ShortMax); + int16x4_t vInt = vmovn_s32(vcvtq_s32_f32(vResult)); + vst1_s16(reinterpret_cast(pDestination), vInt); +#elif defined(_XM_SSE_INTRINSICS_) + // Bounds check + XMVECTOR vResult = _mm_max_ps(V, g_ShortMin); + vResult = _mm_min_ps(vResult, g_ShortMax); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // Pack the ints into shorts + vInt = _mm_packs_epi32(vInt, vInt); + _mm_store_sd(reinterpret_cast(&pDestination->x), _mm_castsi128_pd(vInt)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUShortN4 +( + XMUSHORTN4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorSaturate(V); + N = XMVectorMultiplyAdd(N, g_UShortMax, g_XMOneHalf.v); + N = XMVectorTruncate(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + pDestination->z = static_cast(tmp.z); + pDestination->w = static_cast(tmp.w); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(0)); + vResult = vminq_f32(vResult, vdupq_n_f32(1.0f)); + vResult = vmulq_n_f32(vResult, 65535.0f); + vResult = vaddq_f32(vResult, g_XMOneHalf); + uint16x4_t vInt = vmovn_u32(vcvtq_u32_f32(vResult)); + vst1_u16(reinterpret_cast(pDestination), vInt); +#elif defined(_XM_SSE_INTRINSICS_) + // Bounds check + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + vResult = _mm_min_ps(vResult, g_XMOne); + vResult = _mm_mul_ps(vResult, g_UShortMax); + vResult = _mm_add_ps(vResult, g_XMOneHalf); + // Convert to int + __m128i vInt = _mm_cvttps_epi32(vResult); + // Since the SSE pack instruction clamps using signed rules, + // manually extract the values to store them to memory + pDestination->x = static_cast(_mm_extract_epi16(vInt, 0)); + pDestination->y = static_cast(_mm_extract_epi16(vInt, 2)); + pDestination->z = static_cast(_mm_extract_epi16(vInt, 4)); + pDestination->w = static_cast(_mm_extract_epi16(vInt, 6)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUShort4 +( + XMUSHORT4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, XMVectorZero(), g_UShortMax); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + pDestination->z = static_cast(tmp.z); + pDestination->w = static_cast(tmp.w); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(0)); + vResult = vminq_f32(vResult, g_UShortMax); + uint16x4_t vInt = vmovn_u32(vcvtq_u32_f32(vResult)); + vst1_u16(reinterpret_cast(pDestination), vInt); +#elif defined(_XM_SSE_INTRINSICS_) + // Bounds check + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + vResult = _mm_min_ps(vResult, g_UShortMax); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // Since the SSE pack instruction clamps using signed rules, + // manually extract the values to store them to memory + pDestination->x = static_cast(_mm_extract_epi16(vInt, 0)); + pDestination->y = static_cast(_mm_extract_epi16(vInt, 2)); + pDestination->z = static_cast(_mm_extract_epi16(vInt, 4)); + pDestination->w = static_cast(_mm_extract_epi16(vInt, 6)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreXDecN4 +( + XMXDECN4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + static const XMVECTORF32 Min = { { { -1.0f, -1.0f, -1.0f, 0.0f } } }; + +#if defined(_XM_NO_INTRINSICS_) + + static const XMVECTORF32 Scale = { { { 511.0f, 511.0f, 511.0f, 3.0f } } }; + + XMVECTOR N = XMVectorClamp(V, Min.v, g_XMOne.v); + N = XMVectorMultiply(N, Scale.v); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->v = static_cast( + (static_cast(tmp.w) << 30) + | ((static_cast(tmp.z) & 0x3FF) << 20) + | ((static_cast(tmp.y) & 0x3FF) << 10) + | (static_cast(tmp.x) & 0x3FF)); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 511.0f, 511.0f * 1024.0f, 511.0f * 1048576.0f, 3.0f * 536870912.0f } } }; + static const XMVECTORI32 ScaleMask = { { { 0x3FF, 0x3FF << 10, 0x3FF << 20, 0x3 << 29 } } }; + float32x4_t vResult = vmaxq_f32(V, Min); + vResult = vminq_f32(vResult, vdupq_n_f32(1.0f)); + vResult = vmulq_f32(vResult, Scale); + int32x4_t vResulti = vcvtq_s32_f32(vResult); + vResulti = vandq_s32(vResulti, ScaleMask); + int32x4_t vResultw = vandq_s32(vResulti, g_XMMaskW); + vResulti = vaddq_s32(vResulti, vResultw); + // Do a horizontal or of all 4 entries + uint32x2_t vTemp = vget_low_u32(vreinterpretq_u32_s32(vResulti)); + uint32x2_t vhi = vget_high_u32(vreinterpretq_u32_s32(vResulti)); + vTemp = vorr_u32(vTemp, vhi); + vTemp = vpadd_u32(vTemp, vTemp); + vst1_lane_u32(&pDestination->v, vTemp, 0); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 511.0f, 511.0f * 1024.0f, 511.0f * 1048576.0f, 3.0f * 536870912.0f } } }; + static const XMVECTORI32 ScaleMask = { { { 0x3FF, 0x3FF << 10, 0x3FF << 20, 0x3 << 29 } } }; + XMVECTOR vResult = _mm_max_ps(V, Min); + vResult = _mm_min_ps(vResult, g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult, Scale); + // Convert to int (W is unsigned) + __m128i vResulti = _mm_cvtps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti, ScaleMask); + // To fix W, add itself to shift it up to <<30 instead of <<29 + __m128i vResultw = _mm_and_si128(vResulti, g_XMMaskW); + vResulti = _mm_add_epi32(vResulti, vResultw); + // Do a horizontal or of all 4 entries + vResult = XM_PERMUTE_PS(_mm_castsi128_ps(vResulti), _MM_SHUFFLE(0, 3, 2, 1)); + vResulti = _mm_or_si128(vResulti, _mm_castps_si128(vResult)); + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(0, 3, 2, 1)); + vResulti = _mm_or_si128(vResulti, _mm_castps_si128(vResult)); + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(0, 3, 2, 1)); + vResulti = _mm_or_si128(vResulti, _mm_castps_si128(vResult)); + _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); +#endif +} + +//------------------------------------------------------------------------------ +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4996) +// C4996: ignore deprecation warning +#endif + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreXDec4 +( + XMXDEC4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + static const XMVECTORF32 MinXDec4 = { { { -511.0f, -511.0f, -511.0f, 0.0f } } }; + static const XMVECTORF32 MaxXDec4 = { { { 511.0f, 511.0f, 511.0f, 3.0f } } }; + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, MinXDec4, MaxXDec4); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->v = static_cast( + (static_cast(tmp.w) << 30) + | ((static_cast(tmp.z) & 0x3FF) << 20) + | ((static_cast(tmp.y) & 0x3FF) << 10) + | ((static_cast(tmp.x) & 0x3FF))); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 ScaleXDec4 = { { { 1.0f, 1024.0f / 2.0f, 1024.0f * 1024.0f, 1024.0f * 1024.0f * 1024.0f / 2.0f } } }; + static const XMVECTORI32 MaskXDec4 = { { { 0x3FF, 0x3FF << (10 - 1), 0x3FF << 20, 0x3 << (30 - 1) } } }; + float32x4_t vResult = vmaxq_f32(V, MinXDec4); + vResult = vminq_f32(vResult, MaxXDec4); + vResult = vmulq_f32(vResult, ScaleXDec4); + int32x4_t vResulti = vcvtq_s32_f32(vResult); + vResulti = vandq_s32(vResulti, MaskXDec4); + // Do a horizontal or of 4 entries + uint32x2_t vTemp = vget_low_u32(vreinterpretq_u32_s32(vResulti)); + uint32x2_t vTemp2 = vget_high_u32(vreinterpretq_u32_s32(vResulti)); + vTemp = vorr_u32(vTemp, vTemp2); + // Perform a single bit left shift on y|w + vTemp2 = vdup_lane_u32(vTemp, 1); + vTemp2 = vadd_u32(vTemp2, vTemp2); + vTemp = vorr_u32(vTemp, vTemp2); + vst1_lane_u32(&pDestination->v, vTemp, 0); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 ScaleXDec4 = { { { 1.0f, 1024.0f / 2.0f, 1024.0f * 1024.0f, 1024.0f * 1024.0f * 1024.0f / 2.0f } } }; + static const XMVECTORI32 MaskXDec4 = { { { 0x3FF, 0x3FF << (10 - 1), 0x3FF << 20, 0x3 << (30 - 1) } } }; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V, MinXDec4); + vResult = _mm_min_ps(vResult, MaxXDec4); + // Scale by multiplication + vResult = _mm_mul_ps(vResult, ScaleXDec4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti, MaskXDec4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti, vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); + // Perform a single bit left shift on y|w + vResulti2 = _mm_add_epi32(vResulti2, vResulti2); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti, vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); +#endif +} + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUDecN4 +( + XMUDECN4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + static const XMVECTORF32 Scale = { { { 1023.0f, 1023.0f, 1023.0f, 3.0f } } }; + + XMVECTOR N = XMVectorSaturate(V); + N = XMVectorMultiply(N, Scale.v); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->v = static_cast( + (static_cast(tmp.w) << 30) + | ((static_cast(tmp.z) & 0x3FF) << 20) + | ((static_cast(tmp.y) & 0x3FF) << 10) + | ((static_cast(tmp.x) & 0x3FF))); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 ScaleUDecN4 = { { { 1023.0f, 1023.0f * 1024.0f * 0.5f, 1023.0f * 1024.0f * 1024.0f, 3.0f * 1024.0f * 1024.0f * 1024.0f * 0.5f } } }; + static const XMVECTORI32 MaskUDecN4 = { { { 0x3FF, 0x3FF << (10 - 1), 0x3FF << 20, 0x3 << (30 - 1) } } }; + float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(0.f)); + vResult = vminq_f32(vResult, vdupq_n_f32(1.f)); + vResult = vmulq_f32(vResult, ScaleUDecN4); + uint32x4_t vResulti = vcvtq_u32_f32(vResult); + vResulti = vandq_u32(vResulti, MaskUDecN4); + // Do a horizontal or of 4 entries + uint32x2_t vTemp = vget_low_u32(vResulti); + uint32x2_t vTemp2 = vget_high_u32(vResulti); + vTemp = vorr_u32(vTemp, vTemp2); + // Perform a single bit left shift on y|w + vTemp2 = vdup_lane_u32(vTemp, 1); + vTemp2 = vadd_u32(vTemp2, vTemp2); + vTemp = vorr_u32(vTemp, vTemp2); + vst1_lane_u32(&pDestination->v, vTemp, 0); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 ScaleUDecN4 = { { { 1023.0f, 1023.0f * 1024.0f * 0.5f, 1023.0f * 1024.0f * 1024.0f, 3.0f * 1024.0f * 1024.0f * 1024.0f * 0.5f } } }; + static const XMVECTORI32 MaskUDecN4 = { { { 0x3FF, 0x3FF << (10 - 1), 0x3FF << 20, 0x3 << (30 - 1) } } }; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + vResult = _mm_min_ps(vResult, g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult, ScaleUDecN4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti, MaskUDecN4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti, vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); + // Perform a left shift by one bit on y|w + vResulti2 = _mm_add_epi32(vResulti2, vResulti2); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti, vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUDecN4_XR +( + XMUDECN4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + static const XMVECTORF32 Scale = { { { 510.0f, 510.0f, 510.0f, 3.0f } } }; + static const XMVECTORF32 Bias = { { { 384.0f, 384.0f, 384.0f, 0.0f } } }; + static const XMVECTORF32 C = { { { 1023.f, 1023.f, 1023.f, 3.f } } }; + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorMultiplyAdd(V, Scale, Bias); + N = XMVectorClamp(N, g_XMZero, C); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->v = static_cast( + (static_cast(tmp.w) << 30) + | ((static_cast(tmp.z) & 0x3FF) << 20) + | ((static_cast(tmp.y) & 0x3FF) << 10) + | ((static_cast(tmp.x) & 0x3FF))); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 Shift = { { { 1.0f, 1024.0f * 0.5f, 1024.0f * 1024.0f, 1024.0f * 1024.0f * 1024.0f * 0.5f } } }; + static const XMVECTORU32 MaskUDecN4 = { { { 0x3FF, 0x3FF << (10 - 1), 0x3FF << 20, 0x3 << (30 - 1) } } }; + float32x4_t vResult = vmlaq_f32(Bias, V, Scale); + vResult = vmaxq_f32(vResult, vdupq_n_f32(0.f)); + vResult = vminq_f32(vResult, C); + vResult = vmulq_f32(vResult, Shift); + uint32x4_t vResulti = vcvtq_u32_f32(vResult); + vResulti = vandq_u32(vResulti, MaskUDecN4); + // Do a horizontal or of 4 entries + uint32x2_t vTemp = vget_low_u32(vResulti); + uint32x2_t vTemp2 = vget_high_u32(vResulti); + vTemp = vorr_u32(vTemp, vTemp2); + // Perform a single bit left shift on y|w + vTemp2 = vdup_lane_u32(vTemp, 1); + vTemp2 = vadd_u32(vTemp2, vTemp2); + vTemp = vorr_u32(vTemp, vTemp2); + vst1_lane_u32(&pDestination->v, vTemp, 0); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 Shift = { { { 1.0f, 1024.0f * 0.5f, 1024.0f * 1024.0f, 1024.0f * 1024.0f * 1024.0f * 0.5f } } }; + static const XMVECTORU32 MaskUDecN4 = { { { 0x3FF, 0x3FF << (10 - 1), 0x3FF << 20, 0x3 << (30 - 1) } } }; + // Scale & bias + XMVECTOR vResult = XM_FMADD_PS(V, Scale, Bias); + // Clamp to bounds + vResult = _mm_max_ps(vResult, g_XMZero); + vResult = _mm_min_ps(vResult, C); + // Scale by shift values + vResult = _mm_mul_ps(vResult, Shift); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti, MaskUDecN4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti, vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); + // Perform a left shift by one bit on y|w + vResulti2 = _mm_add_epi32(vResulti2, vResulti2); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti, vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUDec4 +( + XMUDEC4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + static const XMVECTORF32 MaxUDec4 = { { { 1023.0f, 1023.0f, 1023.0f, 3.0f } } }; + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, XMVectorZero(), MaxUDec4); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->v = static_cast( + (static_cast(tmp.w) << 30) + | ((static_cast(tmp.z) & 0x3FF) << 20) + | ((static_cast(tmp.y) & 0x3FF) << 10) + | ((static_cast(tmp.x) & 0x3FF))); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 ScaleUDec4 = { { { 1.0f, 1024.0f / 2.0f, 1024.0f * 1024.0f, 1024.0f * 1024.0f * 1024.0f / 2.0f } } }; + static const XMVECTORI32 MaskUDec4 = { { { 0x3FF, 0x3FF << (10 - 1), 0x3FF << 20, 0x3 << (30 - 1) } } }; + float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(0.f)); + vResult = vminq_f32(vResult, MaxUDec4); + vResult = vmulq_f32(vResult, ScaleUDec4); + uint32x4_t vResulti = vcvtq_u32_f32(vResult); + vResulti = vandq_u32(vResulti, MaskUDec4); + // Do a horizontal or of 4 entries + uint32x2_t vTemp = vget_low_u32(vResulti); + uint32x2_t vTemp2 = vget_high_u32(vResulti); + vTemp = vorr_u32(vTemp, vTemp2); + // Perform a single bit left shift on y|w + vTemp2 = vdup_lane_u32(vTemp, 1); + vTemp2 = vadd_u32(vTemp2, vTemp2); + vTemp = vorr_u32(vTemp, vTemp2); + vst1_lane_u32(&pDestination->v, vTemp, 0); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 ScaleUDec4 = { { { 1.0f, 1024.0f / 2.0f, 1024.0f * 1024.0f, 1024.0f * 1024.0f * 1024.0f / 2.0f } } }; + static const XMVECTORI32 MaskUDec4 = { { { 0x3FF, 0x3FF << (10 - 1), 0x3FF << 20, 0x3 << (30 - 1) } } }; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + vResult = _mm_min_ps(vResult, MaxUDec4); + // Scale by multiplication + vResult = _mm_mul_ps(vResult, ScaleUDec4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti, MaskUDec4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti, vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); + // Perform a left shift by one bit on y|w + vResulti2 = _mm_add_epi32(vResulti2, vResulti2); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti, vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); +#endif +} + +//------------------------------------------------------------------------------ +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4996) +// C4996: ignore deprecation warning +#endif + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreDecN4 +( + XMDECN4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + static const XMVECTORF32 Scale = { { { 511.0f, 511.0f, 511.0f, 1.0f } } }; + + XMVECTOR N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); + N = XMVectorMultiply(N, Scale.v); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->v = static_cast( + (static_cast(tmp.w) << 30) + | ((static_cast(tmp.z) & 0x3FF) << 20) + | ((static_cast(tmp.y) & 0x3FF) << 10) + | ((static_cast(tmp.x) & 0x3FF))); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 ScaleDecN4 = { { { 511.0f, 511.0f * 1024.0f, 511.0f * 1024.0f * 1024.0f, 1.0f * 1024.0f * 1024.0f * 1024.0f } } }; + float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(-1.f)); + vResult = vminq_f32(vResult, vdupq_n_f32(1.f)); + vResult = vmulq_f32(vResult, ScaleDecN4); + int32x4_t vResulti = vcvtq_s32_f32(vResult); + vResulti = vandq_s32(vResulti, g_XMMaskDec4); + // Do a horizontal or of 4 entries + uint32x2_t vTemp = vget_low_u32(vreinterpretq_u32_s32(vResulti)); + uint32x2_t vhi = vget_high_u32(vreinterpretq_u32_s32(vResulti)); + vTemp = vorr_u32(vTemp, vhi); + vTemp = vpadd_u32(vTemp, vTemp); + vst1_lane_u32(&pDestination->v, vTemp, 0); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 ScaleDecN4 = { { { 511.0f, 511.0f * 1024.0f, 511.0f * 1024.0f * 1024.0f, 1.0f * 1024.0f * 1024.0f * 1024.0f } } }; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V, g_XMNegativeOne); + vResult = _mm_min_ps(vResult, g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult, ScaleDecN4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti, g_XMMaskDec4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti, vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti, vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreDec4 +( + XMDEC4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + static const XMVECTORF32 MinDec4 = { { { -511.0f, -511.0f, -511.0f, -1.0f } } }; + static const XMVECTORF32 MaxDec4 = { { { 511.0f, 511.0f, 511.0f, 1.0f } } }; + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, MinDec4, MaxDec4); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->v = static_cast( + (static_cast(tmp.w) << 30) + | ((static_cast(tmp.z) & 0x3FF) << 20) + | ((static_cast(tmp.y) & 0x3FF) << 10) + | ((static_cast(tmp.x) & 0x3FF))); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 ScaleDec4 = { { { 1.0f, 1024.0f, 1024.0f * 1024.0f, 1024.0f * 1024.0f * 1024.0f } } }; + float32x4_t vResult = vmaxq_f32(V, MinDec4); + vResult = vminq_f32(vResult, MaxDec4); + vResult = vmulq_f32(vResult, ScaleDec4); + int32x4_t vResulti = vcvtq_s32_f32(vResult); + vResulti = vandq_s32(vResulti, g_XMMaskDec4); + // Do a horizontal or of all 4 entries + uint32x2_t vTemp = vget_low_u32(vreinterpretq_u32_s32(vResulti)); + uint32x2_t vhi = vget_high_u32(vreinterpretq_u32_s32(vResulti)); + vTemp = vorr_u32(vTemp, vhi); + vTemp = vpadd_u32(vTemp, vTemp); + vst1_lane_u32(&pDestination->v, vTemp, 0); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 ScaleDec4 = { { { 1.0f, 1024.0f, 1024.0f * 1024.0f, 1024.0f * 1024.0f * 1024.0f } } }; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V, MinDec4); + vResult = _mm_min_ps(vResult, MaxDec4); + // Scale by multiplication + vResult = _mm_mul_ps(vResult, ScaleDec4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti, g_XMMaskDec4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti, vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti, vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); +#endif +} + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUByteN4 +( + XMUBYTEN4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorSaturate(V); + N = XMVectorMultiply(N, g_UByteMax); + N = XMVectorTruncate(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + pDestination->z = static_cast(tmp.z); + pDestination->w = static_cast(tmp.w); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t R = vmaxq_f32(V, vdupq_n_f32(0)); + R = vminq_f32(R, vdupq_n_f32(1.0f)); + R = vmulq_n_f32(R, 255.0f); + uint32x4_t vInt32 = vcvtq_u32_f32(R); + uint16x4_t vInt16 = vqmovn_u32(vInt32); + uint8x8_t vInt8 = vqmovn_u16(vcombine_u16(vInt16, vInt16)); + vst1_lane_u32(&pDestination->v, vreinterpret_u32_u8(vInt8), 0); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 ScaleUByteN4 = { { { 255.0f, 255.0f * 256.0f * 0.5f, 255.0f * 256.0f * 256.0f, 255.0f * 256.0f * 256.0f * 256.0f * 0.5f } } }; + static const XMVECTORI32 MaskUByteN4 = { { { 0xFF, 0xFF << (8 - 1), 0xFF << 16, 0xFF << (24 - 1) } } }; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + vResult = _mm_min_ps(vResult, g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult, ScaleUByteN4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti, MaskUByteN4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti, vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); + // Perform a single bit left shift to fix y|w + vResulti2 = _mm_add_epi32(vResulti2, vResulti2); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti, vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUByte4 +( + XMUBYTE4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, XMVectorZero(), g_UByteMax); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + pDestination->z = static_cast(tmp.z); + pDestination->w = static_cast(tmp.w); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t R = vmaxq_f32(V, vdupq_n_f32(0)); + R = vminq_f32(R, vdupq_n_f32(255.0f)); + uint32x4_t vInt32 = vcvtq_u32_f32(R); + uint16x4_t vInt16 = vqmovn_u32(vInt32); + uint8x8_t vInt8 = vqmovn_u16(vcombine_u16(vInt16, vInt16)); + vst1_lane_u32(&pDestination->v, vreinterpret_u32_u8(vInt8), 0); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 ScaleUByte4 = { { { 1.0f, 256.0f * 0.5f, 256.0f * 256.0f, 256.0f * 256.0f * 256.0f * 0.5f } } }; + static const XMVECTORI32 MaskUByte4 = { { { 0xFF, 0xFF << (8 - 1), 0xFF << 16, 0xFF << (24 - 1) } } }; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + vResult = _mm_min_ps(vResult, g_UByteMax); + // Scale by multiplication + vResult = _mm_mul_ps(vResult, ScaleUByte4); + // Convert to int by rounding + __m128i vResulti = _mm_cvtps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti, MaskUByte4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti, vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); + // Perform a single bit left shift to fix y|w + vResulti2 = _mm_add_epi32(vResulti2, vResulti2); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti, vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreByteN4 +( + XMBYTEN4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); + N = XMVectorMultiply(N, g_ByteMax); + N = XMVectorTruncate(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + pDestination->z = static_cast(tmp.z); + pDestination->w = static_cast(tmp.w); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t R = vmaxq_f32(V, vdupq_n_f32(-1.f)); + R = vminq_f32(R, vdupq_n_f32(1.0f)); + R = vmulq_n_f32(R, 127.0f); + int32x4_t vInt32 = vcvtq_s32_f32(R); + int16x4_t vInt16 = vqmovn_s32(vInt32); + int8x8_t vInt8 = vqmovn_s16(vcombine_s16(vInt16, vInt16)); + vst1_lane_u32(&pDestination->v, vreinterpret_u32_s8(vInt8), 0); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 ScaleByteN4 = { { { 127.0f, 127.0f * 256.0f, 127.0f * 256.0f * 256.0f, 127.0f * 256.0f * 256.0f * 256.0f } } }; + static const XMVECTORI32 MaskByteN4 = { { { 0xFF, 0xFF << 8, 0xFF << 16, static_cast(0xFF000000) } } }; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V, g_XMNegativeOne); + vResult = _mm_min_ps(vResult, g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult, ScaleByteN4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti, MaskByteN4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti, vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti, vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreByte4 +( + XMBYTE4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, g_ByteMin, g_ByteMax); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + pDestination->z = static_cast(tmp.z); + pDestination->w = static_cast(tmp.w); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t R = vmaxq_f32(V, vdupq_n_f32(-127.f)); + R = vminq_f32(R, vdupq_n_f32(127.f)); + int32x4_t vInt32 = vcvtq_s32_f32(R); + int16x4_t vInt16 = vqmovn_s32(vInt32); + int8x8_t vInt8 = vqmovn_s16(vcombine_s16(vInt16, vInt16)); + vst1_lane_u32(&pDestination->v, vreinterpret_u32_s8(vInt8), 0); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 ScaleByte4 = { { { 1.0f, 256.0f, 256.0f * 256.0f, 256.0f * 256.0f * 256.0f } } }; + static const XMVECTORI32 MaskByte4 = { { { 0xFF, 0xFF << 8, 0xFF << 16, static_cast(0xFF000000) } } }; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V, g_ByteMin); + vResult = _mm_min_ps(vResult, g_ByteMax); + // Scale by multiplication + vResult = _mm_mul_ps(vResult, ScaleByte4); + // Convert to int by rounding + __m128i vResulti = _mm_cvtps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti, MaskByte4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti, vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti, vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUNibble4 +( + XMUNIBBLE4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + static const XMVECTORF32 Max = { { { 15.0f, 15.0f, 15.0f, 15.0f } } }; +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, XMVectorZero(), Max.v); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->v = static_cast( + ((static_cast(tmp.w) & 0xF) << 12) + | ((static_cast(tmp.z) & 0xF) << 8) + | ((static_cast(tmp.y) & 0xF) << 4) + | (static_cast(tmp.x) & 0xF)); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 1.0f, 16.f, 16.f * 16.f, 16.f * 16.f * 16.f } } }; + static const XMVECTORU32 Mask = { { { 0xF, 0xF << 4, 0xF << 8, 0xF << 12 } } }; + float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(0)); + vResult = vminq_f32(vResult, Max); + vResult = vmulq_f32(vResult, Scale); + uint32x4_t vResulti = vcvtq_u32_f32(vResult); + vResulti = vandq_u32(vResulti, Mask); + // Do a horizontal or of 4 entries + uint32x2_t vTemp = vget_low_u32(vResulti); + uint32x2_t vhi = vget_high_u32(vResulti); + vTemp = vorr_u32(vTemp, vhi); + vTemp = vpadd_u32(vTemp, vTemp); + vst1_lane_u16(&pDestination->v, vreinterpret_u16_u32(vTemp), 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Bounds check + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + vResult = _mm_min_ps(vResult, Max); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // No SSE operations will write to 16-bit values, so we have to extract them manually + auto x = static_cast(_mm_extract_epi16(vInt, 0)); + auto y = static_cast(_mm_extract_epi16(vInt, 2)); + auto z = static_cast(_mm_extract_epi16(vInt, 4)); + auto w = static_cast(_mm_extract_epi16(vInt, 6)); + pDestination->v = static_cast( + ((static_cast(w) & 0xF) << 12) + | ((static_cast(z) & 0xF) << 8) + | ((static_cast(y) & 0xF) << 4) + | ((static_cast(x) & 0xF))); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreU555 +( + XMU555* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + static const XMVECTORF32 Max = { { { 31.0f, 31.0f, 31.0f, 1.0f } } }; + +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR N = XMVectorClamp(V, XMVectorZero(), Max.v); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->v = static_cast( + ((tmp.w > 0.f) ? 0x8000 : 0) + | ((static_cast(tmp.z) & 0x1F) << 10) + | ((static_cast(tmp.y) & 0x1F) << 5) + | (static_cast(tmp.x) & 0x1F)); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 1.0f, 32.f / 2.f, 32.f * 32.f, 32.f * 32.f * 32.f / 2.f } } }; + static const XMVECTORU32 Mask = { { { 0x1F, 0x1F << (5 - 1), 0x1F << 10, 0x1 << (15 - 1) } } }; + float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(0)); + vResult = vminq_f32(vResult, Max); + vResult = vmulq_f32(vResult, Scale); + uint32x4_t vResulti = vcvtq_u32_f32(vResult); + vResulti = vandq_u32(vResulti, Mask); + // Do a horizontal or of 4 entries + uint32x2_t vTemp = vget_low_u32(vResulti); + uint32x2_t vTemp2 = vget_high_u32(vResulti); + vTemp = vorr_u32(vTemp, vTemp2); + // Perform a single bit left shift on y|w + vTemp2 = vdup_lane_u32(vTemp, 1); + vTemp2 = vadd_u32(vTemp2, vTemp2); + vTemp = vorr_u32(vTemp, vTemp2); + vst1_lane_u16(&pDestination->v, vreinterpret_u16_u32(vTemp), 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Bounds check + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + vResult = _mm_min_ps(vResult, Max); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // No SSE operations will write to 16-bit values, so we have to extract them manually + auto x = static_cast(_mm_extract_epi16(vInt, 0)); + auto y = static_cast(_mm_extract_epi16(vInt, 2)); + auto z = static_cast(_mm_extract_epi16(vInt, 4)); + auto w = static_cast(_mm_extract_epi16(vInt, 6)); + pDestination->v = static_cast( + (static_cast(w) ? 0x8000 : 0) + | ((static_cast(z) & 0x1F) << 10) + | ((static_cast(y) & 0x1F) << 5) + | ((static_cast(x) & 0x1F))); +#endif +} + + +/**************************************************************************** + * + * XMCOLOR operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMCOLOR::XMCOLOR +( + float _r, + float _g, + float _b, + float _a +) noexcept +{ + XMStoreColor(this, XMVectorSet(_r, _g, _b, _a)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMCOLOR::XMCOLOR(const float* pArray) noexcept +{ + XMStoreColor(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMHALF2 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMHALF2::XMHALF2 +( + float _x, + float _y +) noexcept +{ + x = XMConvertFloatToHalf(_x); + y = XMConvertFloatToHalf(_y); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMHALF2::XMHALF2(const float* pArray) noexcept +{ + assert(pArray != nullptr); + x = XMConvertFloatToHalf(pArray[0]); + y = XMConvertFloatToHalf(pArray[1]); +} + +/**************************************************************************** + * + * XMSHORTN2 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMSHORTN2::XMSHORTN2 +( + float _x, + float _y +) noexcept +{ + XMStoreShortN2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMSHORTN2::XMSHORTN2(const float* pArray) noexcept +{ + XMStoreShortN2(this, XMLoadFloat2(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMSHORT2 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMSHORT2::XMSHORT2 +( + float _x, + float _y +) noexcept +{ + XMStoreShort2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMSHORT2::XMSHORT2(const float* pArray) noexcept +{ + XMStoreShort2(this, XMLoadFloat2(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMUSHORTN2 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMUSHORTN2::XMUSHORTN2 +( + float _x, + float _y +) noexcept +{ + XMStoreUShortN2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMUSHORTN2::XMUSHORTN2(const float* pArray) noexcept +{ + XMStoreUShortN2(this, XMLoadFloat2(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMUSHORT2 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMUSHORT2::XMUSHORT2 +( + float _x, + float _y +) noexcept +{ + XMStoreUShort2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMUSHORT2::XMUSHORT2(const float* pArray) noexcept +{ + XMStoreUShort2(this, XMLoadFloat2(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMBYTEN2 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMBYTEN2::XMBYTEN2 +( + float _x, + float _y +) noexcept +{ + XMStoreByteN2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMBYTEN2::XMBYTEN2(const float* pArray) noexcept +{ + XMStoreByteN2(this, XMLoadFloat2(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMBYTE2 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMBYTE2::XMBYTE2 +( + float _x, + float _y +) noexcept +{ + XMStoreByte2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMBYTE2::XMBYTE2(const float* pArray) noexcept +{ + XMStoreByte2(this, XMLoadFloat2(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMUBYTEN2 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMUBYTEN2::XMUBYTEN2 +( + float _x, + float _y +) noexcept +{ + XMStoreUByteN2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMUBYTEN2::XMUBYTEN2(const float* pArray) noexcept +{ + XMStoreUByteN2(this, XMLoadFloat2(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMUBYTE2 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMUBYTE2::XMUBYTE2 +( + float _x, + float _y +) noexcept +{ + XMStoreUByte2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMUBYTE2::XMUBYTE2(const float* pArray) noexcept +{ + XMStoreUByte2(this, XMLoadFloat2(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMU565 operators + * + ****************************************************************************/ + +inline XMU565::XMU565 +( + float _x, + float _y, + float _z +) noexcept +{ + XMStoreU565(this, XMVectorSet(_x, _y, _z, 0.0f)); +} + +_Use_decl_annotations_ +inline XMU565::XMU565(const float* pArray) noexcept +{ + XMStoreU565(this, XMLoadFloat3(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMFLOAT3PK operators + * + ****************************************************************************/ + +inline XMFLOAT3PK::XMFLOAT3PK +( + float _x, + float _y, + float _z +) noexcept +{ + XMStoreFloat3PK(this, XMVectorSet(_x, _y, _z, 0.0f)); +} + +_Use_decl_annotations_ +inline XMFLOAT3PK::XMFLOAT3PK(const float* pArray) noexcept +{ + XMStoreFloat3PK(this, XMLoadFloat3(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMFLOAT3SE operators + * + ****************************************************************************/ + +inline XMFLOAT3SE::XMFLOAT3SE +( + float _x, + float _y, + float _z +) noexcept +{ + XMStoreFloat3SE(this, XMVectorSet(_x, _y, _z, 0.0f)); +} + +_Use_decl_annotations_ +inline XMFLOAT3SE::XMFLOAT3SE(const float* pArray) noexcept +{ + XMStoreFloat3SE(this, XMLoadFloat3(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMHALF4 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMHALF4::XMHALF4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + x = XMConvertFloatToHalf(_x); + y = XMConvertFloatToHalf(_y); + z = XMConvertFloatToHalf(_z); + w = XMConvertFloatToHalf(_w); +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline XMHALF4::XMHALF4(const float* pArray) noexcept +{ + XMConvertFloatToHalfStream(&x, sizeof(HALF), pArray, sizeof(float), 4); +} + +/**************************************************************************** + * + * XMSHORTN4 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMSHORTN4::XMSHORTN4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreShortN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMSHORTN4::XMSHORTN4(const float* pArray) noexcept +{ + XMStoreShortN4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMSHORT4 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMSHORT4::XMSHORT4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreShort4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMSHORT4::XMSHORT4(const float* pArray) noexcept +{ + XMStoreShort4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMUSHORTN4 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMUSHORTN4::XMUSHORTN4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreUShortN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMUSHORTN4::XMUSHORTN4(const float* pArray) noexcept +{ + XMStoreUShortN4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMUSHORT4 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMUSHORT4::XMUSHORT4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreUShort4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMUSHORT4::XMUSHORT4(const float* pArray) noexcept +{ + XMStoreUShort4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMXDECN4 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMXDECN4::XMXDECN4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreXDecN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMXDECN4::XMXDECN4(const float* pArray) noexcept +{ + XMStoreXDecN4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMXDEC4 operators + * + ****************************************************************************/ +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4996) + // C4996: ignore deprecation warning +#endif + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + + //------------------------------------------------------------------------------ + +inline XMXDEC4::XMXDEC4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreXDec4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMXDEC4::XMXDEC4(const float* pArray) noexcept +{ + XMStoreXDec4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMDECN4 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMDECN4::XMDECN4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreDecN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMDECN4::XMDECN4(const float* pArray) noexcept +{ + XMStoreDecN4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMDEC4 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMDEC4::XMDEC4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreDec4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMDEC4::XMDEC4(const float* pArray) noexcept +{ + XMStoreDec4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +/**************************************************************************** + * + * XMUDECN4 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMUDECN4::XMUDECN4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreUDecN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMUDECN4::XMUDECN4(const float* pArray) noexcept +{ + XMStoreUDecN4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMUDEC4 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMUDEC4::XMUDEC4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreUDec4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMUDEC4::XMUDEC4(const float* pArray) noexcept +{ + XMStoreUDec4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMBYTEN4 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMBYTEN4::XMBYTEN4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreByteN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMBYTEN4::XMBYTEN4(const float* pArray) noexcept +{ + XMStoreByteN4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMBYTE4 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMBYTE4::XMBYTE4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreByte4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMBYTE4::XMBYTE4(const float* pArray) noexcept +{ + XMStoreByte4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMUBYTEN4 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMUBYTEN4::XMUBYTEN4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreUByteN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMUBYTEN4::XMUBYTEN4(const float* pArray) noexcept +{ + XMStoreUByteN4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMUBYTE4 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMUBYTE4::XMUBYTE4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreUByte4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMUBYTE4::XMUBYTE4(const float* pArray) noexcept +{ + XMStoreUByte4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMUNIBBLE4 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMUNIBBLE4::XMUNIBBLE4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreUNibble4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMUNIBBLE4::XMUNIBBLE4(const float* pArray) noexcept +{ + XMStoreUNibble4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMU555 operators + * + ****************************************************************************/ + + //------------------------------------------------------------------------------ + +inline XMU555::XMU555 +( + float _x, + float _y, + float _z, + bool _w +) noexcept +{ + XMStoreU555(this, XMVectorSet(_x, _y, _z, ((_w) ? 1.0f : 0.0f))); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMU555::XMU555 +( + const float* pArray, + bool _w +) noexcept +{ + XMVECTOR V = XMLoadFloat3(reinterpret_cast(pArray)); + XMStoreU555(this, XMVectorSetW(V, ((_w) ? 1.0f : 0.0f))); +} + diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/dxguids/dxguids.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/dxguids/dxguids.h new file mode 100644 index 0000000..b9a7b08 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/dxguids/dxguids.h @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +#pragma once + +#ifndef __cplusplus +#error "This header requires C++" +#endif + +constexpr inline bool ConstexprIsEqualGUID(REFGUID a, REFGUID b) +{ + return a.Data1 == b.Data1 && + a.Data2 == b.Data2 && + a.Data3 == b.Data3 && + a.Data4[0] == b.Data4[0] && + a.Data4[1] == b.Data4[1] && + a.Data4[2] == b.Data4[2] && + a.Data4[3] == b.Data4[3] && + a.Data4[4] == b.Data4[4] && + a.Data4[5] == b.Data4[5] && + a.Data4[6] == b.Data4[6] && + a.Data4[7] == b.Data4[7]; +} + +template GUID uuidof() = delete; +template GUID uuidof(T*) { return uuidof(); } +template GUID uuidof(T**) { return uuidof(); } +template GUID uuidof(T&) { return uuidof(); } + +// Each COM interface (e.g. ID3D12Device) has a unique interface ID (IID) associated with it. With MSVC, the IID is defined +// along with the interface declaration using compiler intrinsics (__declspec(uuid(...)); the IID can then be retrieved +// using __uuidof. These intrinsics are not supported with all toolchains, so these helpers redefine IID values that can be +// used with the various adapter COM helpers (ComPtr, IID_PPV_ARGS, etc.) for Linux. IIDs are stable and cannot change, but as +// a precaution we statically assert the values are as expected when compiling for Windows. +#if defined(_MSC_VER) +#define _DXGUIDS_SUPPORT_STATIC_ASSERT_IID +#elif defined(__CRT_UUID_DECL) +/* match _mingw.h */ +#if __cpp_constexpr >= 200704l && __cpp_inline_variables >= 201606L +#define _DXGUIDS_SUPPORT_STATIC_ASSERT_IID +#endif /* __cpp_constexpr >= 200704l && __cpp_inline_variables >= 201606L */ +#endif /* _MSC_VER */ + +#ifdef _DXGUIDS_SUPPORT_STATIC_ASSERT_IID +#define _WINADAPTER_ASSERT_IID(InterfaceName) \ +static_assert(ConstexprIsEqualGUID(uuidof(), __uuidof(InterfaceName)), "GUID definition mismatch: "#InterfaceName); +#else +#define _WINADAPTER_ASSERT_IID(InterfaceName) +#endif + +#ifdef __CRT_UUID_DECL +#define WINADAPTER_IID(InterfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ +template <> constexpr GUID uuidof() \ +{ \ + return { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }; \ +} \ +__CRT_UUID_DECL(InterfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ +_WINADAPTER_ASSERT_IID(InterfaceName) +#else +#define WINADAPTER_IID(InterfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ +template <> constexpr GUID uuidof() \ +{ \ + return { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }; \ +} \ +_WINADAPTER_ASSERT_IID(InterfaceName) +#endif /* defined(_WIN32) && defined(__MINGW32__) */ + +// Direct3D +#ifdef __d3d12_h__ +WINADAPTER_IID(ID3D12Object, 0xc4fec28f, 0x7966, 0x4e95, 0x9f, 0x94, 0xf4, 0x31, 0xcb, 0x56, 0xc3, 0xb8); +WINADAPTER_IID(ID3D12DeviceChild, 0x905db94b, 0xa00c, 0x4140, 0x9d, 0xf5, 0x2b, 0x64, 0xca, 0x9e, 0xa3, 0x57); +WINADAPTER_IID(ID3D12RootSignature, 0xc54a6b66, 0x72df, 0x4ee8, 0x8b, 0xe5, 0xa9, 0x46, 0xa1, 0x42, 0x92, 0x14); +WINADAPTER_IID(ID3D12RootSignatureDeserializer, 0x34AB647B, 0x3CC8, 0x46AC, 0x84, 0x1B, 0xC0, 0x96, 0x56, 0x45, 0xC0, 0x46); +WINADAPTER_IID(ID3D12VersionedRootSignatureDeserializer, 0x7F91CE67, 0x090C, 0x4BB7, 0xB7, 0x8E, 0xED, 0x8F, 0xF2, 0xE3, 0x1D, 0xA0); +WINADAPTER_IID(ID3D12Pageable, 0x63ee58fb, 0x1268, 0x4835, 0x86, 0xda, 0xf0, 0x08, 0xce, 0x62, 0xf0, 0xd6); +WINADAPTER_IID(ID3D12Heap, 0x6b3b2502, 0x6e51, 0x45b3, 0x90, 0xee, 0x98, 0x84, 0x26, 0x5e, 0x8d, 0xf3); +WINADAPTER_IID(ID3D12Resource, 0x696442be, 0xa72e, 0x4059, 0xbc, 0x79, 0x5b, 0x5c, 0x98, 0x04, 0x0f, 0xad); +WINADAPTER_IID(ID3D12CommandAllocator, 0x6102dee4, 0xaf59, 0x4b09, 0xb9, 0x99, 0xb4, 0x4d, 0x73, 0xf0, 0x9b, 0x24); +WINADAPTER_IID(ID3D12Fence, 0x0a753dcf, 0xc4d8, 0x4b91, 0xad, 0xf6, 0xbe, 0x5a, 0x60, 0xd9, 0x5a, 0x76); +WINADAPTER_IID(ID3D12Fence1, 0x433685fe, 0xe22b, 0x4ca0, 0xa8, 0xdb, 0xb5, 0xb4, 0xf4, 0xdd, 0x0e, 0x4a); +WINADAPTER_IID(ID3D12PipelineState, 0x765a30f3, 0xf624, 0x4c6f, 0xa8, 0x28, 0xac, 0xe9, 0x48, 0x62, 0x24, 0x45); +WINADAPTER_IID(ID3D12DescriptorHeap, 0x8efb471d, 0x616c, 0x4f49, 0x90, 0xf7, 0x12, 0x7b, 0xb7, 0x63, 0xfa, 0x51); +WINADAPTER_IID(ID3D12QueryHeap, 0x0d9658ae, 0xed45, 0x469e, 0xa6, 0x1d, 0x97, 0x0e, 0xc5, 0x83, 0xca, 0xb4); +WINADAPTER_IID(ID3D12CommandSignature, 0xc36a797c, 0xec80, 0x4f0a, 0x89, 0x85, 0xa7, 0xb2, 0x47, 0x50, 0x82, 0xd1); +WINADAPTER_IID(ID3D12CommandList, 0x7116d91c, 0xe7e4, 0x47ce, 0xb8, 0xc6, 0xec, 0x81, 0x68, 0xf4, 0x37, 0xe5); +WINADAPTER_IID(ID3D12GraphicsCommandList, 0x5b160d0f, 0xac1b, 0x4185, 0x8b, 0xa8, 0xb3, 0xae, 0x42, 0xa5, 0xa4, 0x55); +WINADAPTER_IID(ID3D12GraphicsCommandList1, 0x553103fb, 0x1fe7, 0x4557, 0xbb, 0x38, 0x94, 0x6d, 0x7d, 0x0e, 0x7c, 0xa7); +WINADAPTER_IID(ID3D12GraphicsCommandList2, 0x38C3E585, 0xFF17, 0x412C, 0x91, 0x50, 0x4F, 0xC6, 0xF9, 0xD7, 0x2A, 0x28); +WINADAPTER_IID(ID3D12CommandQueue, 0x0ec870a6, 0x5d7e, 0x4c22, 0x8c, 0xfc, 0x5b, 0xaa, 0xe0, 0x76, 0x16, 0xed); +WINADAPTER_IID(ID3D12Device, 0x189819f1, 0x1db6, 0x4b57, 0xbe, 0x54, 0x18, 0x21, 0x33, 0x9b, 0x85, 0xf7); +WINADAPTER_IID(ID3D12PipelineLibrary, 0xc64226a8, 0x9201, 0x46af, 0xb4, 0xcc, 0x53, 0xfb, 0x9f, 0xf7, 0x41, 0x4f); +WINADAPTER_IID(ID3D12PipelineLibrary1, 0x80eabf42, 0x2568, 0x4e5e, 0xbd, 0x82, 0xc3, 0x7f, 0x86, 0x96, 0x1d, 0xc3); +WINADAPTER_IID(ID3D12Device1, 0x77acce80, 0x638e, 0x4e65, 0x88, 0x95, 0xc1, 0xf2, 0x33, 0x86, 0x86, 0x3e); +WINADAPTER_IID(ID3D12Device2, 0x30baa41e, 0xb15b, 0x475c, 0xa0, 0xbb, 0x1a, 0xf5, 0xc5, 0xb6, 0x43, 0x28); +WINADAPTER_IID(ID3D12Device3, 0x81dadc15, 0x2bad, 0x4392, 0x93, 0xc5, 0x10, 0x13, 0x45, 0xc4, 0xaa, 0x98); +WINADAPTER_IID(ID3D12ProtectedSession, 0xA1533D18, 0x0AC1, 0x4084, 0x85, 0xB9, 0x89, 0xA9, 0x61, 0x16, 0x80, 0x6B); +WINADAPTER_IID(ID3D12ProtectedResourceSession, 0x6CD696F4, 0xF289, 0x40CC, 0x80, 0x91, 0x5A, 0x6C, 0x0A, 0x09, 0x9C, 0x3D); +WINADAPTER_IID(ID3D12Device4, 0xe865df17, 0xa9ee, 0x46f9, 0xa4, 0x63, 0x30, 0x98, 0x31, 0x5a, 0xa2, 0xe5); +WINADAPTER_IID(ID3D12LifetimeOwner, 0xe667af9f, 0xcd56, 0x4f46, 0x83, 0xce, 0x03, 0x2e, 0x59, 0x5d, 0x70, 0xa8); +WINADAPTER_IID(ID3D12SwapChainAssistant, 0xf1df64b6, 0x57fd, 0x49cd, 0x88, 0x07, 0xc0, 0xeb, 0x88, 0xb4, 0x5c, 0x8f); +WINADAPTER_IID(ID3D12LifetimeTracker, 0x3fd03d36, 0x4eb1, 0x424a, 0xa5, 0x82, 0x49, 0x4e, 0xcb, 0x8b, 0xa8, 0x13); +WINADAPTER_IID(ID3D12StateObject, 0x47016943, 0xfca8, 0x4594, 0x93, 0xea, 0xaf, 0x25, 0x8b, 0x55, 0x34, 0x6d); +WINADAPTER_IID(ID3D12StateObjectProperties, 0xde5fa827, 0x9bf9, 0x4f26, 0x89, 0xff, 0xd7, 0xf5, 0x6f, 0xde, 0x38, 0x60); +WINADAPTER_IID(ID3D12Device5, 0x8b4f173b, 0x2fea, 0x4b80, 0x8f, 0x58, 0x43, 0x07, 0x19, 0x1a, 0xb9, 0x5d); +WINADAPTER_IID(ID3D12DeviceRemovedExtendedDataSettings, 0x82BC481C, 0x6B9B, 0x4030, 0xAE, 0xDB, 0x7E, 0xE3, 0xD1, 0xDF, 0x1E, 0x63); +WINADAPTER_IID(ID3D12DeviceRemovedExtendedDataSettings1, 0xDBD5AE51, 0x3317, 0x4F0A, 0xAD, 0xF9, 0x1D, 0x7C, 0xED, 0xCA, 0xAE, 0x0B); +WINADAPTER_IID(ID3D12DeviceRemovedExtendedDataSettings2, 0x61552388, 0x01ab, 0x4008, 0xa4, 0x36, 0x83, 0xdb, 0x18, 0x95, 0x66, 0xea); +WINADAPTER_IID(ID3D12DeviceRemovedExtendedData, 0x98931D33, 0x5AE8, 0x4791, 0xAA, 0x3C, 0x1A, 0x73, 0xA2, 0x93, 0x4E, 0x71); +WINADAPTER_IID(ID3D12DeviceRemovedExtendedData1, 0x9727A022, 0xCF1D, 0x4DDA, 0x9E, 0xBA, 0xEF, 0xFA, 0x65, 0x3F, 0xC5, 0x06); +WINADAPTER_IID(ID3D12DeviceRemovedExtendedData2, 0x67FC5816, 0xE4CA, 0x4915, 0xBF, 0x18, 0x42, 0x54, 0x12, 0x72, 0xDA, 0x54); +WINADAPTER_IID(ID3D12Device6, 0xc70b221b, 0x40e4, 0x4a17, 0x89, 0xaf, 0x02, 0x5a, 0x07, 0x27, 0xa6, 0xdc); +WINADAPTER_IID(ID3D12ProtectedResourceSession1, 0xD6F12DD6, 0x76FB, 0x406E, 0x89, 0x61, 0x42, 0x96, 0xEE, 0xFC, 0x04, 0x09); +WINADAPTER_IID(ID3D12Device7, 0x5c014b53, 0x68a1, 0x4b9b, 0x8b, 0xd1, 0xdd, 0x60, 0x46, 0xb9, 0x35, 0x8b); +WINADAPTER_IID(ID3D12Device8, 0x9218E6BB, 0xF944, 0x4F7E, 0xA7, 0x5C, 0xB1, 0xB2, 0xC7, 0xB7, 0x01, 0xF3); +WINADAPTER_IID(ID3D12Resource1, 0x9D5E227A, 0x4430, 0x4161, 0x88, 0xB3, 0x3E, 0xCA, 0x6B, 0xB1, 0x6E, 0x19); +WINADAPTER_IID(ID3D12Resource2, 0xBE36EC3B, 0xEA85, 0x4AEB, 0xA4, 0x5A, 0xE9, 0xD7, 0x64, 0x04, 0xA4, 0x95); +WINADAPTER_IID(ID3D12Heap1, 0x572F7389, 0x2168, 0x49E3, 0x96, 0x93, 0xD6, 0xDF, 0x58, 0x71, 0xBF, 0x6D); +WINADAPTER_IID(ID3D12GraphicsCommandList3, 0x6FDA83A7, 0xB84C, 0x4E38, 0x9A, 0xC8, 0xC7, 0xBD, 0x22, 0x01, 0x6B, 0x3D); +WINADAPTER_IID(ID3D12MetaCommand, 0xDBB84C27, 0x36CE, 0x4FC9, 0xB8, 0x01, 0xF0, 0x48, 0xC4, 0x6A, 0xC5, 0x70); +WINADAPTER_IID(ID3D12GraphicsCommandList4, 0x8754318e, 0xd3a9, 0x4541, 0x98, 0xcf, 0x64, 0x5b, 0x50, 0xdc, 0x48, 0x74); +WINADAPTER_IID(ID3D12ShaderCacheSession, 0x28e2495d, 0x0f64, 0x4ae4, 0xa6, 0xec, 0x12, 0x92, 0x55, 0xdc, 0x49, 0xa8); +WINADAPTER_IID(ID3D12Device9, 0x4c80e962, 0xf032, 0x4f60, 0xbc, 0x9e, 0xeb, 0xc2, 0xcf, 0xa1, 0xd8, 0x3c); +WINADAPTER_IID(ID3D12Device10, 0x517f8718, 0xaa66, 0x49f9, 0xb0, 0x2b, 0xa7, 0xab, 0x89, 0xc0, 0x60, 0x31); +WINADAPTER_IID(ID3D12Device11, 0x5405c344, 0xd457, 0x444e, 0xb4, 0xdd, 0x23, 0x66, 0xe4, 0x5a, 0xee, 0x39); +WINADAPTER_IID(ID3D12VirtualizationGuestDevice, 0xbc66d368, 0x7373, 0x4943, 0x87, 0x57, 0xfc, 0x87, 0xdc, 0x79, 0xe4, 0x76); +WINADAPTER_IID(ID3D12Tools, 0x7071e1f0, 0xe84b, 0x4b33, 0x97, 0x4f, 0x12, 0xfa, 0x49, 0xde, 0x65, 0xc5); +WINADAPTER_IID(ID3D12SDKConfiguration, 0xe9eb5314, 0x33aa, 0x42b2, 0xa7, 0x18, 0xd7, 0x7f, 0x58, 0xb1, 0xf1, 0xc7); +WINADAPTER_IID(ID3D12SDKConfiguration1, 0x8aaf9303, 0xad25, 0x48b9, 0x9a, 0x57, 0xd9, 0xc3, 0x7e, 0x00, 0x9d, 0x9f); +WINADAPTER_IID(ID3D12DeviceFactory, 0x61f307d3, 0xd34e, 0x4e7c, 0x83, 0x74, 0x3b, 0xa4, 0xde, 0x23, 0xcc, 0xcb); +WINADAPTER_IID(ID3D12DeviceConfiguration, 0x78dbf87b, 0xf766, 0x422b, 0xa6, 0x1c, 0xc8, 0xc4, 0x46, 0xbd, 0xb9, 0xad); +WINADAPTER_IID(ID3D12GraphicsCommandList5, 0x55050859, 0x4024, 0x474c, 0x87, 0xf5, 0x64, 0x72, 0xea, 0xee, 0x44, 0xea); +WINADAPTER_IID(ID3D12GraphicsCommandList6, 0xc3827890, 0xe548, 0x4cfa, 0x96, 0xcf, 0x56, 0x89, 0xa9, 0x37, 0x0f, 0x80); +WINADAPTER_IID(ID3D12GraphicsCommandList7, 0xdd171223, 0x8b61, 0x4769, 0x90, 0xe3, 0x16, 0x0c, 0xcd, 0xe4, 0xe2, 0xc1); +WINADAPTER_IID(ID3D12GraphicsCommandList8, 0xee936ef9, 0x599d, 0x4d28, 0x93, 0x8e, 0x23, 0xc4, 0xad, 0x05, 0xce, 0x51); +#endif + +// Direct3D Video +#ifdef __d3d12video_h__ +WINADAPTER_IID(ID3D12VideoDecoderHeap,0x0946B7C9,0xEBF6,0x4047,0xBB,0x73,0x86,0x83,0xE2,0x7D,0xBB,0x1F); +WINADAPTER_IID(ID3D12VideoDevice,0x1F052807,0x0B46,0x4ACC,0x8A,0x89,0x36,0x4F,0x79,0x37,0x18,0xA4); +WINADAPTER_IID(ID3D12VideoDecoder,0xC59B6BDC,0x7720,0x4074,0xA1,0x36,0x17,0xA1,0x56,0x03,0x74,0x70); +WINADAPTER_IID(ID3D12VideoProcessor,0x304FDB32,0xBEDE,0x410A,0x85,0x45,0x94,0x3A,0xC6,0xA4,0x61,0x38); +WINADAPTER_IID(ID3D12VideoDecodeCommandList,0x3B60536E,0xAD29,0x4E64,0xA2,0x69,0xF8,0x53,0x83,0x7E,0x5E,0x53); +WINADAPTER_IID(ID3D12VideoProcessCommandList,0xAEB2543A,0x167F,0x4682,0xAC,0xC8,0xD1,0x59,0xED,0x4A,0x62,0x09); +WINADAPTER_IID(ID3D12VideoDecodeCommandList1,0xD52F011B,0xB56E,0x453C,0xA0,0x5A,0xA7,0xF3,0x11,0xC8,0xF4,0x72); +WINADAPTER_IID(ID3D12VideoProcessCommandList1,0x542C5C4D,0x7596,0x434F,0x8C,0x93,0x4E,0xFA,0x67,0x66,0xF2,0x67); +WINADAPTER_IID(ID3D12VideoMotionEstimator,0x33FDAE0E,0x098B,0x428F,0x87,0xBB,0x34,0xB6,0x95,0xDE,0x08,0xF8); +WINADAPTER_IID(ID3D12VideoMotionVectorHeap,0x5BE17987,0x743A,0x4061,0x83,0x4B,0x23,0xD2,0x2D,0xAE,0xA5,0x05); +WINADAPTER_IID(ID3D12VideoDevice1,0x981611AD,0xA144,0x4C83,0x98,0x90,0xF3,0x0E,0x26,0xD6,0x58,0xAB); +WINADAPTER_IID(ID3D12VideoEncodeCommandList,0x8455293A,0x0CBD,0x4831,0x9B,0x39,0xFB,0xDB,0xAB,0x72,0x47,0x23); +WINADAPTER_IID(ID3D12VideoDecoder1,0x79A2E5FB,0xCCD2,0x469A,0x9F,0xDE,0x19,0x5D,0x10,0x95,0x1F,0x7E); +WINADAPTER_IID(ID3D12VideoDecoderHeap1,0xDA1D98C5,0x539F,0x41B2,0xBF,0x6B,0x11,0x98,0xA0,0x3B,0x6D,0x26); +WINADAPTER_IID(ID3D12VideoProcessor1,0xF3CFE615,0x553F,0x425C,0x86,0xD8,0xEE,0x8C,0x1B,0x1F,0xB0,0x1C); +WINADAPTER_IID(ID3D12VideoExtensionCommand,0x554E41E8,0xAE8E,0x4A8C,0xB7,0xD2,0x5B,0x4F,0x27,0x4A,0x30,0xE4); +WINADAPTER_IID(ID3D12VideoDevice2,0xF019AC49,0xF838,0x4A95,0x9B,0x17,0x57,0x94,0x37,0xC8,0xF5,0x13); +WINADAPTER_IID(ID3D12VideoDecodeCommandList2,0x6e120880,0xc114,0x4153,0x80,0x36,0xd2,0x47,0x05,0x1e,0x17,0x29); +WINADAPTER_IID(ID3D12VideoDecodeCommandList3,0x2aee8c37,0x9562,0x42da,0x8a,0xbf,0x61,0xef,0xeb,0x2e,0x45,0x13); +WINADAPTER_IID(ID3D12VideoProcessCommandList2,0xdb525ae4,0x6ad6,0x473c,0xba,0xa7,0x59,0xb2,0xe3,0x70,0x82,0xe4); +WINADAPTER_IID(ID3D12VideoProcessCommandList3,0x1a0a4ca4,0x9f08,0x40ce,0x95,0x58,0xb4,0x11,0xfd,0x26,0x66,0xff); +WINADAPTER_IID(ID3D12VideoEncodeCommandList1,0x94971eca,0x2bdb,0x4769,0x88,0xcf,0x36,0x75,0xea,0x75,0x7e,0xbc); +WINADAPTER_IID(ID3D12VideoEncoder,0x2E0D212D,0x8DF9,0x44A6,0xA7,0x70,0xBB,0x28,0x9B,0x18,0x27,0x37); +WINADAPTER_IID(ID3D12VideoEncoderHeap,0x22B35D96,0x876A,0x44C0,0xB2,0x5E,0xFB,0x8C,0x9C,0x7F,0x1C,0x4A); +WINADAPTER_IID(ID3D12VideoDevice3,0x4243ADB4,0x3A32,0x4666,0x97,0x3C,0x0C,0xCC,0x56,0x25,0xDC,0x44); +WINADAPTER_IID(ID3D12VideoEncodeCommandList2,0x895491e2,0xe701,0x46a9,0x9a,0x1f,0x8d,0x34,0x80,0xed,0x86,0x7a); +WINADAPTER_IID(ID3D12VideoEncodeCommandList3,0x7f027b22,0x1515,0x4e85,0xaa,0x0d,0x02,0x64,0x86,0x58,0x05,0x76); +#endif + +#ifdef __d3d12sdklayers_h__ +WINADAPTER_IID(ID3D12Debug, 0x344488b7, 0x6846, 0x474b, 0xb9, 0x89, 0xf0, 0x27, 0x44, 0x82, 0x45, 0xe0); +WINADAPTER_IID(ID3D12Debug1, 0xaffaa4ca, 0x63fe, 0x4d8e, 0xb8, 0xad, 0x15, 0x90, 0x00, 0xaf, 0x43, 0x04); +WINADAPTER_IID(ID3D12Debug2, 0x93a665c4, 0xa3b2, 0x4e5d, 0xb6, 0x92, 0xa2, 0x6a, 0xe1, 0x4e, 0x33, 0x74); +WINADAPTER_IID(ID3D12Debug3, 0x5cf4e58f, 0xf671, 0x4ff1, 0xa5, 0x42, 0x36, 0x86, 0xe3, 0xd1, 0x53, 0xd1); +WINADAPTER_IID(ID3D12Debug4, 0x014b816e, 0x9ec5, 0x4a2f, 0xa8, 0x45, 0xff, 0xbe, 0x44, 0x1c, 0xe1, 0x3a); +WINADAPTER_IID(ID3D12Debug5, 0x548d6b12, 0x09fa, 0x40e0, 0x90, 0x69, 0x5d, 0xcd, 0x58, 0x9a, 0x52, 0xc9); +WINADAPTER_IID(ID3D12Debug6, 0x82a816d6, 0x5d01, 0x4157, 0x97, 0xd0, 0x49, 0x75, 0x46, 0x3f, 0xd1, 0xed); +WINADAPTER_IID(ID3D12DebugDevice1, 0xa9b71770, 0xd099, 0x4a65, 0xa6, 0x98, 0x3d, 0xee, 0x10, 0x02, 0x0f, 0x88); +WINADAPTER_IID(ID3D12DebugDevice, 0x3febd6dd, 0x4973, 0x4787, 0x81, 0x94, 0xe4, 0x5f, 0x9e, 0x28, 0x92, 0x3e); +WINADAPTER_IID(ID3D12DebugDevice2, 0x60eccbc1, 0x378d, 0x4df1, 0x89, 0x4c, 0xf8, 0xac, 0x5c, 0xe4, 0xd7, 0xdd); +WINADAPTER_IID(ID3D12DebugCommandQueue, 0x09e0bf36, 0x54ac, 0x484f, 0x88, 0x47, 0x4b, 0xae, 0xea, 0xb6, 0x05, 0x3a); +WINADAPTER_IID(ID3D12DebugCommandQueue1, 0x16be35a2, 0xbfd6, 0x49f2, 0xbc, 0xae, 0xea, 0xae, 0x4a, 0xff, 0x86, 0x2d); +WINADAPTER_IID(ID3D12DebugCommandList1, 0x102ca951, 0x311b, 0x4b01, 0xb1, 0x1f, 0xec, 0xb8, 0x3e, 0x06, 0x1b, 0x37); +WINADAPTER_IID(ID3D12DebugCommandList, 0x09e0bf36, 0x54ac, 0x484f, 0x88, 0x47, 0x4b, 0xae, 0xea, 0xb6, 0x05, 0x3f); +WINADAPTER_IID(ID3D12DebugCommandList2, 0xaeb575cf, 0x4e06, 0x48be, 0xba, 0x3b, 0xc4, 0x50, 0xfc, 0x96, 0x65, 0x2e); +WINADAPTER_IID(ID3D12DebugCommandList3, 0x197d5e15, 0x4d37, 0x4d34, 0xaf, 0x78, 0x72, 0x4c, 0xd7, 0x0f, 0xdb, 0x1f); +WINADAPTER_IID(ID3D12SharingContract, 0x0adf7d52, 0x929c, 0x4e61, 0xad, 0xdb, 0xff, 0xed, 0x30, 0xde, 0x66, 0xef); +WINADAPTER_IID(ID3D12InfoQueue, 0x0742a90b, 0xc387, 0x483f, 0xb9, 0x46, 0x30, 0xa7, 0xe4, 0xe6, 0x14, 0x58); +WINADAPTER_IID(ID3D12InfoQueue1, 0x2852dd88, 0xb484, 0x4c0c, 0xb6, 0xb1, 0x67, 0x16, 0x85, 0x00, 0xe6, 0x00); +#endif + +// DXCore +#ifdef __dxcore_interface_h__ +WINADAPTER_IID(IDXCoreAdapterFactory, 0x78ee5945, 0xc36e, 0x4b13, 0xa6, 0x69, 0x00, 0x5d, 0xd1, 0x1c, 0x0f, 0x06); +WINADAPTER_IID(IDXCoreAdapterList, 0x526c7776, 0x40e9, 0x459b, 0xb7, 0x11, 0xf3, 0x2a, 0xd7, 0x6d, 0xfc, 0x28); +WINADAPTER_IID(IDXCoreAdapter, 0xf0db4c7f, 0xfe5a, 0x42a2, 0xbd, 0x62, 0xf2, 0xa6, 0xcf, 0x6f, 0xc8, 0x3e); +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/gif_lib.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/gif_lib.h new file mode 100644 index 0000000..41bf7a2 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/gif_lib.h @@ -0,0 +1,305 @@ +/****************************************************************************** + +gif_lib.h - service library for decoding and encoding GIF images + +SPDX-License-Identifier: MIT + +*****************************************************************************/ + +#ifndef _GIF_LIB_H_ +#define _GIF_LIB_H_ 1 + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#define GIFLIB_MAJOR 5 +#define GIFLIB_MINOR 2 +#define GIFLIB_RELEASE 1 + +#define GIF_ERROR 0 +#define GIF_OK 1 + +#include +#include + +#define GIF_STAMP "GIFVER" /* First chars in file - GIF stamp. */ +#define GIF_STAMP_LEN sizeof(GIF_STAMP) - 1 +#define GIF_VERSION_POS 3 /* Version first character in stamp. */ +#define GIF87_STAMP "GIF87a" /* First chars in file - GIF stamp. */ +#define GIF89_STAMP "GIF89a" /* First chars in file - GIF stamp. */ + +typedef unsigned char GifPixelType; +typedef unsigned char *GifRowType; +typedef unsigned char GifByteType; +typedef unsigned int GifPrefixType; +typedef int GifWord; + +typedef struct GifColorType { + GifByteType Red, Green, Blue; +} GifColorType; + +typedef struct ColorMapObject { + int ColorCount; + int BitsPerPixel; + bool SortFlag; + GifColorType *Colors; /* on malloc(3) heap */ +} ColorMapObject; + +typedef struct GifImageDesc { + GifWord Left, Top, Width, Height; /* Current image dimensions. */ + bool Interlace; /* Sequential/Interlaced lines. */ + ColorMapObject *ColorMap; /* The local color map */ +} GifImageDesc; + +typedef struct ExtensionBlock { + int ByteCount; + GifByteType *Bytes; /* on malloc(3) heap */ + int Function; /* The block function code */ +#define CONTINUE_EXT_FUNC_CODE 0x00 /* continuation subblock */ +#define COMMENT_EXT_FUNC_CODE 0xfe /* comment */ +#define GRAPHICS_EXT_FUNC_CODE 0xf9 /* graphics control (GIF89) */ +#define PLAINTEXT_EXT_FUNC_CODE 0x01 /* plaintext */ +#define APPLICATION_EXT_FUNC_CODE 0xff /* application block (GIF89) */ +} ExtensionBlock; + +typedef struct SavedImage { + GifImageDesc ImageDesc; + GifByteType *RasterBits; /* on malloc(3) heap */ + int ExtensionBlockCount; /* Count of extensions before image */ + ExtensionBlock *ExtensionBlocks; /* Extensions before image */ +} SavedImage; + +typedef struct GifFileType { + GifWord SWidth, SHeight; /* Size of virtual canvas */ + GifWord SColorResolution; /* How many colors can we generate? */ + GifWord SBackGroundColor; /* Background color for virtual canvas */ + GifByteType AspectByte; /* Used to compute pixel aspect ratio */ + ColorMapObject *SColorMap; /* Global colormap, NULL if nonexistent. */ + int ImageCount; /* Number of current image (both APIs) */ + GifImageDesc Image; /* Current image (low-level API) */ + SavedImage *SavedImages; /* Image sequence (high-level API) */ + int ExtensionBlockCount; /* Count extensions past last image */ + ExtensionBlock *ExtensionBlocks; /* Extensions past last image */ + int Error; /* Last error condition reported */ + void *UserData; /* hook to attach user data (TVT) */ + void *Private; /* Don't mess with this! */ +} GifFileType; + +#define GIF_ASPECT_RATIO(n) ((n)+15.0/64.0) + +typedef enum { + UNDEFINED_RECORD_TYPE, + SCREEN_DESC_RECORD_TYPE, + IMAGE_DESC_RECORD_TYPE, /* Begin with ',' */ + EXTENSION_RECORD_TYPE, /* Begin with '!' */ + TERMINATE_RECORD_TYPE /* Begin with ';' */ +} GifRecordType; + +/* func type to read gif data from arbitrary sources (TVT) */ +typedef int (*InputFunc) (GifFileType *, GifByteType *, int); + +/* func type to write gif data to arbitrary targets. + * Returns count of bytes written. (MRB) + */ +typedef int (*OutputFunc) (GifFileType *, const GifByteType *, int); + +/****************************************************************************** + GIF89 structures +******************************************************************************/ + +typedef struct GraphicsControlBlock { + int DisposalMode; +#define DISPOSAL_UNSPECIFIED 0 /* No disposal specified. */ +#define DISPOSE_DO_NOT 1 /* Leave image in place */ +#define DISPOSE_BACKGROUND 2 /* Set area too background color */ +#define DISPOSE_PREVIOUS 3 /* Restore to previous content */ + bool UserInputFlag; /* User confirmation required before disposal */ + int DelayTime; /* pre-display delay in 0.01sec units */ + int TransparentColor; /* Palette index for transparency, -1 if none */ +#define NO_TRANSPARENT_COLOR -1 +} GraphicsControlBlock; + +/****************************************************************************** + GIF encoding routines +******************************************************************************/ + +/* Main entry points */ +GifFileType *EGifOpenFileName(const char *GifFileName, + const bool GifTestExistence, int *Error); +GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error); +GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error); +int EGifSpew(GifFileType * GifFile); +const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */ +int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); + +#define E_GIF_SUCCEEDED 0 +#define E_GIF_ERR_OPEN_FAILED 1 /* And EGif possible errors. */ +#define E_GIF_ERR_WRITE_FAILED 2 +#define E_GIF_ERR_HAS_SCRN_DSCR 3 +#define E_GIF_ERR_HAS_IMAG_DSCR 4 +#define E_GIF_ERR_NO_COLOR_MAP 5 +#define E_GIF_ERR_DATA_TOO_BIG 6 +#define E_GIF_ERR_NOT_ENOUGH_MEM 7 +#define E_GIF_ERR_DISK_IS_FULL 8 +#define E_GIF_ERR_CLOSE_FAILED 9 +#define E_GIF_ERR_NOT_WRITEABLE 10 + +/* These are legacy. You probably do not want to call them directly */ +int EGifPutScreenDesc(GifFileType *GifFile, + const int GifWidth, const int GifHeight, + const int GifColorRes, + const int GifBackGround, + const ColorMapObject *GifColorMap); +int EGifPutImageDesc(GifFileType *GifFile, + const int GifLeft, const int GifTop, + const int GifWidth, const int GifHeight, + const bool GifInterlace, + const ColorMapObject *GifColorMap); +void EGifSetGifVersion(GifFileType *GifFile, const bool gif89); +int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine, + int GifLineLen); +int EGifPutPixel(GifFileType *GifFile, const GifPixelType GifPixel); +int EGifPutComment(GifFileType *GifFile, const char *GifComment); +int EGifPutExtensionLeader(GifFileType *GifFile, const int GifExtCode); +int EGifPutExtensionBlock(GifFileType *GifFile, + const int GifExtLen, const void *GifExtension); +int EGifPutExtensionTrailer(GifFileType *GifFile); +int EGifPutExtension(GifFileType *GifFile, const int GifExtCode, + const int GifExtLen, + const void *GifExtension); +int EGifPutCode(GifFileType *GifFile, int GifCodeSize, + const GifByteType *GifCodeBlock); +int EGifPutCodeNext(GifFileType *GifFile, + const GifByteType *GifCodeBlock); + +/****************************************************************************** + GIF decoding routines +******************************************************************************/ + +/* Main entry points */ +GifFileType *DGifOpenFileName(const char *GifFileName, int *Error); +GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error); +int DGifSlurp(GifFileType * GifFile); +GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new one (TVT) */ + int DGifCloseFile(GifFileType * GifFile, int *ErrorCode); + +#define D_GIF_SUCCEEDED 0 +#define D_GIF_ERR_OPEN_FAILED 101 /* And DGif possible errors. */ +#define D_GIF_ERR_READ_FAILED 102 +#define D_GIF_ERR_NOT_GIF_FILE 103 +#define D_GIF_ERR_NO_SCRN_DSCR 104 +#define D_GIF_ERR_NO_IMAG_DSCR 105 +#define D_GIF_ERR_NO_COLOR_MAP 106 +#define D_GIF_ERR_WRONG_RECORD 107 +#define D_GIF_ERR_DATA_TOO_BIG 108 +#define D_GIF_ERR_NOT_ENOUGH_MEM 109 +#define D_GIF_ERR_CLOSE_FAILED 110 +#define D_GIF_ERR_NOT_READABLE 111 +#define D_GIF_ERR_IMAGE_DEFECT 112 +#define D_GIF_ERR_EOF_TOO_SOON 113 + +/* These are legacy. You probably do not want to call them directly */ +int DGifGetScreenDesc(GifFileType *GifFile); +int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType); +int DGifGetImageHeader(GifFileType *GifFile); +int DGifGetImageDesc(GifFileType *GifFile); +int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); +int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel); +int DGifGetExtension(GifFileType *GifFile, int *GifExtCode, + GifByteType **GifExtension); +int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension); +int DGifGetCode(GifFileType *GifFile, int *GifCodeSize, + GifByteType **GifCodeBlock); +int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock); +int DGifGetLZCodes(GifFileType *GifFile, int *GifCode); +const char *DGifGetGifVersion(GifFileType *GifFile); + + +/****************************************************************************** + Error handling and reporting. +******************************************************************************/ +extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ + +/***************************************************************************** + Everything below this point is new after version 1.2, supporting `slurp + mode' for doing I/O in two big belts with all the image-bashing in core. +******************************************************************************/ + +/****************************************************************************** + Color map handling from gif_alloc.c +******************************************************************************/ + +extern ColorMapObject *GifMakeMapObject(int ColorCount, + const GifColorType *ColorMap); +extern void GifFreeMapObject(ColorMapObject *Object); +extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1, + const ColorMapObject *ColorIn2, + GifPixelType ColorTransIn2[]); +extern int GifBitSize(int n); + +/****************************************************************************** + Support for the in-core structures allocation (slurp mode). +******************************************************************************/ + +extern void GifApplyTranslation(SavedImage *Image, GifPixelType Translation[]); +extern int GifAddExtensionBlock(int *ExtensionBlock_Count, + ExtensionBlock **ExtensionBlocks, + int Function, + unsigned int Len, unsigned char ExtData[]); +extern void GifFreeExtensions(int *ExtensionBlock_Count, + ExtensionBlock **ExtensionBlocks); +extern SavedImage *GifMakeSavedImage(GifFileType *GifFile, + const SavedImage *CopyFrom); +extern void GifFreeSavedImages(GifFileType *GifFile); + +/****************************************************************************** + 5.x functions for GIF89 graphics control blocks +******************************************************************************/ + +int DGifExtensionToGCB(const size_t GifExtensionLength, + const GifByteType *GifExtension, + GraphicsControlBlock *GCB); +size_t EGifGCBToExtension(const GraphicsControlBlock *GCB, + GifByteType *GifExtension); + +int DGifSavedExtensionToGCB(GifFileType *GifFile, + int ImageIndex, + GraphicsControlBlock *GCB); +int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, + GifFileType *GifFile, + int ImageIndex); + +/****************************************************************************** + The library's internal utility font +******************************************************************************/ + +#define GIF_FONT_WIDTH 8 +#define GIF_FONT_HEIGHT 8 +extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH]; + +extern void GifDrawText8x8(SavedImage *Image, + const int x, const int y, + const char *legend, const int color); + +extern void GifDrawBox(SavedImage *Image, + const int x, const int y, + const int w, const int d, const int color); + +extern void GifDrawRectangle(SavedImage *Image, + const int x, const int y, + const int w, const int d, const int color); + +#if !defined(_WIN32) +extern void GifDrawBoxedText8x8(SavedImage *Image, + const int x, const int y, + const char *legend, + const int border, const int bg, const int fg); +#endif + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* _GIF_LIB_H */ + +/* end */ diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/basetsd.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/basetsd.h new file mode 100644 index 0000000..3cddaa1 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/basetsd.h @@ -0,0 +1,405 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +#pragma once + +// These #defines prevent the idl-generated headers from trying to include +// Windows.h from the SDK rather than this one. +#define RPC_NO_WINDOWS_H +#define COM_NO_WINDOWS_H + +// Allcaps type definitions +#include +#include +#include +#include + +// Note: using fixed-width here to match Windows widths +// Specifically this is different for 'long' vs 'LONG' +typedef uint8_t UINT8; +typedef int8_t INT8; +typedef uint16_t UINT16; +typedef int16_t INT16; +typedef uint32_t UINT32, UINT, ULONG, DWORD, BOOL, WINBOOL; +typedef int32_t INT32, INT, LONG; +typedef uint64_t UINT64, ULONG_PTR; +typedef int64_t INT64, LONG_PTR; +typedef void VOID, *HANDLE, *RPC_IF_HANDLE, *LPVOID; +typedef const void *LPCVOID; +typedef size_t SIZE_T; +typedef float FLOAT; +typedef double DOUBLE; +typedef unsigned char BYTE; +typedef int HWND; +typedef int PALETTEENTRY; +typedef int HDC; +typedef uint16_t WORD; +typedef void* PVOID; +typedef char BOOLEAN; +typedef uint64_t ULONGLONG; +typedef uint16_t USHORT, *PUSHORT; +typedef int64_t LONGLONG, *PLONGLONG; +typedef int64_t LONG_PTR, *PLONG_PTR; +typedef int64_t LONG64, *PLONG64; +typedef uint64_t ULONG64, *PULONG64; +typedef wchar_t WCHAR, *PWSTR; +typedef uint8_t UCHAR, *PUCHAR; +typedef uint64_t ULONG_PTR, *PULONG_PTR; +typedef uint64_t UINT_PTR, *PUINT_PTR; +typedef int64_t INT_PTR, *PINT_PTR; + +// Note: WCHAR is not the same between Windows and Linux, to enable +// string manipulation APIs to work with resulting strings. +// APIs to D3D/DXCore will work on Linux wchars, but beware with +// interactions directly with the Windows kernel. +typedef char CHAR, *PSTR, *LPSTR, TCHAR, *PTSTR; +typedef const char *LPCSTR, *PCSTR, *LPCTSTR, *PCTSTR; +typedef wchar_t WCHAR, *PWSTR, *LPWSTR, *PWCHAR; +typedef const wchar_t *LPCWSTR, *PCWSTR; + +#undef LONG_MAX +#define LONG_MAX INT_MAX +#undef ULONG_MAX +#define ULONG_MAX UINT_MAX + +// Misc defines +#define MIDL_INTERFACE(x) interface +#define __analysis_assume(x) +#define TRUE 1u +#define FALSE 0u +#define DECLSPEC_UUID(x) +#define DECLSPEC_NOVTABLE +#define DECLSPEC_SELECTANY +#ifdef __cplusplus +#define EXTERN_C extern "C" +#else +#define EXTERN_C extern +#endif +#define APIENTRY +#define OUT +#define IN +#define CONST const +#define MAX_PATH 260 +#define GENERIC_ALL 0x10000000L +#define C_ASSERT(expr) static_assert((expr)) +#define _countof(a) (sizeof(a) / sizeof(*(a))) + +typedef struct tagRECTL +{ + LONG left; + LONG top; + LONG right; + LONG bottom; +} RECTL; + +typedef struct tagPOINT +{ + int x; + int y; +} POINT; + +typedef struct _GUID { + uint32_t Data1; + uint16_t Data2; + uint16_t Data3; + uint8_t Data4[ 8 ]; +} GUID; + +#ifdef INITGUID +#ifdef __cplusplus +#define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) EXTERN_C const GUID DECLSPEC_SELECTANY name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } +#else +#define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID DECLSPEC_SELECTANY name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } +#endif +#else +#define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) EXTERN_C const GUID name +#endif + +typedef GUID IID; +typedef GUID UUID; +typedef GUID CLSID; +#ifdef __cplusplus +#define REFGUID const GUID & +#define REFIID const IID & +#define REFCLSID const IID & + +__inline int InlineIsEqualGUID(REFGUID rguid1, REFGUID rguid2) +{ + return ( + ((uint32_t *)&rguid1)[0] == ((uint32_t *)&rguid2)[0] && + ((uint32_t *)&rguid1)[1] == ((uint32_t *)&rguid2)[1] && + ((uint32_t *)&rguid1)[2] == ((uint32_t *)&rguid2)[2] && + ((uint32_t *)&rguid1)[3] == ((uint32_t *)&rguid2)[3]); +} + +inline bool operator==(REFGUID guidOne, REFGUID guidOther) +{ + return !!InlineIsEqualGUID(guidOne, guidOther); +} + +inline bool operator!=(REFGUID guidOne, REFGUID guidOther) +{ + return !(guidOne == guidOther); +} + +#else +#define REFGUID const GUID * +#define REFIID const IID * +#define REFCLSID const IID * +#endif + +// SAL annotations +#define _In_ +#define _In_z_ +#define _In_opt_ +#define _In_opt_z_ +#define _In_reads_(x) +#define _In_reads_opt_(x) +#define _In_reads_bytes_(x) +#define _In_reads_bytes_opt_(x) +#define _In_range_(x, y) +#define _In_bytecount_(x) +#define _Out_ +#define _Out_opt_ +#define _Outptr_ +#define _Outptr_opt_result_z_ +#define _Outptr_opt_result_bytebuffer_(x) +#define _COM_Outptr_ +#define _COM_Outptr_result_maybenull_ +#define _COM_Outptr_opt_ +#define _COM_Outptr_opt_result_maybenull_ +#define _Out_writes_(x) +#define _Out_writes_z_(x) +#define _Out_writes_opt_(x) +#define _Out_writes_all_(x) +#define _Out_writes_all_opt_(x) +#define _Out_writes_to_opt_(x, y) +#define _Out_writes_bytes_(x) +#define _Out_writes_bytes_all_(x) +#define _Out_writes_bytes_all_opt_(x) +#define _Out_writes_bytes_opt_(x) +#define _Inout_ +#define _Inout_opt_ +#define _Inout_updates_(x) +#define _Inout_updates_bytes_(x) +#define _Field_size_(x) +#define _Field_size_opt_(x) +#define _Field_size_bytes_(x) +#define _Field_size_full_(x) +#define _Field_size_full_opt_(x) +#define _Field_size_bytes_full_(x) +#define _Field_size_bytes_full_opt_(x) +#define _Field_size_bytes_part_(x, y) +#define _Field_range_(x, y) +#define _Field_z_ +#define _Check_return_ +#define _IRQL_requires_(x) +#define _IRQL_requires_min_(x) +#define _IRQL_requires_max_(x) +#define _At_(x, y) +#define _Always_(x) +#define _Return_type_success_(x) +#define _Translates_Win32_to_HRESULT_(x) +#define _Maybenull_ +#define _Outptr_result_maybenull_ +#define _Outptr_result_nullonfailure_ +#define _Analysis_assume_(x) +#define _Success_(x) +#define _In_count_(x) +#define _In_opt_count_(x) +#define _Use_decl_annotations_ +#define _Null_terminated_ + +// Calling conventions +#define __cdecl +#define __stdcall +#define STDMETHODCALLTYPE +#define STDAPICALLTYPE +#define STDAPI EXTERN_C HRESULT STDAPICALLTYPE +#define WINAPI + +#define interface struct +#if defined (__cplusplus) && !defined (CINTERFACE) +#define STDMETHOD(method) virtual HRESULT STDMETHODCALLTYPE method +#define STDMETHOD_(type, method) virtual type STDMETHODCALLTYPE method +#define PURE = 0 +#define THIS_ +#define THIS void +#define DECLARE_INTERFACE(iface) interface DECLSPEC_NOVTABLE iface +#define DECLARE_INTERFACE_(iface, baseiface) interface DECLSPEC_NOVTABLE iface : public baseiface + +interface IUnknown; +extern "C++" +{ + template void** IID_PPV_ARGS_Helper(T** pp) + { + (void)static_cast(*pp); + return reinterpret_cast(pp); + } +} +#define IID_PPV_ARGS(ppType) __uuidof (**(ppType)), IID_PPV_ARGS_Helper (ppType) +#else +#define STDMETHOD(method) HRESULT (STDMETHODCALLTYPE *method) +#define STDMETHOD_(type, method) type (STDMETHODCALLTYPE *method) +#define PURE +#define THIS_ INTERFACE *This, +#define THIS INTERFACE *This +#ifdef CONST_VTABLE +#define DECLARE_INTERFACE(iface) typedef interface iface { const struct iface##Vtbl *lpVtbl; } iface; typedef const struct iface##Vtbl iface##Vtbl; const struct iface##Vtbl +#else +#define DECLARE_INTERFACE(iface) typedef interface iface { struct iface##Vtbl *lpVtbl; } iface; typedef struct iface##Vtbl iface##Vtbl; struct iface##Vtbl +#endif +#define DECLARE_INTERFACE_(iface, baseiface) DECLARE_INTERFACE (iface) +#endif + +#define IFACEMETHOD(method) /*override*/ STDMETHOD (method) +#define IFACEMETHOD_(type, method) /*override*/ STDMETHOD_(type, method) +#ifndef BEGIN_INTERFACE +#define BEGIN_INTERFACE +#define END_INTERFACE +#endif + +// Error codes +typedef LONG HRESULT; +#define SUCCEEDED(hr) (((HRESULT)(hr)) >= 0) +#define FAILED(hr) (((HRESULT)(hr)) < 0) +#define S_OK ((HRESULT)0L) +#define S_FALSE ((HRESULT)1L) +#define E_NOTIMPL ((HRESULT)0x80004001L) +#define E_OUTOFMEMORY ((HRESULT)0x8007000EL) +#define E_INVALIDARG ((HRESULT)0x80070057L) +#define E_NOINTERFACE ((HRESULT)0x80004002L) +#define E_POINTER ((HRESULT)0x80004003L) +#define E_HANDLE ((HRESULT)0x80070006L) +#define E_ABORT ((HRESULT)0x80004004L) +#define E_FAIL ((HRESULT)0x80004005L) +#define E_ACCESSDENIED ((HRESULT)0x80070005L) +#define E_UNEXPECTED ((HRESULT)0x8000FFFFL) +#define DXGI_ERROR_INVALID_CALL ((HRESULT)0x887A0001L) +#define DXGI_ERROR_NOT_FOUND ((HRESULT)0x887A0002L) +#define DXGI_ERROR_MORE_DATA ((HRESULT)0x887A0003L) +#define DXGI_ERROR_UNSUPPORTED ((HRESULT)0x887A0004L) +#define DXGI_ERROR_DEVICE_REMOVED ((HRESULT)0x887A0005L) +#define DXGI_ERROR_DEVICE_HUNG ((HRESULT)0x887A0006L) +#define DXGI_ERROR_DEVICE_RESET ((HRESULT)0x887A0007L) +#define DXGI_ERROR_DRIVER_INTERNAL_ERROR ((HRESULT)0x887A0020L) + +typedef struct _LUID +{ + ULONG LowPart; + LONG HighPart; +} LUID; + +typedef struct _RECT +{ + int left; + int top; + int right; + int bottom; +} RECT; + +typedef union _LARGE_INTEGER { + struct { + uint32_t LowPart; + uint32_t HighPart; + } u; + int64_t QuadPart; +} LARGE_INTEGER; +typedef LARGE_INTEGER *PLARGE_INTEGER; + +typedef union _ULARGE_INTEGER { + struct { + uint32_t LowPart; + uint32_t HighPart; + } u; + uint64_t QuadPart; +} ULARGE_INTEGER; +typedef ULARGE_INTEGER *PULARGE_INTEGER; + +#define DECLARE_HANDLE(name) \ + struct name##__ { \ + int unused; \ + }; \ + typedef struct name##__ *name + +typedef struct _SECURITY_ATTRIBUTES { + DWORD nLength; + LPVOID lpSecurityDescriptor; + WINBOOL bInheritHandle; +} SECURITY_ATTRIBUTES; + +struct STATSTG; + +#ifdef __cplusplus +// ENUM_FLAG_OPERATORS +// Define operator overloads to enable bit operations on enum values that are +// used to define flags. Use DEFINE_ENUM_FLAG_OPERATORS(YOUR_TYPE) to enable these +// operators on YOUR_TYPE. +extern "C++" { + template + struct _ENUM_FLAG_INTEGER_FOR_SIZE; + + template <> + struct _ENUM_FLAG_INTEGER_FOR_SIZE<1> + { + typedef int8_t type; + }; + + template <> + struct _ENUM_FLAG_INTEGER_FOR_SIZE<2> + { + typedef int16_t type; + }; + + template <> + struct _ENUM_FLAG_INTEGER_FOR_SIZE<4> + { + typedef int32_t type; + }; + + template <> + struct _ENUM_FLAG_INTEGER_FOR_SIZE<8> + { + typedef int64_t type; + }; + + // used as an approximation of std::underlying_type + template + struct _ENUM_FLAG_SIZED_INTEGER + { + typedef typename _ENUM_FLAG_INTEGER_FOR_SIZE::type type; + }; + +} +#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) \ +extern "C++" { \ +inline constexpr ENUMTYPE operator | (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((_ENUM_FLAG_SIZED_INTEGER::type)a) | ((_ENUM_FLAG_SIZED_INTEGER::type)b)); } \ +inline ENUMTYPE &operator |= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((_ENUM_FLAG_SIZED_INTEGER::type &)a) |= ((_ENUM_FLAG_SIZED_INTEGER::type)b)); } \ +inline constexpr ENUMTYPE operator & (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((_ENUM_FLAG_SIZED_INTEGER::type)a) & ((_ENUM_FLAG_SIZED_INTEGER::type)b)); } \ +inline ENUMTYPE &operator &= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((_ENUM_FLAG_SIZED_INTEGER::type &)a) &= ((_ENUM_FLAG_SIZED_INTEGER::type)b)); } \ +inline constexpr ENUMTYPE operator ~ (ENUMTYPE a) { return ENUMTYPE(~((_ENUM_FLAG_SIZED_INTEGER::type)a)); } \ +inline constexpr ENUMTYPE operator ^ (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((_ENUM_FLAG_SIZED_INTEGER::type)a) ^ ((_ENUM_FLAG_SIZED_INTEGER::type)b)); } \ +inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((_ENUM_FLAG_SIZED_INTEGER::type &)a) ^= ((_ENUM_FLAG_SIZED_INTEGER::type)b)); } \ +} +#else +#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) /* */ +#endif + +// D3DX12 uses these +#include +#define HeapAlloc(heap, flags, size) malloc(size) +#define HeapFree(heap, flags, ptr) free(ptr) + +#if defined(lint) +// Note: lint -e530 says don't complain about uninitialized variables for +// this variable. Error 527 has to do with unreachable code. +// -restore restores checking to the -save state +#define UNREFERENCED_PARAMETER(P) \ + /*lint -save -e527 -e530 */ \ + { \ + (P) = (P); \ + } \ + /*lint -restore */ +#else +#define UNREFERENCED_PARAMETER(P) (P) +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/oaidl.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/oaidl.h new file mode 100644 index 0000000..76f5b5f --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/oaidl.h @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// Stub header to satisfy d3d12.h include +#pragma once \ No newline at end of file diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/ocidl.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/ocidl.h new file mode 100644 index 0000000..76f5b5f --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/ocidl.h @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// Stub header to satisfy d3d12.h include +#pragma once \ No newline at end of file diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/rpc.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/rpc.h new file mode 100644 index 0000000..76f5b5f --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/rpc.h @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// Stub header to satisfy d3d12.h include +#pragma once \ No newline at end of file diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/rpcndr.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/rpcndr.h new file mode 100644 index 0000000..68aa390 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/rpcndr.h @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// Stub header to satisfy d3d12.h include +#pragma once + +#include "basetsd.h" + +#define __RPCNDR_H_VERSION__ + +#ifdef CONST_VTABLE +#define CONST_VTBL const +#else +#define CONST_VTBL +#endif + +/* Macros for __uuidof template-based emulation */ +#if defined(__cplusplus) +#if __cpp_constexpr >= 200704l && __cpp_inline_variables >= 201606L +#define __wsl_stub_uuidof_use_constexpr 1 +#else +#define __wsl_stub_uuidof_use_constexpr 0 +#endif +#ifndef __GNUC__ +#error "Only support for compilers that support for `GNU C++ extension`" +#endif +extern "C++" { +#if __wsl_stub_uuidof_use_constexpr + __extension__ template struct __wsl_stub_uuidof_s; + __extension__ template constexpr const GUID &__wsl_stub_uuidof(); +#else + __extension__ template const GUID &__wsl_stub_uuidof(); +#endif +} + +#if __wsl_stub_uuidof_use_constexpr +#define __CRT_UUID_DECL(type, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ + extern "C++" \ + { \ + template <> \ + struct __wsl_stub_uuidof_s \ + { \ + static constexpr IID __uuid_inst = { \ + l, w1, w2, {b1, b2, b3, b4, b5, b6, b7, b8}}; \ + }; \ + template <> \ + constexpr const GUID &__wsl_stub_uuidof() \ + { \ + return __wsl_stub_uuidof_s::__uuid_inst; \ + } \ + template <> \ + constexpr const GUID &__wsl_stub_uuidof() \ + { \ + return __wsl_stub_uuidof_s::__uuid_inst; \ + } \ + } +#else +#define __CRT_UUID_DECL(type, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ + extern "C++" \ + { \ + template <> \ + inline const GUID &__wsl_stub_uuidof() \ + { \ + static const IID __uuid_inst = { \ + l, w1, w2, {b1, b2, b3, b4, b5, b6, b7, b8}}; \ + return __uuid_inst; \ + } \ + template <> \ + inline const GUID &__wsl_stub_uuidof() \ + { \ + return __wsl_stub_uuidof(); \ + } \ + } +#endif +#define __uuidof(type) __wsl_stub_uuidof<__typeof(type)>() +#else +#define __CRT_UUID_DECL(type, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) +#endif diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/unknwn.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/unknwn.h new file mode 100644 index 0000000..e08ad1e --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/unknwn.h @@ -0,0 +1,3 @@ +#pragma once + +#include "unknwnbase.h" diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/unknwnbase.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/unknwnbase.h new file mode 100644 index 0000000..7a54651 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/unknwnbase.h @@ -0,0 +1,124 @@ +/*------------------------------------------------------------------------------------- + * + * Copyright (c) Microsoft Corporation + * Licensed under the MIT license + * + *-------------------------------------------------------------------------------------*/ + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + +/* File created by MIDL compiler version 8.01.0627 */ + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 500 +#endif + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif /* __RPCNDR_H_VERSION__ */ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __unknwnbase_h__ +#define __unknwnbase_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __IUnknown_FWD_DEFINED__ +#define __IUnknown_FWD_DEFINED__ +typedef interface IUnknown IUnknown; + +#endif /* __IUnknown_FWD_DEFINED__ */ + +#ifndef __IUnknown_INTERFACE_DEFINED__ +#define __IUnknown_INTERFACE_DEFINED__ + +/* interface IUnknown */ +/* [unique][uuid][object][local] */ + +typedef /* [unique] */ IUnknown *LPUNKNOWN; + +EXTERN_C const IID IID_IUnknown; + +#if defined(__cplusplus) && !defined(CINTERFACE) +extern "C++" +{ + MIDL_INTERFACE("00000000-0000-0000-c000-000000000046") + IUnknown + { + BEGIN_INTERFACE + + virtual HRESULT STDMETHODCALLTYPE QueryInterface( + REFIID riid, + void **ppvObject) = 0; + + virtual ULONG STDMETHODCALLTYPE AddRef() = 0; + + virtual ULONG STDMETHODCALLTYPE Release() = 0; + + template + HRESULT + STDMETHODCALLTYPE + QueryInterface(_COM_Outptr_ Q * *pp) + { + return QueryInterface(__uuidof(Q), (void **)pp); + } + END_INTERFACE + }; +} +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(IUnknown, 0x00000000, 0x0000, 0x0000, 0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x46) +#endif +#else +typedef struct IUnknownVtbl { + BEGIN_INTERFACE + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + IUnknown *This, + REFIID riid, + void **ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + IUnknown *This); + + ULONG (STDMETHODCALLTYPE *Release)( + IUnknown *This); + + END_INTERFACE +} IUnknownVtbl; + +interface IUnknown { + CONST_VTBL IUnknownVtbl* lpVtbl; +}; + +#ifdef COBJMACROS +/*** IUnknown methods ***/ +#define IUnknown_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define IUnknown_AddRef(This) (This)->lpVtbl->AddRef(This) +#define IUnknown_Release(This) (This)->lpVtbl->Release(This) +#endif + +#endif + +#endif /* __IUnknown_INTERFACE_DEFINED__ */ + +DEFINE_GUID(IID_IUnknown, 0x00000000, 0x0000, 0x0000, 0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x46); + +#endif /* __unknwnbase_h__ */ diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/winapifamily.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/winapifamily.h new file mode 100644 index 0000000..064c4c2 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/winapifamily.h @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// Stub header to satisfy d3d12.h include. Unconditionally light up all APIs. +#pragma once +#define WINAPI_FAMILY_PARTITION(Partitions) 1 \ No newline at end of file diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/wrl/client.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/wrl/client.h new file mode 100644 index 0000000..64293a7 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/wrl/client.h @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// Stub to satisfy d3dx12.h include +#pragma once +#include \ No newline at end of file diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/wrl/implements.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/wrl/implements.h new file mode 100644 index 0000000..5a3979e --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/stubs/wrl/implements.h @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// Stub to satisfy DML TF runtime includes +#pragma once +#include \ No newline at end of file diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/winadapter.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/winadapter.h new file mode 100644 index 0000000..ccb2b3c --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/winadapter.h @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +#pragma once + +#include diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/wrladapter.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/wrladapter.h new file mode 100644 index 0000000..fcfd894 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/wsl/wrladapter.h @@ -0,0 +1,803 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +#pragma once + +#include "winadapter.h" + +// defined by winadapter.h and needed by some windows headers, but conflicts +// with some libc++ implementation headers +#ifdef __in +#undef __in +#endif +#ifdef __out +#undef __out +#endif + +#include +#include +#include +#include +#include +#include + +namespace Microsoft +{ +namespace WRL +{ + namespace Details + { + struct BoolStruct { int Member; }; + typedef int BoolStruct::* BoolType; + + template // T should be the ComPtr or a derived type of it, not just the interface + class ComPtrRefBase + { + public: + typedef typename T::InterfaceType InterfaceType; + + operator IUnknown**() const throw() + { + static_assert(__is_base_of(IUnknown, InterfaceType), "Invalid cast: InterfaceType does not derive from IUnknown"); + return reinterpret_cast(ptr_->ReleaseAndGetAddressOf()); + } + + protected: + T* ptr_; + }; + + template + class ComPtrRef : public Details::ComPtrRefBase // T should be the ComPtr or a derived type of it, not just the interface + { + using Super = Details::ComPtrRefBase; + using InterfaceType = typename Super::InterfaceType; + public: + ComPtrRef(_In_opt_ T* ptr) throw() + { + this->ptr_ = ptr; + } + + // Conversion operators + operator void**() const throw() + { + return reinterpret_cast(this->ptr_->ReleaseAndGetAddressOf()); + } + + // This is our operator ComPtr (or the latest derived class from ComPtr (e.g. WeakRef)) + operator T*() throw() + { + *this->ptr_ = nullptr; + return this->ptr_; + } + + // We define operator InterfaceType**() here instead of on ComPtrRefBase, since + // if InterfaceType is IUnknown or IInspectable, having it on the base will collide. + operator InterfaceType**() throw() + { + return this->ptr_->ReleaseAndGetAddressOf(); + } + + // This is used for IID_PPV_ARGS in order to do __uuidof(**(ppType)). + // It does not need to clear ptr_ at this point, it is done at IID_PPV_ARGS_Helper(ComPtrRef&) later in this file. + InterfaceType* operator *() throw() + { + return this->ptr_->Get(); + } + + // Explicit functions + InterfaceType* const * GetAddressOf() const throw() + { + return this->ptr_->GetAddressOf(); + } + + InterfaceType** ReleaseAndGetAddressOf() throw() + { + return this->ptr_->ReleaseAndGetAddressOf(); + } + }; + } + + template + class ComPtr + { + public: + typedef T InterfaceType; + + protected: + InterfaceType *ptr_; + template friend class ComPtr; + + void InternalAddRef() const throw() + { + if (ptr_ != nullptr) + { + ptr_->AddRef(); + } + } + + unsigned long InternalRelease() throw() + { + unsigned long ref = 0; + T* temp = ptr_; + + if (temp != nullptr) + { + ptr_ = nullptr; + ref = temp->Release(); + } + + return ref; + } + + public: + ComPtr() throw() : ptr_(nullptr) + { + } + + ComPtr(decltype(nullptr)) throw() : ptr_(nullptr) + { + } + + template + ComPtr(_In_opt_ U *other) throw() : ptr_(other) + { + InternalAddRef(); + } + + ComPtr(const ComPtr& other) throw() : ptr_(other.ptr_) + { + InternalAddRef(); + } + + // copy constructor that allows to instantiate class when U* is convertible to T* + template + ComPtr(const ComPtr &other, typename std::enable_if::value, void *>::type * = 0) throw() : + ptr_(other.ptr_) + { + InternalAddRef(); + } + + ComPtr(_Inout_ ComPtr &&other) throw() : ptr_(nullptr) + { + if (this != reinterpret_cast(&reinterpret_cast(other))) + { + Swap(other); + } + } + + // Move constructor that allows instantiation of a class when U* is convertible to T* + template + ComPtr(_Inout_ ComPtr&& other, typename std::enable_if::value, void *>::type * = 0) throw() : + ptr_(other.ptr_) + { + other.ptr_ = nullptr; + } + + ~ComPtr() throw() + { + InternalRelease(); + } + + ComPtr& operator=(decltype(nullptr)) throw() + { + InternalRelease(); + return *this; + } + + ComPtr& operator=(_In_opt_ T *other) throw() + { + if (ptr_ != other) + { + ComPtr(other).Swap(*this); + } + return *this; + } + + template + ComPtr& operator=(_In_opt_ U *other) throw() + { + ComPtr(other).Swap(*this); + return *this; + } + + ComPtr& operator=(const ComPtr &other) throw() + { + if (ptr_ != other.ptr_) + { + ComPtr(other).Swap(*this); + } + return *this; + } + + template + ComPtr& operator=(const ComPtr& other) throw() + { + ComPtr(other).Swap(*this); + return *this; + } + + ComPtr& operator=(_Inout_ ComPtr &&other) throw() + { + ComPtr(static_cast(other)).Swap(*this); + return *this; + } + + template + ComPtr& operator=(_Inout_ ComPtr&& other) throw() + { + ComPtr(static_cast&&>(other)).Swap(*this); + return *this; + } + + void Swap(_Inout_ ComPtr&& r) throw() + { + T* tmp = ptr_; + ptr_ = r.ptr_; + r.ptr_ = tmp; + } + + void Swap(_Inout_ ComPtr& r) throw() + { + T* tmp = ptr_; + ptr_ = r.ptr_; + r.ptr_ = tmp; + } + + operator Details::BoolType() const throw() + { + return Get() != nullptr ? &Details::BoolStruct::Member : nullptr; + } + + T* Get() const throw() + { + return ptr_; + } + + InterfaceType* operator->() const throw() + { + return ptr_; + } + + Details::ComPtrRef> operator&() throw() + { + return Details::ComPtrRef>(this); + } + + const Details::ComPtrRef> operator&() const throw() + { + return Details::ComPtrRef>(this); + } + + T* const* GetAddressOf() const throw() + { + return &ptr_; + } + + T** GetAddressOf() throw() + { + return &ptr_; + } + + T** ReleaseAndGetAddressOf() throw() + { + InternalRelease(); + return &ptr_; + } + + T* Detach() throw() + { + T* ptr = ptr_; + ptr_ = nullptr; + return ptr; + } + + void Attach(_In_opt_ InterfaceType* other) throw() + { + if (ptr_ != nullptr) + { + auto ref = ptr_->Release(); + // DBG_UNREFERENCED_LOCAL_VARIABLE(ref); + // Attaching to the same object only works if duplicate references are being coalesced. Otherwise + // re-attaching will cause the pointer to be released and may cause a crash on a subsequent dereference. + assert(ref != 0 || ptr_ != other); + } + + ptr_ = other; + } + + unsigned long Reset() + { + return InternalRelease(); + } + + // Previously, unsafe behavior could be triggered when 'this' is ComPtr or ComPtr and CopyTo is used to copy to another type U. + // The user will use operator& to convert the destination into a ComPtrRef, which can then implicit cast to IInspectable** and IUnknown**. + // If this overload of CopyTo is not present, it will implicitly cast to IInspectable or IUnknown and match CopyTo(InterfaceType**) instead. + // A valid polymoprhic downcast requires run-time type checking via QueryInterface, so CopyTo(InterfaceType**) will break type safety. + // This overload matches ComPtrRef before the implicit cast takes place, preventing the unsafe downcast. + template + HRESULT CopyTo(Details::ComPtrRef> ptr, typename std::enable_if< + (std::is_same::value) + && !std::is_same::value, void *>::type * = 0) const throw() + { + return ptr_->QueryInterface(__uuidof(U), ptr); + } + + HRESULT CopyTo(_Outptr_result_maybenull_ InterfaceType** ptr) const throw() + { + InternalAddRef(); + *ptr = ptr_; + return S_OK; + } + + HRESULT CopyTo(REFIID riid, _Outptr_result_nullonfailure_ void** ptr) const throw() + { + return ptr_->QueryInterface(riid, ptr); + } + + template + HRESULT CopyTo(_Outptr_result_nullonfailure_ U** ptr) const throw() + { + return ptr_->QueryInterface(__uuidof(U), reinterpret_cast(ptr)); + } + + // query for U interface + template + HRESULT As(_Inout_ Details::ComPtrRef> p) const throw() + { + return ptr_->QueryInterface(__uuidof(U), p); + } + + // query for U interface + template + HRESULT As(_Out_ ComPtr* p) const throw() + { + return ptr_->QueryInterface(__uuidof(U), reinterpret_cast(p->ReleaseAndGetAddressOf())); + } + + // query for riid interface and return as IUnknown + HRESULT AsIID(REFIID riid, _Out_ ComPtr* p) const throw() + { + return ptr_->QueryInterface(riid, reinterpret_cast(p->ReleaseAndGetAddressOf())); + } + + }; // ComPtr + + + namespace Details + { + // Empty struct used as default template parameter + class Nil + { + }; + + // Empty struct used for validating template parameter types in Implements + struct ImplementsBase + { + }; + + class RuntimeClassBase + { + protected: + template + static HRESULT AsIID(_In_ T* implements, REFIID riid, _Outptr_result_nullonfailure_ void **ppvObject) noexcept + { + *ppvObject = nullptr; + bool isRefDelegated = false; + // Prefer InlineIsEqualGUID over other forms since it's better perf on 4-byte aligned data, which is almost always the case. + if (InlineIsEqualGUID(riid, __uuidof(IUnknown))) + { + *ppvObject = implements->CastToUnknown(); + static_cast(*ppvObject)->AddRef(); + return S_OK; + } + + HRESULT hr = implements->CanCastTo(riid, ppvObject, &isRefDelegated); + if (SUCCEEDED(hr) && !isRefDelegated) + { + static_cast(*ppvObject)->AddRef(); + } + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable: 6102) // '*ppvObject' is used but may not be initialized +#endif + _Analysis_assume_(SUCCEEDED(hr) || (*ppvObject == nullptr)); +#ifdef _MSC_VER +#pragma warning(pop) +#endif + return hr; + } + + public: + HRESULT RuntimeClassInitialize() noexcept + { + return S_OK; + } + }; + + // Interface traits provides casting and filling iids methods helpers + template + struct InterfaceTraits + { + typedef I0 Base; + + template + static Base* CastToBase(_In_ T* ptr) noexcept + { + return static_cast(ptr); + } + + template + static IUnknown* CastToUnknown(_In_ T* ptr) noexcept + { + return static_cast(static_cast(ptr)); + } + + template + _Success_(return == true) + static bool CanCastTo(_In_ T* ptr, REFIID riid, _Outptr_ void **ppv) noexcept + { + // Prefer InlineIsEqualGUID over other forms since it's better perf on 4-byte aligned data, which is almost always the case. + if (InlineIsEqualGUID(riid, __uuidof(Base))) + { + *ppv = static_cast(ptr); + return true; + } + + return false; + } + }; + + // Specialization for Nil parameter + template<> + struct InterfaceTraits + { + typedef Nil Base; + + template + _Success_(return == true) + static bool CanCastTo(_In_ T*, REFIID, _Outptr_ void **) noexcept + { + return false; + } + }; + + // ChainInterfaces - template allows specifying a derived COM interface along with its class hierarchy to allow QI for the base interfaces + template + struct ChainInterfaces : I0 + { + protected: + HRESULT CanCastTo(REFIID riid, _Outptr_ void **ppv) throw() + { + typename InterfaceTraits::Base* ptr = InterfaceTraits::CastToBase(this); + + return (InterfaceTraits::CanCastTo(this, riid, ppv) || + InterfaceTraits::CanCastTo(ptr, riid, ppv) || + InterfaceTraits::CanCastTo(ptr, riid, ppv) || + InterfaceTraits::CanCastTo(ptr, riid, ppv) || + InterfaceTraits::CanCastTo(ptr, riid, ppv) || + InterfaceTraits::CanCastTo(ptr, riid, ppv) || + InterfaceTraits::CanCastTo(ptr, riid, ppv) || + InterfaceTraits::CanCastTo(ptr, riid, ppv) || + InterfaceTraits::CanCastTo(ptr, riid, ppv) || + InterfaceTraits::CanCastTo(ptr, riid, ppv)) ? S_OK : E_NOINTERFACE; + } + + IUnknown* CastToUnknown() throw() + { + return InterfaceTraits::CastToUnknown(this); + } + }; + + // Helper template used by Implements. This template traverses a list of interfaces and adds them as base class and information + // to enable QI. + template + struct ImplementsHelper; + + template + struct ImplementsMarker + {}; + + template + struct MarkImplements; + + template + struct MarkImplements + { + typedef I0 Type; + }; + + template + struct MarkImplements + { + typedef ImplementsMarker Type; + }; + + // AdjustImplements pre-processes the type list for more efficient builds. + template + struct AdjustImplements; + + template + struct AdjustImplements + { + typedef ImplementsHelper::value>::Type, Bases...> Type; + }; + + // Use AdjustImplements to remove instances of "Nil" from the type list. + template + struct AdjustImplements + { + typedef typename AdjustImplements::Type Type; + }; + + template <> + struct AdjustImplements<> + { + typedef ImplementsHelper<> Type; + }; + + // Specialization handles unadorned interfaces + template + struct ImplementsHelper : + I0, + AdjustImplements::Type + { + template friend struct ImplementsHelper; + friend class RuntimeClassBase; + + protected: + + HRESULT CanCastTo(REFIID riid, _Outptr_ void **ppv, bool *pRefDelegated = nullptr) noexcept + { + // Prefer InlineIsEqualGUID over other forms since it's better perf on 4-byte aligned data, which is almost always the case. + if (InlineIsEqualGUID(riid, __uuidof(I0))) + { + *ppv = reinterpret_cast(reinterpret_cast(this)); + return S_OK; + } + return AdjustImplements::Type::CanCastTo(riid, ppv, pRefDelegated); + } + + IUnknown* CastToUnknown() noexcept + { + return reinterpret_cast(reinterpret_cast(this)); + } + }; + + + // Selector is used to "tag" base interfaces to be used in casting, since a runtime class may indirectly derive from + // the same interface or Implements<> template multiple times + template + struct Selector : public base + { + }; + + // Specialization handles types that derive from ImplementsHelper (e.g. nested Implements). + template + struct ImplementsHelper, TInterfaces...> : + Selector, TInterfaces...>>, + Selector::Type, ImplementsHelper, TInterfaces...>> + { + template friend struct ImplementsHelper; + friend class RuntimeClassBase; + + protected: + typedef Selector, TInterfaces...>> CurrentType; + typedef Selector::Type, ImplementsHelper, TInterfaces...>> BaseType; + + HRESULT CanCastTo(REFIID riid, _Outptr_ void **ppv, bool *pRefDelegated = nullptr) noexcept + { + HRESULT hr = CurrentType::CanCastTo(riid, ppv); + if (hr == E_NOINTERFACE) + { + hr = BaseType::CanCastTo(riid, ppv, pRefDelegated); + } + return hr; + } + + IUnknown* CastToUnknown() noexcept + { + // First in list wins. + return CurrentType::CastToUnknown(); + } + }; + + // terminal case specialization. + template <> + struct ImplementsHelper<> + { + template friend struct ImplementsHelper; + friend class RuntimeClassBase; + + protected: + HRESULT CanCastTo(_In_ REFIID /*riid*/, _Outptr_ void ** /*ppv*/, bool * /*pRefDelegated*/ = nullptr) noexcept + { + return E_NOINTERFACE; + } + + // IUnknown* CastToUnknown() noexcept; // not defined for terminal case. + }; + + // Specialization handles chaining interfaces + template + struct ImplementsHelper, TInterfaces...> : + ChainInterfaces, + AdjustImplements::Type + { + template friend struct ImplementsHelper; + friend class RuntimeClassBase; + + protected: + typedef typename AdjustImplements::Type BaseType; + + HRESULT CanCastTo(REFIID riid, _Outptr_ void **ppv, bool *pRefDelegated = nullptr) noexcept + { + HRESULT hr = ChainInterfaces::CanCastTo(riid, ppv); + if (FAILED(hr)) + { + hr = BaseType::CanCastTo(riid, ppv, pRefDelegated); + } + + return hr; + } + + IUnknown* CastToUnknown() noexcept + { + return ChainInterfaces::CastToUnknown(); + } + }; + + // Implements - template implementing QI using the information provided through its template parameters + // Each template parameter has to be one of the following: + // * COM Interface + // * A class that implements one or more COM interfaces + // * ChainInterfaces template + template + struct Implements : + AdjustImplements::Type, + ImplementsBase + { + public: + typedef I0 FirstInterface; + protected: + typedef typename AdjustImplements::Type BaseType; + template friend struct ImplementsHelper; + friend class RuntimeClassBase; + + HRESULT CanCastTo(REFIID riid, _Outptr_ void **ppv) noexcept + { + return BaseType::CanCastTo(riid, ppv); + } + + IUnknown* CastToUnknown() noexcept + { + return BaseType::CastToUnknown(); + } + }; + + // Used on RuntimeClass to protect it from being constructed with new + class DontUseNewUseMake + { + private: + void* operator new(size_t) noexcept + { + assert(false); + return 0; + } + + public: + void* operator new(size_t, _In_ void* placement) noexcept + { + return placement; + } + }; + + template + class RuntimeClassImpl : + public AdjustImplements::Type, + public RuntimeClassBase, + public DontUseNewUseMake + { + public: + STDMETHOD(QueryInterface)(REFIID riid, _Outptr_result_nullonfailure_ void **ppvObject) + { + return Super::AsIID(this, riid, ppvObject); + } + + STDMETHOD_(ULONG, AddRef)() + { + return InternalAddRef(); + } + + STDMETHOD_(ULONG, Release)() + { + ULONG ref = InternalRelease(); + if (ref == 0) + { + this->~RuntimeClassImpl(); + delete[] reinterpret_cast(this); + } + + return ref; + } + + protected: + using Super = RuntimeClassBase; + static const LONG c_lProtectDestruction = -(LONG_MAX / 2); + + RuntimeClassImpl() noexcept = default; + + virtual ~RuntimeClassImpl() noexcept + { + // Set refcount_ to -(LONG_MAX/2) to protect destruction and + // also catch mismatched Release in debug builds + refcount_ = static_cast(c_lProtectDestruction); + } + + ULONG InternalAddRef() noexcept + { + return ++refcount_; + } + + ULONG InternalRelease() noexcept + { + return --refcount_; + } + + unsigned long GetRefCount() const noexcept + { + return refcount_; + } + + std::atomic refcount_{1}; + }; + } + + template + class Base : public Details::RuntimeClassImpl + { + Base(const Base&) = delete; + Base& operator=(const Base&) = delete; + + protected: + HRESULT CustomQueryInterface(REFIID /*riid*/, _Outptr_result_nullonfailure_ void** /*ppvObject*/, _Out_ bool *handled) + { + *handled = false; + return S_OK; + } + + public: + Base() throw() = default; + typedef Base RuntimeClassT; + }; + + // Creates a Nano-COM object wrapped in a smart pointer. + template + ComPtr Make(TArgs&&... args) + { + std::unique_ptr buffer(new(std::nothrow) char[sizeof(T)]); + ComPtr object; + + if (buffer) + { + T* ptr = new (buffer.get())T(std::forward(args)...); + object.Attach(ptr); + buffer.release(); + } + + return object; + } + + using Details::ChainInterfaces; +} +} + +// Overloaded global function to provide to IID_PPV_ARGS that support Details::ComPtrRef +template +void** IID_PPV_ARGS_Helper(Microsoft::WRL::Details::ComPtrRef pp) throw() +{ + return pp; +} diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/zconf.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/zconf.h new file mode 100644 index 0000000..21bc03b --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/zconf.h @@ -0,0 +1,557 @@ +/* zconf.h -- configuration of the zlib compression library + * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id$ */ + +#ifndef ZCONF_H +#define ZCONF_H +/* #undef Z_PREFIX */ +/* #undef Z_HAVE_UNISTD_H */ + +/* + * If you *really* need a unique prefix for all types and library functions, + * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. + * Even better than compiling with -DZ_PREFIX would be to use configure to set + * this permanently in zconf.h using "./configure --zprefix". + */ +#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ +# define Z_PREFIX_SET + +/* all linked symbols and init macros */ +# define _dist_code z__dist_code +# define _length_code z__length_code +# define _tr_align z__tr_align +# define _tr_flush_bits z__tr_flush_bits +# define _tr_flush_block z__tr_flush_block +# define _tr_init z__tr_init +# define _tr_stored_block z__tr_stored_block +# define _tr_tally z__tr_tally +# define adler32 z_adler32 +# define adler32_combine z_adler32_combine +# define adler32_combine64 z_adler32_combine64 +# define adler32_z z_adler32_z +# ifndef Z_SOLO +# define compress z_compress +# define compress2 z_compress2 +# define compressBound z_compressBound +# endif +# define crc32 z_crc32 +# define crc32_combine z_crc32_combine +# define crc32_combine64 z_crc32_combine64 +# define crc32_combine_gen z_crc32_combine_gen +# define crc32_combine_gen64 z_crc32_combine_gen64 +# define crc32_combine_op z_crc32_combine_op +# define crc32_z z_crc32_z +# define deflate z_deflate +# define deflateBound z_deflateBound +# define deflateCopy z_deflateCopy +# define deflateEnd z_deflateEnd +# define deflateGetDictionary z_deflateGetDictionary +# define deflateInit z_deflateInit +# define deflateInit2 z_deflateInit2 +# define deflateInit2_ z_deflateInit2_ +# define deflateInit_ z_deflateInit_ +# define deflateParams z_deflateParams +# define deflatePending z_deflatePending +# define deflatePrime z_deflatePrime +# define deflateReset z_deflateReset +# define deflateResetKeep z_deflateResetKeep +# define deflateSetDictionary z_deflateSetDictionary +# define deflateSetHeader z_deflateSetHeader +# define deflateTune z_deflateTune +# define deflate_copyright z_deflate_copyright +# define get_crc_table z_get_crc_table +# ifndef Z_SOLO +# define gz_error z_gz_error +# define gz_intmax z_gz_intmax +# define gz_strwinerror z_gz_strwinerror +# define gzbuffer z_gzbuffer +# define gzclearerr z_gzclearerr +# define gzclose z_gzclose +# define gzclose_r z_gzclose_r +# define gzclose_w z_gzclose_w +# define gzdirect z_gzdirect +# define gzdopen z_gzdopen +# define gzeof z_gzeof +# define gzerror z_gzerror +# define gzflush z_gzflush +# define gzfread z_gzfread +# define gzfwrite z_gzfwrite +# define gzgetc z_gzgetc +# define gzgetc_ z_gzgetc_ +# define gzgets z_gzgets +# define gzoffset z_gzoffset +# define gzoffset64 z_gzoffset64 +# define gzopen z_gzopen +# define gzopen64 z_gzopen64 +# ifdef _WIN32 +# define gzopen_w z_gzopen_w +# endif +# define gzprintf z_gzprintf +# define gzputc z_gzputc +# define gzputs z_gzputs +# define gzread z_gzread +# define gzrewind z_gzrewind +# define gzseek z_gzseek +# define gzseek64 z_gzseek64 +# define gzsetparams z_gzsetparams +# define gztell z_gztell +# define gztell64 z_gztell64 +# define gzungetc z_gzungetc +# define gzvprintf z_gzvprintf +# define gzwrite z_gzwrite +# endif +# define inflate z_inflate +# define inflateBack z_inflateBack +# define inflateBackEnd z_inflateBackEnd +# define inflateBackInit z_inflateBackInit +# define inflateBackInit_ z_inflateBackInit_ +# define inflateCodesUsed z_inflateCodesUsed +# define inflateCopy z_inflateCopy +# define inflateEnd z_inflateEnd +# define inflateGetDictionary z_inflateGetDictionary +# define inflateGetHeader z_inflateGetHeader +# define inflateInit z_inflateInit +# define inflateInit2 z_inflateInit2 +# define inflateInit2_ z_inflateInit2_ +# define inflateInit_ z_inflateInit_ +# define inflateMark z_inflateMark +# define inflatePrime z_inflatePrime +# define inflateReset z_inflateReset +# define inflateReset2 z_inflateReset2 +# define inflateResetKeep z_inflateResetKeep +# define inflateSetDictionary z_inflateSetDictionary +# define inflateSync z_inflateSync +# define inflateSyncPoint z_inflateSyncPoint +# define inflateUndermine z_inflateUndermine +# define inflateValidate z_inflateValidate +# define inflate_copyright z_inflate_copyright +# define inflate_fast z_inflate_fast +# define inflate_table z_inflate_table +# ifndef Z_SOLO +# define uncompress z_uncompress +# define uncompress2 z_uncompress2 +# endif +# define zError z_zError +# ifndef Z_SOLO +# define zcalloc z_zcalloc +# define zcfree z_zcfree +# endif +# define zlibCompileFlags z_zlibCompileFlags +# define zlibVersion z_zlibVersion + +/* all zlib typedefs in zlib.h and zconf.h */ +# define Byte z_Byte +# define Bytef z_Bytef +# define alloc_func z_alloc_func +# define charf z_charf +# define free_func z_free_func +# ifndef Z_SOLO +# define gzFile z_gzFile +# endif +# define gz_header z_gz_header +# define gz_headerp z_gz_headerp +# define in_func z_in_func +# define intf z_intf +# define out_func z_out_func +# define uInt z_uInt +# define uIntf z_uIntf +# define uLong z_uLong +# define uLongf z_uLongf +# define voidp z_voidp +# define voidpc z_voidpc +# define voidpf z_voidpf + +/* all zlib structs in zlib.h and zconf.h */ +# define gz_header_s z_gz_header_s +# define internal_state z_internal_state + +#endif + +#if defined(__MSDOS__) && !defined(MSDOS) +# define MSDOS +#endif +#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) +# define OS2 +#endif +#if defined(_WINDOWS) && !defined(WINDOWS) +# define WINDOWS +#endif +#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) +# ifndef WIN32 +# define WIN32 +# endif +#endif +#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) +# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) +# ifndef SYS16BIT +# define SYS16BIT +# endif +# endif +#endif + +/* + * Compile with -DMAXSEG_64K if the alloc function cannot allocate more + * than 64k bytes at a time (needed on systems with 16-bit int). + */ +#ifdef SYS16BIT +# define MAXSEG_64K +#endif +#ifdef MSDOS +# define UNALIGNED_OK +#endif + +#ifdef __STDC_VERSION__ +# ifndef STDC +# define STDC +# endif +# if __STDC_VERSION__ >= 199901L +# ifndef STDC99 +# define STDC99 +# endif +# endif +#endif +#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) +# define STDC +#endif +#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) +# define STDC +#endif +#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) +# define STDC +#endif +#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) +# define STDC +#endif + +#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ +# define STDC +#endif + +#ifndef STDC +# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ +# define const /* note: need a more gentle solution here */ +# endif +#endif + +#if defined(ZLIB_CONST) && !defined(z_const) +# define z_const const +#else +# define z_const +#endif + +#ifdef Z_SOLO + typedef unsigned long z_size_t; +#else +# define z_longlong long long +# if defined(NO_SIZE_T) + typedef unsigned NO_SIZE_T z_size_t; +# elif defined(STDC) +# include + typedef size_t z_size_t; +# else + typedef unsigned long z_size_t; +# endif +# undef z_longlong +#endif + +/* Maximum value for memLevel in deflateInit2 */ +#ifndef MAX_MEM_LEVEL +# ifdef MAXSEG_64K +# define MAX_MEM_LEVEL 8 +# else +# define MAX_MEM_LEVEL 9 +# endif +#endif + +/* Maximum value for windowBits in deflateInit2 and inflateInit2. + * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files + * created by gzip. (Files created by minigzip can still be extracted by + * gzip.) + */ +#ifndef MAX_WBITS +# define MAX_WBITS 15 /* 32K LZ77 window */ +#endif + +/* The memory requirements for deflate are (in bytes): + (1 << (windowBits+2)) + (1 << (memLevel+9)) + that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) + plus a few kilobytes for small objects. For example, if you want to reduce + the default memory requirements from 256K to 128K, compile with + make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" + Of course this will generally degrade compression (there's no free lunch). + + The memory requirements for inflate are (in bytes) 1 << windowBits + that is, 32K for windowBits=15 (default value) plus about 7 kilobytes + for small objects. +*/ + + /* Type declarations */ + +#ifndef OF /* function prototypes */ +# ifdef STDC +# define OF(args) args +# else +# define OF(args) () +# endif +#endif + +#ifndef Z_ARG /* function prototypes for stdarg */ +# if defined(STDC) || defined(Z_HAVE_STDARG_H) +# define Z_ARG(args) args +# else +# define Z_ARG(args) () +# endif +#endif + +/* The following definitions for FAR are needed only for MSDOS mixed + * model programming (small or medium model with some far allocations). + * This was tested only with MSC; for other MSDOS compilers you may have + * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, + * just define FAR to be empty. + */ +#ifdef SYS16BIT +# if defined(M_I86SM) || defined(M_I86MM) + /* MSC small or medium model */ +# define SMALL_MEDIUM +# ifdef _MSC_VER +# define FAR _far +# else +# define FAR far +# endif +# endif +# if (defined(__SMALL__) || defined(__MEDIUM__)) + /* Turbo C small or medium model */ +# define SMALL_MEDIUM +# ifdef __BORLANDC__ +# define FAR _far +# else +# define FAR far +# endif +# endif +#endif + +#if defined(WINDOWS) || defined(WIN32) + /* If building or using zlib as a DLL, define ZLIB_DLL. + * This is not mandatory, but it offers a little performance increase. + */ +# if 0 +# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) +# ifdef ZLIB_INTERNAL +# define ZEXTERN extern __declspec(dllexport) +# else +# define ZEXTERN extern __declspec(dllimport) +# endif +# endif +# endif /* ZLIB_DLL */ + /* If building or using zlib with the WINAPI/WINAPIV calling convention, + * define ZLIB_WINAPI. + * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. + */ +# ifdef ZLIB_WINAPI +# ifdef FAR +# undef FAR +# endif +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif +# include + /* No need for _export, use ZLIB.DEF instead. */ + /* For complete Windows compatibility, use WINAPI, not __stdcall. */ +# define ZEXPORT WINAPI +# ifdef WIN32 +# define ZEXPORTVA WINAPIV +# else +# define ZEXPORTVA FAR CDECL +# endif +# endif +#endif + +#if defined (__BEOS__) +# if 0 +# ifdef ZLIB_INTERNAL +# define ZEXPORT __declspec(dllexport) +# define ZEXPORTVA __declspec(dllexport) +# else +# define ZEXPORT __declspec(dllimport) +# define ZEXPORTVA __declspec(dllimport) +# endif +# endif +#endif + +#ifndef ZEXTERN +# define ZEXTERN extern +#endif +#ifndef ZEXPORT +# define ZEXPORT +#endif +#ifndef ZEXPORTVA +# define ZEXPORTVA +#endif + +#ifndef FAR +# define FAR +#endif + +#if !defined(__MACTYPES__) +typedef unsigned char Byte; /* 8 bits */ +#endif +typedef unsigned int uInt; /* 16 bits or more */ +typedef unsigned long uLong; /* 32 bits or more */ + +#ifdef SMALL_MEDIUM + /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ +# define Bytef Byte FAR +#else + typedef Byte FAR Bytef; +#endif +typedef char FAR charf; +typedef int FAR intf; +typedef uInt FAR uIntf; +typedef uLong FAR uLongf; + +#ifdef STDC + typedef void const *voidpc; + typedef void FAR *voidpf; + typedef void *voidp; +#else + typedef Byte const *voidpc; + typedef Byte FAR *voidpf; + typedef Byte *voidp; +#endif + +#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC) +# include +# if (UINT_MAX == 0xffffffffUL) +# define Z_U4 unsigned +# elif (ULONG_MAX == 0xffffffffUL) +# define Z_U4 unsigned long +# elif (USHRT_MAX == 0xffffffffUL) +# define Z_U4 unsigned short +# endif +#endif + +#ifdef Z_U4 + typedef Z_U4 z_crc_t; +#else + typedef unsigned long z_crc_t; +#endif + +#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ +# if ~(~HAVE_UNISTD_H + 0) == 0 && ~(~HAVE_UNISTD_H + 1) == 1 +# define Z_HAVE_UNISTD_H +# elif HAVE_UNISTD_H != 0 +# define Z_HAVE_UNISTD_H +# endif +#endif + +#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */ +# if ~(~HAVE_STDARG_H + 0) == 0 && ~(~HAVE_STDARG_H + 1) == 1 +# define Z_HAVE_STDARG_H +# elif HAVE_STDARG_H != 0 +# define Z_HAVE_STDARG_H +# endif +#endif + +#ifdef STDC +# ifndef Z_SOLO +# include /* for off_t */ +# endif +#endif + +#if defined(STDC) || defined(Z_HAVE_STDARG_H) +# ifndef Z_SOLO +# include /* for va_list */ +# endif +#endif + +#ifdef _WIN32 +# ifndef Z_SOLO +# include /* for wchar_t */ +# endif +#endif + +/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and + * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even + * though the former does not conform to the LFS document), but considering + * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as + * equivalently requesting no 64-bit operations + */ +#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1 +# undef _LARGEFILE64_SOURCE +#endif + +#ifndef Z_HAVE_UNISTD_H +# ifdef __WATCOMC__ +# define Z_HAVE_UNISTD_H +# endif +#endif +#ifndef Z_HAVE_UNISTD_H +# if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32) +# define Z_HAVE_UNISTD_H +# endif +#endif +#ifndef Z_SOLO +# if defined(Z_HAVE_UNISTD_H) +# include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ +# ifdef VMS +# include /* for off_t */ +# endif +# ifndef z_off_t +# define z_off_t off_t +# endif +# endif +#endif + +#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0 +# define Z_LFS64 +#endif + +#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64) +# define Z_LARGE64 +#endif + +#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64) +# define Z_WANT64 +#endif + +#if !defined(SEEK_SET) && !defined(Z_SOLO) +# define SEEK_SET 0 /* Seek from beginning of file. */ +# define SEEK_CUR 1 /* Seek from current position. */ +# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ +#endif + +#ifndef z_off_t +# define z_off_t long +#endif + +#if !defined(_WIN32) && defined(Z_LARGE64) +# define z_off64_t off64_t +#else +# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) +# define z_off64_t __int64 +# else +# define z_off64_t z_off_t +# endif +#endif + +/* MVS linker does not support external names larger than 8 bytes */ +#if defined(__MVS__) + #pragma map(deflateInit_,"DEIN") + #pragma map(deflateInit2_,"DEIN2") + #pragma map(deflateEnd,"DEEND") + #pragma map(deflateBound,"DEBND") + #pragma map(inflateInit_,"ININ") + #pragma map(inflateInit2_,"ININ2") + #pragma map(inflateEnd,"INEND") + #pragma map(inflateSync,"INSY") + #pragma map(inflateSetDictionary,"INSEDI") + #pragma map(compressBound,"CMBND") + #pragma map(inflate_table,"INTABL") + #pragma map(inflate_fast,"INFA") + #pragma map(inflate_copyright,"INCOPY") +#endif + +#endif /* ZCONF_H */ diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/include/zlib.h b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/zlib.h new file mode 100644 index 0000000..953cb50 --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/include/zlib.h @@ -0,0 +1,1935 @@ +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.2.13, October 13th, 2022 + + Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + + The data format used by the zlib library is described by RFCs (Request for + Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 + (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format). +*/ + +#ifndef ZLIB_H +#define ZLIB_H + +#include "zconf.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define ZLIB_VERSION "1.2.13" +#define ZLIB_VERNUM 0x12d0 +#define ZLIB_VER_MAJOR 1 +#define ZLIB_VER_MINOR 2 +#define ZLIB_VER_REVISION 13 +#define ZLIB_VER_SUBREVISION 0 + +/* + The 'zlib' compression library provides in-memory compression and + decompression functions, including integrity checks of the uncompressed data. + This version of the library supports only one compression method (deflation) + but other algorithms will be added later and will have the same stream + interface. + + Compression can be done in a single step if the buffers are large enough, + or can be done by repeated calls of the compression function. In the latter + case, the application must provide more input and/or consume the output + (providing more output space) before each call. + + The compressed data format used by default by the in-memory functions is + the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped + around a deflate stream, which is itself documented in RFC 1951. + + The library also supports reading and writing files in gzip (.gz) format + with an interface similar to that of stdio using the functions that start + with "gz". The gzip format is different from the zlib format. gzip is a + gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. + + This library can optionally read and write gzip and raw deflate streams in + memory as well. + + The zlib format was designed to be compact and fast for use in memory + and on communications channels. The gzip format was designed for single- + file compression on file systems, has a larger header than zlib to maintain + directory information, and uses a different, slower check method than zlib. + + The library does not install any signal handler. The decoder checks + the consistency of the compressed data, so the library should never crash + even in the case of corrupted input. +*/ + +typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); +typedef void (*free_func) OF((voidpf opaque, voidpf address)); + +struct internal_state; + +typedef struct z_stream_s { + z_const Bytef *next_in; /* next input byte */ + uInt avail_in; /* number of bytes available at next_in */ + uLong total_in; /* total number of input bytes read so far */ + + Bytef *next_out; /* next output byte will go here */ + uInt avail_out; /* remaining free space at next_out */ + uLong total_out; /* total number of bytes output so far */ + + z_const char *msg; /* last error message, NULL if no error */ + struct internal_state FAR *state; /* not visible by applications */ + + alloc_func zalloc; /* used to allocate the internal state */ + free_func zfree; /* used to free the internal state */ + voidpf opaque; /* private data object passed to zalloc and zfree */ + + int data_type; /* best guess about the data type: binary or text + for deflate, or the decoding state for inflate */ + uLong adler; /* Adler-32 or CRC-32 value of the uncompressed data */ + uLong reserved; /* reserved for future use */ +} z_stream; + +typedef z_stream FAR *z_streamp; + +/* + gzip header information passed to and from zlib routines. See RFC 1952 + for more details on the meanings of these fields. +*/ +typedef struct gz_header_s { + int text; /* true if compressed data believed to be text */ + uLong time; /* modification time */ + int xflags; /* extra flags (not used when writing a gzip file) */ + int os; /* operating system */ + Bytef *extra; /* pointer to extra field or Z_NULL if none */ + uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ + uInt extra_max; /* space at extra (only when reading header) */ + Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ + uInt name_max; /* space at name (only when reading header) */ + Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ + uInt comm_max; /* space at comment (only when reading header) */ + int hcrc; /* true if there was or will be a header crc */ + int done; /* true when done reading gzip header (not used + when writing a gzip file) */ +} gz_header; + +typedef gz_header FAR *gz_headerp; + +/* + The application must update next_in and avail_in when avail_in has dropped + to zero. It must update next_out and avail_out when avail_out has dropped + to zero. The application must initialize zalloc, zfree and opaque before + calling the init function. All other fields are set by the compression + library and must not be updated by the application. + + The opaque value provided by the application will be passed as the first + parameter for calls of zalloc and zfree. This can be useful for custom + memory management. The compression library attaches no meaning to the + opaque value. + + zalloc must return Z_NULL if there is not enough memory for the object. + If zlib is used in a multi-threaded application, zalloc and zfree must be + thread safe. In that case, zlib is thread-safe. When zalloc and zfree are + Z_NULL on entry to the initialization function, they are set to internal + routines that use the standard library functions malloc() and free(). + + On 16-bit systems, the functions zalloc and zfree must be able to allocate + exactly 65536 bytes, but will not be required to allocate more than this if + the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers + returned by zalloc for objects of exactly 65536 bytes *must* have their + offset normalized to zero. The default allocation function provided by this + library ensures this (see zutil.c). To reduce memory requirements and avoid + any allocation of 64K objects, at the expense of compression ratio, compile + the library with -DMAX_WBITS=14 (see zconf.h). + + The fields total_in and total_out can be used for statistics or progress + reports. After compression, total_in holds the total size of the + uncompressed data and may be saved for use by the decompressor (particularly + if the decompressor wants to decompress everything in a single step). +*/ + + /* constants */ + +#define Z_NO_FLUSH 0 +#define Z_PARTIAL_FLUSH 1 +#define Z_SYNC_FLUSH 2 +#define Z_FULL_FLUSH 3 +#define Z_FINISH 4 +#define Z_BLOCK 5 +#define Z_TREES 6 +/* Allowed flush values; see deflate() and inflate() below for details */ + +#define Z_OK 0 +#define Z_STREAM_END 1 +#define Z_NEED_DICT 2 +#define Z_ERRNO (-1) +#define Z_STREAM_ERROR (-2) +#define Z_DATA_ERROR (-3) +#define Z_MEM_ERROR (-4) +#define Z_BUF_ERROR (-5) +#define Z_VERSION_ERROR (-6) +/* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ + +#define Z_NO_COMPRESSION 0 +#define Z_BEST_SPEED 1 +#define Z_BEST_COMPRESSION 9 +#define Z_DEFAULT_COMPRESSION (-1) +/* compression levels */ + +#define Z_FILTERED 1 +#define Z_HUFFMAN_ONLY 2 +#define Z_RLE 3 +#define Z_FIXED 4 +#define Z_DEFAULT_STRATEGY 0 +/* compression strategy; see deflateInit2() below for details */ + +#define Z_BINARY 0 +#define Z_TEXT 1 +#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ +#define Z_UNKNOWN 2 +/* Possible values of the data_type field for deflate() */ + +#define Z_DEFLATED 8 +/* The deflate compression method (the only one supported in this version) */ + +#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ + +#define zlib_version zlibVersion() +/* for compatibility with versions < 1.0.2 */ + + + /* basic functions */ + +ZEXTERN const char * ZEXPORT zlibVersion OF((void)); +/* The application can compare zlibVersion and ZLIB_VERSION for consistency. + If the first character differs, the library code actually used is not + compatible with the zlib.h header file used by the application. This check + is automatically made by deflateInit and inflateInit. + */ + +/* +ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); + + Initializes the internal stream state for compression. The fields + zalloc, zfree and opaque must be initialized before by the caller. If + zalloc and zfree are set to Z_NULL, deflateInit updates them to use default + allocation functions. + + The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: + 1 gives best speed, 9 gives best compression, 0 gives no compression at all + (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION + requests a default compromise between speed and compression (currently + equivalent to level 6). + + deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if level is not a valid compression level, or + Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible + with the version assumed by the caller (ZLIB_VERSION). msg is set to null + if there is no error message. deflateInit does not perform any compression: + this will be done by deflate(). +*/ + + +ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); +/* + deflate compresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may introduce + some output latency (reading input without producing any output) except when + forced to flush. + + The detailed semantics are as follows. deflate performs one or both of the + following actions: + + - Compress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in and avail_in are updated and + processing will resume at this point for the next call of deflate(). + + - Generate more output starting at next_out and update next_out and avail_out + accordingly. This action is forced if the parameter flush is non zero. + Forcing flush frequently degrades the compression ratio, so this parameter + should be set only when necessary. Some output may be provided even if + flush is zero. + + Before the call of deflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming more + output, and updating avail_in or avail_out accordingly; avail_out should + never be zero before the call. The application can consume the compressed + output when it wants, for example when the output buffer is full (avail_out + == 0), or after each call of deflate(). If deflate returns Z_OK and with + zero avail_out, it must be called again after making room in the output + buffer because there might be more output pending. See deflatePending(), + which can be used if desired to determine whether or not there is more output + in that case. + + Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to + decide how much data to accumulate before producing output, in order to + maximize compression. + + If the parameter flush is set to Z_SYNC_FLUSH, all pending output is + flushed to the output buffer and the output is aligned on a byte boundary, so + that the decompressor can get all input data available so far. (In + particular avail_in is zero after the call if enough output space has been + provided before the call.) Flushing may degrade compression for some + compression algorithms and so it should be used only when necessary. This + completes the current deflate block and follows it with an empty stored block + that is three bits plus filler bits to the next byte, followed by four bytes + (00 00 ff ff). + + If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the + output buffer, but the output is not aligned to a byte boundary. All of the + input data so far will be available to the decompressor, as for Z_SYNC_FLUSH. + This completes the current deflate block and follows it with an empty fixed + codes block that is 10 bits long. This assures that enough bytes are output + in order for the decompressor to finish the block before the empty fixed + codes block. + + If flush is set to Z_BLOCK, a deflate block is completed and emitted, as + for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to + seven bits of the current block are held to be written as the next byte after + the next deflate block is completed. In this case, the decompressor may not + be provided enough bits at this point in order to complete decompression of + the data provided so far to the compressor. It may need to wait for the next + block to be emitted. This is for advanced applications that need to control + the emission of deflate blocks. + + If flush is set to Z_FULL_FLUSH, all output is flushed as with + Z_SYNC_FLUSH, and the compression state is reset so that decompression can + restart from this point if previous compressed data has been damaged or if + random access is desired. Using Z_FULL_FLUSH too often can seriously degrade + compression. + + If deflate returns with avail_out == 0, this function must be called again + with the same value of the flush parameter and more output space (updated + avail_out), until the flush is complete (deflate returns with non-zero + avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that + avail_out is greater than six to avoid repeated flush markers due to + avail_out == 0 on return. + + If the parameter flush is set to Z_FINISH, pending input is processed, + pending output is flushed and deflate returns with Z_STREAM_END if there was + enough output space. If deflate returns with Z_OK or Z_BUF_ERROR, this + function must be called again with Z_FINISH and more output space (updated + avail_out) but no more input data, until it returns with Z_STREAM_END or an + error. After deflate has returned Z_STREAM_END, the only possible operations + on the stream are deflateReset or deflateEnd. + + Z_FINISH can be used in the first deflate call after deflateInit if all the + compression is to be done in a single step. In order to complete in one + call, avail_out must be at least the value returned by deflateBound (see + below). Then deflate is guaranteed to return Z_STREAM_END. If not enough + output space is provided, deflate will not return Z_STREAM_END, and it must + be called again as described above. + + deflate() sets strm->adler to the Adler-32 checksum of all input read + so far (that is, total_in bytes). If a gzip stream is being generated, then + strm->adler will be the CRC-32 checksum of the input read so far. (See + deflateInit2 below.) + + deflate() may update strm->data_type if it can make a good guess about + the input data type (Z_BINARY or Z_TEXT). If in doubt, the data is + considered binary. This field is only for information purposes and does not + affect the compression algorithm in any manner. + + deflate() returns Z_OK if some progress has been made (more input + processed or more output produced), Z_STREAM_END if all input has been + consumed and all output has been produced (only when flush is set to + Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example + if next_in or next_out was Z_NULL or the state was inadvertently written over + by the application), or Z_BUF_ERROR if no progress is possible (for example + avail_in or avail_out was zero). Note that Z_BUF_ERROR is not fatal, and + deflate() can be called again with more input and more output space to + continue compressing. +*/ + + +ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any pending + output. + + deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the + stream state was inconsistent, Z_DATA_ERROR if the stream was freed + prematurely (some input or output was discarded). In the error case, msg + may be set but then points to a static string (which must not be + deallocated). +*/ + + +/* +ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); + + Initializes the internal stream state for decompression. The fields + next_in, avail_in, zalloc, zfree and opaque must be initialized before by + the caller. In the current version of inflate, the provided input is not + read or consumed. The allocation of a sliding window will be deferred to + the first call of inflate (if the decompression does not complete on the + first call). If zalloc and zfree are set to Z_NULL, inflateInit updates + them to use default allocation functions. + + inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_VERSION_ERROR if the zlib library version is incompatible with the + version assumed by the caller, or Z_STREAM_ERROR if the parameters are + invalid, such as a null pointer to the structure. msg is set to null if + there is no error message. inflateInit does not perform any decompression. + Actual decompression will be done by inflate(). So next_in, and avail_in, + next_out, and avail_out are unused and unchanged. The current + implementation of inflateInit() does not process any header information -- + that is deferred until inflate() is called. +*/ + + +ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); +/* + inflate decompresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may introduce + some output latency (reading input without producing any output) except when + forced to flush. + + The detailed semantics are as follows. inflate performs one or both of the + following actions: + + - Decompress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), then next_in and avail_in are updated + accordingly, and processing will resume at this point for the next call of + inflate(). + + - Generate more output starting at next_out and update next_out and avail_out + accordingly. inflate() provides as much output as possible, until there is + no more input data or no more space in the output buffer (see below about + the flush parameter). + + Before the call of inflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming more + output, and updating the next_* and avail_* values accordingly. If the + caller of inflate() does not provide both available input and available + output space, it is possible that there will be no progress made. The + application can consume the uncompressed output when it wants, for example + when the output buffer is full (avail_out == 0), or after each call of + inflate(). If inflate returns Z_OK and with zero avail_out, it must be + called again after making room in the output buffer because there might be + more output pending. + + The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH, + Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much + output as possible to the output buffer. Z_BLOCK requests that inflate() + stop if and when it gets to the next deflate block boundary. When decoding + the zlib or gzip format, this will cause inflate() to return immediately + after the header and before the first block. When doing a raw inflate, + inflate() will go ahead and process the first block, and will return when it + gets to the end of that block, or when it runs out of data. + + The Z_BLOCK option assists in appending to or combining deflate streams. + To assist in this, on return inflate() always sets strm->data_type to the + number of unused bits in the last byte taken from strm->next_in, plus 64 if + inflate() is currently decoding the last block in the deflate stream, plus + 128 if inflate() returned immediately after decoding an end-of-block code or + decoding the complete header up to just before the first byte of the deflate + stream. The end-of-block will not be indicated until all of the uncompressed + data from that block has been written to strm->next_out. The number of + unused bits may in general be greater than seven, except when bit 7 of + data_type is set, in which case the number of unused bits will be less than + eight. data_type is set as noted here every time inflate() returns for all + flush options, and so can be used to determine the amount of currently + consumed input in bits. + + The Z_TREES option behaves as Z_BLOCK does, but it also returns when the + end of each deflate block header is reached, before any actual data in that + block is decoded. This allows the caller to determine the length of the + deflate block header for later use in random access within a deflate block. + 256 is added to the value of strm->data_type when inflate() returns + immediately after reaching the end of the deflate block header. + + inflate() should normally be called until it returns Z_STREAM_END or an + error. However if all decompression is to be performed in a single step (a + single call of inflate), the parameter flush should be set to Z_FINISH. In + this case all pending input is processed and all pending output is flushed; + avail_out must be large enough to hold all of the uncompressed data for the + operation to complete. (The size of the uncompressed data may have been + saved by the compressor for this purpose.) The use of Z_FINISH is not + required to perform an inflation in one step. However it may be used to + inform inflate that a faster approach can be used for the single inflate() + call. Z_FINISH also informs inflate to not maintain a sliding window if the + stream completes, which reduces inflate's memory footprint. If the stream + does not complete, either because not all of the stream is provided or not + enough output space is provided, then a sliding window will be allocated and + inflate() can be called again to continue the operation as if Z_NO_FLUSH had + been used. + + In this implementation, inflate() always flushes as much output as + possible to the output buffer, and always uses the faster approach on the + first call. So the effects of the flush parameter in this implementation are + on the return value of inflate() as noted below, when inflate() returns early + when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of + memory for a sliding window when Z_FINISH is used. + + If a preset dictionary is needed after this call (see inflateSetDictionary + below), inflate sets strm->adler to the Adler-32 checksum of the dictionary + chosen by the compressor and returns Z_NEED_DICT; otherwise it sets + strm->adler to the Adler-32 checksum of all output produced so far (that is, + total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described + below. At the end of the stream, inflate() checks that its computed Adler-32 + checksum is equal to that saved by the compressor and returns Z_STREAM_END + only if the checksum is correct. + + inflate() can decompress and check either zlib-wrapped or gzip-wrapped + deflate data. The header type is detected automatically, if requested when + initializing with inflateInit2(). Any information contained in the gzip + header is not retained unless inflateGetHeader() is used. When processing + gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output + produced so far. The CRC-32 is checked against the gzip trailer, as is the + uncompressed length, modulo 2^32. + + inflate() returns Z_OK if some progress has been made (more input processed + or more output produced), Z_STREAM_END if the end of the compressed data has + been reached and all uncompressed output has been produced, Z_NEED_DICT if a + preset dictionary is needed at this point, Z_DATA_ERROR if the input data was + corrupted (input stream not conforming to the zlib format or incorrect check + value, in which case strm->msg points to a string with a more specific + error), Z_STREAM_ERROR if the stream structure was inconsistent (for example + next_in or next_out was Z_NULL, or the state was inadvertently written over + by the application), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR + if no progress was possible or if there was not enough room in the output + buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and + inflate() can be called again with more input and more output space to + continue decompressing. If Z_DATA_ERROR is returned, the application may + then call inflateSync() to look for a good compression block if a partial + recovery of the data is to be attempted. +*/ + + +ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any pending + output. + + inflateEnd returns Z_OK if success, or Z_STREAM_ERROR if the stream state + was inconsistent. +*/ + + + /* Advanced functions */ + +/* + The following functions are needed only in some special applications. +*/ + +/* +ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, + int level, + int method, + int windowBits, + int memLevel, + int strategy)); + + This is another version of deflateInit with more compression options. The + fields zalloc, zfree and opaque must be initialized before by the caller. + + The method parameter is the compression method. It must be Z_DEFLATED in + this version of the library. + + The windowBits parameter is the base two logarithm of the window size + (the size of the history buffer). It should be in the range 8..15 for this + version of the library. Larger values of this parameter result in better + compression at the expense of memory usage. The default value is 15 if + deflateInit is used instead. + + For the current implementation of deflate(), a windowBits value of 8 (a + window size of 256 bytes) is not supported. As a result, a request for 8 + will result in 9 (a 512-byte window). In that case, providing 8 to + inflateInit2() will result in an error when the zlib header with 9 is + checked against the initialization of inflate(). The remedy is to not use 8 + with deflateInit2() with this initialization, or at least in that case use 9 + with inflateInit2(). + + windowBits can also be -8..-15 for raw deflate. In this case, -windowBits + determines the window size. deflate() will then generate raw deflate data + with no zlib header or trailer, and will not compute a check value. + + windowBits can also be greater than 15 for optional gzip encoding. Add + 16 to windowBits to write a simple gzip header and trailer around the + compressed data instead of a zlib wrapper. The gzip header will have no + file name, no extra data, no comment, no modification time (set to zero), no + header crc, and the operating system will be set to the appropriate value, + if the operating system was determined at compile time. If a gzip stream is + being written, strm->adler is a CRC-32 instead of an Adler-32. + + For raw deflate or gzip encoding, a request for a 256-byte window is + rejected as invalid, since only the zlib header provides a means of + transmitting the window size to the decompressor. + + The memLevel parameter specifies how much memory should be allocated + for the internal compression state. memLevel=1 uses minimum memory but is + slow and reduces compression ratio; memLevel=9 uses maximum memory for + optimal speed. The default value is 8. See zconf.h for total memory usage + as a function of windowBits and memLevel. + + The strategy parameter is used to tune the compression algorithm. Use the + value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a + filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no + string match), or Z_RLE to limit match distances to one (run-length + encoding). Filtered data consists mostly of small values with a somewhat + random distribution. In this case, the compression algorithm is tuned to + compress them better. The effect of Z_FILTERED is to force more Huffman + coding and less string matching; it is somewhat intermediate between + Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as + fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The + strategy parameter only affects the compression ratio but not the + correctness of the compressed output even if it is not set appropriately. + Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler + decoder for special applications. + + deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid + method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is + incompatible with the version assumed by the caller (ZLIB_VERSION). msg is + set to null if there is no error message. deflateInit2 does not perform any + compression: this will be done by deflate(). +*/ + +ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +/* + Initializes the compression dictionary from the given byte sequence + without producing any compressed output. When using the zlib format, this + function must be called immediately after deflateInit, deflateInit2 or + deflateReset, and before any call of deflate. When doing raw deflate, this + function must be called either before any call of deflate, or immediately + after the completion of a deflate block, i.e. after all input has been + consumed and all output has been delivered when using any of the flush + options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH. The + compressor and decompressor must use exactly the same dictionary (see + inflateSetDictionary). + + The dictionary should consist of strings (byte sequences) that are likely + to be encountered later in the data to be compressed, with the most commonly + used strings preferably put towards the end of the dictionary. Using a + dictionary is most useful when the data to be compressed is short and can be + predicted with good accuracy; the data can then be compressed better than + with the default empty dictionary. + + Depending on the size of the compression data structures selected by + deflateInit or deflateInit2, a part of the dictionary may in effect be + discarded, for example if the dictionary is larger than the window size + provided in deflateInit or deflateInit2. Thus the strings most likely to be + useful should be put at the end of the dictionary, not at the front. In + addition, the current implementation of deflate will use at most the window + size minus 262 bytes of the provided dictionary. + + Upon return of this function, strm->adler is set to the Adler-32 value + of the dictionary; the decompressor may later use this value to determine + which dictionary has been used by the compressor. (The Adler-32 value + applies to the whole dictionary even if only a subset of the dictionary is + actually used by the compressor.) If a raw deflate was requested, then the + Adler-32 value is not computed and strm->adler is not set. + + deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a + parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is + inconsistent (for example if deflate has already been called for this stream + or if not at a block boundary for raw deflate). deflateSetDictionary does + not perform any compression: this will be done by deflate(). +*/ + +ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm, + Bytef *dictionary, + uInt *dictLength)); +/* + Returns the sliding dictionary being maintained by deflate. dictLength is + set to the number of bytes in the dictionary, and that many bytes are copied + to dictionary. dictionary must have enough space, where 32768 bytes is + always enough. If deflateGetDictionary() is called with dictionary equal to + Z_NULL, then only the dictionary length is returned, and nothing is copied. + Similarly, if dictLength is Z_NULL, then it is not set. + + deflateGetDictionary() may return a length less than the window size, even + when more than the window size in input has been provided. It may return up + to 258 bytes less in that case, due to how zlib's implementation of deflate + manages the sliding window and lookahead for matches, where matches can be + up to 258 bytes long. If the application needs the last window-size bytes of + input, then that would need to be saved by the application outside of zlib. + + deflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the + stream state is inconsistent. +*/ + +ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, + z_streamp source)); +/* + Sets the destination stream as a complete copy of the source stream. + + This function can be useful when several compression strategies will be + tried, for example when there are several ways of pre-processing the input + data with a filter. The streams that will be discarded should then be freed + by calling deflateEnd. Note that deflateCopy duplicates the internal + compression state which can be quite large, so this strategy is slow and can + consume lots of memory. + + deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + (such as zalloc being Z_NULL). msg is left unchanged in both source and + destination. +*/ + +ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); +/* + This function is equivalent to deflateEnd followed by deflateInit, but + does not free and reallocate the internal compression state. The stream + will leave the compression level and any other attributes that may have been + set unchanged. + + deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being Z_NULL). +*/ + +ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, + int level, + int strategy)); +/* + Dynamically update the compression level and compression strategy. The + interpretation of level and strategy is as in deflateInit2(). This can be + used to switch between compression and straight copy of the input data, or + to switch to a different kind of input data requiring a different strategy. + If the compression approach (which is a function of the level) or the + strategy is changed, and if there have been any deflate() calls since the + state was initialized or reset, then the input available so far is + compressed with the old level and strategy using deflate(strm, Z_BLOCK). + There are three approaches for the compression levels 0, 1..3, and 4..9 + respectively. The new level and strategy will take effect at the next call + of deflate(). + + If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does + not have enough output space to complete, then the parameter change will not + take effect. In this case, deflateParams() can be called again with the + same parameters and more output space to try again. + + In order to assure a change in the parameters on the first try, the + deflate stream should be flushed using deflate() with Z_BLOCK or other flush + request until strm.avail_out is not zero, before calling deflateParams(). + Then no more input data should be provided before the deflateParams() call. + If this is done, the old level and strategy will be applied to the data + compressed before deflateParams(), and the new level and strategy will be + applied to the the data compressed after deflateParams(). + + deflateParams returns Z_OK on success, Z_STREAM_ERROR if the source stream + state was inconsistent or if a parameter was invalid, or Z_BUF_ERROR if + there was not enough output space to complete the compression of the + available input data before a change in the strategy or approach. Note that + in the case of a Z_BUF_ERROR, the parameters are not changed. A return + value of Z_BUF_ERROR is not fatal, in which case deflateParams() can be + retried with more output space. +*/ + +ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, + int good_length, + int max_lazy, + int nice_length, + int max_chain)); +/* + Fine tune deflate's internal compression parameters. This should only be + used by someone who understands the algorithm used by zlib's deflate for + searching for the best matching string, and even then only by the most + fanatic optimizer trying to squeeze out the last compressed bit for their + specific input data. Read the deflate.c source code for the meaning of the + max_lazy, good_length, nice_length, and max_chain parameters. + + deflateTune() can be called after deflateInit() or deflateInit2(), and + returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. + */ + +ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, + uLong sourceLen)); +/* + deflateBound() returns an upper bound on the compressed size after + deflation of sourceLen bytes. It must be called after deflateInit() or + deflateInit2(), and after deflateSetHeader(), if used. This would be used + to allocate an output buffer for deflation in a single pass, and so would be + called before deflate(). If that first deflate() call is provided the + sourceLen input bytes, an output buffer allocated to the size returned by + deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed + to return Z_STREAM_END. Note that it is possible for the compressed size to + be larger than the value returned by deflateBound() if flush options other + than Z_FINISH or Z_NO_FLUSH are used. +*/ + +ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm, + unsigned *pending, + int *bits)); +/* + deflatePending() returns the number of bytes and bits of output that have + been generated, but not yet provided in the available output. The bytes not + provided would be due to the available output space having being consumed. + The number of bits of output not provided are between 0 and 7, where they + await more bits to join them in order to fill out a full byte. If pending + or bits are Z_NULL, then those values are not set. + + deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. + */ + +ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, + int bits, + int value)); +/* + deflatePrime() inserts bits in the deflate output stream. The intent + is that this function is used to start off the deflate output with the bits + leftover from a previous deflate stream when appending to it. As such, this + function can only be used for raw deflate, and must be used before the first + deflate() call after a deflateInit2() or deflateReset(). bits must be less + than or equal to 16, and that many of the least significant bits of value + will be inserted in the output. + + deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough + room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the + source stream state was inconsistent. +*/ + +ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, + gz_headerp head)); +/* + deflateSetHeader() provides gzip header information for when a gzip + stream is requested by deflateInit2(). deflateSetHeader() may be called + after deflateInit2() or deflateReset() and before the first call of + deflate(). The text, time, os, extra field, name, and comment information + in the provided gz_header structure are written to the gzip header (xflag is + ignored -- the extra flags are set according to the compression level). The + caller must assure that, if not Z_NULL, name and comment are terminated with + a zero byte, and that if extra is not Z_NULL, that extra_len bytes are + available there. If hcrc is true, a gzip header crc is included. Note that + the current versions of the command-line version of gzip (up through version + 1.3.x) do not support header crc's, and will report that it is a "multi-part + gzip file" and give up. + + If deflateSetHeader is not used, the default gzip header has text false, + the time set to zero, and os set to 255, with no extra, name, or comment + fields. The gzip header is returned to the default state by deflateReset(). + + deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +/* +ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, + int windowBits)); + + This is another version of inflateInit with an extra parameter. The + fields next_in, avail_in, zalloc, zfree and opaque must be initialized + before by the caller. + + The windowBits parameter is the base two logarithm of the maximum window + size (the size of the history buffer). It should be in the range 8..15 for + this version of the library. The default value is 15 if inflateInit is used + instead. windowBits must be greater than or equal to the windowBits value + provided to deflateInit2() while compressing, or it must be equal to 15 if + deflateInit2() was not used. If a compressed stream with a larger window + size is given as input, inflate() will return with the error code + Z_DATA_ERROR instead of trying to allocate a larger window. + + windowBits can also be zero to request that inflate use the window size in + the zlib header of the compressed stream. + + windowBits can also be -8..-15 for raw inflate. In this case, -windowBits + determines the window size. inflate() will then process raw deflate data, + not looking for a zlib or gzip header, not generating a check value, and not + looking for any check values for comparison at the end of the stream. This + is for use with other formats that use the deflate compressed data format + such as zip. Those formats provide their own check values. If a custom + format is developed using the raw deflate format for compressed data, it is + recommended that a check value such as an Adler-32 or a CRC-32 be applied to + the uncompressed data as is done in the zlib, gzip, and zip formats. For + most applications, the zlib format should be used as is. Note that comments + above on the use in deflateInit2() applies to the magnitude of windowBits. + + windowBits can also be greater than 15 for optional gzip decoding. Add + 32 to windowBits to enable zlib and gzip decoding with automatic header + detection, or add 16 to decode only the gzip format (the zlib format will + return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a + CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see + below), inflate() will *not* automatically decode concatenated gzip members. + inflate() will return Z_STREAM_END at the end of the gzip member. The state + would need to be reset to continue decoding a subsequent gzip member. This + *must* be done if there is more data after a gzip member, in order for the + decompression to be compliant with the gzip standard (RFC 1952). + + inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_VERSION_ERROR if the zlib library version is incompatible with the + version assumed by the caller, or Z_STREAM_ERROR if the parameters are + invalid, such as a null pointer to the structure. msg is set to null if + there is no error message. inflateInit2 does not perform any decompression + apart from possibly reading the zlib header if present: actual decompression + will be done by inflate(). (So next_in and avail_in may be modified, but + next_out and avail_out are unused and unchanged.) The current implementation + of inflateInit2() does not process any header information -- that is + deferred until inflate() is called. +*/ + +ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +/* + Initializes the decompression dictionary from the given uncompressed byte + sequence. This function must be called immediately after a call of inflate, + if that call returned Z_NEED_DICT. The dictionary chosen by the compressor + can be determined from the Adler-32 value returned by that call of inflate. + The compressor and decompressor must use exactly the same dictionary (see + deflateSetDictionary). For raw inflate, this function can be called at any + time to set the dictionary. If the provided dictionary is smaller than the + window and there is already data in the window, then the provided dictionary + will amend what's there. The application must insure that the dictionary + that was used for compression is provided. + + inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a + parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is + inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the + expected one (incorrect Adler-32 value). inflateSetDictionary does not + perform any decompression: this will be done by subsequent calls of + inflate(). +*/ + +ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm, + Bytef *dictionary, + uInt *dictLength)); +/* + Returns the sliding dictionary being maintained by inflate. dictLength is + set to the number of bytes in the dictionary, and that many bytes are copied + to dictionary. dictionary must have enough space, where 32768 bytes is + always enough. If inflateGetDictionary() is called with dictionary equal to + Z_NULL, then only the dictionary length is returned, and nothing is copied. + Similarly, if dictLength is Z_NULL, then it is not set. + + inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the + stream state is inconsistent. +*/ + +ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); +/* + Skips invalid compressed data until a possible full flush point (see above + for the description of deflate with Z_FULL_FLUSH) can be found, or until all + available input is skipped. No output is provided. + + inflateSync searches for a 00 00 FF FF pattern in the compressed data. + All full flush points have this pattern, but not all occurrences of this + pattern are full flush points. + + inflateSync returns Z_OK if a possible full flush point has been found, + Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point + has been found, or Z_STREAM_ERROR if the stream structure was inconsistent. + In the success case, the application may save the current current value of + total_in which indicates where valid compressed data was found. In the + error case, the application may repeatedly call inflateSync, providing more + input each time, until success or end of the input data. +*/ + +ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, + z_streamp source)); +/* + Sets the destination stream as a complete copy of the source stream. + + This function can be useful when randomly accessing a large stream. The + first pass through the stream can periodically record the inflate state, + allowing restarting inflate at those points when randomly accessing the + stream. + + inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + (such as zalloc being Z_NULL). msg is left unchanged in both source and + destination. +*/ + +ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); +/* + This function is equivalent to inflateEnd followed by inflateInit, + but does not free and reallocate the internal decompression state. The + stream will keep attributes that may have been set by inflateInit2. + + inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being Z_NULL). +*/ + +ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, + int windowBits)); +/* + This function is the same as inflateReset, but it also permits changing + the wrap and window size requests. The windowBits parameter is interpreted + the same as it is for inflateInit2. If the window size is changed, then the + memory allocated for the window is freed, and the window will be reallocated + by inflate() if needed. + + inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being Z_NULL), or if + the windowBits parameter is invalid. +*/ + +ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, + int bits, + int value)); +/* + This function inserts bits in the inflate input stream. The intent is + that this function is used to start inflating at a bit position in the + middle of a byte. The provided bits will be used before any bytes are used + from next_in. This function should only be used with raw inflate, and + should be used before the first inflate() call after inflateInit2() or + inflateReset(). bits must be less than or equal to 16, and that many of the + least significant bits of value will be inserted in the input. + + If bits is negative, then the input stream bit buffer is emptied. Then + inflatePrime() can be called again to put bits in the buffer. This is used + to clear out bits leftover after feeding inflate a block description prior + to feeding inflate codes. + + inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); +/* + This function returns two values, one in the lower 16 bits of the return + value, and the other in the remaining upper bits, obtained by shifting the + return value down 16 bits. If the upper value is -1 and the lower value is + zero, then inflate() is currently decoding information outside of a block. + If the upper value is -1 and the lower value is non-zero, then inflate is in + the middle of a stored block, with the lower value equaling the number of + bytes from the input remaining to copy. If the upper value is not -1, then + it is the number of bits back from the current bit position in the input of + the code (literal or length/distance pair) currently being processed. In + that case the lower value is the number of bytes already emitted for that + code. + + A code is being processed if inflate is waiting for more input to complete + decoding of the code, or if it has completed decoding but is waiting for + more output space to write the literal or match data. + + inflateMark() is used to mark locations in the input data for random + access, which may be at bit positions, and to note those cases where the + output of a code may span boundaries of random access blocks. The current + location in the input stream can be determined from avail_in and data_type + as noted in the description for the Z_BLOCK flush parameter for inflate. + + inflateMark returns the value noted above, or -65536 if the provided + source stream state was inconsistent. +*/ + +ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, + gz_headerp head)); +/* + inflateGetHeader() requests that gzip header information be stored in the + provided gz_header structure. inflateGetHeader() may be called after + inflateInit2() or inflateReset(), and before the first call of inflate(). + As inflate() processes the gzip stream, head->done is zero until the header + is completed, at which time head->done is set to one. If a zlib stream is + being decoded, then head->done is set to -1 to indicate that there will be + no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be + used to force inflate() to return immediately after header processing is + complete and before any actual data is decompressed. + + The text, time, xflags, and os fields are filled in with the gzip header + contents. hcrc is set to true if there is a header CRC. (The header CRC + was valid if done is set to one.) If extra is not Z_NULL, then extra_max + contains the maximum number of bytes to write to extra. Once done is true, + extra_len contains the actual extra field length, and extra contains the + extra field, or that field truncated if extra_max is less than extra_len. + If name is not Z_NULL, then up to name_max characters are written there, + terminated with a zero unless the length is greater than name_max. If + comment is not Z_NULL, then up to comm_max characters are written there, + terminated with a zero unless the length is greater than comm_max. When any + of extra, name, or comment are not Z_NULL and the respective field is not + present in the header, then that field is set to Z_NULL to signal its + absence. This allows the use of deflateSetHeader() with the returned + structure to duplicate the header. However if those fields are set to + allocated memory, then the application will need to save those pointers + elsewhere so that they can be eventually freed. + + If inflateGetHeader is not used, then the header information is simply + discarded. The header is always checked for validity, including the header + CRC if present. inflateReset() will reset the process to discard the header + information. The application would need to call inflateGetHeader() again to + retrieve the header from the next gzip stream. + + inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +/* +ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, + unsigned char FAR *window)); + + Initialize the internal stream state for decompression using inflateBack() + calls. The fields zalloc, zfree and opaque in strm must be initialized + before the call. If zalloc and zfree are Z_NULL, then the default library- + derived memory allocation routines are used. windowBits is the base two + logarithm of the window size, in the range 8..15. window is a caller + supplied buffer of that size. Except for special applications where it is + assured that deflate was used with small window sizes, windowBits must be 15 + and a 32K byte window must be supplied to be able to decompress general + deflate streams. + + See inflateBack() for the usage of these routines. + + inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of + the parameters are invalid, Z_MEM_ERROR if the internal state could not be + allocated, or Z_VERSION_ERROR if the version of the library does not match + the version of the header file. +*/ + +typedef unsigned (*in_func) OF((void FAR *, + z_const unsigned char FAR * FAR *)); +typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); + +ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, + in_func in, void FAR *in_desc, + out_func out, void FAR *out_desc)); +/* + inflateBack() does a raw inflate with a single call using a call-back + interface for input and output. This is potentially more efficient than + inflate() for file i/o applications, in that it avoids copying between the + output and the sliding window by simply making the window itself the output + buffer. inflate() can be faster on modern CPUs when used with large + buffers. inflateBack() trusts the application to not change the output + buffer passed by the output function, at least until inflateBack() returns. + + inflateBackInit() must be called first to allocate the internal state + and to initialize the state with the user-provided window buffer. + inflateBack() may then be used multiple times to inflate a complete, raw + deflate stream with each call. inflateBackEnd() is then called to free the + allocated state. + + A raw deflate stream is one with no zlib or gzip header or trailer. + This routine would normally be used in a utility that reads zip or gzip + files and writes out uncompressed files. The utility would decode the + header and process the trailer on its own, hence this routine expects only + the raw deflate stream to decompress. This is different from the default + behavior of inflate(), which expects a zlib header and trailer around the + deflate stream. + + inflateBack() uses two subroutines supplied by the caller that are then + called by inflateBack() for input and output. inflateBack() calls those + routines until it reads a complete deflate stream and writes out all of the + uncompressed data, or until it encounters an error. The function's + parameters and return types are defined above in the in_func and out_func + typedefs. inflateBack() will call in(in_desc, &buf) which should return the + number of bytes of provided input, and a pointer to that input in buf. If + there is no input available, in() must return zero -- buf is ignored in that + case -- and inflateBack() will return a buffer error. inflateBack() will + call out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. + out() should return zero on success, or non-zero on failure. If out() + returns non-zero, inflateBack() will return with an error. Neither in() nor + out() are permitted to change the contents of the window provided to + inflateBackInit(), which is also the buffer that out() uses to write from. + The length written by out() will be at most the window size. Any non-zero + amount of input may be provided by in(). + + For convenience, inflateBack() can be provided input on the first call by + setting strm->next_in and strm->avail_in. If that input is exhausted, then + in() will be called. Therefore strm->next_in must be initialized before + calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called + immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in + must also be initialized, and then if strm->avail_in is not zero, input will + initially be taken from strm->next_in[0 .. strm->avail_in - 1]. + + The in_desc and out_desc parameters of inflateBack() is passed as the + first parameter of in() and out() respectively when they are called. These + descriptors can be optionally used to pass any information that the caller- + supplied in() and out() functions need to do their job. + + On return, inflateBack() will set strm->next_in and strm->avail_in to + pass back any unused input that was provided by the last in() call. The + return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR + if in() or out() returned an error, Z_DATA_ERROR if there was a format error + in the deflate stream (in which case strm->msg is set to indicate the nature + of the error), or Z_STREAM_ERROR if the stream was not properly initialized. + In the case of Z_BUF_ERROR, an input or output error can be distinguished + using strm->next_in which will be Z_NULL only if in() returned an error. If + strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning + non-zero. (in() will always be called before out(), so strm->next_in is + assured to be defined if out() returns non-zero.) Note that inflateBack() + cannot return Z_OK. +*/ + +ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); +/* + All memory allocated by inflateBackInit() is freed. + + inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream + state was inconsistent. +*/ + +ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); +/* Return flags indicating compile-time options. + + Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: + 1.0: size of uInt + 3.2: size of uLong + 5.4: size of voidpf (pointer) + 7.6: size of z_off_t + + Compiler, assembler, and debug options: + 8: ZLIB_DEBUG + 9: ASMV or ASMINF -- use ASM code + 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention + 11: 0 (reserved) + + One-time table building (smaller code, but not thread-safe if true): + 12: BUILDFIXED -- build static block decoding tables when needed + 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed + 14,15: 0 (reserved) + + Library content (indicates missing functionality): + 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking + deflate code when not needed) + 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect + and decode gzip streams (to avoid linking crc code) + 18-19: 0 (reserved) + + Operation variations (changes in library functionality): + 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate + 21: FASTEST -- deflate algorithm with only one, lowest compression level + 22,23: 0 (reserved) + + The sprintf variant used by gzprintf (zero is best): + 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format + 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! + 26: 0 = returns value, 1 = void -- 1 means inferred string length returned + + Remainder: + 27-31: 0 (reserved) + */ + +#ifndef Z_SOLO + + /* utility functions */ + +/* + The following utility functions are implemented on top of the basic + stream-oriented functions. To simplify the interface, some default options + are assumed (compression level and memory usage, standard memory allocation + functions). The source code of these utility functions can be modified if + you need special options. +*/ + +ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); +/* + Compresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total size + of the destination buffer, which must be at least the value returned by + compressBound(sourceLen). Upon exit, destLen is the actual size of the + compressed data. compress() is equivalent to compress2() with a level + parameter of Z_DEFAULT_COMPRESSION. + + compress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer. +*/ + +ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen, + int level)); +/* + Compresses the source buffer into the destination buffer. The level + parameter has the same meaning as in deflateInit. sourceLen is the byte + length of the source buffer. Upon entry, destLen is the total size of the + destination buffer, which must be at least the value returned by + compressBound(sourceLen). Upon exit, destLen is the actual size of the + compressed data. + + compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_BUF_ERROR if there was not enough room in the output buffer, + Z_STREAM_ERROR if the level parameter is invalid. +*/ + +ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); +/* + compressBound() returns an upper bound on the compressed size after + compress() or compress2() on sourceLen bytes. It would be used before a + compress() or compress2() call to allocate the destination buffer. +*/ + +ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); +/* + Decompresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total size + of the destination buffer, which must be large enough to hold the entire + uncompressed data. (The size of the uncompressed data must have been saved + previously by the compressor and transmitted to the decompressor by some + mechanism outside the scope of this compression library.) Upon exit, destLen + is the actual size of the uncompressed data. + + uncompress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. In + the case where there is not enough room, uncompress() will fill the output + buffer with the uncompressed data up to that point. +*/ + +ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen)); +/* + Same as uncompress, except that sourceLen is a pointer, where the + length of the source is *sourceLen. On return, *sourceLen is the number of + source bytes consumed. +*/ + + /* gzip file access functions */ + +/* + This library supports reading and writing files in gzip (.gz) format with + an interface similar to that of stdio, using the functions that start with + "gz". The gzip format is different from the zlib format. gzip is a gzip + wrapper, documented in RFC 1952, wrapped around a deflate stream. +*/ + +typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */ + +/* +ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); + + Open the gzip (.gz) file at path for reading and decompressing, or + compressing and writing. The mode parameter is as in fopen ("rb" or "wb") + but can also include a compression level ("wb9") or a strategy: 'f' for + filtered data as in "wb6f", 'h' for Huffman-only compression as in "wb1h", + 'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression + as in "wb9F". (See the description of deflateInit2 for more information + about the strategy parameter.) 'T' will request transparent writing or + appending with no compression and not using the gzip format. + + "a" can be used instead of "w" to request that the gzip stream that will + be written be appended to the file. "+" will result in an error, since + reading and writing to the same gzip file is not supported. The addition of + "x" when writing will create the file exclusively, which fails if the file + already exists. On systems that support it, the addition of "e" when + reading or writing will set the flag to close the file on an execve() call. + + These functions, as well as gzip, will read and decode a sequence of gzip + streams in a file. The append function of gzopen() can be used to create + such a file. (Also see gzflush() for another way to do this.) When + appending, gzopen does not test whether the file begins with a gzip stream, + nor does it look for the end of the gzip streams to begin appending. gzopen + will simply append a gzip stream to the existing file. + + gzopen can be used to read a file which is not in gzip format; in this + case gzread will directly read from the file without decompression. When + reading, this will be detected automatically by looking for the magic two- + byte gzip header. + + gzopen returns NULL if the file could not be opened, if there was + insufficient memory to allocate the gzFile state, or if an invalid mode was + specified (an 'r', 'w', or 'a' was not provided, or '+' was provided). + errno can be checked to determine if the reason gzopen failed was that the + file could not be opened. +*/ + +ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); +/* + Associate a gzFile with the file descriptor fd. File descriptors are + obtained from calls like open, dup, creat, pipe or fileno (if the file has + been previously opened with fopen). The mode parameter is as in gzopen. + + The next call of gzclose on the returned gzFile will also close the file + descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor + fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd, + mode);. The duplicated descriptor should be saved to avoid a leak, since + gzdopen does not close fd if it fails. If you are using fileno() to get the + file descriptor from a FILE *, then you will have to use dup() to avoid + double-close()ing the file descriptor. Both gzclose() and fclose() will + close the associated file descriptor, so they need to have different file + descriptors. + + gzdopen returns NULL if there was insufficient memory to allocate the + gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not + provided, or '+' was provided), or if fd is -1. The file descriptor is not + used until the next gz* read, write, seek, or close operation, so gzdopen + will not detect if fd is invalid (unless fd is -1). +*/ + +ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); +/* + Set the internal buffer size used by this library's functions for file to + size. The default buffer size is 8192 bytes. This function must be called + after gzopen() or gzdopen(), and before any other calls that read or write + the file. The buffer memory allocation is always deferred to the first read + or write. Three times that size in buffer space is allocated. A larger + buffer size of, for example, 64K or 128K bytes will noticeably increase the + speed of decompression (reading). + + The new buffer size also affects the maximum length for gzprintf(). + + gzbuffer() returns 0 on success, or -1 on failure, such as being called + too late. +*/ + +ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); +/* + Dynamically update the compression level and strategy for file. See the + description of deflateInit2 for the meaning of these parameters. Previously + provided data is flushed before applying the parameter changes. + + gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not + opened for writing, Z_ERRNO if there is an error writing the flushed data, + or Z_MEM_ERROR if there is a memory allocation error. +*/ + +ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); +/* + Read and decompress up to len uncompressed bytes from file into buf. If + the input file is not in gzip format, gzread copies the given number of + bytes into the buffer directly from the file. + + After reaching the end of a gzip stream in the input, gzread will continue + to read, looking for another gzip stream. Any number of gzip streams may be + concatenated in the input file, and will all be decompressed by gzread(). + If something other than a gzip stream is encountered after a gzip stream, + that remaining trailing garbage is ignored (and no error is returned). + + gzread can be used to read a gzip file that is being concurrently written. + Upon reaching the end of the input, gzread will return with the available + data. If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then + gzclearerr can be used to clear the end of file indicator in order to permit + gzread to be tried again. Z_OK indicates that a gzip stream was completed + on the last gzread. Z_BUF_ERROR indicates that the input file ended in the + middle of a gzip stream. Note that gzread does not return -1 in the event + of an incomplete gzip stream. This error is deferred until gzclose(), which + will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip + stream. Alternatively, gzerror can be used before gzclose to detect this + case. + + gzread returns the number of uncompressed bytes actually read, less than + len for end of file, or -1 for error. If len is too large to fit in an int, + then nothing is read, -1 is returned, and the error state is set to + Z_STREAM_ERROR. +*/ + +ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems, + gzFile file)); +/* + Read and decompress up to nitems items of size size from file into buf, + otherwise operating as gzread() does. This duplicates the interface of + stdio's fread(), with size_t request and return types. If the library + defines size_t, then z_size_t is identical to size_t. If not, then z_size_t + is an unsigned integer type that can contain a pointer. + + gzfread() returns the number of full items read of size size, or zero if + the end of the file was reached and a full item could not be read, or if + there was an error. gzerror() must be consulted if zero is returned in + order to determine if there was an error. If the multiplication of size and + nitems overflows, i.e. the product does not fit in a z_size_t, then nothing + is read, zero is returned, and the error state is set to Z_STREAM_ERROR. + + In the event that the end of file is reached and only a partial item is + available at the end, i.e. the remaining uncompressed data length is not a + multiple of size, then the final partial item is nevertheless read into buf + and the end-of-file flag is set. The length of the partial item read is not + provided, but could be inferred from the result of gztell(). This behavior + is the same as the behavior of fread() implementations in common libraries, + but it prevents the direct use of gzfread() to read a concurrently written + file, resetting and retrying on end-of-file, when size is not 1. +*/ + +ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len)); +/* + Compress and write the len uncompressed bytes at buf to file. gzwrite + returns the number of uncompressed bytes written or 0 in case of error. +*/ + +ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size, + z_size_t nitems, gzFile file)); +/* + Compress and write nitems items of size size from buf to file, duplicating + the interface of stdio's fwrite(), with size_t request and return types. If + the library defines size_t, then z_size_t is identical to size_t. If not, + then z_size_t is an unsigned integer type that can contain a pointer. + + gzfwrite() returns the number of full items written of size size, or zero + if there was an error. If the multiplication of size and nitems overflows, + i.e. the product does not fit in a z_size_t, then nothing is written, zero + is returned, and the error state is set to Z_STREAM_ERROR. +*/ + +ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)); +/* + Convert, format, compress, and write the arguments (...) to file under + control of the string format, as in fprintf. gzprintf returns the number of + uncompressed bytes actually written, or a negative zlib error code in case + of error. The number of uncompressed bytes written is limited to 8191, or + one less than the buffer size given to gzbuffer(). The caller should assure + that this limit is not exceeded. If it is exceeded, then gzprintf() will + return an error (0) with nothing written. In this case, there may also be a + buffer overflow with unpredictable consequences, which is possible only if + zlib was compiled with the insecure functions sprintf() or vsprintf(), + because the secure snprintf() or vsnprintf() functions were not available. + This can be determined using zlibCompileFlags(). +*/ + +ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); +/* + Compress and write the given null-terminated string s to file, excluding + the terminating null character. + + gzputs returns the number of characters written, or -1 in case of error. +*/ + +ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); +/* + Read and decompress bytes from file into buf, until len-1 characters are + read, or until a newline character is read and transferred to buf, or an + end-of-file condition is encountered. If any characters are read or if len + is one, the string is terminated with a null character. If no characters + are read due to an end-of-file or len is less than one, then the buffer is + left untouched. + + gzgets returns buf which is a null-terminated string, or it returns NULL + for end-of-file or in case of error. If there was an error, the contents at + buf are indeterminate. +*/ + +ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); +/* + Compress and write c, converted to an unsigned char, into file. gzputc + returns the value that was written, or -1 in case of error. +*/ + +ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); +/* + Read and decompress one byte from file. gzgetc returns this byte or -1 + in case of end of file or error. This is implemented as a macro for speed. + As such, it does not do all of the checking the other functions do. I.e. + it does not check to see if file is NULL, nor whether the structure file + points to has been clobbered or not. +*/ + +ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); +/* + Push c back onto the stream for file to be read as the first character on + the next read. At least one character of push-back is always allowed. + gzungetc() returns the character pushed, or -1 on failure. gzungetc() will + fail if c is -1, and may fail if a character has been pushed but not read + yet. If gzungetc is used immediately after gzopen or gzdopen, at least the + output buffer size of pushed characters is allowed. (See gzbuffer above.) + The pushed character will be discarded if the stream is repositioned with + gzseek() or gzrewind(). +*/ + +ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); +/* + Flush all pending output to file. The parameter flush is as in the + deflate() function. The return value is the zlib error number (see function + gzerror below). gzflush is only permitted when writing. + + If the flush parameter is Z_FINISH, the remaining data is written and the + gzip stream is completed in the output. If gzwrite() is called again, a new + gzip stream will be started in the output. gzread() is able to read such + concatenated gzip streams. + + gzflush should be called only when strictly necessary because it will + degrade compression if called too often. +*/ + +/* +ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, + z_off_t offset, int whence)); + + Set the starting position to offset relative to whence for the next gzread + or gzwrite on file. The offset represents a number of bytes in the + uncompressed data stream. The whence parameter is defined as in lseek(2); + the value SEEK_END is not supported. + + If the file is opened for reading, this function is emulated but can be + extremely slow. If the file is opened for writing, only forward seeks are + supported; gzseek then compresses a sequence of zeroes up to the new + starting position. + + gzseek returns the resulting offset location as measured in bytes from + the beginning of the uncompressed stream, or -1 in case of error, in + particular if the file is opened for writing and the new starting position + would be before the current position. +*/ + +ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); +/* + Rewind file. This function is supported only for reading. + + gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET). +*/ + +/* +ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); + + Return the starting position for the next gzread or gzwrite on file. + This position represents a number of bytes in the uncompressed data stream, + and is zero when starting, even if appending or reading a gzip stream from + the middle of a file using gzdopen(). + + gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) +*/ + +/* +ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); + + Return the current compressed (actual) read or write offset of file. This + offset includes the count of bytes that precede the gzip stream, for example + when appending or when using gzdopen() for reading. When reading, the + offset does not include as yet unused buffered input. This information can + be used for a progress indicator. On error, gzoffset() returns -1. +*/ + +ZEXTERN int ZEXPORT gzeof OF((gzFile file)); +/* + Return true (1) if the end-of-file indicator for file has been set while + reading, false (0) otherwise. Note that the end-of-file indicator is set + only if the read tried to go past the end of the input, but came up short. + Therefore, just like feof(), gzeof() may return false even if there is no + more data to read, in the event that the last read request was for the exact + number of bytes remaining in the input file. This will happen if the input + file size is an exact multiple of the buffer size. + + If gzeof() returns true, then the read functions will return no more data, + unless the end-of-file indicator is reset by gzclearerr() and the input file + has grown since the previous end of file was detected. +*/ + +ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); +/* + Return true (1) if file is being copied directly while reading, or false + (0) if file is a gzip stream being decompressed. + + If the input file is empty, gzdirect() will return true, since the input + does not contain a gzip stream. + + If gzdirect() is used immediately after gzopen() or gzdopen() it will + cause buffers to be allocated to allow reading the file to determine if it + is a gzip file. Therefore if gzbuffer() is used, it should be called before + gzdirect(). + + When writing, gzdirect() returns true (1) if transparent writing was + requested ("wT" for the gzopen() mode), or false (0) otherwise. (Note: + gzdirect() is not needed when writing. Transparent writing must be + explicitly requested, so the application already knows the answer. When + linking statically, using gzdirect() will include all of the zlib code for + gzip file reading and decompression, which may not be desired.) +*/ + +ZEXTERN int ZEXPORT gzclose OF((gzFile file)); +/* + Flush all pending output for file, if necessary, close file and + deallocate the (de)compression state. Note that once file is closed, you + cannot call gzerror with file, since its structures have been deallocated. + gzclose must not be called more than once on the same file, just as free + must not be called more than once on the same allocation. + + gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a + file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the + last read ended in the middle of a gzip stream, or Z_OK on success. +*/ + +ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); +ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); +/* + Same as gzclose(), but gzclose_r() is only for use when reading, and + gzclose_w() is only for use when writing or appending. The advantage to + using these instead of gzclose() is that they avoid linking in zlib + compression or decompression code that is not used when only reading or only + writing respectively. If gzclose() is used, then both compression and + decompression code will be included the application when linking to a static + zlib library. +*/ + +ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); +/* + Return the error message for the last error which occurred on file. + errnum is set to zlib error number. If an error occurred in the file system + and not in the compression library, errnum is set to Z_ERRNO and the + application may consult errno to get the exact error code. + + The application must not modify the returned string. Future calls to + this function may invalidate the previously returned string. If file is + closed, then the string previously returned by gzerror will no longer be + available. + + gzerror() should be used to distinguish errors from end-of-file for those + functions above that do not distinguish those cases in their return values. +*/ + +ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); +/* + Clear the error and end-of-file flags for file. This is analogous to the + clearerr() function in stdio. This is useful for continuing to read a gzip + file that is being written concurrently. +*/ + +#endif /* !Z_SOLO */ + + /* checksum functions */ + +/* + These functions are not related to compression but are exported + anyway because they might be useful in applications using the compression + library. +*/ + +ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); +/* + Update a running Adler-32 checksum with the bytes buf[0..len-1] and + return the updated checksum. An Adler-32 value is in the range of a 32-bit + unsigned integer. If buf is Z_NULL, this function returns the required + initial value for the checksum. + + An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed + much faster. + + Usage example: + + uLong adler = adler32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + adler = adler32(adler, buffer, length); + } + if (adler != original_adler) error(); +*/ + +ZEXTERN uLong ZEXPORT adler32_z OF((uLong adler, const Bytef *buf, + z_size_t len)); +/* + Same as adler32(), but with a size_t length. +*/ + +/* +ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, + z_off_t len2)); + + Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 + and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for + each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of + seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. Note + that the z_off_t type (like off_t) is a signed integer. If len2 is + negative, the result has no meaning or utility. +*/ + +ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); +/* + Update a running CRC-32 with the bytes buf[0..len-1] and return the + updated CRC-32. A CRC-32 value is in the range of a 32-bit unsigned integer. + If buf is Z_NULL, this function returns the required initial value for the + crc. Pre- and post-conditioning (one's complement) is performed within this + function so it shouldn't be done by the application. + + Usage example: + + uLong crc = crc32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + crc = crc32(crc, buffer, length); + } + if (crc != original_crc) error(); +*/ + +ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf, + z_size_t len)); +/* + Same as crc32(), but with a size_t length. +*/ + +/* +ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); + + Combine two CRC-32 check values into one. For two sequences of bytes, + seq1 and seq2 with lengths len1 and len2, CRC-32 check values were + calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 + check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and + len2. +*/ + +/* +ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t len2)); + + Return the operator corresponding to length len2, to be used with + crc32_combine_op(). +*/ + +ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op)); +/* + Give the same result as crc32_combine(), using op in place of len2. op is + is generated from len2 by crc32_combine_gen(). This will be faster than + crc32_combine() if the generated op is used more than once. +*/ + + + /* various hacks, don't look :) */ + +/* deflateInit and inflateInit are macros to allow checking the zlib version + * and the compiler's view of z_stream: + */ +ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, + int windowBits, int memLevel, + int strategy, const char *version, + int stream_size)); +ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, + unsigned char FAR *window, + const char *version, + int stream_size)); +#ifdef Z_PREFIX_SET +# define z_deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) +# define z_inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) +# define z_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ + (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) +# define z_inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ + (int)sizeof(z_stream)) +# define z_inflateBackInit(strm, windowBits, window) \ + inflateBackInit_((strm), (windowBits), (window), \ + ZLIB_VERSION, (int)sizeof(z_stream)) +#else +# define deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) +# define inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) +# define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ + (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) +# define inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ + (int)sizeof(z_stream)) +# define inflateBackInit(strm, windowBits, window) \ + inflateBackInit_((strm), (windowBits), (window), \ + ZLIB_VERSION, (int)sizeof(z_stream)) +#endif + +#ifndef Z_SOLO + +/* gzgetc() macro and its supporting function and exposed data structure. Note + * that the real internal state is much larger than the exposed structure. + * This abbreviated structure exposes just enough for the gzgetc() macro. The + * user should not mess with these exposed elements, since their names or + * behavior could change in the future, perhaps even capriciously. They can + * only be used by the gzgetc() macro. You have been warned. + */ +struct gzFile_s { + unsigned have; + unsigned char *next; + z_off64_t pos; +}; +ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ +#ifdef Z_PREFIX_SET +# undef z_gzgetc +# define z_gzgetc(g) \ + ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) +#else +# define gzgetc(g) \ + ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) +#endif + +/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or + * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if + * both are true, the application gets the *64 functions, and the regular + * functions are changed to 64 bits) -- in case these are set on systems + * without large file support, _LFS64_LARGEFILE must also be true + */ +#ifdef Z_LARGE64 + ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); + ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); + ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); + ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); + ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t)); + ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t)); + ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off64_t)); +#endif + +#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64) +# ifdef Z_PREFIX_SET +# define z_gzopen z_gzopen64 +# define z_gzseek z_gzseek64 +# define z_gztell z_gztell64 +# define z_gzoffset z_gzoffset64 +# define z_adler32_combine z_adler32_combine64 +# define z_crc32_combine z_crc32_combine64 +# define z_crc32_combine_gen z_crc32_combine_gen64 +# else +# define gzopen gzopen64 +# define gzseek gzseek64 +# define gztell gztell64 +# define gzoffset gzoffset64 +# define adler32_combine adler32_combine64 +# define crc32_combine crc32_combine64 +# define crc32_combine_gen crc32_combine_gen64 +# endif +# ifndef Z_LARGE64 + ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); + ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); + ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); + ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); + ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t)); +# endif +#else + ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); + ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); + ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); + ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); + ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t)); +#endif + +#else /* Z_SOLO */ + + ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t)); + +#endif /* !Z_SOLO */ + +/* undocumented functions */ +ZEXTERN const char * ZEXPORT zError OF((int)); +ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); +ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void)); +ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); +ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int)); +ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF((z_streamp)); +ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp)); +ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp)); +#if defined(_WIN32) && !defined(Z_SOLO) +ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path, + const char *mode)); +#endif +#if defined(STDC) || defined(Z_HAVE_STDARG_H) +# ifndef Z_SOLO +ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file, + const char *format, + va_list va)); +# endif +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* ZLIB_H */ diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/DirectX-Guids.lib b/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/DirectX-Guids.lib new file mode 100644 index 0000000..f7591a8 Binary files /dev/null and b/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/DirectX-Guids.lib differ diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/DirectXTex.lib b/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/DirectXTex.lib new file mode 100644 index 0000000..1328dc2 Binary files /dev/null and b/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/DirectXTex.lib differ diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/cpr.lib b/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/cpr.lib new file mode 100644 index 0000000..b413656 Binary files /dev/null and b/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/cpr.lib differ diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/gif.lib b/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/gif.lib new file mode 100644 index 0000000..0358ff3 Binary files /dev/null and b/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/gif.lib differ diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/libcurl.lib b/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/libcurl.lib new file mode 100644 index 0000000..f064ed3 Binary files /dev/null and b/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/libcurl.lib differ diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/minhook.x64.lib b/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/minhook.x64.lib new file mode 100644 index 0000000..3e8d91a Binary files /dev/null and b/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/minhook.x64.lib differ diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/pkgconfig/libcurl.pc b/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/pkgconfig/libcurl.pc new file mode 100644 index 0000000..6016a5d --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/pkgconfig/libcurl.pc @@ -0,0 +1,40 @@ +prefix=${pcfiledir}/../.. +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) 1998 - 2022, Daniel Stenberg, , et al. +# +# This software is licensed as described in the file COPYING, which +# you should have received as part of this distribution. The terms +# are also available at https://curl.se/docs/copyright.html. +# +# You may opt to use, copy, modify, merge, publish, distribute and/or sell +# copies of the Software, and permit persons to whom the Software is +# furnished to do so, under the terms of the COPYING file. +# +# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +# KIND, either express or implied. +# +# SPDX-License-Identifier: curl +# +########################################################################### + +# This should most probably benefit from getting a "Requires:" field added +# dynamically by configure. +# +exec_prefix=${prefix} +libdir=${prefix}/lib +includedir=${prefix}/include +supported_protocols="DICT FILE FTP FTPS GOPHER GOPHERS HTTP HTTPS IMAP IMAPS MQTT POP3 POP3S RTSP SMB SMBS SMTP SMTPS TELNET TFTP" +supported_features="SSL IPv6 unixsockets libz AsynchDNS Largefile SSPI alt-svc HSTS SPNEGO Kerberos NTLM unicode threadsafe" + +Name: libcurl +URL: https://curl.se/ +Description: Library to transfer files with ftp, http, etc. +Version: 7.86.0-DEV +Libs: -L"${libdir}" -llibcurl -lwinmm -lws2_32 -lzlib -ladvapi32 -lcrypt32 -lbcrypt +Cflags: -I"${includedir}" diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/pkgconfig/zlib.pc b/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/pkgconfig/zlib.pc new file mode 100644 index 0000000..24eb50d --- /dev/null +++ b/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/pkgconfig/zlib.pc @@ -0,0 +1,14 @@ +prefix=${pcfiledir}/../.. + +exec_prefix=${prefix} +libdir=${prefix}/lib +sharedlibdir=${prefix}/lib +includedir=${prefix}/include + +Name: zlib +Description: zlib compression library +Version: 1.2.13 + +Libs: -L"${libdir}" -L"${sharedlibdir}" -lzlib +Requires: +Cflags: -I"${includedir}" diff --git a/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/zlib.lib b/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/zlib.lib new file mode 100644 index 0000000..0194743 Binary files /dev/null and b/EscapeTheBackroomsGUiTest/vcpkg_Out/lib/zlib.lib differ diff --git a/README.md b/README.md index acbe024..8667c50 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,25 @@ # EscapeTheBackrooms Internal Trainer --- -# Legal and ethical shit +## About +A simple Trainer for the Game "Escape The Backrooms" for messing around a little with the Game. +I made this with the Objective of learning a little more about the Inner Workings and reverse Engineering in Unreal Engine Games. -This Project was just for Educational Purposes so i could learn more about making Trainers for UE Games. It was never my intention to create an Cheat to Destroy other Peoples gaming Experience even if i experimented a little around with some Techniques to do so (With Friends not random Players). +## Legality and Ethicality +This Project was just made for **Educational Purposes**. **It was never my intention to create an Cheat to Destroy other Peoples gaming Experience** even if i experimented a little around with some Techniques to do so (With Friends not random Players). +So Use this Project just for Educational Purposes or to have fun, don´t be an Asshole🧙‍♂️, Always Respect and Support small Game Developer Studios and their Work❤️ -Use this Project also just for Educational Purposes since it was also just my purpose for this whole Project. Always Respect and Support small Game Developer Studios and their Work❤️ +## Peoples work i used -# Peoples work i used +* Canvas based GUI: [MaddyOff´s Canvas Gui](https://github.com/MaddyOff/ue4-canvas-gui) +* Sig Scanning: [Guided Hacking Rake´s Pattern Scanner](https://github.com/GH-Rake/PatternScan) +* Generating SDK: [Encryped and Fischsalat´s Unreal Dumper](https://github.com/Encryqed/Dumper-7) -* For the Canvas based GUI: https://github.com/MaddyOff/ue4-canvas-gui -* For the Sig Scanning i didnt implement yet: https://github.com/GH-Rake/PatternScan -* For the generated SDK: https://github.com/Encryqed/Dumper-7 +## How to Build: + +### Normal: +* Download and Open in Visual Studio 2022 the .sln File of the Project +* And then Build as "Release" no other Dependencies required! + +### CMake (Soon!): \ No newline at end of file