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

Name variables in GL errors #1149

Open
dsrbecky opened this issue Oct 3, 2017 · 4 comments
Open

Name variables in GL errors #1149

dsrbecky opened this issue Oct 3, 2017 · 4 comments

Comments

@dsrbecky
Copy link
Contributor

dsrbecky commented Oct 3, 2017

Follow up for #883

We check arguments using helper functions like this: CheckGE!GLuint(end, start)

This will generate error message which includes the two relevant values, so the user should be able to tell which of the function arguments is incorrect based on that. It would be more user friendly to also include the argument as string.

If this was C++, we could just use macro CHECK_GE(end, start) which stringifies the argument and includes it in the error message. Ideally the language should support something similar.

@dsrbecky
Copy link
Contributor Author

As easier first step, it would be nice if we could print the type of the value.
At the moment, we explicitly cast down to u64 as the last step before generating the message.
If we just remove the cast and allow 'interface{}' typed value for the messages:
glErrorInvalidValueMsg(new!ERR_INVALID_OBJECT_NAME(value: value))
This would yield slightly nicer error message, such as:
"Invalid value TextureId(42). Object with this name does not exist."

@dsrbecky
Copy link
Contributor Author

Ideally something like {{value}} would mean untyped message arg.
I am not sure how this interacts with the C++ side of things.
So maybe {{value:id}} where id translates to uint64_t in C++ and interface{} in Go.

@ben-clayton
Copy link
Contributor

glErrorInvalidValueMsg(new!ERR_INVALID_OBJECT_NAME(value: value))
This would yield slightly nicer error message, such as:
"Invalid value TextureId(42). Object with this name does not exist."

This wouldn't actually work. The message will get serialized to proto, where the TextureId (which is an int aliased type) will get boxed as an int.

Ideally something like {{value}} would mean untyped message arg.

IIRC it does.

@dsrbecky
Copy link
Contributor Author

Why not serialize the type-name in proto as well then?

I think {{value}}} is string, and there is no way to do untyped. Having said that, we could do the conversion to string automatically at message creation side i.e. automatically format and store string "TextureId(42)"

purvisa-at-google-com pushed a commit that referenced this issue Sep 29, 2022
- remove the unnecessary vulkan_utils package
- Separate the external API and xml parsing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants