Skip to content
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

DXC: Annotate new struct fields and enums #1989

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MarijnS95
Copy link
Contributor

@MarijnS95 MarijnS95 commented Aug 30, 2024

For #474 (comment)..

For DXC_FOURCC it would have been awesome if we could have something like the following, if const methods were supported:

public static const uint DXC_FOURCC(char ch0, char ch1, char ch2, char ch3) => ch0 | (ch1 << 8) | (ch2 << 16) | (ch3 << 24);

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);
```
Comment on lines +28814 to +28838
{
"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_",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately both these static const UINT32s don't appear to be parsed by enums.json?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems more like a ClangSharp limitation than enums.json.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, either way it's something that I expected to show up, but it didn't. Should I manually declare "members", while leaving "autoPopulate" in place in hopes of getting a compilation conflict when ClangSharp can provide these to us, or is it a fix you can do elsewhere in the tooling?

As this PR shows we used to have manual fields for DXC_CP_ too (now unnecessary), while also relying on autoPopulate without conflicts being generated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants