Skip to content

Conversation

@bashbaug
Copy link
Contributor

@bashbaug bashbaug commented Jun 5, 2025

This is a change I have been using locally for some time now that I've found useful, so I thought I'd see if it's something worth adding to the upstream C++ bindings. In short, for queries that return the result of the query directly (vs. through a pointer), the value that is returned is uninitialized. This means that if the query returns an error, the value that gets returned is most likely random and non-deterministic, which likely isn't what users expect.

With this change, the return values are always initialized, so even if an error occurs the query always returns a deterministic value. The return value is not always meaningful, or identifiable as a default value, but it frequently is, and even when it isn't it's beneficial to return a consistent value than a random value.

@kpet
Copy link
Contributor

kpet commented Aug 19, 2025

Merging as discussed in 2025/09/19 teleconference.

@kpet kpet merged commit 0c458c4 into KhronosGroup:main Aug 19, 2025
93 of 103 checks passed
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