GPUOpen-LibrariesAndSDKs / FidelityFX-SDK

The main repository for the FidelityFX SDK.
Other
876 stars 89 forks source link

Initialize all fields to null or default values in all structs in .hpp files #83

Open QDanteQ opened 3 months ago

QDanteQ commented 3 months ago

Hello, can you please initialize all fields in structs to null or default value in constructor, otherwise we need to do it on client side and it complicates the code. That's only a case for structs in .hpp files, for structs in .h we can use initializer list. For example if we need to disable frame generation, typically we need to initialize only ffx::ConfigureDescFrameGeneration.swapChain field. Other fields should be 0 or false. But it's not the case, and we end up having trash in all fields.

  ffx::ConfigureDescFrameGeneration config{};
  config.swapChain = swapchain.GetSwapchain();
  ffx::Configure(m_FGContext, config);

https://github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK/blob/1bbe66e7ea0d358e84af4471a90aa9c35b583de0/ffx-api/include/ffx_api/ffx_framegeneration.hpp#L41