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

C++ API does not default-initialize struct members #102

Open
simco50 opened this issue Oct 9, 2024 · 1 comment
Open

C++ API does not default-initialize struct members #102

simco50 opened this issue Oct 9, 2024 · 1 comment

Comments

@simco50
Copy link

simco50 commented Oct 9, 2024

The C++ API wraps around the C structs with InitHelper. This has a constructor so doing this does not zero-initialize the object.

ffx::DispatchDescUpscale upscale_desc  = {}; // Does not initialize the members!

This is quite unexpected to me. If a future update of the FFX SDK adds a member to any of the structs, it will be uninitialized unless explicitly set in the user code.
Doing a memset(0) on the object is also not an option because the constructor or InitHelper fills in the header.
Ideally the C++ wrapper should initialize all struct members.

@batcholi
Copy link

2024-11-16-173615_622x260_scrot
I think it DOES initialize all members, actually.

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

2 participants