FidelityFX-SDK icon indicating copy to clipboard operation
FidelityFX-SDK copied to clipboard

C++ API does not default-initialize struct members

Open simco50 opened this issue 1 year ago • 1 comments

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.

simco50 avatar Oct 09 '24 11:10 simco50

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

batcholi avatar Nov 17 '24 01:11 batcholi