From 5f6cd6abdd3a130a66781538586480acfb89b9f7 Mon Sep 17 00:00:00 2001 From: Amer Koleci Date: Fri, 2 Sep 2022 12:56:31 +0200 Subject: [PATCH] Generator: WIP Com types generation. --- src/Generator/ApiData.cs | 20 + src/Generator/CodeWriter.cs | 5 +- src/Generator/Program.cs | 262 +++++++- src/Vortice.Win32/Attributes.cs | 16 + src/Vortice.Win32/Generated/DXGI.xml | 610 +++++++++--------- .../Generated/Graphics/Dxgi.Common.cs | 6 +- src/Vortice.Win32/Generated/Graphics/Dxgi.cs | 122 +++- src/Vortice.Win32/NetStandard.cs | 2 +- src/samples/01-ClearScreen/Program.cs | 4 - 9 files changed, 700 insertions(+), 347 deletions(-) diff --git a/src/Generator/ApiData.cs b/src/Generator/ApiData.cs index 229fba6..364db46 100644 --- a/src/Generator/ApiData.cs +++ b/src/Generator/ApiData.cs @@ -42,6 +42,21 @@ public class ApiStructField public ApiDataType Type { get; set; } } +public class ApiParameter +{ + public string Name { get; set; } + public ApiDataType Type { get; set; } +} + +public class ApiFunction +{ + public string Name { get; set; } + public bool SetLastError { get; set; } + public ApiDataType ReturnType { get; set; } + public IList Params { get; set; } = new List(); + public List Attrs { get; set; } +} + public class ApiType { public string Name { get; set; } @@ -57,6 +72,11 @@ public class ApiType public int Size { get; set; } public int PackingSize { get; set; } public ApiStructField[] Fields { get; set; } + + // Com + public string Guid { get; set; } + public ApiDataType Interface { get; set; } + public IList Methods { get; set; } = new List(); } public sealed class ApiData diff --git a/src/Generator/CodeWriter.cs b/src/Generator/CodeWriter.cs index 6a13a9c..80847e8 100644 --- a/src/Generator/CodeWriter.cs +++ b/src/Generator/CodeWriter.cs @@ -37,6 +37,7 @@ public sealed class CodeWriter : IDisposable _writer.WriteLine(); _writer.WriteLine($"using System;"); + _writer.WriteLine($"using System.Diagnostics;"); _writer.WriteLine($"using System.Runtime.CompilerServices;"); _writer.WriteLine($"using System.Diagnostics.CodeAnalysis;"); @@ -46,7 +47,7 @@ public sealed class CodeWriter : IDisposable } _writer.WriteLine(); - _writer.WriteLine("#if NETSTANDARD2_0"); + _writer.WriteLine("#if !NET6_0_OR_GREATER"); _writer.WriteLine("using MemoryMarshal = Win32.MemoryMarshal;"); _writer.WriteLine("#endif"); _writer.WriteLine(); @@ -83,7 +84,7 @@ public sealed class CodeWriter : IDisposable _shouldIndent = true; } - public void WriteUndindented(string @string) + public void WriteLineUndindented(string @string) { _writer.WriteLine(@string); _shouldIndent = true; diff --git a/src/Generator/Program.cs b/src/Generator/Program.cs index ce030d8..2ea6c1f 100644 --- a/src/Generator/Program.cs +++ b/src/Generator/Program.cs @@ -7,7 +7,6 @@ using System.Xml; using MessagePack; using Microsoft.Windows.SDK.Win32Docs; using Newtonsoft.Json; -using Newtonsoft.Json.Linq; namespace Generator; @@ -45,6 +44,8 @@ public static class Program { "Foundation.LUID", "Luid" }, { "Foundation.LARGE_INTEGER", "LargeInterger" }, + { "System.Com.IUnknown", "IUnknown" }, + // TODO: Understand those -> { "Foundation.HWND", "IntPtr" }, { "Foundation.HANDLE", "IntPtr" }, @@ -208,38 +209,38 @@ public static class Program { writer.WriteStartElement(null, "param", null); string paramName = param.Key; - if (paramName.StartsWith("pp") && char.IsUpper(paramName[2])) - { - paramName = paramName.Substring(2); - paramName = paramName[0].ToString().ToLower() + paramName.Substring(1); - } - else if (paramName.StartsWith("p") && char.IsUpper(paramName[1])) - { - paramName = paramName.Substring(1); - paramName = paramName[0].ToString().ToLower() + paramName.Substring(1); - } - else if (paramName.StartsWith("u") && char.IsUpper(paramName[1])) - { - paramName = paramName.Substring(1); - paramName = paramName[0].ToString().ToLower() + paramName.Substring(1); - } - else if (paramName.StartsWith("b") && char.IsUpper(paramName[1])) // bEnable - { - paramName = paramName.Substring(1); - paramName = paramName[0].ToString().ToLower() + paramName.Substring(1); - } - else if (char.IsUpper(paramName[0]) && paramName.Length > 1 && char.IsLower(paramName[1])) - { - paramName = paramName[0].ToString().ToLower() + paramName.Substring(1); - } - else if (paramName == "ID") - { - paramName = "id"; - } - else if (paramName == "dwCookie") - { - paramName = "cookie"; - } + //if (paramName.StartsWith("pp") && char.IsUpper(paramName[2])) + //{ + // paramName = paramName.Substring(2); + // paramName = paramName[0].ToString().ToLower() + paramName.Substring(1); + //} + //else if (paramName.StartsWith("p") && char.IsUpper(paramName[1])) + //{ + // paramName = paramName.Substring(1); + // paramName = paramName[0].ToString().ToLower() + paramName.Substring(1); + //} + //else if (paramName.StartsWith("u") && char.IsUpper(paramName[1])) + //{ + // paramName = paramName.Substring(1); + // paramName = paramName[0].ToString().ToLower() + paramName.Substring(1); + //} + //else if (paramName.StartsWith("b") && char.IsUpper(paramName[1])) // bEnable + //{ + // paramName = paramName.Substring(1); + // paramName = paramName[0].ToString().ToLower() + paramName.Substring(1); + //} + //else if (char.IsUpper(paramName[0]) && paramName.Length > 1 && char.IsLower(paramName[1])) + //{ + // paramName = paramName[0].ToString().ToLower() + paramName.Substring(1); + //} + //else if (paramName == "ID") + //{ + // paramName = "id"; + //} + //else if (paramName == "dwCookie") + //{ + // paramName = "cookie"; + //} writer.WriteAttributeString("name", paramName); @@ -492,6 +493,15 @@ public static class Program } writer.WriteLine($"#endregion Structs"); writer.WriteLine(); + + // Com types + writer.WriteLine($"#region COM Types"); + foreach (ApiType comType in api.Types.Where(item => item.Kind.ToLowerInvariant() == "com")) + { + GenerateComType(writer, comType); + } + writer.WriteLine($"#endregion COM Types"); + writer.WriteLine(); } private static void GenerateEnum(CodeWriter writer, ApiType enumType, bool autoGenerated) @@ -653,6 +663,192 @@ public static class Program writer.WriteLine(); } + private static void GenerateComType(CodeWriter writer, ApiType comType) + { + if (comType.Name != "IDXGIObject" /*&& + comType.Name != "IDXGIDeviceSubObject"*/) + { + return; + } + + string csTypeName = comType.Name; + //AddCsMapping(writer.Api, comType.Name, csTypeName); + + writer.WriteLine($"/// "); + + if (s_generateUnmanagedDocs) + { + writer.WriteLine($"/// {comType.Name}"); + } + + writer.WriteLine($"[Guid(\"{comType.Guid}\")]"); + writer.WriteLine($"[NativeTypeName(\"struct {comType.Name} : {comType.Interface.Name}\")]"); + writer.WriteLine($"[NativeInheritance(\"{comType.Interface.Name}\")]"); + using (writer.PushBlock($"public unsafe partial struct {csTypeName} : {csTypeName}.Interface")) + { + // Generate IID + writer.WriteLine($"[NativeTypeName(\"const GUID\")]"); + using (writer.PushBlock($"public static ref readonly Guid IID_{csTypeName}")) + { + writer.WriteLine("[MethodImpl(MethodImplOptions.AggressiveInlining)]"); + using (writer.PushBlock("get")) + { + var guid = Guid.Parse(comType.Guid).ToString("N"); + var _1 = "0x" + guid.Substring(6, 2).ToUpperInvariant(); + var _2 = "0x" + guid.Substring(4, 2).ToUpperInvariant(); + var _3 = "0x" + guid.Substring(2, 2).ToUpperInvariant(); + var _4 = "0x" + guid.Substring(0, 2).ToUpperInvariant(); + + var _5 = "0x" + guid.Substring(10, 2).ToUpperInvariant(); + var _6 = "0x" + guid.Substring(8, 2).ToUpperInvariant(); + + var _7 = "0x" + guid.Substring(14, 2).ToUpperInvariant(); + var _8 = "0x" + guid.Substring(12, 2).ToUpperInvariant(); + + var d = "0x" + guid.Substring(16, 2).ToUpperInvariant(); + var e = "0x" + guid.Substring(18, 2).ToUpperInvariant(); + var f = "0x" + guid.Substring(20, 2).ToUpperInvariant(); + var g = "0x" + guid.Substring(22, 2).ToUpperInvariant(); + var h = "0x" + guid.Substring(24, 2).ToUpperInvariant(); + var i = "0x" + guid.Substring(26, 2).ToUpperInvariant(); + var j = "0x" + guid.Substring(28, 2).ToUpperInvariant(); + var k = "0x" + guid.Substring(30, 2).ToUpperInvariant(); + + writer.WriteLine("ReadOnlySpan data = new byte[] {"); + writer.WriteLine($"{'\t'}{_1}, {_2}, {_3}, {_4},"); + writer.WriteLine($"{'\t'}{_5}, {_6},"); + writer.WriteLine($"{'\t'}{_7}, {_8},"); + writer.WriteLine($"{'\t'}{d},"); + writer.WriteLine($"{'\t'}{e},"); + writer.WriteLine($"{'\t'}{f},"); + writer.WriteLine($"{'\t'}{g},"); + writer.WriteLine($"{'\t'}{h},"); + writer.WriteLine($"{'\t'}{i},"); + writer.WriteLine($"{'\t'}{j},"); + writer.WriteLine($"{'\t'}{k}"); + writer.WriteLine("};"); + writer.WriteLine(); + + writer.WriteLine("Debug.Assert(data.Length == Unsafe.SizeOf());"); + writer.WriteLine("return ref Unsafe.As(ref MemoryMarshal.GetReference(data));"); + } + } + writer.WriteLine(); + + writer.WriteLine($"public static Guid* NativeGuid => (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in IID_{csTypeName}));"); + writer.WriteLine(); + + writer.WriteLine($"public void** lpVtbl;"); + writer.WriteLine(); + + int vtblIndex = 0; + if (comType.Interface.Name == "IUnknown") + { + writer.WriteLine("/// "); + writer.WriteLine("[MethodImpl(MethodImplOptions.AggressiveInlining)]"); + writer.WriteLine("[VtblIndex(0)]"); + using (writer.PushBlock($"public HResult QueryInterface([NativeTypeName(\"const IID &\")] Guid* riid, void** ppvObject)")) + { + writer.WriteLine("return ((delegate* unmanaged[Stdcall])(lpVtbl[0]))((IUnknown*)Unsafe.AsPointer(ref this), riid, ppvObject);"); + } + writer.WriteLine(); + + // AddRef + writer.WriteLine("/// "); + writer.WriteLine("[MethodImpl(MethodImplOptions.AggressiveInlining)]"); + writer.WriteLine("[VtblIndex(1)]"); + writer.WriteLine("[return: NativeTypeName(\"ULONG\")]"); + using (writer.PushBlock($"public uint AddRef()")) + { + writer.WriteLine("return ((delegate* unmanaged[Stdcall])(lpVtbl[1]))((IUnknown*)Unsafe.AsPointer(ref this));"); + } + writer.WriteLine(); + + // Release + writer.WriteLine("/// "); + writer.WriteLine("[MethodImpl(MethodImplOptions.AggressiveInlining)]"); + writer.WriteLine("[VtblIndex(2)]"); + writer.WriteLine("[return: NativeTypeName(\"ULONG\")]"); + using (writer.PushBlock($"public uint Release()")) + { + writer.WriteLine("return ((delegate* unmanaged[Stdcall])(lpVtbl[2]))((IUnknown*)Unsafe.AsPointer(ref this));"); + } + writer.WriteLine(); + vtblIndex = 3; + } + + foreach (var method in comType.Methods) + { + // TODO: Handle inherit + string returnType = GetTypeName(method.ReturnType); + + StringBuilder argumentBuilder = new(); + StringBuilder argumentsTypesBuilder = new(); + StringBuilder argumentsNameBuilder = new(); + int parameterIndex = 0; + + foreach (var parameter in method.Params) + { + string parameterType = GetTypeName(parameter.Type); + string parameterName = parameter.Name; + + argumentBuilder.Append(parameterType).Append(' ').Append(parameterName); + argumentsTypesBuilder.Append(parameterType); + argumentsNameBuilder.Append(parameterName); + + if (parameterIndex < method.Params.Count - 1) + { + argumentBuilder.Append(", "); + argumentsTypesBuilder.Append(", "); + argumentsNameBuilder.Append(", "); + } + + parameterIndex++; + } + + // Return type + string returnMarshalType = returnType; + if (returnMarshalType.ToLower() == "hresult") + { + returnMarshalType = "int"; + } + + argumentsTypesBuilder.Append(", ").Append(returnMarshalType); + + string argumentsString = argumentBuilder.ToString(); + string argumentTypesString = argumentsTypesBuilder.ToString(); + string argumentNamesString = argumentsNameBuilder.ToString(); + + writer.WriteLine($"/// "); + writer.WriteLine("[MethodImpl(MethodImplOptions.AggressiveInlining)]"); + writer.WriteLine($"[VtblIndex({vtblIndex})]"); + using (writer.PushBlock($"public {returnType} {method.Name}({argumentsString})")) + { + writer.WriteLineUndindented("#if NET6_0_OR_GREATER"); + if (returnType != "void") + writer.Write("return "); + writer.WriteLine($"((delegate* unmanaged<{comType.Name}*, {argumentTypesString}>)(lpVtbl[{vtblIndex}]))(({comType.Name}*)Unsafe.AsPointer(ref this), {argumentNamesString});"); + writer.WriteLineUndindented("#else"); + if (returnType != "void") + writer.Write("return "); + writer.WriteLine($"((delegate* unmanaged[Stdcall]<{comType.Name}*, {argumentTypesString}>)(lpVtbl[{vtblIndex}]))(({comType.Name}*)Unsafe.AsPointer(ref this), {argumentNamesString});"); + writer.WriteLineUndindented("#endif"); + } + + writer.WriteLine(); + + vtblIndex++; + } + + using (writer.PushBlock($"public interface Interface : {comType.Interface.Name}.Interface")) + { + } + writer.WriteLine(); + } + + writer.WriteLine(); + } + private static bool ShouldSkipConstant(ApiDataConstant constant) { if (constant.Name == "_FACDXGI" || diff --git a/src/Vortice.Win32/Attributes.cs b/src/Vortice.Win32/Attributes.cs index 40e0b8c..0d270f2 100644 --- a/src/Vortice.Win32/Attributes.cs +++ b/src/Vortice.Win32/Attributes.cs @@ -22,6 +22,22 @@ internal sealed partial class NativeTypeNameAttribute : Attribute public string Name { get; } } +/// Defines the base type of a struct as it was in the native signature. +[AttributeUsage(AttributeTargets.Struct, AllowMultiple = false, Inherited = true)] +[Conditional("DEBUG")] +internal sealed partial class NativeInheritanceAttribute : Attribute +{ + /// Initializes a new instance of the class. + /// The name of the base type that was inherited from in the native signature. + public NativeInheritanceAttribute(string name) + { + Name = name; + } + + /// Gets the name of the base type that was inherited from in the native signature. + public string Name { get; } +} + /// Defines the vtbl index of a method as it was in the native signature. [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] [Conditional("DEBUG")] diff --git a/src/Vortice.Win32/Generated/DXGI.xml b/src/Vortice.Win32/Generated/DXGI.xml index f825eed..dcd8f73 100644 --- a/src/Vortice.Win32/Generated/DXGI.xml +++ b/src/Vortice.Win32/Generated/DXGI.xml @@ -50,7 +50,7 @@ Note that with legacy Win32 window swapchains, this works the same as DXGI_SCALI Identifies the adapter on which a shared resource object was created. Microsoft Docs: A handle to a shared resource object. The IDXGIResource1::CreateSharedHandle method returns this handle. - A pointer to a variable that receives a locally unique identifier (LUID) value that identifies the adapter. LUID is defined in Dxgi.h. An LUID is a 64-bit value that is guaranteed to be unique only on the operating system on which it was generated. The uniqueness of an LUID is guaranteed only until the operating system is restarted. + A pointer to a variable that receives a locally unique identifier (LUID) value that identifies the adapter. LUID is defined in Dxgi.h. An LUID is a 64-bit value that is guaranteed to be unique only on the operating system on which it was generated. The uniqueness of an LUID is guaranteed only until the operating system is restarted. @@ -98,7 +98,7 @@ Note that simply re-creating the swap chain or the device will usually have no i Retrieves a debugging interface. Microsoft Docs: The globally unique identifier (GUID) of the requested interface type. - A pointer to a buffer that receives a pointer to the debugging interface. + A pointer to a buffer that receives a pointer to the debugging interface. @@ -144,7 +144,7 @@ Note that simply re-creating the swap chain or the device will usually have no i Outputs the IDXGIAdapter for the specified LUID. Microsoft Docs: - A unique value that identifies the adapter. + A unique value that identifies the adapter. See LUID for a definition of the structure. LUID is defined in dxgi.h. The globally unique identifier (GUID) of the IDXGIAdapter object referenced by the ppvAdapter parameter. @@ -168,7 +168,7 @@ Note that simply re-creating the swap chain or the device will usually have no i Gets the output (the display monitor) to which you can restrict the contents of a present operation. Microsoft Docs: - A pointer to a buffer that receives a pointer to the IDXGIOutput interface for the restrict-to output. An application passes this pointer to IDXGIOutput in a call to the IDXGIFactory2::CreateSwapChainForHwnd, IDXGIFactory2::CreateSwapChainForCoreWindow, or IDXGIFactory2::CreateSwapChainForComposition method to create the swap chain. + A pointer to a buffer that receives a pointer to the IDXGIOutput interface for the restrict-to output. An application passes this pointer to IDXGIOutput in a call to the IDXGIFactory2::CreateSwapChainForHwnd, IDXGIFactory2::CreateSwapChainForCoreWindow, or IDXGIFactory2::CreateSwapChainForComposition method to create the swap chain. @@ -181,14 +181,14 @@ Note that simply re-creating the swap chain or the device will usually have no i Pushes a deny-all storage filter onto the storage-filter stack. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that pushes the filter. + A DXGI_DEBUG_ID value that identifies the entity that pushes the filter. Gets the source region that is used for the swap chain. Microsoft Docs: - A pointer to a RECT structure + A pointer to a RECT structure that receives the source region for the swap chain. @@ -196,8 +196,8 @@ Note that simply re-creating the swap chain or the device will usually have no i Set an interface in the object's private data. Microsoft Docs: - A GUID identifying the interface. - The interface to set. + A GUID identifying the interface. + The interface to set. @@ -225,7 +225,7 @@ Note that simply re-creating the swap chain or the device will usually have no i Sets the rotation of the back buffers for the swap chain. Microsoft Docs: - A DXGI_MODE_ROTATION-typed value that specifies how to set the rotation of the back buffers for the swap chain. + A DXGI_MODE_ROTATION-typed value that specifies how to set the rotation of the back buffers for the swap chain. @@ -247,11 +247,11 @@ Note that simply re-creating the swap chain or the device will usually have no i Adds a debug message to the message queue and sends that message to the debug output. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that produced the message. - A DXGI_INFO_QUEUE_MESSAGE_CATEGORY-typed value that specifies the category of the message. - A DXGI_INFO_QUEUE_MESSAGE_SEVERITY-typed value that specifies the severity of the message. - An integer that uniquely identifies the message. - The message string. + A DXGI_DEBUG_ID value that identifies the entity that produced the message. + A DXGI_INFO_QUEUE_MESSAGE_CATEGORY-typed value that specifies the category of the message. + A DXGI_INFO_QUEUE_MESSAGE_SEVERITY-typed value that specifies the severity of the message. + An integer that uniquely identifies the message. + The message string. @@ -264,36 +264,36 @@ Note that simply re-creating the swap chain or the device will usually have no i Pops a storage filter from the top of the storage-filter stack. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that pops the filter. + A DXGI_DEBUG_ID value that identifies the entity that pops the filter. Gets a message from the message queue. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that gets the message. - An index into the message queue after an optional retrieval filter has been applied. This can be between 0 and the number of messages in the message queue that pass through the retrieval filter. Call IDXGIInfoQueue::GetNumStoredMessagesAllowedByRetrievalFilters to obtain this number. 0 is the message at the beginning of the message queue. - A pointer to a DXGI_INFO_QUEUE_MESSAGE structure that describes the message. - A pointer to a variable that receives the size, in bytes, of the message description that pMessage points to. This size includes the size of the DXGI_INFO_QUEUE_MESSAGE structure in bytes. + A DXGI_DEBUG_ID value that identifies the entity that gets the message. + An index into the message queue after an optional retrieval filter has been applied. This can be between 0 and the number of messages in the message queue that pass through the retrieval filter. Call IDXGIInfoQueue::GetNumStoredMessagesAllowedByRetrievalFilters to obtain this number. 0 is the message at the beginning of the message queue. + A pointer to a DXGI_INFO_QUEUE_MESSAGE structure that describes the message. + A pointer to a variable that receives the size, in bytes, of the message description that pMessage points to. This size includes the size of the DXGI_INFO_QUEUE_MESSAGE structure in bytes. Gets the display modes that match the requested format and other input options. Microsoft Docs: - A DXGI_FORMAT-typed value for the color format. - A combination of DXGI_ENUM_MODES-typed values that are combined by using a bitwise OR operation. The resulting value specifies options for display modes to include. You must specify DXGI_ENUM_MODES_SCALING to expose the display modes that require scaling. Centered modes that require no + A DXGI_FORMAT-typed value for the color format. + A combination of DXGI_ENUM_MODES-typed values that are combined by using a bitwise OR operation. The resulting value specifies options for display modes to include. You must specify DXGI_ENUM_MODES_SCALING to expose the display modes that require scaling. Centered modes that require no scaling and correspond directly to the display output are enumerated by default. - A pointer to a variable that receives the number of display modes that GetDisplayModeList1 returns in the memory block to which pDesc points. Set pDesc to NULL so that pNumModes returns the number of display modes that match the format and the options. + A pointer to a variable that receives the number of display modes that GetDisplayModeList1 returns in the memory block to which pDesc points. Set pDesc to NULL so that pNumModes returns the number of display modes that match the format and the options. Otherwise, pNumModes returns the number of display modes returned in pDesc. - A pointer to a list of display modes; set to NULL to get the number of display modes. + A pointer to a list of display modes; set to NULL to get the number of display modes. Sets the number of frames that the system is allowed to queue for rendering. Microsoft Docs: - The maximum number of back buffer frames that a driver can queue. The value defaults to 3, but + The maximum number of back buffer frames that a driver can queue. The value defaults to 3, but can range from 1 to 16. A value of 0 will reset latency to the default. For multi-head devices, this value is specified per-head. @@ -307,22 +307,22 @@ Note that simply re-creating the swap chain or the device will usually have no i Sets the size of the destination surface to use for the video processing blit operation. Microsoft Docs: - The width of the destination size, in pixels. - The height of the destination size, in pixels. + The width of the destination size, in pixels. + The height of the destination size, in pixels. Gets the number of messages that were denied passage through a storage filter. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that gets the number. + A DXGI_DEBUG_ID value that identifies the entity that gets the number. Pushes a deny-all retrieval filter onto the retrieval-filter stack. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that pushes the deny-all retrieval filter. + A DXGI_DEBUG_ID value that identifies the entity that pushes the deny-all retrieval filter. @@ -341,12 +341,12 @@ Note that simply re-creating the swap chain or the device will usually have no i Finds the display mode that most closely matches the requested display mode. Microsoft Docs: - A pointer to the DXGI_MODE_DESC1 structure that describes the display mode to match. Members of DXGI_MODE_DESC1 can be unspecified, which indicates no preference for + A pointer to the DXGI_MODE_DESC1 structure that describes the display mode to match. Members of DXGI_MODE_DESC1 can be unspecified, which indicates no preference for that member. A value of 0 for Width or Height indicates that the value is unspecified. If either Width or Height is 0, both must be 0. A numerator and denominator of 0 in RefreshRate indicate it is unspecified. Other members of DXGI_MODE_DESC1 have enumeration values that indicate that the member is unspecified. If pConcernedDevice is NULL, the Formatmember of DXGI_MODE_DESC1 cannot be DXGI_FORMAT_UNKNOWN. - A pointer to the DXGI_MODE_DESC1 structure that receives a description of the display mode that most closely matches the display mode described at pModeToMatch. - A pointer to the Direct3D device interface. If this parameter is NULL, FindClosestMatchingMode1 returns only modes whose format matches that of pModeToMatch; otherwise, FindClosestMatchingMode1 returns only those formats that are supported for scan-out by the device. For info about the formats that are supported for scan-out by the device at each feature level: + A pointer to the DXGI_MODE_DESC1 structure that receives a description of the display mode that most closely matches the display mode described at pModeToMatch. + A pointer to the Direct3D device interface. If this parameter is NULL, FindClosestMatchingMode1 returns only modes whose format matches that of pModeToMatch; otherwise, FindClosestMatchingMode1 returns only those formats that are supported for scan-out by the device. For info about the formats that are supported for scan-out by the device at each feature level:
  • @@ -377,7 +377,7 @@ Note that simply re-creating the swap chain or the device will usually have no i Unregisters a window or an event to stop it from receiving notification when occlusion status changes. Microsoft Docs: - A key value for the window or event to unregister. The IDXGIFactory2::RegisterOcclusionStatusWindow or IDXGIFactory2::RegisterOcclusionStatusEvent method returns this value. + A key value for the window or event to unregister. The IDXGIFactory2::RegisterOcclusionStatusWindow or IDXGIFactory2::RegisterOcclusionStatusEvent method returns this value. @@ -396,50 +396,50 @@ Note that simply re-creating the swap chain or the device will usually have no i Pushes a copy of the retrieval filter that is currently on the top of the retrieval-filter stack onto the retrieval-filter stack. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that pushes the copy of the retrieval filter. + A DXGI_DEBUG_ID value that identifies the entity that pushes the copy of the retrieval filter. Unregisters a window or an event to stop it from receiving notification when stereo status changes. Microsoft Docs: - A key value for the window or event to unregister. The IDXGIFactory2::RegisterStereoStatusWindow or IDXGIFactory2::RegisterStereoStatusEvent method returns this value. + A key value for the window or event to unregister. The IDXGIFactory2::RegisterStereoStatusWindow or IDXGIFactory2::RegisterStereoStatusEvent method returns this value. Notifies applications that hardware stretching is supported. Microsoft Docs: - A bitfield of DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAGS enumeration values describing which types of hardware composition are supported. The values are bitwise OR'd together. + A bitfield of DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAGS enumeration values describing which types of hardware composition are supported. The values are bitwise OR'd together. Create an adapter interface that represents a software adapter. Microsoft Docs: - Handle to the software adapter's dll. HMODULE can be obtained with GetModuleHandle or LoadLibrary. - Address of a pointer to an adapter (see IDXGIAdapter). + Handle to the software adapter's dll. HMODULE can be obtained with GetModuleHandle or LoadLibrary. + Address of a pointer to an adapter (see IDXGIAdapter). Unregisters an event to stop it from receiving notification of hardware content protection teardown events. Microsoft Docs: - A key value for the window or event to unregister. The IDXGIAdapter3::RegisterHardwareContentProtectionTeardownStatusEvent method returns this value. + A key value for the window or event to unregister. The IDXGIAdapter3::RegisterHardwareContentProtectionTeardownStatusEvent method returns this value. Get the state associated with full-screen mode. Microsoft Docs: - A pointer to a boolean whose value is either: + A pointer to a boolean whose value is either:
    • TRUE if the swap chain is in full-screen mode
    • FALSE if the swap chain is in windowed mode
    - A pointer to the output target (see IDXGIOutput) when the mode is full screen; otherwise NULL. + A pointer to the output target (see IDXGIOutput) when the mode is full screen; otherwise NULL.
    @@ -479,9 +479,9 @@ For Direct3D 10.1 and Direct3D 11, you can use two special quality level values. Allows the operating system to free the video memory of resources by discarding their content. Microsoft Docs: - The number of resources in the ppResources argument array. - An array of pointers to IDXGIResource interfaces for the resources to offer. - A DXGI_OFFER_RESOURCE_PRIORITY-typed value that indicates how valuable data is. + The number of resources in the ppResources argument array. + An array of pointers to IDXGIResource interfaces for the resources to offer. + A DXGI_OFFER_RESOURCE_PRIORITY-typed value that indicates how valuable data is. @@ -494,16 +494,16 @@ For Direct3D 10.1 and Direct3D 11, you can use two special quality level values. Sets the gamma controls. Microsoft Docs: - A pointer to a DXGI_GAMMA_CONTROL structure that describes the gamma curve to set. + A pointer to a DXGI_GAMMA_CONTROL structure that describes the gamma curve to set. This method sets High Dynamic Range (HDR) and Wide Color Gamut (WCG) header metadata. Microsoft Docs: - Specifies one member of the DXGI_HDR_METADATA_TYPE enum. - Specifies the size of pMetaData, in bytes. - Specifies a void pointer that references the metadata, if it exists. Refer to the DXGI_HDR_METADATA_HDR10 structure. + Specifies one member of the DXGI_HDR_METADATA_TYPE enum. + Specifies the size of pMetaData, in bytes. + Specifies a void pointer that references the metadata, if it exists. Refer to the DXGI_HDR_METADATA_HDR10 structure. @@ -522,9 +522,9 @@ For Direct3D 10.1 and Direct3D 11, you can use two special quality level values. Gets the storage filter at the top of the storage-filter stack. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that gets the filter. - A pointer to a DXGI_INFO_QUEUE_FILTER structure that describes the filter. - A pointer to a variable that receives the size, in bytes, of the filter description to which pFilter points. If pFilter is NULL, GetStorageFilter outputs the size of the storage filter. + A DXGI_DEBUG_ID value that identifies the entity that gets the filter. + A pointer to a DXGI_INFO_QUEUE_FILTER structure that describes the filter. + A pointer to a variable that receives the size, in bytes, of the filter description to which pFilter points. If pFilter is NULL, GetStorageFilter outputs the size of the storage filter. @@ -543,40 +543,40 @@ For Direct3D 10.1 and Direct3D 11, you can use two special quality level values. Gets a DXGI 1.0 description of an adapter (or video card). Microsoft Docs: - A pointer to a DXGI_ADAPTER_DESC structure that describes the adapter. This parameter must not be NULL. On feature level 9 graphics hardware, GetDesc returns zeros for the PCI ID in the VendorId, DeviceId, SubSysId, and Revision members of DXGI_ADAPTER_DESC and “Software Adapter” for the description string in the Description member. + A pointer to a DXGI_ADAPTER_DESC structure that describes the adapter. This parameter must not be NULL. On feature level 9 graphics hardware, GetDesc returns zeros for the PCI ID in the VendorId, DeviceId, SubSysId, and Revision members of DXGI_ADAPTER_DESC and “Software Adapter” for the description string in the Description member. Gets the retrieval filter at the top of the retrieval-filter stack. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that gets the filter. - A pointer to a DXGI_INFO_QUEUE_FILTER structure that describes the filter. - A pointer to a variable that receives the size, in bytes, of the filter description to which pFilter points. If pFilter is NULL, GetRetrievalFilter outputs the size of the retrieval filter. + A DXGI_DEBUG_ID value that identifies the entity that gets the filter. + A pointer to a DXGI_INFO_QUEUE_FILTER structure that describes the filter. + A pointer to a variable that receives the size, in bytes, of the filter description to which pFilter points. If pFilter is NULL, GetRetrievalFilter outputs the size of the retrieval filter. Sets the display state to windowed or full screen. Microsoft Docs: - A Boolean value that specifies whether to set the display state to windowed or full screen. TRUE for full screen, and FALSE for windowed. - If you pass TRUE to the Fullscreen parameter to set the display state to full screen, you can optionally set this parameter to a pointer to an IDXGIOutput interface for the output target that contains the swap chain. If you set this parameter to NULL, DXGI will choose the output based on the swap-chain's device and the output window's placement. If you pass FALSE to Fullscreen, then you must set this parameter to NULL. + A Boolean value that specifies whether to set the display state to windowed or full screen. TRUE for full screen, and FALSE for windowed. + If you pass TRUE to the Fullscreen parameter to set the display state to full screen, you can optionally set this parameter to a pointer to an IDXGIOutput interface for the output target that contains the swap chain. If you set this parameter to NULL, DXGI will choose the output based on the swap-chain's device and the output window's placement. If you pass FALSE to Fullscreen, then you must set this parameter to NULL. Pushes a retrieval filter onto the retrieval-filter stack. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that pushes the filter. - A pointer to a DXGI_INFO_QUEUE_FILTER structure that describes the filter. + A DXGI_DEBUG_ID value that identifies the entity that pushes the filter. + A pointer to a DXGI_INFO_QUEUE_FILTER structure that describes the filter. Adds retrieval filters to the top of the retrieval-filter stack. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that produced the filters. - An array of DXGI_INFO_QUEUE_FILTER structures that describe the filters. + A DXGI_DEBUG_ID value that identifies the entity that produced the filters. + An array of DXGI_INFO_QUEUE_FILTER structures that describe the filters. @@ -585,17 +585,17 @@ For Direct3D 10.1 and Direct3D 11, you can use two special quality level values. Microsoft Docs: A pointer to the globally unique identifier (GUID) of the CoreWindow object that is referenced by the ppUnk parameter. - A pointer to a variable that receives a pointer to the CoreWindow object. + A pointer to a variable that receives a pointer to the CoreWindow object.
Allows the operating system to free the video memory of resources, including both discarding the content and de-committing the memory. Microsoft Docs: - The number of resources in the ppResources argument array. - An array of pointers to IDXGIResource interfaces for the resources to offer. - A DXGI_OFFER_RESOURCE_PRIORITY-typed value that indicates how valuable data is. - Specifies the DXGI_OFFER_RESOURCE_FLAGS. + The number of resources in the ppResources argument array. + An array of pointers to IDXGIResource interfaces for the resources to offer. + A DXGI_OFFER_RESOURCE_PRIORITY-typed value that indicates how valuable data is. + Specifies the DXGI_OFFER_RESOURCE_FLAGS. @@ -608,15 +608,15 @@ For Direct3D 10.1 and Direct3D 11, you can use two special quality level values. Creates a swap chain that is associated with an HWND handle to the output window for the swap chain. Microsoft Docs: - For Direct3D 11, and earlier versions of Direct3D, this is a pointer to the Direct3D device for the swap chain. For Direct3D 12 this is a pointer to a direct command queue (refer to ID3D12CommandQueue). This parameter cannot be NULL. + For Direct3D 11, and earlier versions of Direct3D, this is a pointer to the Direct3D device for the swap chain. For Direct3D 12 this is a pointer to a direct command queue (refer to ID3D12CommandQueue). This parameter cannot be NULL. The HWND handle that is associated with the swap chain that CreateSwapChainForHwnd creates. This parameter cannot be NULL. - A pointer to a DXGI_SWAP_CHAIN_DESC1 structure for the swap-chain description. This parameter cannot be NULL. - A pointer to a DXGI_SWAP_CHAIN_FULLSCREEN_DESC structure for the description of a full-screen swap chain. You can optionally set this parameter to create a full-screen swap chain. Set it to NULL to create a windowed swap chain. - A pointer to the IDXGIOutput interface for the output to restrict content to. You must also pass the DXGI_PRESENT_RESTRICT_TO_OUTPUT flag in a IDXGISwapChain1::Present1 call to force the content to appear blacked out on any other output. If you want to restrict the content to a different output, you must create a new swap chain. However, you can conditionally restrict content based on the DXGI_PRESENT_RESTRICT_TO_OUTPUT flag. + A pointer to a DXGI_SWAP_CHAIN_DESC1 structure for the swap-chain description. This parameter cannot be NULL. + A pointer to a DXGI_SWAP_CHAIN_FULLSCREEN_DESC structure for the description of a full-screen swap chain. You can optionally set this parameter to create a full-screen swap chain. Set it to NULL to create a windowed swap chain. + A pointer to the IDXGIOutput interface for the output to restrict content to. You must also pass the DXGI_PRESENT_RESTRICT_TO_OUTPUT flag in a IDXGISwapChain1::Present1 call to force the content to appear blacked out on any other output. If you want to restrict the content to a different output, you must create a new swap chain. However, you can conditionally restrict content based on the DXGI_PRESENT_RESTRICT_TO_OUTPUT flag. Set this parameter to NULL if you don't want to restrict content to an output target. - A pointer to a variable that receives a pointer to the IDXGISwapChain1 interface for the swap chain that CreateSwapChainForHwnd creates. + A pointer to a variable that receives a pointer to the IDXGISwapChain1 interface for the swap chain that CreateSwapChainForHwnd creates. @@ -629,14 +629,14 @@ Set this parameter to NULL if you don't want to restrict content to an ou Sets the color space used by the swap chain. Microsoft Docs: - A pointer to a combination of DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAGS-typed values that are combined by using a bitwise OR operation. The resulting value specifies the color space to set for the swap chain. + A pointer to a combination of DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAGS-typed values that are combined by using a bitwise OR operation. The resulting value specifies the color space to set for the swap chain. Sets the rectangle that defines the source region for the video processing blit operation. Microsoft Docs: - A pointer to a RECT structure + A pointer to a RECT structure that contains the source region to set for the swap chain. @@ -644,12 +644,12 @@ Set this parameter to NULL if you don't want to restrict content to an ou Finds the display mode that most closely matches the requested display mode. Microsoft Docs: - The desired display mode (see DXGI_MODE_DESC). Members of DXGI_MODE_DESC can be unspecified indicating no preference for + The desired display mode (see DXGI_MODE_DESC). Members of DXGI_MODE_DESC can be unspecified indicating no preference for that member. A value of 0 for Width or Height indicates the value is unspecified. If either Width or Height are 0, both must be 0. A numerator and denominator of 0 in RefreshRate indicate it is unspecified. Other members of DXGI_MODE_DESC have enumeration values indicating the member is unspecified. If pConcernedDevice is NULL, Formatcannot be DXGI_FORMAT_UNKNOWN. - The mode that most closely matches pModeToMatch. - A pointer to the Direct3D device interface. If this parameter is NULL, only modes whose format matches that of pModeToMatch will + The mode that most closely matches pModeToMatch. + A pointer to the Direct3D device interface. If this parameter is NULL, only modes whose format matches that of pModeToMatch will be returned; otherwise, only those formats that are supported for scan-out by the device are returned. For info about the formats that are supported for scan-out by the device at each feature level:
    @@ -687,24 +687,24 @@ Set this parameter to NULL if you don't want to restrict content to an ou Checks whether the system supports a device interface for a graphics component. Microsoft Docs: - The GUID of the interface of the device version for which support is being checked. This should usually be __uuidof(IDXGIDevice), which returns the version number of the Direct3D 9 UMD (user mode driver) binary. Since WDDM 2.3, all driver components within a driver package (D3D9, D3D11, and D3D12) have been required to share a single version number, so this is a good way to query the driver version regardless of which API is being used. - The user mode driver version of InterfaceName. This is returned only if the interface is supported, otherwise this parameter will be NULL. + The GUID of the interface of the device version for which support is being checked. This should usually be __uuidof(IDXGIDevice), which returns the version number of the Direct3D 9 UMD (user mode driver) binary. Since WDDM 2.3, all driver components within a driver package (D3D9, D3D11, and D3D12) have been required to share a single version number, so this is a good way to query the driver version regardless of which API is being used. + The user mode driver version of InterfaceName. This is returned only if the interface is supported, otherwise this parameter will be NULL. Retrieves the underlying HWND for this swap-chain object. Microsoft Docs: - A pointer to a variable that receives the HWND for the swap-chain object. + A pointer to a variable that receives the HWND for the swap-chain object. Sets a message category to break on when a message with that category passes through the storage filter. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that sets the breaking condition. - A DXGI_INFO_QUEUE_MESSAGE_CATEGORY-typed value that specifies the category of the message. - A Boolean value that specifies whether SetBreakOnCategory turns on or off this breaking condition (TRUE for on, FALSE for off). + A DXGI_DEBUG_ID value that identifies the entity that sets the breaking condition. + A DXGI_INFO_QUEUE_MESSAGE_CATEGORY-typed value that specifies the category of the message. + A Boolean value that specifies whether SetBreakOnCategory turns on or off this breaking condition (TRUE for on, FALSE for off). @@ -738,9 +738,9 @@ Set this parameter to NULL if you don't want to restrict content to an ou Get a pointer to the object's data. Microsoft Docs: - A GUID identifying the data. - The size of the data. - Pointer to the data. + A GUID identifying the data. + The size of the data. + Pointer to the data. @@ -753,15 +753,15 @@ Set this parameter to NULL if you don't want to restrict content to an ou Checks the swap chain's support for color space. Microsoft Docs: - A DXGI_COLOR_SPACE_TYPE-typed value that specifies color space type to check support for. - A pointer to a variable that receives a combination of DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG-typed values that are combined by using a bitwise OR operation. The resulting value specifies options for color space support. + A DXGI_COLOR_SPACE_TYPE-typed value that specifies color space type to check support for. + A pointer to a variable that receives a combination of DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG-typed values that are combined by using a bitwise OR operation. The resulting value specifies options for color space support. Gets the number of messages currently stored in the message queue. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that gets the number. + A DXGI_DEBUG_ID value that identifies the entity that gets the number. @@ -792,7 +792,7 @@ Set this parameter to NULL if you don't want to restrict content to an ou Get an extended description of the output that includes color characteristics and connection type. Microsoft Docs: - A pointer to the output description (see DXGI_OUTPUT_DESC1). + A pointer to the output description (see DXGI_OUTPUT_DESC1). @@ -813,11 +813,11 @@ Set this parameter to NULL if you don't want to restrict content to an ou Creates a swap chain that is associated with the CoreWindow object for the output window for the swap chain. Microsoft Docs: - For Direct3D 11, and earlier versions of Direct3D, this is a pointer to the Direct3D device for the swap chain. For Direct3D 12 this is a pointer to a direct command queue (refer to ID3D12CommandQueue). This parameter cannot be NULL. - A pointer to the CoreWindow object that is associated with the swap chain that CreateSwapChainForCoreWindow creates. - A pointer to a DXGI_SWAP_CHAIN_DESC1 structure for the swap-chain description. This parameter cannot be NULL. - A pointer to the IDXGIOutput interface that the swap chain is restricted to. If the swap chain is moved to a different output, the content is black. You can optionally set this parameter to an output target that uses DXGI_PRESENT_RESTRICT_TO_OUTPUT to restrict the content on this output. If you do not set this parameter to restrict content on an output target, you can set it to NULL. - A pointer to a variable that receives a pointer to the IDXGISwapChain1 interface for the swap chain that CreateSwapChainForCoreWindow creates. + For Direct3D 11, and earlier versions of Direct3D, this is a pointer to the Direct3D device for the swap chain. For Direct3D 12 this is a pointer to a direct command queue (refer to ID3D12CommandQueue). This parameter cannot be NULL. + A pointer to the CoreWindow object that is associated with the swap chain that CreateSwapChainForCoreWindow creates. + A pointer to a DXGI_SWAP_CHAIN_DESC1 structure for the swap-chain description. This parameter cannot be NULL. + A pointer to the IDXGIOutput interface that the swap chain is restricted to. If the swap chain is moved to a different output, the content is black. You can optionally set this parameter to an output target that uses DXGI_PRESENT_RESTRICT_TO_OUTPUT to restrict the content on this output. If you do not set this parameter to restrict content on an output target, you can set it to NULL. + A pointer to a variable that receives a pointer to the IDXGISwapChain1 interface for the swap chain that CreateSwapChainForCoreWindow creates. @@ -825,8 +825,8 @@ Set this parameter to NULL if you don't want to restrict content to an ou Gets the parent resource and subresource index that support a subresource surface. Microsoft Docs: The globally unique identifier (GUID) of the requested interface type. - A pointer to a buffer that receives a pointer to the parent resource object for the subresource surface. - A pointer to a variable that receives the index of the subresource surface. + A pointer to a buffer that receives a pointer to the parent resource object for the subresource surface. + A pointer to a variable that receives the index of the subresource surface.
@@ -841,9 +841,9 @@ Set this parameter to NULL if you don't want to restrict content to an ou Sets a message identifier to break on when a message with that identifier passes through the storage filter. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that sets the breaking condition. - An integer value that specifies the identifier of the message. - A Boolean value that specifies whether SetBreakOnID turns on or off this breaking condition (TRUE for on, FALSE for off). + A DXGI_DEBUG_ID value that identifies the entity that sets the breaking condition. + An integer value that specifies the identifier of the message. + A Boolean value that specifies whether SetBreakOnID turns on or off this breaking condition (TRUE for on, FALSE for off). @@ -856,24 +856,24 @@ Set this parameter to NULL if you don't want to restrict content to an ou Creates a swap chain that you can use to send Direct3D content into the DirectComposition API or the Windows.UI.Xaml framework to compose in a window. Microsoft Docs: - For Direct3D 11, and earlier versions of Direct3D, this is a pointer to the Direct3D device for the swap chain. For Direct3D 12 this is a pointer to a direct command queue (refer to ID3D12CommandQueue). This parameter cannot be NULL. Software drivers, like D3D_DRIVER_TYPE_REFERENCE, are not supported for composition swap chains. - A pointer to a DXGI_SWAP_CHAIN_DESC1 structure for the swap-chain description. This parameter cannot be NULL. + For Direct3D 11, and earlier versions of Direct3D, this is a pointer to the Direct3D device for the swap chain. For Direct3D 12 this is a pointer to a direct command queue (refer to ID3D12CommandQueue). This parameter cannot be NULL. Software drivers, like D3D_DRIVER_TYPE_REFERENCE, are not supported for composition swap chains. + A pointer to a DXGI_SWAP_CHAIN_DESC1 structure for the swap-chain description. This parameter cannot be NULL. You must specify the DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL value in the SwapEffect member of DXGI_SWAP_CHAIN_DESC1 because CreateSwapChainForComposition supports only flip presentation model. You must also specify the DXGI_SCALING_STRETCH value in the Scaling member of DXGI_SWAP_CHAIN_DESC1. - A pointer to the IDXGIOutput interface for the output to restrict content to. You must also pass the DXGI_PRESENT_RESTRICT_TO_OUTPUT flag in a IDXGISwapChain1::Present1 call to force the content to appear blacked out on any other output. If you want to restrict the content to a different output, you must create a new swap chain. However, you can conditionally restrict content based on the DXGI_PRESENT_RESTRICT_TO_OUTPUT flag. + A pointer to the IDXGIOutput interface for the output to restrict content to. You must also pass the DXGI_PRESENT_RESTRICT_TO_OUTPUT flag in a IDXGISwapChain1::Present1 call to force the content to appear blacked out on any other output. If you want to restrict the content to a different output, you must create a new swap chain. However, you can conditionally restrict content based on the DXGI_PRESENT_RESTRICT_TO_OUTPUT flag. Set this parameter to NULL if you don't want to restrict content to an output target. - A pointer to a variable that receives a pointer to the IDXGISwapChain1 interface for the swap chain that CreateSwapChainForComposition creates. + A pointer to a variable that receives a pointer to the IDXGISwapChain1 interface for the swap chain that CreateSwapChainForComposition creates. Gets the number of messages that a storage filter allowed to pass through. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that gets the number. + A DXGI_DEBUG_ID value that identifies the entity that gets the number. @@ -887,7 +887,7 @@ Set this parameter to NULL if you don't want to restrict content to an ou Retrieves the device. Microsoft Docs: The reference id for the device. - The address of a pointer to the device. + The address of a pointer to the device.
@@ -901,15 +901,15 @@ Set this parameter to NULL if you don't want to restrict content to an ou Creates a YUV swap chain for an existing DirectComposition surface handle. Microsoft Docs: - A pointer to the Direct3D device for the swap chain. This parameter cannot be NULL. Software drivers, like D3D_DRIVER_TYPE_REFERENCE, are not supported for composition swap chains. + A pointer to the Direct3D device for the swap chain. This parameter cannot be NULL. Software drivers, like D3D_DRIVER_TYPE_REFERENCE, are not supported for composition swap chains. A handle to an existing DirectComposition surface. This parameter cannot be NULL. - A pointer to a DXGI_SWAP_CHAIN_DESC1 structure for the swap-chain description. This parameter cannot be NULL. - A pointer to the IDXGIOutput interface for the swap chain to restrict content to. If the swap chain is moved to a different output, the content is black. You can optionally set this parameter to an output target that uses DXGI_PRESENT_RESTRICT_TO_OUTPUT to restrict the content on this output. If the swap chain is moved to a different output, the content is black. + A pointer to a DXGI_SWAP_CHAIN_DESC1 structure for the swap-chain description. This parameter cannot be NULL. + A pointer to the IDXGIOutput interface for the swap chain to restrict content to. If the swap chain is moved to a different output, the content is black. You can optionally set this parameter to an output target that uses DXGI_PRESENT_RESTRICT_TO_OUTPUT to restrict the content on this output. If the swap chain is moved to a different output, the content is black. You must also pass the DXGI_PRESENT_RESTRICT_TO_OUTPUT flag in a present call to force the content to appear blacked out on any other output. If you want to restrict the content to a different output, you must create a new swap chain. However, you can conditionally restrict content based on the DXGI_PRESENT_RESTRICT_TO_OUTPUT flag. Set this parameter to NULL if you don't want to restrict content to an output target. - A pointer to a variable that receives a pointer to the IDXGISwapChain1 interface for the swap chain that this method creates. + A pointer to a variable that receives a pointer to the IDXGISwapChain1 interface for the swap chain that this method creates. @@ -986,36 +986,36 @@ If the app's custom present duration request is not approved, this field is set Takes ownership of an output. Microsoft Docs: - A pointer to the IUnknown interface of a device (such as an ID3D10Device). - Set to TRUE to enable other threads or applications to take ownership of the device; otherwise, set to FALSE. + A pointer to the IUnknown interface of a device (such as an ID3D10Device). + Set to TRUE to enable other threads or applications to take ownership of the device; otherwise, set to FALSE. Accesses one of the swap-chain's back buffers. Microsoft Docs: - A zero-based buffer index. + A zero-based buffer index. If the swap chain's swap effect is DXGI_SWAP_EFFECT_DISCARD, this method can only access the first buffer; for this situation, set the index to zero. If the swap chain's swap effect is either DXGI_SWAP_EFFECT_SEQUENTIAL or DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL, only the swap chain's zero-index buffer can be read from and written to. The swap chain's buffers with indexes greater than zero can only be read from; so if you call the IDXGIResource::GetUsage method for such buffers, they have the DXGI_USAGE_READ_ONLY flag set. The type of interface used to manipulate the buffer. - A pointer to a back-buffer interface. + A pointer to a back-buffer interface. Enumerate adapter (video card) outputs. Microsoft Docs: - The index of the output. - The address of a pointer to an IDXGIOutput interface at the position specified by the Output parameter. + The index of the output. + The address of a pointer to an IDXGIOutput interface at the position specified by the Output parameter. Requests a custom presentation duration (custom refresh rate). Microsoft Docs: - The custom presentation duration, specified in hundreds of nanoseconds. + The custom presentation duration, specified in hundreds of nanoseconds. @@ -1030,7 +1030,7 @@ If the swap chain's swap effect is either - [out] + [out] The transform matrix currently used for swap chain scaling and translation. @@ -1039,7 +1039,7 @@ The transform matrix currently used for swap chain scaling and translation. Gets the number of times that IDXGISwapChain::Present or IDXGISwapChain1::Present1 has been called. Microsoft Docs: - A pointer to a variable that receives the number of calls. + A pointer to a variable that receives the number of calls. @@ -1052,8 +1052,8 @@ The transform matrix currently used for swap chain scaling and translation. Enumerates graphics adapters based on a given GPU preference. Microsoft Docs: - The index of the adapter to enumerate. The indices are in order of the preference specified in GpuPreference—for example, if DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE is specified, then the highest-performing adapter is at index 0, the second-highest is at index 1, and so on. - The GPU preference for the app. + The index of the adapter to enumerate. The indices are in order of the preference specified in GpuPreference—for example, if DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE is specified, then the highest-performing adapter is at index 0, the second-highest is at index 1, and so on. + The GPU preference for the app. The globally unique identifier (GUID) of the IDXGIAdapter object referenced by the ppvAdapter parameter. The address of an IDXGIAdapter interface pointer to the adapter. @@ -1070,14 +1070,14 @@ This parameter must not be NULL. Queries the system for a DXGI_FRAME_STATISTICS_MEDIA structure that indicates whether a custom refresh rate is currently approved by the system. Microsoft Docs: - A DXGI_FRAME_STATISTICS_MEDIA structure indicating whether the system currently approves the custom refresh rate request. + A DXGI_FRAME_STATISTICS_MEDIA structure indicating whether the system currently approves the custom refresh rate request. Get the output (the display monitor) that contains the majority of the client area of the target window. Microsoft Docs: - A pointer to the output interface (see IDXGIOutput). + A pointer to the output interface (see IDXGIOutput). @@ -1099,12 +1099,12 @@ This parameter must not be NULL. Gets information about the new pointer shape for the current desktop frame. Microsoft Docs: - The size in bytes of the buffer that the caller passed to the pPointerShapeBuffer parameter. - A pointer to a buffer to which GetFramePointerShape copies and returns pixel data for the new pointer shape. - Pointer to a variable that receives the number of bytes that GetFramePointerShape needs to store the new pointer shape pixel data in the buffer at pPointerShapeBuffer. + The size in bytes of the buffer that the caller passed to the pPointerShapeBuffer parameter. + A pointer to a buffer to which GetFramePointerShape copies and returns pixel data for the new pointer shape. + Pointer to a variable that receives the number of bytes that GetFramePointerShape needs to store the new pointer shape pixel data in the buffer at pPointerShapeBuffer. For more information about returning the required buffer size, see Remarks. - Pointer to a DXGI_OUTDUPL_POINTER_SHAPE_INFO structure that receives the pointer shape information. + Pointer to a DXGI_OUTDUPL_POINTER_SHAPE_INFO structure that receives the pointer shape information. @@ -1117,16 +1117,16 @@ For more information about returning the required buffer size, see Remarks. Creates a swap chain. Microsoft Docs: - For Direct3D 11, and earlier versions of Direct3D, this is a pointer to the Direct3D device for the swap chain. For Direct3D 12 this is a pointer to a direct command queue (refer to ID3D12CommandQueue) . This parameter cannot be NULL. - A pointer to a DXGI_SWAP_CHAIN_DESC structure for the swap-chain description. This parameter cannot be NULL. - A pointer to a variable that receives a pointer to the IDXGISwapChain interface for the swap chain that CreateSwapChain creates. + For Direct3D 11, and earlier versions of Direct3D, this is a pointer to the Direct3D device for the swap chain. For Direct3D 12 this is a pointer to a direct command queue (refer to ID3D12CommandQueue) . This parameter cannot be NULL. + A pointer to a DXGI_SWAP_CHAIN_DESC structure for the swap-chain description. This parameter cannot be NULL. + A pointer to a variable that receives a pointer to the IDXGISwapChain interface for the swap chain that CreateSwapChain creates. Gets performance statistics about the last render frame. Microsoft Docs: - A pointer to a DXGI_FRAME_STATISTICS structure for the frame statistics. + A pointer to a DXGI_FRAME_STATISTICS structure for the frame statistics. @@ -1179,21 +1179,21 @@ For more information about returning the required buffer size, see Remarks. Changes the swap chain's back buffer size, format, and number of buffers. This should be called when the application window is resized. Microsoft Docs: - The number of buffers in the swap chain (including all back and front buffers). + The number of buffers in the swap chain (including all back and front buffers). This number can be different from the number of buffers with which you created the swap chain. This number can't be greater than DXGI_MAX_SWAP_CHAIN_BUFFERS. Set this number to zero to preserve the existing number of buffers in the swap chain. You can't specify less than two buffers for the flip presentation model. - The new width of the back buffer. + The new width of the back buffer. If you specify zero, DXGI will use the width of the client area of the target window. You can't specify the width as zero if you called the IDXGIFactory2::CreateSwapChainForComposition method to create the swap chain for a composition surface. - The new height of the back buffer. + The new height of the back buffer. If you specify zero, DXGI will use the height of the client area of the target window. You can't specify the height as zero if you called the IDXGIFactory2::CreateSwapChainForComposition method to create the swap chain for a composition surface. - A DXGI_FORMAT-typed value for the new format of the back buffer. + A DXGI_FORMAT-typed value for the new format of the back buffer. Set this value to DXGI_FORMAT_UNKNOWN to preserve the existing format of the back buffer. The flip presentation model supports a more restricted set of formats than the bit-block transfer (bitblt) model. - A combination of DXGI_SWAP_CHAIN_FLAG-typed values that are combined by using a bitwise OR operation. + A combination of DXGI_SWAP_CHAIN_FLAG-typed values that are combined by using a bitwise OR operation. The resulting value specifies options for swap-chain behavior. @@ -1228,7 +1228,7 @@ For more information about returning the required buffer size, see Remarks. Gets a description of the swap chain. Microsoft Docs: - A pointer to a DXGI_SWAP_CHAIN_DESC1 structure that describes the swap chain. + A pointer to a DXGI_SWAP_CHAIN_DESC1 structure that describes the swap chain. @@ -1259,7 +1259,7 @@ For more information about returning the required buffer size, see Remarks. Registers an application window to receive notification messages of changes of occlusion status. Microsoft Docs: - The handle of the window to send a notification message to when occlusion status change occurs. + The handle of the window to send a notification message to when occlusion status change occurs. Identifies the notification message to send. A pointer to a key value that an application can pass to the IDXGIFactory2::UnregisterOcclusionStatus method to unregister the notification message that wMsg specifies. @@ -1268,16 +1268,16 @@ For more information about returning the required buffer size, see Remarks. Gets the handle to a shared resource. Microsoft Docs: - A pointer to a handle. + A pointer to a handle. Queries the graphics driver for a supported frame present duration corresponding to a custom refresh rate. Microsoft Docs: - Indicates the frame duration to check. This value is the duration of one frame at the desired refresh rate, specified in hundreds of nanoseconds. For example, set this field to 167777 to check for 60 Hz refresh rate support. - A variable that will be set to the closest supported frame present duration that's smaller than the requested value, or zero if the device does not support any lower duration. - A variable that will be set to the closest supported frame present duration that's larger than the requested value, or zero if the device does not support any higher duration. + Indicates the frame duration to check. This value is the duration of one frame at the desired refresh rate, specified in hundreds of nanoseconds. For example, set this field to 167777 to check for 60 Hz refresh rate support. + A variable that will be set to the closest supported frame present duration that's smaller than the requested value, or zero if the device does not support any lower duration. + A variable that will be set to the closest supported frame present duration that's larger than the requested value, or zero if the device does not support any higher duration. @@ -1290,7 +1290,7 @@ For more information about returning the required buffer size, see Remarks. Gets the maximum number of messages that can be added to the message queue. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that gets the number. + A DXGI_DEBUG_ID value that identifies the entity that gets the number. @@ -1318,14 +1318,14 @@ For more information about returning the required buffer size, see Remarks. This method stops notifying a CPU synchronization object whenever a budget change occurs. An application may switch back to polling the information regularly. Microsoft Docs: - A key value for the window or event to unregister. The IDXGIAdapter3::RegisterHardwareContentProtectionTeardownStatusEvent method returns this value. + A key value for the window or event to unregister. The IDXGIAdapter3::RegisterHardwareContentProtectionTeardownStatusEvent method returns this value. Gets the rectangle that defines the target region for the video processing blit operation. Microsoft Docs: - A pointer to a RECT structure + A pointer to a RECT structure that receives the target region for the swap chain. @@ -1333,7 +1333,7 @@ For more information about returning the required buffer size, see Remarks. Provides the CPU with efficient access to a desktop image if that desktop image is already in system memory. Microsoft Docs: - A pointer to a DXGI_MAPPED_RECT structure that receives the surface data that the CPU needs to directly access the surface data. + A pointer to a DXGI_MAPPED_RECT structure that receives the surface data that the CPU needs to directly access the surface data. @@ -1379,10 +1379,10 @@ For more information about returning the required buffer size, see Remarks. Gets the residency status of an array of resources. Microsoft Docs: - An array of IDXGIResource interfaces. - An array of DXGI_RESIDENCY flags. Each element describes the residency status for corresponding element in + An array of IDXGIResource interfaces. + An array of DXGI_RESIDENCY flags. Each element describes the residency status for corresponding element in the ppResources argument array. - The number of resources in the ppResources argument array and pResidencyStatus argument array. + The number of resources in the ppResources argument array and pResidencyStatus argument array. @@ -1395,14 +1395,14 @@ For more information about returning the required buffer size, see Remarks. Get the expected resource usage. Microsoft Docs: - A pointer to a usage flag (see DXGI_USAGE). For Direct3D 10, a surface can be used as a shader input or a render-target output. + A pointer to a usage flag (see DXGI_USAGE). For Direct3D 10, a surface can be used as a shader input or a render-target output. Unregisters an event to stop receiving notifications when the adapter enumeration state changes. Microsoft Docs: - A key value for the event to unregister. + A key value for the event to unregister. @@ -1424,12 +1424,12 @@ For more information about returning the required buffer size, see Remarks. This method sends the minimum required physical memory for an application, to the OS. Microsoft Docs: - Specifies the device's physical adapter for which the video memory information is being set. + Specifies the device's physical adapter for which the video memory information is being set. For single-GPU operation, set this to zero. If there are multiple GPU nodes, set this to the index of the node (the device's physical adapter) for which the video memory information is being set. See Multi-adapter systems. - Specifies a DXGI_MEMORY_SEGMENT_GROUP that identifies the group as local or non-local. - Specifies a UINT64 that sets the minimum required physical memory, in bytes. + Specifies a DXGI_MEMORY_SEGMENT_GROUP that identifies the group as local or non-local. + Specifies a UINT64 that sets the minimum required physical memory, in bytes. @@ -1442,8 +1442,8 @@ For more information about returning the required buffer size, see Remarks. Allows DXGI to monitor an application's message queue for the alt-enter key sequence (which causes the application to switch from windowed to full screen or vice versa). Microsoft Docs: - The handle of the window that is to be monitored. This parameter can be NULL; but only if Flags is also 0. - + The handle of the window that is to be monitored. This parameter can be NULL; but only if Flags is also 0. + @@ -1456,25 +1456,25 @@ For more information about returning the required buffer size, see Remarks. Changes the swap chain's back buffer size, format, and number of buffers, where the swap chain was created using a D3D12 command queue as an input device. This should be called when the application window is resized. Microsoft Docs: - The number of buffers in the swap chain (including all back and front buffers). + The number of buffers in the swap chain (including all back and front buffers). This number can be different from the number of buffers with which you created the swap chain. This number can't be greater than DXGI_MAX_SWAP_CHAIN_BUFFERS. Set this number to zero to preserve the existing number of buffers in the swap chain. You can't specify less than two buffers for the flip presentation model. - The new width of the back buffer. + The new width of the back buffer. If you specify zero, DXGI will use the width of the client area of the target window. You can't specify the width as zero if you called the IDXGIFactory2::CreateSwapChainForComposition method to create the swap chain for a composition surface. - The new height of the back buffer. + The new height of the back buffer. If you specify zero, DXGI will use the height of the client area of the target window. You can't specify the height as zero if you called the IDXGIFactory2::CreateSwapChainForComposition method to create the swap chain for a composition surface. - A DXGI_FORMAT-typed value for the new format of the back buffer. + A DXGI_FORMAT-typed value for the new format of the back buffer. Set this value to DXGI_FORMAT_UNKNOWN to preserve the existing format of the back buffer. The flip presentation model supports a more restricted set of formats than the bit-block transfer (bitblt) model. - A combination of DXGI_SWAP_CHAIN_FLAG-typed values that are combined by using a bitwise OR operation. + A combination of DXGI_SWAP_CHAIN_FLAG-typed values that are combined by using a bitwise OR operation. The resulting value specifies options for swap-chain behavior. - An array of UINTs, of total size BufferCount, where the value indicates which node the back buffer should be created on. + An array of UINTs, of total size BufferCount, where the value indicates which node the back buffer should be created on. Buffers created using ResizeBuffers1 with a non-null pCreationNodeMask array are visible to all nodes. - An array of command queues (ID3D12CommandQueue instances), of total size BufferCount. + An array of command queues (ID3D12CommandQueue instances), of total size BufferCount. Each queue provided must match the corresponding creation node mask specified in the pCreationNodeMask array. When Present() is called, in addition to rotating to the next buffer for the next frame, the swapchain will also rotate through these command queues. This allows the app to control which queue requires synchronization for a given present operation. @@ -1484,32 +1484,32 @@ For more information about returning the required buffer size, see Remarks. Removes a storage filter from the top of the storage-filter stack. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that removes the filter. + A DXGI_DEBUG_ID value that identifies the entity that removes the filter. Restores access to resources that were previously offered by calling IDXGIDevice2::OfferResources. Microsoft Docs: - The number of resources in the ppResources argument and pDiscarded argument arrays. - An array of pointers to IDXGIResource interfaces for the resources to reclaim. - A pointer to an array that receives Boolean values. Each value in the array corresponds to a resource at the same index that the ppResources parameter specifies. The runtime sets each Boolean value to TRUE if the corresponding resource’s content was discarded and is now undefined, or to FALSE if the corresponding resource’s old content is still intact. The caller can pass in NULL, if the caller intends to fill the resources with new content regardless of whether the old content was discarded. + The number of resources in the ppResources argument and pDiscarded argument arrays. + An array of pointers to IDXGIResource interfaces for the resources to reclaim. + A pointer to an array that receives Boolean values. Each value in the array corresponds to a resource at the same index that the ppResources parameter specifies. The runtime sets each Boolean value to TRUE if the corresponding resource’s content was discarded and is now undefined, or to FALSE if the corresponding resource’s old content is still intact. The caller can pass in NULL, if the caller intends to fill the resources with new content regardless of whether the old content was discarded. Turns the debug output on or off. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that gets the mute status. - A Boolean value that specifies whether to turn the debug output on or off (TRUE for on, FALSE for off). + A DXGI_DEBUG_ID value that identifies the entity that gets the mute status. + A Boolean value that specifies whether to turn the debug output on or off (TRUE for on, FALSE for off). Sets the source region to be used for the swap chain. Microsoft Docs: - Source width to use for the swap chain. This value must be greater than zero, and must be less than or equal to the overall width of the swap chain. - Source height to use for the swap chain. This value must be greater than zero, and must be less than or equal to the overall height of the swap chain. + Source width to use for the swap chain. This value must be greater than zero, and must be less than or equal to the overall width of the swap chain. + Source height to use for the swap chain. This value must be greater than zero, and must be less than or equal to the overall height of the swap chain. @@ -1588,14 +1588,14 @@ recreated and the content regenerated in order to be used. All future use of tha Gets the rotation of the back buffers for the swap chain. Microsoft Docs: - A pointer to a variable that receives a DXGI_MODE_ROTATION-typed value that specifies the rotation of the back buffers for the swap chain. + A pointer to a variable that receives a DXGI_MODE_ROTATION-typed value that specifies the rotation of the back buffers for the swap chain. Gets a copy of the current display surface. Microsoft Docs: - A pointer to a destination surface (see IDXGISurface). + A pointer to a destination surface (see IDXGISurface). @@ -1608,22 +1608,22 @@ recreated and the content regenerated in order to be used. All future use of tha Sets the color space used by the swap chain. Microsoft Docs: - A DXGI_COLOR_SPACE_TYPE-typed value that specifies the color space to set. + A DXGI_COLOR_SPACE_TYPE-typed value that specifies the color space to set. Sets the maximum number of messages that can be added to the message queue. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that sets the limit on the number of messages. - The maximum number of messages that can be added to the queue. –1 means no limit. + A DXGI_DEBUG_ID value that identifies the entity that sets the limit on the number of messages. + The maximum number of messages that can be added to the queue. –1 means no limit. Resizes the output target. Microsoft Docs: - A pointer to a DXGI_MODE_DESC structure that describes the mode, which specifies the new width, height, format, and refresh rate of the target. + A pointer to a DXGI_MODE_DESC structure that describes the mode, which specifies the new width, height, format, and refresh rate of the target. If the format is DXGI_FORMAT_UNKNOWN, ResizeTarget uses the existing format. We only recommend that you use DXGI_FORMAT_UNKNOWN when the swap chain is in full-screen mode as this method is not thread safe. @@ -1632,7 +1632,7 @@ recreated and the content regenerated in order to be used. All future use of tha Pops a retrieval filter from the top of the retrieval-filter stack. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that pops the filter. + A DXGI_DEBUG_ID value that identifies the entity that pops the filter. @@ -1651,11 +1651,11 @@ recreated and the content regenerated in order to be used. All future use of tha Returns a surface. This method is used internally and you should not call it directly in your application. Microsoft Docs: - A pointer to a DXGI_SURFACE_DESC structure that describes the surface. - The number of surfaces to create. - A DXGI_USAGE flag that specifies how the surface is expected to be used. - An optional pointer to a DXGI_SHARED_RESOURCE structure that contains shared resource information for opening views of such resources. - The address of an IDXGISurface interface pointer to the first created surface. + A pointer to a DXGI_SURFACE_DESC structure that describes the surface. + The number of surfaces to create. + A DXGI_USAGE flag that specifies how the surface is expected to be used. + An optional pointer to a DXGI_SHARED_RESOURCE structure that contains shared resource information for opening views of such resources. + The address of an IDXGISurface interface pointer to the first created surface. @@ -1721,25 +1721,25 @@ The recommended approach is to manually convert DX11 Discard swap chains to use Get a description of the output. Microsoft Docs: - A pointer to the output description (see DXGI_OUTPUT_DESC). + A pointer to the output description (see DXGI_OUTPUT_DESC). Allows specifying a list of supported formats for fullscreen surfaces that can be returned by the IDXGIOutputDuplication object. Microsoft Docs: - A pointer to the Direct3D device interface that you can use to process the desktop image. This device must be created from the adapter to which the output is connected. - Reserved for future use; must be zero. - Specifies the number of supported formats. - Specifies an array, of length SupportedFormatsCount of DXGI_FORMAT entries. - A pointer to a variable that receives the new IDXGIOutputDuplication interface. + A pointer to the Direct3D device interface that you can use to process the desktop image. This device must be created from the adapter to which the output is connected. + Reserved for future use; must be zero. + Specifies the number of supported formats. + Specifies an array, of length SupportedFormatsCount of DXGI_FORMAT entries. + A pointer to a variable that receives the new IDXGIOutputDuplication interface. Retrieves the background color of the swap chain. Microsoft Docs: - A pointer to a DXGI_RGBA structure that receives the background color of the swap chain. + A pointer to a DXGI_RGBA structure that receives the background color of the swap chain. @@ -1752,14 +1752,14 @@ The recommended approach is to manually convert DX11 Discard swap chains to use Pushes an empty storage filter onto the storage-filter stack. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that pushes the empty storage filter. + A DXGI_DEBUG_ID value that identifies the entity that pushes the empty storage filter. Using a key, releases exclusive rendering access to a shared resource. Microsoft Docs: - A value that indicates which device to give access to. This method succeeds when the device that currently owns the surface calls the ReleaseSync method using the same value. This value can be any UINT64 value. + A value that indicates which device to give access to. This method succeeds when the device that currently owns the surface calls the ReleaseSync method using the same value. This value can be any UINT64 value. @@ -1778,8 +1778,8 @@ The recommended approach is to manually convert DX11 Discard swap chains to use Enumerates both adapters (video cards) with or without outputs. Microsoft Docs: - The index of the adapter to enumerate. - The address of a pointer to an IDXGIAdapter1 interface at the position specified by the Adapter parameter. + The index of the adapter to enumerate. + The address of a pointer to an IDXGIAdapter1 interface at the position specified by the Adapter parameter. This parameter must not be NULL. @@ -1811,7 +1811,7 @@ The recommended approach is to manually convert DX11 Discard swap chains to use Presents a frame on the display screen. Microsoft Docs: - An integer that specifies how to synchronize presentation of a frame with the vertical blank. + An integer that specifies how to synchronize presentation of a frame with the vertical blank. For the bit-block transfer (bitblt) model (DXGI_SWAP_EFFECT_DISCARDor DXGI_SWAP_EFFECT_SEQUENTIAL), values are: @@ -1830,8 +1830,8 @@ For the flip model (IDXGIOutput1), Present1 performs the synchronization to the output that contains the largest sub-rectangle of the target window's client area. - An integer value that contains swap-chain presentation options. These options are defined by the DXGI_PRESENT constants. - A pointer to a DXGI_PRESENT_PARAMETERS structure that describes updated rectangles and scroll information of the frame to present. + An integer value that contains swap-chain presentation options. These options are defined by the DXGI_PRESENT constants. + A pointer to a DXGI_PRESENT_PARAMETERS structure that describes updated rectangles and scroll information of the frame to present. @@ -1895,7 +1895,7 @@ If the update region straddles more than one output (each represented by Returns the adapter for the specified device. Microsoft Docs: - The address of an IDXGIAdapter interface pointer to the adapter. This parameter must not be NULL. + The address of an IDXGIAdapter interface pointer to the adapter. This parameter must not be NULL. @@ -1988,7 +1988,7 @@ If the update region straddles more than one output (each represented by Set the priority for evicting the resource from memory. Microsoft Docs: - + @@ -2010,7 +2010,7 @@ If the update region straddles more than one output (each represented by Changes the background color of the swap chain. Microsoft Docs: - A pointer to a DXGI_RGBA structure that specifies the background color to set. + A pointer to a DXGI_RGBA structure that specifies the background color to set. @@ -2040,7 +2040,7 @@ If the update region straddles more than one output (each represented by Gets the gamma control settings. Microsoft Docs: - An array of gamma control settings (see DXGI_GAMMA_CONTROL). + An array of gamma control settings (see DXGI_GAMMA_CONTROL). @@ -2065,14 +2065,14 @@ If the update region straddles more than one output (each represented by Gets the size of the retrieval-filter stack in bytes. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that gets the size. + A DXGI_DEBUG_ID value that identifies the entity that gets the size. Removes a retrieval filter from the top of the retrieval-filter stack. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that removes the filter. + A DXGI_DEBUG_ID value that identifies the entity that removes the filter. @@ -2085,8 +2085,8 @@ If the update region straddles more than one output (each represented by Pushes a storage filter onto the storage-filter stack. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that pushes the filter. - A pointer to a DXGI_INFO_QUEUE_FILTER structure that describes the filter. + A DXGI_DEBUG_ID value that identifies the entity that pushes the filter. + A pointer to a DXGI_INFO_QUEUE_FILTER structure that describes the filter. @@ -2108,15 +2108,15 @@ If the update region straddles more than one output (each represented by Gets a description of the gamma-control capabilities. Microsoft Docs: - A pointer to a description of the gamma-control capabilities (see DXGI_GAMMA_CONTROL_CAPABILITIES). + A pointer to a description of the gamma-control capabilities (see DXGI_GAMMA_CONTROL_CAPABILITIES). Adds a user-defined message to the message queue and sends that message to the debug output. Microsoft Docs: - A DXGI_INFO_QUEUE_MESSAGE_SEVERITY-typed value that specifies the severity of the message. - The message string. + A DXGI_INFO_QUEUE_MESSAGE_SEVERITY-typed value that specifies the severity of the message. + The message string. @@ -2129,9 +2129,9 @@ If the update region straddles more than one output (each represented by Used to check for hardware feature support. Microsoft Docs: - Specifies one member of DXGI_FEATURE to query support for. - Specifies a pointer to a buffer that will be filled with data that describes the feature support. - The size, in bytes, of pFeatureSupportData. + Specifies one member of DXGI_FEATURE to query support for. + Specifies a pointer to a buffer that will be filled with data that describes the feature support. + The size, in bytes, of pFeatureSupportData. @@ -2192,8 +2192,8 @@ If the update region straddles more than one output (each represented by Determines whether the break on a message category is turned on or off. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that gets the breaking status. - A DXGI_INFO_QUEUE_MESSAGE_CATEGORY-typed value that specifies the category of the message. + A DXGI_DEBUG_ID value that identifies the entity that gets the breaking status. + A DXGI_INFO_QUEUE_MESSAGE_CATEGORY-typed value that specifies the category of the message. @@ -2206,7 +2206,7 @@ If the update region straddles more than one output (each represented by Releases the GDI device context (DC) that is associated with the current surface and allows you to use Direct3D to render. Microsoft Docs: - A pointer to a RECT structure that identifies the dirty region of the surface. + A pointer to a RECT structure that identifies the dirty region of the surface. A dirty region is any part of the surface that you used for GDI rendering and that you want to preserve. This area is used as a performance hint to graphics subsystem in certain scenarios. Do not use this parameter to restrict rendering to the specified rectangular region. @@ -2265,8 +2265,8 @@ You can pass a pointer to an empty RECT structure (a rectangle with no po Get a pointer to the data contained in the surface, and deny GPU access to the surface. Microsoft Docs: - A pointer to the surface data (see DXGI_MAPPED_RECT). - CPU read-write flags. These flags can be combined with a logical OR. + A pointer to the surface data (see DXGI_MAPPED_RECT). + CPU read-write flags. These flags can be combined with a logical OR. @@ -2293,7 +2293,7 @@ You can pass a pointer to an empty RECT structure (a rectangle with no po Get the eviction priority. Microsoft Docs: - A pointer to the eviction priority, which determines when a resource can be evicted from memory. + A pointer to the eviction priority, which determines when a resource can be evicted from memory. The following defined values are possible. @@ -2359,19 +2359,19 @@ The resource is evicted from memory only if there is no other way of resolving t This method informs the process of the current budget and process usage. Microsoft Docs: - Specifies the device's physical adapter for which the video memory information is queried. + Specifies the device's physical adapter for which the video memory information is queried. For single-GPU operation, set this to zero. If there are multiple GPU nodes, set this to the index of the node (the device's physical adapter) for which the video memory information is queried. See Multi-adapter systems. - Specifies a DXGI_MEMORY_SEGMENT_GROUP that identifies the group as local or non-local. - Fills in a DXGI_QUERY_VIDEO_MEMORY_INFO structure with the current values. + Specifies a DXGI_MEMORY_SEGMENT_GROUP that identifies the group as local or non-local. + Fills in a DXGI_QUERY_VIDEO_MEMORY_INFO structure with the current values. Gets the number of frames that the swap chain is allowed to queue for rendering. Microsoft Docs: - The maximum number of back buffer frames that will be queued for the swap chain. This value is 1 by default, but should be set to 2 if the scene takes longer than it takes for one vertical refresh (typically about 16ms) to draw. + The maximum number of back buffer frames that will be queued for the swap chain. This value is 1 by default, but should be set to 2 if the scene takes longer than it takes for one vertical refresh (typically about 16ms) to draw. @@ -2384,7 +2384,7 @@ The resource is evicted from memory only if there is no other way of resolving t Sets the number of frames that the swap chain is allowed to queue for rendering. Microsoft Docs: - The maximum number of back buffer frames that will be queued for the swap chain. This value is 1 by default. + The maximum number of back buffer frames that will be queued for the swap chain. This value is 1 by default. @@ -2412,7 +2412,7 @@ The resource is evicted from memory only if there is no other way of resolving t Gets a description of a full-screen swap chain. Microsoft Docs: - A pointer to a DXGI_SWAP_CHAIN_FULLSCREEN_DESC structure that describes the full-screen swap chain. + A pointer to a DXGI_SWAP_CHAIN_FULLSCREEN_DESC structure that describes the full-screen swap chain. @@ -2464,11 +2464,11 @@ The resource is evicted from memory only if there is no other way of resolving t Gets information about the moved rectangles for the current desktop frame. Microsoft Docs: - The size in bytes of the buffer that the caller passed to the pMoveRectBuffer parameter. - A pointer to an array of + The size in bytes of the buffer that the caller passed to the pMoveRectBuffer parameter. + A pointer to an array of DXGI_OUTDUPL_MOVE_RECT structures that identifies the moved rectangle regions for the desktop frame. - Pointer to a variable that receives the number of bytes that + Pointer to a variable that receives the number of bytes that GetFrameMoveRects needs to store information about moved regions in the buffer at pMoveRectBuffer. @@ -2479,15 +2479,15 @@ For more information about returning the required buffer size, see Remarks. Gets statistics about recently rendered frames. Microsoft Docs: - A pointer to frame statistics (see DXGI_FRAME_STATISTICS). + A pointer to frame statistics (see DXGI_FRAME_STATISTICS). Creates a desktop duplication interface from the IDXGIOutput1 interface that represents an adapter output. Microsoft Docs: - A pointer to the Direct3D device interface that you can use to process the desktop image. This device must be created from the adapter to which the output is connected. - A pointer to a variable that receives the new IDXGIOutputDuplication interface. + A pointer to the Direct3D device interface that you can use to process the desktop image. This device must be created from the adapter to which the output is connected. + A pointer to a variable that receives the new IDXGIOutputDuplication interface. @@ -2563,14 +2563,14 @@ For detailed luminance and color capabilities, see additional members of this st Get the window through which the user controls the transition to and from full screen. Microsoft Docs: - A pointer to a window handle. + A pointer to a window handle. Creates a handle to a shared resource. You can then use the returned handle with multiple Direct3D devices. Microsoft Docs: - A pointer to a SECURITY_ATTRIBUTES + A pointer to a SECURITY_ATTRIBUTES structure that contains two separate but related data members: an optional security descriptor, and a Boolean value that determines whether child processes can inherit the returned handle. @@ -2599,22 +2599,22 @@ The name can have a "Global\" or "Local\" prefix to explicitly create the object Kernel Object Namespaces. Fast user switching is implemented using Terminal Services sessions. Kernel object names must follow the guidelines outlined for Terminal Services so that applications can support multiple users. The object can be created in a private namespace. For more information, see Object Namespaces. - A pointer to a variable that receives the NT HANDLE value to the resource to share. You can use this handle in calls to access the resource. + A pointer to a variable that receives the NT HANDLE value to the resource to share. You can use this handle in calls to access the resource. Enumerates the adapters (video cards). Microsoft Docs: - The index of the adapter to enumerate. - The address of a pointer to an IDXGIAdapter interface at the position specified by the Adapter parameter. This parameter must not be NULL. + The index of the adapter to enumerate. + The address of a pointer to an IDXGIAdapter interface at the position specified by the Adapter parameter. This parameter must not be NULL. Pushes a copy of the storage filter that is currently on the top of the storage-filter stack onto the storage-filter stack. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that pushes the copy of the storage filter. + A DXGI_DEBUG_ID value that identifies the entity that pushes the copy of the storage filter. @@ -2627,7 +2627,7 @@ The object can be created in a private namespace. For more information, see Returns a device context (DC) that allows you to render to a Microsoft DirectX Graphics Infrastructure (DXGI) surface using Windows Graphics Device Interface (GDI). Microsoft Docs: - A Boolean value that specifies whether to preserve Direct3D contents in the GDI DC. TRUE directs the runtime not to preserve Direct3D contents in the GDI DC; that is, the runtime discards the Direct3D contents. FALSE guarantees that Direct3D contents are available in the GDI DC. + A Boolean value that specifies whether to preserve Direct3D contents in the GDI DC. TRUE directs the runtime not to preserve Direct3D contents in the GDI DC; that is, the runtime discards the Direct3D contents. FALSE guarantees that Direct3D contents are available in the GDI DC. A pointer to an HDC handle that represents the current device context for GDI rendering. @@ -2635,16 +2635,16 @@ The object can be created in a private namespace. For more information, see Adds storage filters to the top of the storage-filter stack. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that produced the filters. - An array of DXGI_INFO_QUEUE_FILTER structures that describe the filters. + A DXGI_DEBUG_ID value that identifies the entity that produced the filters. + An array of DXGI_INFO_QUEUE_FILTER structures that describe the filters. Determines whether the break on a message severity level is turned on or off. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that gets the breaking status. - A DXGI_INFO_QUEUE_MESSAGE_SEVERITY-typed value that specifies the severity of the message. + A DXGI_DEBUG_ID value that identifies the entity that gets the breaking status. + A DXGI_INFO_QUEUE_MESSAGE_SEVERITY-typed value that specifies the severity of the message. @@ -2805,35 +2805,35 @@ To check for hardware support of this feature, refer to - A DXGI_DEBUG_ID value that identifies the entity that gets the number. + A DXGI_DEBUG_ID value that identifies the entity that gets the number. Gets the number of messages that can pass through a retrieval filter. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that gets the number. + A DXGI_DEBUG_ID value that identifies the entity that gets the number. Clears all messages from the message queue. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that clears the messages. + A DXGI_DEBUG_ID value that identifies the entity that clears the messages. Creates a YUV swap chain for an existing DirectComposition surface handle. Microsoft Docs: - A pointer to the Direct3D device for the swap chain. This parameter cannot be NULL. + A pointer to the Direct3D device for the swap chain. This parameter cannot be NULL. Software drivers, like D3D_DRIVER_TYPE_REFERENCE, are not supported for composition swap chains. A handle to an existing DirectComposition surface. This parameter cannot be NULL. - A pointer to a DXGI_DECODE_SWAP_CHAIN_DESC structure for the swap-chain description. + A pointer to a DXGI_DECODE_SWAP_CHAIN_DESC structure for the swap-chain description. This parameter cannot be NULL. - A pointer to a IDXGIResource interface that represents the resource that contains the info + A pointer to a IDXGIResource interface that represents the resource that contains the info that CreateDecodeSwapChainForCompositionSurfaceHandle decodes. - A pointer to the IDXGIOutput interface for the swap chain to restrict content to. If the swap chain + A pointer to the IDXGIOutput interface for the swap chain to restrict content to. If the swap chain is moved to a different output, the content is black. You can optionally set this parameter to an output target that uses DXGI_PRESENT_RESTRICT_TO_OUTPUT to restrict the content on this output. If the swap chain is moved to a different output, the content is black. @@ -2846,7 +2846,7 @@ You must also pass the A pointer to a variable that receives a pointer to the IDXGIDecodeSwapChain interface for the + A pointer to a variable that receives a pointer to the IDXGIDecodeSwapChain interface for the swap chain that this method creates. @@ -2860,7 +2860,7 @@ Set this parameter to NULL if you don't want to restrict content to an ou Get a description of the swap chain. Microsoft Docs: - A pointer to the swap-chain description (see DXGI_SWAP_CHAIN_DESC). + A pointer to the swap-chain description (see DXGI_SWAP_CHAIN_DESC). @@ -3633,17 +3633,17 @@ This is usually used with 10 or 12 bit color channels. Sets application-defined data to the object and associates that data with a GUID. Microsoft Docs: - A GUID that identifies the data. Use this GUID in a call to GetPrivateData to get the data. - The size of the object's data. - A pointer to the object's data. + A GUID that identifies the data. Use this GUID in a call to GetPrivateData to get the data. + The size of the object's data. + A pointer to the object's data. Presents a frame on the output adapter. Microsoft Docs: - An index indicating which member of the subresource array to present. - An integer that specifies how to synchronize presentation of a frame with the vertical blank. + An index indicating which member of the subresource array to present. + An integer that specifies how to synchronize presentation of a frame with the vertical blank. For the bit-block transfer (bitblt) model (DXGI_SWAP_EFFECT_DISCARDor DXGI_SWAP_EFFECT_SEQUENTIAL), values are: @@ -3659,7 +3659,7 @@ For the flip model (An integer value that contains swap-chain presentation options. These options are defined by the DXGI_PRESENT constants. + An integer value that contains swap-chain presentation options. These options are defined by the DXGI_PRESENT constants. The DXGI_PRESENT_USE_DURATION flag must be set if a custom present duration (custom refresh rate) is being used. @@ -3668,15 +3668,15 @@ The DXGI_PRESENT_USE_DURATION flag must be set if a custom present durati Retrieves a description of a duplicated output. This description specifies the dimensions of the surface that contains the desktop image. Microsoft Docs: - A pointer to a DXGI_OUTDUPL_DESC structure that describes the duplicated output. This parameter must not be NULL. + A pointer to a DXGI_OUTDUPL_DESC structure that describes the duplicated output. This parameter must not be NULL. Determines whether the break on a message identifier is turned on or off. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that gets the breaking status. - An integer value that specifies the identifier of the message. + A DXGI_DEBUG_ID value that identifies the entity that gets the breaking status. + An integer value that specifies the identifier of the message. @@ -3719,24 +3719,24 @@ For more information about choosing windowed verses full screen, see - A DXGI_FORMAT-typed value for the color format. - A DXGI_COLOR_SPACE_TYPE-typed value that specifies color space type to check overlay support for. - A pointer to the Direct3D device interface. CheckOverlayColorSpaceSupport returns only support info about this scan-out device. - A pointer to a variable that receives a combination of DXGI_OVERLAY_COLOR_SPACE_SUPPORT_FLAG-typed values that are combined by using a bitwise OR operation. The resulting value specifies options for overlay color space support. + A DXGI_FORMAT-typed value for the color format. + A DXGI_COLOR_SPACE_TYPE-typed value that specifies color space type to check overlay support for. + A pointer to the Direct3D device interface. CheckOverlayColorSpaceSupport returns only support info about this scan-out device. + A pointer to a variable that receives a combination of DXGI_OVERLAY_COLOR_SPACE_SUPPORT_FLAG-typed values that are combined by using a bitwise OR operation. The resulting value specifies options for overlay color space support. Copies the display surface (front buffer) to a user-provided resource. Microsoft Docs: - A pointer to a resource interface that represents the resource to which GetDisplaySurfaceData1 copies the display surface. + A pointer to a resource interface that represents the resource to which GetDisplaySurfaceData1 copies the display surface. Gets a Microsoft DirectX Graphics Infrastructure (DXGI) 1.6 description of an adapter or video card. This description includes information about ACG compatibility. Microsoft Docs: - A pointer to a DXGI_ADAPTER_DESC3 structure that describes the adapter. + A pointer to a DXGI_ADAPTER_DESC3 structure that describes the adapter. This parameter must not be NULL. On feature level 9 graphics hardware, early versions of GetDesc3 (GetDesc1, and GetDesc) return zeros for the PCI ID in the VendorId, DeviceId, SubSysId, and Revision members of the adapter description structure and “Software Adapter” for the description string in the Description member. GetDesc3 and GetDesc2 return the actual feature level 9 hardware values in these members. @@ -3744,15 +3744,15 @@ For more information about choosing windowed verses full screen, see - The current width of the source region of the swap chain. This value can range from 1 to the overall width of the swap chain. - The current height of the source region of the swap chain. This value can range from 1 to the overall height of the swap chain. + The current width of the source region of the swap chain. This value can range from 1 to the overall width of the swap chain. + The current height of the source region of the swap chain. This value can range from 1 to the overall height of the swap chain. Sets the GPU thread priority. Microsoft Docs: - A value that specifies the required GPU thread priority. This value must be between -7 and 7, inclusive, where 0 represents normal priority. + A value that specifies the required GPU thread priority. This value must be between -7 and 7, inclusive, where 0 represents normal priority. @@ -3771,16 +3771,16 @@ For more information about choosing windowed verses full screen, see - A DXGI_DEBUG_ID value that identifies the entity that gets the mute status. + A DXGI_DEBUG_ID value that identifies the entity that gets the mute status. Retrieves an interface that Windows Store apps use for debugging the Microsoft DirectX Graphics Infrastructure (DXGI). Microsoft Docs: - Not used. + Not used. The globally unique identifier (GUID) of the requested interface type, which can be the identifier for the IDXGIDebug, IDXGIDebug1, or IDXGIInfoQueue interfaces. - A pointer to a buffer that receives a pointer to the debugging interface. + A pointer to a buffer that receives a pointer to the debugging interface. @@ -3808,7 +3808,7 @@ For more information about choosing windowed verses full screen, see - An integer that specifies how to synchronize presentation of a frame with the vertical blank. + An integer that specifies how to synchronize presentation of a frame with the vertical blank. For the bit-block transfer (bitblt) model (DXGI_SWAP_EFFECT_DISCARDor DXGI_SWAP_EFFECT_SEQUENTIAL), values are: @@ -3827,18 +3827,18 @@ For the flip model (IDXGIOutput), Present performs the synchronization to the output that contains the largest sub-rectangle of the target window's client area. - An integer value that contains swap-chain presentation options. These options are defined by the DXGI_PRESENT constants. + An integer value that contains swap-chain presentation options. These options are defined by the DXGI_PRESENT constants. Gets information about dirty rectangles for the current desktop frame. Microsoft Docs: - The size in bytes of the buffer that the caller passed to the pDirtyRectsBuffer + The size in bytes of the buffer that the caller passed to the pDirtyRectsBuffer parameter. - A pointer to an array of RECT structures + A pointer to an array of RECT structures that identifies the dirty rectangle regions for the desktop frame. - Pointer to a variable that receives the number of bytes that + Pointer to a variable that receives the number of bytes that GetFrameDirtyRects needs to store information about dirty regions in the buffer at pDirtyRectsBuffer. @@ -3856,20 +3856,20 @@ For more information about returning the required buffer size, see Remarks. Gets the display modes that match the requested format and other input options. Microsoft Docs: - The color format (see DXGI_FORMAT). - Options for modes to include (see DXGI_ENUM_MODES). + The color format (see DXGI_FORMAT). + Options for modes to include (see DXGI_ENUM_MODES). DXGI_ENUM_MODES_SCALING needs to be specified to expose the display modes that require scaling. Centered modes, requiring no scaling and corresponding directly to the display output, are enumerated by default. - Set pDesc to NULL so that pNumModes returns the number of display modes that match the format and the options. + Set pDesc to NULL so that pNumModes returns the number of display modes that match the format and the options. Otherwise, pNumModes returns the number of display modes returned in pDesc. - A pointer to a list of display modes (see DXGI_MODE_DESC); set to NULL to get the number of display modes. + A pointer to a list of display modes (see DXGI_MODE_DESC); set to NULL to get the number of display modes. Gets the GPU thread priority. Microsoft Docs: - A pointer to a variable that receives a value that indicates the current GPU thread priority. The value will be between -7 and 7, inclusive, where 0 represents normal priority. + A pointer to a variable that receives a value that indicates the current GPU thread priority. The value will be between -7 and 7, inclusive, where 0 represents normal priority. @@ -3913,7 +3913,7 @@ For more information about returning the required buffer size, see Remarks.Creates a subresource surface object. Microsoft Docs: The index of the subresource surface object to enumerate. - The address of a pointer to a IDXGISurface2 interface that represents the created subresource surface object at the position specified by the index parameter. + The address of a pointer to a IDXGISurface2 interface that represents the created subresource surface object at the position specified by the index parameter. @@ -3989,32 +3989,32 @@ For more information about returning the required buffer size, see Remarks. Checks for overlay support. Microsoft Docs: - A DXGI_FORMAT-typed value for the color format. - A pointer to the Direct3D device interface. CheckOverlaySupport returns only support info about this scan-out device. - A pointer to a variable that receives a combination of DXGI_OVERLAY_SUPPORT_FLAG-typed values that are combined by using a bitwise OR operation. The resulting value specifies options for overlay support. + A DXGI_FORMAT-typed value for the color format. + A pointer to the Direct3D device interface. CheckOverlaySupport returns only support info about this scan-out device. + A pointer to a variable that receives a combination of DXGI_OVERLAY_SUPPORT_FLAG-typed values that are combined by using a bitwise OR operation. The resulting value specifies options for overlay support. Gets the size of the storage-filter stack in bytes. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that gets the size. + A DXGI_DEBUG_ID value that identifies the entity that gets the size. Restores access to resources that were previously offered by calling IDXGIDevice4::OfferResources1. Microsoft Docs: - The number of resources in the ppResources argument and pResults argument arrays. - An array of pointers to IDXGIResource interfaces for the resources to reclaim. - A pointer to an array that receives DXGI_RECLAIM_RESOURCE_RESULTS values. Each value in the array corresponds to a resource at the same index that the ppResources parameter specifies. The caller can pass in NULL, if the caller intends to fill the resources with new content regardless of whether the old content was discarded. + The number of resources in the ppResources argument and pResults argument arrays. + An array of pointers to IDXGIResource interfaces for the resources to reclaim. + A pointer to an array that receives DXGI_RECLAIM_RESOURCE_RESULTS values. Each value in the array corresponds to a resource at the same index that the ppResources parameter specifies. The caller can pass in NULL, if the caller intends to fill the resources with new content regardless of whether the old content was discarded. Sets the rectangle that defines the target region for the video processing blit operation. Microsoft Docs: - A pointer to a RECT structure + A pointer to a RECT structure that contains the target region to set for the swap chain. @@ -4522,15 +4522,15 @@ For more info about YUV formats for video rendering, see - The transform matrix to use for swap chain scaling and translation. This function can only be used with composition swap chains created by IDXGIFactory2::CreateSwapChainForComposition. Only scale and translation components are allowed in the matrix. + The transform matrix to use for swap chain scaling and translation. This function can only be used with composition swap chains created by IDXGIFactory2::CreateSwapChainForComposition. Only scale and translation components are allowed in the matrix. Gets the size of the destination surface to use for the video processing blit operation. Microsoft Docs: - A pointer to a variable that receives the width in pixels. - A pointer to a variable that receives the height in pixels. + A pointer to a variable that receives the width in pixels. + A pointer to a variable that receives the height in pixels. @@ -4549,27 +4549,27 @@ For more info about YUV formats for video rendering, see - A DXGI_DEBUG_ID value that identifies the entity that sets the breaking condition. - A DXGI_INFO_QUEUE_MESSAGE_SEVERITY-typed value that specifies the severity of the message. - A Boolean value that specifies whether SetBreakOnSeverity turns on or off this breaking condition (TRUE for on, FALSE for off). + A DXGI_DEBUG_ID value that identifies the entity that sets the breaking condition. + A DXGI_INFO_QUEUE_MESSAGE_SEVERITY-typed value that specifies the severity of the message. + A Boolean value that specifies whether SetBreakOnSeverity turns on or off this breaking condition (TRUE for on, FALSE for off). Indicates that the application is ready to process the next desktop image. Microsoft Docs: - The time-out interval, in milliseconds. This interval specifies the amount of time that this method waits for a new frame before it returns to the caller. This method returns if the interval elapses, and a new desktop image is not available. + The time-out interval, in milliseconds. This interval specifies the amount of time that this method waits for a new frame before it returns to the caller. This method returns if the interval elapses, and a new desktop image is not available. For more information about the time-out interval, see Remarks. - A pointer to a memory location that receives the DXGI_OUTDUPL_FRAME_INFO structure that describes timing and presentation statistics for a frame. - A pointer to a variable that receives the IDXGIResource interface of the surface that contains the desktop bitmap. + A pointer to a memory location that receives the DXGI_OUTDUPL_FRAME_INFO structure that describes timing and presentation statistics for a frame. + A pointer to a variable that receives the IDXGIResource interface of the surface that contains the desktop bitmap. Changes the display mode. Microsoft Docs: - A pointer to a surface (see IDXGISurface) used for rendering an image to the screen. The surface must have been created as a back buffer (DXGI_USAGE_BACKBUFFER). + A pointer to a surface (see IDXGISurface) used for rendering an image to the screen. The surface must have been created as a back buffer (DXGI_USAGE_BACKBUFFER). @@ -4602,7 +4602,7 @@ The scrolled rectangle also describes the destination rectangle, that is, the re Gets a Microsoft DirectX Graphics Infrastructure (DXGI) 1.2 description of an adapter or video card. Microsoft Docs: - A pointer to a DXGI_ADAPTER_DESC2 structure that describes the adapter. + A pointer to a DXGI_ADAPTER_DESC2 structure that describes the adapter. This parameter must not be NULL. On feature level 9 graphics hardware, earlier versions of GetDesc2 (GetDesc and GetDesc1) return zeros for the PCI ID in the VendorId, DeviceId, SubSysId, and Revision members of the adapter description structure and “Software Adapter” for the description string in the Description member. GetDesc2 returns the actual feature level 9 hardware values in these members. @@ -4611,7 +4611,7 @@ The scrolled rectangle also describes the destination rectangle, that is, the re Gets the parent of the object. Microsoft Docs: The ID of the requested interface. - The address of a pointer to the parent object. + The address of a pointer to the parent object. @@ -4624,7 +4624,7 @@ The scrolled rectangle also describes the destination rectangle, that is, the re Get a description of the surface. Microsoft Docs: - A pointer to the surface description (see DXGI_SURFACE_DESC). + A pointer to the surface description (see DXGI_SURFACE_DESC). @@ -4700,7 +4700,7 @@ The scrolled rectangle also describes the destination rectangle, that is, the re Registers an application window to receive notification messages of changes of stereo status. Microsoft Docs: - The handle of the window to send a notification message to when stereo status change occurs. + The handle of the window to send a notification message to when stereo status change occurs. Identifies the notification message to send. A pointer to a key value that an application can pass to the IDXGIFactory2::UnregisterStereoStatus method to unregister the notification message that wMsg specifies. @@ -4709,7 +4709,7 @@ The scrolled rectangle also describes the destination rectangle, that is, the re Gets the number of frames that the system is allowed to queue for rendering. Microsoft Docs: - This value is set to the number of frames that can be queued for render. + This value is set to the number of frames that can be queued for render. This value defaults to 3, but can range from 1 to 16. @@ -4725,7 +4725,7 @@ The scrolled rectangle also describes the destination rectangle, that is, the re Gets a DXGI 1.1 description of an adapter (or video card). Microsoft Docs: - A pointer to a DXGI_ADAPTER_DESC1 structure that describes the adapter. + A pointer to a DXGI_ADAPTER_DESC1 structure that describes the adapter. This parameter must not be NULL. On feature level 9 graphics hardware, GetDesc1 returns zeros for the PCI ID in the VendorId, DeviceId, SubSysId, and Revision members of DXGI_ADAPTER_DESC1 and “Software Adapter” for the description string in the Description member. @@ -4733,7 +4733,7 @@ The scrolled rectangle also describes the destination rectangle, that is, the re Pushes an empty retrieval filter onto the retrieval-filter stack. Microsoft Docs: - A DXGI_DEBUG_ID value that identifies the entity that pushes the empty retrieval filter. + A DXGI_DEBUG_ID value that identifies the entity that pushes the empty retrieval filter. @@ -4748,7 +4748,7 @@ The scrolled rectangle also describes the destination rectangle, that is, the re Using a key, acquires exclusive rendering access to a shared resource. Microsoft Docs: - A value that indicates which device to give access to. This method will succeed when the device that currently owns the surface calls + A value that indicates which device to give access to. This method will succeed when the device that currently owns the surface calls the IDXGIKeyedMutex::ReleaseSync method using the same value. This value can be any UINT64 value. The time-out interval, in milliseconds. This method will return if the interval elapses, and the keyed mutex has not been released using the specified Key. If this value is set to zero, the AcquireSync method will test to see if the keyed mutex has been released and returns immediately. diff --git a/src/Vortice.Win32/Generated/Graphics/Dxgi.Common.cs b/src/Vortice.Win32/Generated/Graphics/Dxgi.Common.cs index 2adc528..c708647 100644 --- a/src/Vortice.Win32/Generated/Graphics/Dxgi.Common.cs +++ b/src/Vortice.Win32/Generated/Graphics/Dxgi.Common.cs @@ -8,10 +8,11 @@ // ------------------------------------------------------------------------------ using System; +using System.Diagnostics; using System.Runtime.CompilerServices; using System.Diagnostics.CodeAnalysis; -#if NETSTANDARD2_0 +#if !NET6_0_OR_GREATER using MemoryMarshal = Win32.MemoryMarshal; #endif @@ -1724,3 +1725,6 @@ public partial struct JpegQuantizationTable #endregion Structs +#region COM Types +#endregion COM Types + diff --git a/src/Vortice.Win32/Generated/Graphics/Dxgi.cs b/src/Vortice.Win32/Generated/Graphics/Dxgi.cs index c9ab871..c247b85 100644 --- a/src/Vortice.Win32/Generated/Graphics/Dxgi.cs +++ b/src/Vortice.Win32/Generated/Graphics/Dxgi.cs @@ -8,10 +8,11 @@ // ------------------------------------------------------------------------------ using System; +using System.Diagnostics; using System.Runtime.CompilerServices; using System.Diagnostics.CodeAnalysis; -#if NETSTANDARD2_0 +#if !NET6_0_OR_GREATER using MemoryMarshal = Win32.MemoryMarshal; #endif @@ -2174,3 +2175,122 @@ public partial struct InfoQueueFilter #endregion Structs +#region COM Types +/// +/// IDXGIObject +[Guid("aec22fb8-76f3-4639-9be0-28eb43a67a2e")] +[NativeTypeName("struct IDXGIObject : IUnknown")] +[NativeInheritance("IUnknown")] +public unsafe partial struct IDXGIObject : IDXGIObject.Interface +{ + [NativeTypeName("const GUID")] + public static ref readonly Guid IID_IDXGIObject + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + ReadOnlySpan data = new byte[] { + 0xB8, 0x2F, 0xC2, 0xAE, + 0xF3, 0x76, + 0x39, 0x46, + 0x9B, + 0xE0, + 0x28, + 0xEB, + 0x43, + 0xA6, + 0x7A, + 0x2E + }; + + Debug.Assert(data.Length == Unsafe.SizeOf()); + return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); + } + } + + public static Guid* NativeGuid => (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in IID_IDXGIObject)); + + public void** lpVtbl; + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(0)] + public HResult QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject) + { + return ((delegate* unmanaged[Stdcall])(lpVtbl[0]))((IUnknown*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(1)] + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return ((delegate* unmanaged[Stdcall])(lpVtbl[1]))((IUnknown*)Unsafe.AsPointer(ref this)); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(2)] + [return: NativeTypeName("ULONG")] + public uint Release() + { + return ((delegate* unmanaged[Stdcall])(lpVtbl[2]))((IUnknown*)Unsafe.AsPointer(ref this)); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(3)] + public HResult SetPrivateData(Guid* Name, uint DataSize, void* pData) + { +#if NET6_0_OR_GREATER + return ((delegate* unmanaged)(lpVtbl[3]))((IDXGIObject*)Unsafe.AsPointer(ref this), Name, DataSize, pData); +#else + return ((delegate* unmanaged[Stdcall])(lpVtbl[3]))((IDXGIObject*)Unsafe.AsPointer(ref this), Name, DataSize, pData); +#endif + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(4)] + public HResult SetPrivateDataInterface(Guid* Name, IUnknown pUnknown) + { +#if NET6_0_OR_GREATER + return ((delegate* unmanaged)(lpVtbl[4]))((IDXGIObject*)Unsafe.AsPointer(ref this), Name, pUnknown); +#else + return ((delegate* unmanaged[Stdcall])(lpVtbl[4]))((IDXGIObject*)Unsafe.AsPointer(ref this), Name, pUnknown); +#endif + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(5)] + public HResult GetPrivateData(Guid* Name, uint* pDataSize, void* pData) + { +#if NET6_0_OR_GREATER + return ((delegate* unmanaged)(lpVtbl[5]))((IDXGIObject*)Unsafe.AsPointer(ref this), Name, pDataSize, pData); +#else + return ((delegate* unmanaged[Stdcall])(lpVtbl[5]))((IDXGIObject*)Unsafe.AsPointer(ref this), Name, pDataSize, pData); +#endif + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(6)] + public HResult GetParent(Guid* riid, void** ppParent) + { +#if NET6_0_OR_GREATER + return ((delegate* unmanaged)(lpVtbl[6]))((IDXGIObject*)Unsafe.AsPointer(ref this), riid, ppParent); +#else + return ((delegate* unmanaged[Stdcall])(lpVtbl[6]))((IDXGIObject*)Unsafe.AsPointer(ref this), riid, ppParent); +#endif + } + + public interface Interface : IUnknown.Interface + { + } + +} + +#endregion COM Types + diff --git a/src/Vortice.Win32/NetStandard.cs b/src/Vortice.Win32/NetStandard.cs index 227dd0a..e3a0272 100644 --- a/src/Vortice.Win32/NetStandard.cs +++ b/src/Vortice.Win32/NetStandard.cs @@ -1,7 +1,7 @@ // Copyright © Amer Koleci and Contributors. // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. -#if NETSTANDARD2_0 +#if !NET6_0_OR_GREATER using System.Runtime.CompilerServices; diff --git a/src/samples/01-ClearScreen/Program.cs b/src/samples/01-ClearScreen/Program.cs index 947d975..18be445 100644 --- a/src/samples/01-ClearScreen/Program.cs +++ b/src/samples/01-ClearScreen/Program.cs @@ -10,9 +10,5 @@ public static unsafe class Program { public static void Main() { - SampleDescription desc = new(1, 0); - desc.Count - - Scaling scaling = Scaling.Stretch; } }