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
VideoCommon: Don't add garbage to shader uids in debug builds #10755
Conversation
There wasn't anything stopping compilers from doing it in release builds either, but most optimizations would make the padding zero
|
This is fine but I don't get why it's needed? Aren't the shader uid structs (ex |
|
A similar dolphin/Source/Core/VideoCommon/GXPipelineTypes.h Lines 34 to 37 in 431d757
|
The active fields are initialized, but Clang doesn't think it needs to initialize the padding: https://gcc.godbolt.org/z/cf7KxdEcs
Indeed, we zero pipeline uids there. But then this happens:
|
Edit: I see you’re doing 2. Nvm then :p maybe the other topics are interesting though. |
|
I was going to suggest to move this memset to individual uid_data constructors instead -- but since we're already checking that the types are POD / trivially copiable I think this is good enough. I'm -0.5 on doing this via compiler flags, seems like a really big hammer for a very localized problem. |
Prevents debug builds from leaving stack data in UIDs, making them no longer compare equal
There wasn't anything stopping compilers from doing it in release builds either, but most optimizations would make the padding zero