-
Notifications
You must be signed in to change notification settings - Fork 279
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
[xml] Definition of object namespaces #428
Conversation
Also uploaded schema changes, but still struggling to validate them without installing python... |
@oddhack are there any downsides to all these new attributes? I guess folks will need to remember to add them when adding new commands. |
ANGLE maintains its own separate object type annotations for entry points. Our work is similar to this change. We use the types to map from GLuint to strictly typed ID handles (nominally a zero-cost transformation). Link to our mapping below: These are used in code gen and turn into code like this:
We also annotate enum types with specific types. Our enum type annotation is also similar to the related enum work in #335 . I do notice two things about this change:
There's also a concern that this new field is easy to miss on new APIs and we might be missing other object types. A presubmit check would be great if such a thing is possible. Also the API is moving more slowly now so it might not big a bug burden since there are fewer new object types being introduced. I'm also not sure why you didn't squash the XML changes together. Might make it easier to review, not sure. |
Ah, I see you address this in your introduction where you want to do extensions separately. That seems reasonable as long as there's some checking that we don't miss out on any object types. |
Oh, i never noticed this in specs before you said it... |
@SunSerega the specs clearly indicate they're from the same namespace in the error conditions e.g. for
All the APIs work the same way. |
Yeah i went though specs before asking. And for all functions i could find (in 4.6 core spec) i see that full story is:
So while passing program object into shader argument gives different error than if you pass buffer object there, it is no less invalid. That leads me to think it's only an implementation technicality based on time when there was a reason to combine these namespaces. If so - it shouldn't affect Though documentation i added need to change then, i just assumed that each object type has own namespace. (this is mostly reminder for myself) But i would prefer to first hear out someone who knows why do shaders and programs have a common namespace. |
@SunSerega it's totally fine to split programs and shaders as it's strictly more information than merging them. ANGLE would have no problem handling that. And some integrations might require them to be separate. So SGTM. |
Ah ok, well if it's not an objection - might as well change docs now. |
Love it! A few nits from here:
|
Well, if anything short - then probably
Ah, i thought i made them optional from the start... Thanks for reminding. |
Yeah registry.rnc is probably the best place for explanation, doesn't have to be the name! |
Also, i looked again at |
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.
Awesome, thanks for implementing my changes (I know I can be annoying sometimes haha)
Looks good on my side, seems like a pretty benign yet brilliant change!
cc @Dav1dde as GLAD was affected last time we introduced a new attribute, most other parsers should be able to gloss over unrecognized attributes.
@oddhack, this is approved to merge. |
@SunSerega please add descriptions of schema additions to xml/registry.tex. I'll regenerate the PDF and merge after that's done. |
You mean |
Done. |
I think this way it makes much more sense...
@oddhack this can be merged if you're happy with the update. |
<param group="SyncObjectMask"><ptype>GLbitfield</ptype> <name>flags</name></param> | ||
<param><ptype>GLuint64</ptype> <name>timeout</name></param> | ||
</command> | ||
<command> | ||
<proto group="SyncStatus"><ptype>GLenum</ptype> <name>glClientWaitSyncAPPLE</name></proto> | ||
<param group="sync"><ptype>GLsync</ptype> <name>sync</name></param> | ||
<param><ptype>GLsync</ptype> <name>sync</name></param> |
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.
This was a typo, parameter was duplicated. Will be fixed shortly.
regenerate headers for a new QCOM extension.
…p#428 and regenerate headers for a new QCOM extension.
Object name that you get from
glCreateBuffers
can not be passed toglActiveProgram
. Any high-level-ish binding would want to enforce this.And well, my bindings already had system for that, for a while now. This list was made by going through 4.6 core specification and manually deciding which object type go where. When making this system - i was thinking of at some point translating it as-is into xml files. But when i actually sat down to do it - i decided to apply it to every function i can find.
And to how i implemented it:
There already are attributes like
group="Texture"
, but they are really inconsistent (mostly at existing). And i don't think it's a good idea to use single attribute name for all sorts of different things, better keepgroup
for groups of enum values. So i made new attributeobject_name_type
.I made values of this attribute lower case and space separated i.e. as formatless as i can make it, so they are easy to format into any naming convention, like
vertexArray
,vertex_array
, etc.I'm not sure what to do with these functions:
They define core function as alias, but they take
GLhandleARB
instead ofGLuint
as object name. And it's defined as folowing:Should they also have this attribute, even though argument type isn't quite the same?
Also,
binaryFormat
argument ofglGetProgramBinary
andglProgramBinary
is a number, which value is implementation defined and only values that you get fromglGetProgramBinary
should be usedglProgramBinary
. So, i guess, same reasoning as to object names applies here. But i'm not sure if i should use same attribute for it.I didn't actually add
object_name_type
for all object types - i wanted to add object types defined in extensions separately, if this pull goes well.But i might as well start discussion on it here... Here is everything i found, except clearly irrelevant or just dead extensions like
AMD_performance_monitor
:vertex array object
texture handle
state
,command list
path
occlusion query
memory object
,semaphore
fence
progress fence
performance query
query resource tag
performance query id
,performance query handle
And and bit of offtop - i noticed that last argument of
glBindImageTextureEXT
is:While in
glBindImageTexture
it's defined as:Maybe one in
glBindImageTextureEXT
should be changed to matchglBindImageTexture
?