Skip to content
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

rendervulkan: address several warnings from GCC's new -Wnrvo warning #1500

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sharkautarch
Copy link

@sharkautarch sharkautarch commented Aug 31, 2024

(note that -Wnrvo isn't enabled by default anywhere, I just decided to use it to look for simple optimization opportunities)
Three functions edited to enable complete (n)rvo

I checked the differences this PR made to the codegen when building w/ gcc & --buildtype=release -Db_lto=on

For CVulkanDevice::commandBuffer(), this removes one or more conditional deletion checks on a temporary empty unique_ptr (which I'm pretty sure is unreachable, but the compiler is not aware of that fact)

For CVulkanDevice::CreateTimelineSemaphore and CVulkanDevice::ImportTimelineSemaphore this PR removes one or more atomic adds from said functions (when building w/ lto for gcc, the two functions are inlined, but in the places that they were inlined into, there's still a reduction in the amount of atomic adds compared to before this PR)

There are still some remaining warnings from -Wnrvo, but they either don't seem to be worth the effort, at least for now...

Three functions edited to enable complete (n)rvo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant