GPUOpen-Archive / Anvil

Anvil is a cross-platform framework for Vulkan
MIT License
594 stars 62 forks source link

Properly zero-initialise objects #129

Closed janisozaur closed 5 years ago

janisozaur commented 5 years ago

Rather than trying to cheat compiler into forcefully zeroing memory, like https://github.com/GPUOpen-LibrariesAndSDKs/Anvil/pull/128 tries to do, properly zero-initialise the relevant objects.

Fixes #125 Closes #128

DominikWitczakAMD commented 5 years ago

I don't like memsetting structs you propose in the PR, since this assumes NONE enums are always 0, which is true right now but may change in the future. However, the good find here is that the affected structs were missing default constructors, so thanks for contributing. I've added these internally.

Also, we should not be modifying external dependency's source code, as such changes would be overwritten when we update the dependency to newer version.

janisozaur commented 5 years ago

The same problem is being "fixed" in https://github.com/GPUOpen-LibrariesAndSDKs/Anvil/pull/144/

thesmallcreeper commented 5 years ago

Since GCC 8 compiles and GCC 8 hates memsets (?does it in order to have a more aggressive optimization?) we can say that these were the lasts memsets in the repo