-
Notifications
You must be signed in to change notification settings - Fork 284
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
Added len and group attributes to wgl.xml #569
base: main
Are you sure you want to change the base?
Conversation
@SunSerega @Perksey might be interested to comment on this PR. |
|
Yeah, when making this PR I was envisioning GL, WGL and GLX as different enum group namespaces. I personally think that they should be considered different namespaces for groups, but there could be arguments for making them the same namespace. This is not a C problem as these groups are not used in the C headers, so that is at least one things that we don't have to worry about. |
@@ -72,44 +72,44 @@ Registry at https://github.com/KhronosGroup/OpenGL-Registry | |||
sometimes reused for other purposes --> | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note this comment (was originally in gl.xml but must've got removed):
<!-- SECTION: GL parameter class type definitions.
The groups are intended to contain all the possible legal values
for corresponding function parameters, but it is likely that many
of the groups are out of date relative to current OpenGL and OpenGL
ES specifications, and the many extensions to those specifications.
As such, they may not be a reliable source for enumeration info.
We welcome assistance from the community in achieving and
maintaining the completeness of the enum groups. Khronos does not
use the enum group information, and the OpenGL Working Group does
not have internal resources to bring it up to date.
-->
This was added in #280 and #291. While thanks to community efforts this situation has got a lot better, I do think it is worth adding a comment in both files that the groups at the very least are exclusively community-supported, and that the OpenGL Working Group has no intention of keeping the groupings up-to-date themselves due to them not being relevant for Khronos uses. It's annoying we missed this comment being removed from gl.xml.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add this comment to these files too.
xml/wgl.xml
Outdated
<enum value="0x21A6" name="WGL_GPU_NUM_SIMD_AMD"/> | ||
<enum value="0x21A7" name="WGL_GPU_NUM_RB_AMD"/> | ||
<enum value="0x21A8" name="WGL_GPU_NUM_SPI_AMD"/> | ||
<enum value="0x21A6" name="WGL_GPU_NUM_SIMD_AMD" group="GPUProperty"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's our ruling on vendor-specific enum groups? In gl.xml this would've likely been GPUPropertyAMD
. Related: #481
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with making this enum vendor specific, but I think most enum groups in gl.xml
do not have a vendor postfix, even if it's mostly an extension concept. For this group, if someone else made an extension it would likely not fit into the same enum groups so it might reduce future confusion (but also, gl, wgl, and glx aren't getting that many new changes to them and probably won't).
Then there is also the fact that almost all API in wgl comes in the form of extensions, so basically all groups would need a postfix. But maybe that is what we want.
Hm... Is it possible for, for instance, a |
Yes, this happens and is marked with a few FIXMEs comments in the PR. I guess this can be solved by making them the same namespace and add a WGL prefix to all groups defined in To me it seemed more cleaner to have them be different namespaces and figure out a way to cross reference, rather than make them the same namespace but add a prefix to the names in wgl and glx. I initially thought of it like this as it fit better into the current structure of our generator, but it's fine to change that. There are some downsides to sharing the namespace between files, group changes in I think there is also another problem where some WGL functions only accept a set of enums that do not have groups defined in EDIT: |
@NogginBops is this PR still a work in progress? If so, can you "convert to draft". Thanks. |
Not for this PR but...
I guess think would also need to be |
I agree these should be marked with the |
Yes, I've since rewritten my data scrappers. Had too much legacy code, your idea with group namespaces was the final push. Right now I'm using XML files from the branch in my own fork, which has the changes from this PR plus a bunch of my own, with the namespace prefixes supported for all sorts of items, including the kinds too. |
Ok great then I will move forward on this assuming we are going to go with namespaces. |
@SunSerega how do you feel about doing something like this in <enum value="0x0DE1" name="GL_TEXTURE_2D" group="...,wgl::ObjectType"/>
<enum value="0x0DE1" name="GL_TEXTURE_3D" group="...,wgl::ObjectType"/> to be able to create enum groups for This relates to this to the DX interop extension but will be applicable to other extensions as well |
Yeah, this also works with how I imagined it: If no namespace is specified - it defaults to the same namespace as the file name. Otherwise, any namespace can be specified. |
@SunSerega what do you think about my newest commit? Is it in the right direction? |
Since we are going for file-based namespaces, besides
|
@SunSerega is this PR getting ready or is there something else needed before I can un-draft it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked everything again, LGTM.
@@ -766,6 +766,7 @@ Registry at https://github.com/KhronosGroup/OpenGL-Registry | |||
<command> | |||
<proto><ptype>UINT</ptype> <name>wglEnumerateVideoCaptureDevicesNV</name></proto> | |||
<param><ptype>HDC</ptype> <name>hDc</name></param> | |||
<!-- FIXME: Some way for len="" to refer to the return value. Maybe len="RETURN()"? --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SunSerega what do you think about this?
Should we introduce RETURN()
or should we just leave this unhandled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't mind either way, but also while this is the only case - it doesn't matter much, since this case would need to be handled manually anyway, and IMO len
attribute values are not yet consistent enough to use as notification for consumers, like "some new, yet unexpected value appeared, need to figure out how to handle this". Mainly because more than a 1/4 of them are just COMPSIZE
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, I could remove this comment or leave it in.
I'll leave it to @oddhack to say whether this comments gets to stay or gets removed.
This PR aims to add some of the metadata present in
gl.xml
intowgl.xml
.One problem I've found is that if needing to reference enums or enum groups from
gl.xml
, and I do think the namespaces should be kept separate. Maybe the GL enum values could be added under some tag in the xml? Or prefix the tags with something likeGL::TextureTarget
for example. None of the solutions stand out as the "correct" one.