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

new_render_command_encoder assumes the return value can never be NULL #282

Open
madsmtm opened this issue Sep 5, 2023 · 0 comments
Open

Comments

@madsmtm
Copy link
Contributor

madsmtm commented Sep 5, 2023

Found while working on #241.

The argument-buffer and the bindless examples currently pass an empty RenderPassDescriptor to CommandBuffer::new_render_command_encoder, which causes the function to return NULL (instead of an actual render command encoder object).

This in turn means that all the code following it basically does nothing (as it sends messages to a NULL value, which Objective-C just ignores).

To very clearly see how this is unsound and confusing, try putting the following statement after new_render_command_encoder:

let encoder = Some(encoder).unwrap();
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

No branches or pull requests

1 participant