FidelityFX-SDK
FidelityFX-SDK copied to clipboard
C++ API does not default-initialize struct members
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.
I think it DOES initialize all members, actually.