-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scraper/enums: Define enum for Windows.Win32.Graphics.Hlsl.DXC_CP #474
Conversation
New contributing guidelines are up at https://github.com/microsoft/win32metadata/blob/master/CONTRIBUTING.md. I don't think the CP_INSTALLED and CP_SUPPORTED should be in the same enum as the others. As the duplicate shows, it's used by the enum API. Also the GetCPInfo APIs take an open set of values it seems from the docs, not just the ones from the enum. @sotteson1 is an enum the proper choice here for an open set? |
c301eac
to
1fd89ba
Compare
That's nice and useful, thanks!
Correct, these are explicitly listed in
You're right, the docs mention a lot more values than are available in constants, perhaps it's not a good idea to define this for The values are not in the SDK header yet but should hopefully be in some future release, does it make sense to list the members explicitly now and have Should I order the members by value, for cleanliness? Copypasted them from the header but that seems to be arbitrary ordering anyway. |
I prefer the DXC_CP approach with constrained values just for DXC.
I would just manually define them for now. We can make future changes to the metadata when the time comes if necessary.
I would order them by value (0 first) so the enum members are ordered by value as you'd expect. |
This results in the following enum: // Windows.Win32.Graphics.Hlsl.DXC_CP public enum DXC_CP : uint { DXC_CP_ACP = 0u DXC_CP_UTF16 = 1200u, DXC_CP_UTF8 = 65001u, } With the following replacements: Windows.Win32.Graphics.Hlsl.IDxcBlobEncoding.GetEncoding : pCodePage...UInt32* => DXC_CP* Windows.Win32.Graphics.Hlsl.IDxcLibrary.CreateBlobFromFile : codePage...UInt32* => DXC_CP* Windows.Win32.Graphics.Hlsl.IDxcLibrary.CreateBlobWithEncodingFromPinned : codePage...UInt32 => DXC_CP Windows.Win32.Graphics.Hlsl.IDxcLibrary.CreateBlobWithEncodingOnHeapCopy : codePage...UInt32 => DXC_CP Windows.Win32.Graphics.Hlsl.IDxcLibrary.CreateBlobWithEncodingOnMalloc : codePage...UInt32 => DXC_CP Windows.Win32.Graphics.Hlsl.DXC_CP not found in 1st winmd In future DXC headers a new `IDxcUtils` class (taking the place of `IDxcLibrary`) is introduced which also takes `DXC_CP_` enum values in its `codePage` parameters [1]. It is listed here preliminarily anticipating it being added to the headers in a newer SDK. [1]: https://github.com/microsoft/DirectXShaderCompiler/blob/aa4f5176ebba010a860a214d73f33bdc5b5042ce/include/dxc/dxcapi.h#L356-L390
They're manually defined now, but I feel like keeping
👍 They're in the right order now.
Cool, then we're on the same page, and this PR is ready for review and merging :) |
Merged. Thanks for the contribution. |
@MarijnS95 I think |
@teoxoy for completeness, beb18b9 added I think you are right, at least the More DXC annotations appear to be missing; I cobbled together some in #1989 but without any codegen/testing for now. |
From the discussion in #450 (comment)
This results in the following enum:
With the following replacements:
Old comment when this was done for all of `CP_`
This results in the following enum:
With the following replacements:
As mentioned in #450 (comment)
"filter": "CP_"
picks up two unrelated constants already defined in another enum:TODO
CODEPAGE
okay?Note on DXC
These are the only supported codepages, others are invalid.
IDxcUtils
interface also takes in codepage arguments. These need to be annotated too, can that already be done in advance or will the emitter complain on unmatched methods in the"uses"
list?