-
-
Notifications
You must be signed in to change notification settings - Fork 130
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
expose webgl extensions through parameter api #165
Conversation
I think it would be better to add utility api, for example, |
I agree that some non-standard api that does the thing would likely be better overall. Still, this approach allows us to just piggyback on existing standard, so you don't need any extra platform-specific code on the other side. |
Thanks! I like @Gordon-F's idea to add a non-standard API here: when targeting natively -- most projects will end up splitting the string again or searching for an extension name in the string. which could be simplified if we can expose For the specific case in gfx-rs/gfx#3773 it would also be nice to have functions that follow the existing |
I've added dedicated Adding the "supports_x" methods is more tricky and I don't exactly want to go there inside glow's scope yet. This is complicated, because different sets of extensions (which are in core from some versions) are responsible for that in different platforms. Also the feature is kinda split into two: no-srgb and srgb texture. I only care about webgl right now for this particular case, so I haven't fully explored what's the proper set of checks necessary for portability. But the gist of it is that there are two extensions on webgl, one extension for basic support, and a whole set of interedependent extensions for srgb part on native gl. Also some of those are in core in different versions, so that would also have to be checked. We already have the right abstraction to check those in gfx gl backend, and a lot of that would have to be replicated in glow. I'm not sure if it's worth 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.
Looks great, thank you! I had a couple minor comments
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.
Nice, thank you!
bors r+
Build succeeded: |
Currently it is impossible to query for webgl extensions, due to it using specialized unexposed api for retreiving the list. This PR exposes the list with desktop gl api by intercepting parameter calls and implementing them using the web-specific api under the hood.