From 69347d8b24e146a039c74443593b90d613ff1813 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Sat, 31 Aug 2024 00:55:19 +0200 Subject: [PATCH 1/2] DXC: Annotate new struct fields and enums For `DXC_FOURCC` it would have been awesome if we could have something like the following, if `const` methods were supported: ```cs public static const uint DXC_FOURCC(char ch0, char ch1, char ch2, char ch3) => ch0 | (ch1 << 8) | (ch2 << 16) | (ch3 << 24); ``` --- generation/WinSDK/emitter.settings.rsp | 3 + generation/WinSDK/enums.json | 140 ++++++++++++++++++++++--- scripts/ChangesSinceLastRelease.txt | 25 +++++ 3 files changed, 154 insertions(+), 14 deletions(-) diff --git a/generation/WinSDK/emitter.settings.rsp b/generation/WinSDK/emitter.settings.rsp index d55afbdc8..f6a233180 100644 --- a/generation/WinSDK/emitter.settings.rsp +++ b/generation/WinSDK/emitter.settings.rsp @@ -706,6 +706,9 @@ ICreateWithTransactionEx::CreateInstance::pObject=[ComOutPtr] IClassFactory2::CreateInstanceLic::ppvObj=[ComOutPtr] DxcCreateInstance::ppv=[ComOutPtr] DxcCreateInstance2::ppv=[ComOutPtr] +IDxcContainerReflection::GetPartReflection::ppvObject=[ComOutPtr] +IDxcUtils::CreateReflection::ppvReflection=[ComOutPtr] +IDxcUtils::GetDxilContainerPart::ppPartData=[NativeArrayInfo(CountFieldName = "pPartSizeInBytes")] IWbemServices::CreateInstanceEnum::ppEnum=[ComOutPtr] StiCreateInstanceW::ppSti=[ComOutPtr] IMFImageSharingEngineClassFactory::CreateInstanceFromUDN::ppEngine=[ComOutPtr] diff --git a/generation/WinSDK/enums.json b/generation/WinSDK/enums.json index 4dbf88250..98343237b 100644 --- a/generation/WinSDK/enums.json +++ b/generation/WinSDK/enums.json @@ -28765,20 +28765,6 @@ "filter": "DXC_CP_", "header": "dxcapi.h" }, - "members": [ - { - "name": "DXC_CP_ACP", - "value": "0" - }, - { - "name": "DXC_CP_UTF16", - "value": "1200" - }, - { - "name": "DXC_CP_UTF8", - "value": "65001" - } - ], "uses": [ { "interface": "IDxcBlobEncoding", @@ -28824,6 +28810,132 @@ "interface": "IDxcUtils", "method": "LoadFile", "parameter": "pCodePage" + }, + { + "struct": "DxcBuffer", + "field": "Encoding" + } + ] + }, + { + "name": "DxcValidatorFlags", + "flags": true, + "autoPopulate": { + "filter": "DxcValidatorFlags_", + "header": "dxcapi.h" + }, + "uses": [ + { + "interface": "IDxcValidator", + "method": "Validate", + "parameter": "Flags" + }, + { + "interface": "IDxcValidator2", + "method": "ValidateWithDebug", + "parameter": "Flags" + } + ] + }, + { + "name": "DxcVersionInfoFlags", + "flags": true, + "autoPopulate": { + "filter": "DxcVersionInfoFlags_", + "header": "dxcapi.h" + }, + "uses": [ + { + "interface": "IDxcVersionInfo", + "method": "GetFlags", + "parameter": "pFlags" + } + ] + }, + { + "name": "DXC_HASHFLAG", + "flags": true, + "autoPopulate": { + "filter": "DXC_HASHFLAG_", + "header": "dxcapi.h" + }, + "uses": [ + { + "struct": "DxcShaderHash", + "field": "Flags" + } + ] + }, + { + "name": "DXC_PART", + "flags": false, + "members": [ + { + "name": "DXC_PART_PDB", + "value": "('I' | ('L' << 8) | ('D' << 16) | ('B' << 24))" + }, + { + "name": "DXC_PART_PDB_NAME", + "value": "('I' | ('L' << 8) | ('D' << 16) | ('N' << 24))" + }, + { + "name": "DXC_PART_PRIVATE_DATA", + "value": "('P' | ('R' << 8) | ('I' << 16) | ('V' << 24))" + }, + { + "name": "DXC_PART_ROOT_SIGNATURE", + "value": "('R' | ('T' << 8) | ('S' << 16) | ('0' << 24))" + }, + { + "name": "DXC_PART_DXIL", + "value": "('D' | ('X' << 8) | ('I' << 16) | ('L' << 24))" + }, + { + "name": "DXC_PART_REFLECTION_DATA", + "value": "('S' | ('T' << 8) | ('A' << 16) | ('T' << 24))" + }, + { + "name": "DXC_PART_SHADER_HASH", + "value": "('H' | ('A' << 8) | ('S' << 16) | ('H' << 24))" + }, + { + "name": "DXC_PART_INPUT_SIGNATURE", + "value": "('I' | ('S' << 8) | ('G' << 16) | ('1' << 24))" + }, + { + "name": "DXC_PART_OUTPUT_SIGNATURE", + "value": "('O' | ('S' << 8) | ('G' << 16) | ('1' << 24))" + }, + { + "name": "DXC_PART_PATCH_CONSTANT_SIGNATURE", + "value": "('P' | ('S' << 8) | ('G' << 16) | ('1' << 24))" + } + ], + "uses": [ + { + "interface": "IDxcUtils", + "method": "GetDxilContainerPart", + "parameter": "DxcPart" + }, + { + "interface": "IDxcContainerBuilder", + "method": "AddPart", + "parameter": "fourCC" + }, + { + "interface": "IDxcContainerBuilder", + "method": "RemovePart", + "parameter": "fourCC" + }, + { + "interface": "IDxcContainerReflection", + "method": "GetPartKind", + "parameter": "pResult" + }, + { + "interface": "IDxcContainerReflection", + "method": "FindFirstPartKind", + "parameter": "kind" } ] }, diff --git a/scripts/ChangesSinceLastRelease.txt b/scripts/ChangesSinceLastRelease.txt index e69de29bb..665728ef4 100644 --- a/scripts/ChangesSinceLastRelease.txt +++ b/scripts/ChangesSinceLastRelease.txt @@ -0,0 +1,25 @@ +# DXC: Annotate new struct fields and enums +Windows.Win32.Graphics.Direct3D.Dxc.Apis.DXC_HASHFLAG_INCLUDES_SOURCE removed +Windows.Win32.Graphics.Direct3D.Dxc.DXC_HASHFLAG added +Windows.Win32.Graphics.Direct3D.Dxc.DXC_HASHFLAG.DXC_HASHFLAG_INCLUDES_SOURCE added +Windows.Win32.Graphics.Direct3D.Dxc.DXC_PART added +Windows.Win32.Graphics.Direct3D.Dxc.DXC_PART.DXC_PART_DXIL added +Windows.Win32.Graphics.Direct3D.Dxc.DXC_PART.DXC_PART_INPUT_SIGNATURE added +Windows.Win32.Graphics.Direct3D.Dxc.DXC_PART.DXC_PART_OUTPUT_SIGNATURE added +Windows.Win32.Graphics.Direct3D.Dxc.DXC_PART.DXC_PART_PATCH_CONSTANT_SIGNATURE added +Windows.Win32.Graphics.Direct3D.Dxc.DXC_PART.DXC_PART_PDB added +Windows.Win32.Graphics.Direct3D.Dxc.DXC_PART.DXC_PART_PDB_NAME added +Windows.Win32.Graphics.Direct3D.Dxc.DXC_PART.DXC_PART_PRIVATE_DATA added +Windows.Win32.Graphics.Direct3D.Dxc.DXC_PART.DXC_PART_REFLECTION_DATA added +Windows.Win32.Graphics.Direct3D.Dxc.DXC_PART.DXC_PART_ROOT_SIGNATURE added +Windows.Win32.Graphics.Direct3D.Dxc.DXC_PART.DXC_PART_SHADER_HASH added +Windows.Win32.Graphics.Direct3D.Dxc.DxcBuffer.Encoding...System.UInt32 => Windows.Win32.Graphics.Direct3D.Dxc.DXC_CP +Windows.Win32.Graphics.Direct3D.Dxc.DxcShaderHash.Flags...System.UInt32 => Windows.Win32.Graphics.Direct3D.Dxc.DXC_HASHFLAG +Windows.Win32.Graphics.Direct3D.Dxc.IDxcContainerBuilder.AddPart : fourCC...UInt32 => DXC_PART +Windows.Win32.Graphics.Direct3D.Dxc.IDxcContainerBuilder.RemovePart : fourCC...UInt32 => DXC_PART +Windows.Win32.Graphics.Direct3D.Dxc.IDxcContainerReflection.FindFirstPartKind : kind...UInt32 => DXC_PART +Windows.Win32.Graphics.Direct3D.Dxc.IDxcContainerReflection.GetPartKind : pResult...UInt32* => DXC_PART* +Windows.Win32.Graphics.Direct3D.Dxc.IDxcContainerReflection.GetPartReflection : ppvObject : [In,Out] => [ComOutPtr,Out] +Windows.Win32.Graphics.Direct3D.Dxc.IDxcUtils.CreateReflection : ppvReflection : [In,Out] => [ComOutPtr,Out] +Windows.Win32.Graphics.Direct3D.Dxc.IDxcUtils.GetDxilContainerPart : DxcPart...UInt32 => DXC_PART +Windows.Win32.Graphics.Direct3D.Dxc.IDxcUtils.GetDxilContainerPart : ppPartData : [Out] => [NativeArrayInfo(CountFieldName=pPartSizeInBytes),Out] From edf69ec73a54edfe5fff4ce067d10ab7bf597810 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Thu, 16 Oct 2025 23:33:46 +0200 Subject: [PATCH 2/2] Manually define `static const` variants which aren't scraped like `#define` --- generation/WinSDK/enums.json | 44 +++++++++++++++++++++++------ scripts/ChangesSinceLastRelease.txt | 13 +++++++++ 2 files changed, 49 insertions(+), 8 deletions(-) diff --git a/generation/WinSDK/enums.json b/generation/WinSDK/enums.json index 98343237b..c6443ae58 100644 --- a/generation/WinSDK/enums.json +++ b/generation/WinSDK/enums.json @@ -28820,10 +28820,28 @@ { "name": "DxcValidatorFlags", "flags": true, - "autoPopulate": { - "filter": "DxcValidatorFlags_", - "header": "dxcapi.h" - }, + "members": [ + { + "name": "Default", + "value": "0" + }, + { + "name": "InPlaceEdit", + "value": "1" + }, + { + "name": "RootSignatureOnly", + "value": "2" + }, + { + "name": "ModuleOnly", + "value": "4" + }, + { + "name": "ValidMask", + "value": "0x7" + } + ], "uses": [ { "interface": "IDxcValidator", @@ -28840,10 +28858,20 @@ { "name": "DxcVersionInfoFlags", "flags": true, - "autoPopulate": { - "filter": "DxcVersionInfoFlags_", - "header": "dxcapi.h" - }, + "members": [ + { + "name": "None", + "value": "0" + }, + { + "name": "Debug", + "value": "1" + }, + { + "name": "Internal", + "value": "2" + } + ], "uses": [ { "interface": "IDxcVersionInfo", diff --git a/scripts/ChangesSinceLastRelease.txt b/scripts/ChangesSinceLastRelease.txt index 665728ef4..a9523a1b7 100644 --- a/scripts/ChangesSinceLastRelease.txt +++ b/scripts/ChangesSinceLastRelease.txt @@ -15,6 +15,16 @@ Windows.Win32.Graphics.Direct3D.Dxc.DXC_PART.DXC_PART_ROOT_SIGNATURE added Windows.Win32.Graphics.Direct3D.Dxc.DXC_PART.DXC_PART_SHADER_HASH added Windows.Win32.Graphics.Direct3D.Dxc.DxcBuffer.Encoding...System.UInt32 => Windows.Win32.Graphics.Direct3D.Dxc.DXC_CP Windows.Win32.Graphics.Direct3D.Dxc.DxcShaderHash.Flags...System.UInt32 => Windows.Win32.Graphics.Direct3D.Dxc.DXC_HASHFLAG +Windows.Win32.Graphics.Direct3D.Dxc.DxcValidatorFlags added +Windows.Win32.Graphics.Direct3D.Dxc.DxcValidatorFlags.Default added +Windows.Win32.Graphics.Direct3D.Dxc.DxcValidatorFlags.InPlaceEdit added +Windows.Win32.Graphics.Direct3D.Dxc.DxcValidatorFlags.ModuleOnly added +Windows.Win32.Graphics.Direct3D.Dxc.DxcValidatorFlags.RootSignatureOnly added +Windows.Win32.Graphics.Direct3D.Dxc.DxcValidatorFlags.ValidMask added +Windows.Win32.Graphics.Direct3D.Dxc.DxcVersionInfoFlags added +Windows.Win32.Graphics.Direct3D.Dxc.DxcVersionInfoFlags.Debug added +Windows.Win32.Graphics.Direct3D.Dxc.DxcVersionInfoFlags.Internal added +Windows.Win32.Graphics.Direct3D.Dxc.DxcVersionInfoFlags.None added Windows.Win32.Graphics.Direct3D.Dxc.IDxcContainerBuilder.AddPart : fourCC...UInt32 => DXC_PART Windows.Win32.Graphics.Direct3D.Dxc.IDxcContainerBuilder.RemovePart : fourCC...UInt32 => DXC_PART Windows.Win32.Graphics.Direct3D.Dxc.IDxcContainerReflection.FindFirstPartKind : kind...UInt32 => DXC_PART @@ -23,3 +33,6 @@ Windows.Win32.Graphics.Direct3D.Dxc.IDxcContainerReflection.GetPartReflection : Windows.Win32.Graphics.Direct3D.Dxc.IDxcUtils.CreateReflection : ppvReflection : [In,Out] => [ComOutPtr,Out] Windows.Win32.Graphics.Direct3D.Dxc.IDxcUtils.GetDxilContainerPart : DxcPart...UInt32 => DXC_PART Windows.Win32.Graphics.Direct3D.Dxc.IDxcUtils.GetDxilContainerPart : ppPartData : [Out] => [NativeArrayInfo(CountFieldName=pPartSizeInBytes),Out] +Windows.Win32.Graphics.Direct3D.Dxc.IDxcValidator.Validate : Flags...UInt32 => DxcValidatorFlags +Windows.Win32.Graphics.Direct3D.Dxc.IDxcValidator2.ValidateWithDebug : Flags...UInt32 => DxcValidatorFlags +Windows.Win32.Graphics.Direct3D.Dxc.IDxcVersionInfo.GetFlags : pFlags...UInt32* => DxcVersionInfoFlags*