safestruct: Accessors for non trivial globals

Adding Tracy in VVL showed that we are paying the price of initializing
global variables upon shared library entry, even if we do not
end up accessing those.
Adding accessors will make sure we pay this price
only when truly needed.
Also making the necessary changes in VVL.
This commit is contained in:
Arno 2024-07-17 16:02:41 +02:00 committed by Charles Giessen
parent 5f26cf65a1
commit 9479047902
5 changed files with 44 additions and 36 deletions

View file

@ -19,10 +19,6 @@
namespace vku {
// Mapping of unknown stype codes to structure lengths. This should be set up by the application
// before vkCreateInstance() and not modified afterwards.
extern std::vector<std::pair<uint32_t, uint32_t>> custom_stype_info;
// State that elements in a pNext chain may need to be aware of
struct PNextCopyState {
// Custom initialization function. Returns true if the structure passed to init was initialized, false otherwise