-
Notifications
You must be signed in to change notification settings - Fork 419
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
Add "previous" member to MVKPerformanceTracker structure #2183
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for submitting.
Thanks for pointing out about MVK_PRIVATE_API_VERSION
. We increment MVK_PRIVATE_API_VERSION
once per MoltenVK release cycle (which is the same as Vulkan SDK cycle), if the private ABI changes. We have just cut MoltenVK v1.2.8
for the upcoming SDK. This PR will be in the next future SDK, and does modify the ABI, so you should increment the value of MVK_PRIVATE_API_VERSION
to 41
.
Regarding accessing the MoltenVK version at runtime, it is encoded in VkPhysicalDeviceProperties::driverVersion
and VkLayerProperties::implementationVersion
. The encoding is defined by the MVK_MAKE_VERSION()
macro. It's monotonically numeric, so you can compare different versions, or use MVK_MAKE_VERSION()
to create a version number to compare against.
If needed, similar to MVK_MAKE_VERSION()
and MVK_VERSION_STRING
, we could potentially add macros to extract three integers, or create a string, from a passed-in encoded version number.
MVK_PRIVATE_API_VERSION
is not runtime derivable, but it is connected to the MoltenVK version as indicted above, so you can derive the runtime version of MVK_PRIVATE_API_VERSION
, and the layout of any private ABI structures, by comparing the corresponding encoded MoltenVK version, as I describe above.
I'm not sure how we can directly pass MVK_PRIVATE_API_VERSION
back from a runtime, except to create a Vulkan extension to do so.
Thanks for the hints re However, after thinking about this problem a bit more I will be reverting back to the simple approach of guarding the new code at compile time using FYI, I looked at The current logic is: The original logic might be okay for linearly growing lists, but is not okay for nested structures like performance data. The only concern I have is this function is also used for If you agree with this change, I will submit commits for this as well as bumping |
I decided to make the proposed changes above and @billhollings can review and comment as needed. FYI - I have one more thing I would potentially like to add to this - a new |
I have completed my research and have submitted an additional commit that proposes and implements two new performance counters in For instance, Here are screen grabs of the embedded Optick profiler running inside RBDoom3BFG with MoltenVK. You can see the Submit_Wait times (corresponds to I have now completed my work on this PR and it is ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating. Some documentation suggestions, and a refactoring request.
…sentSwapchains perf counters
…ents of execute() function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now. Thanks for all the updates.
Addresses #2177.
This small PR adds a
previous
member to theMVKPerformanceTracker
struct and saves the formerlatest
value before updatinglatest
withinupdateActivityPerformance()
. It also addsprevious
toMVKLogInfo
.Note that I did not change the
MVK_PRIVATE_API_VERSION
.I still have a question about how to determine version information at runtime. Now that
vkGetVersionStringsMVK()
is deprecated, what is the offical means of determining MoltenVK's version or theMVKPerformanceStatistics
version at runtime? This is to handle cases when dynamic linking is used and one needs to determine if the new field is present.Is the only mechanism to use the
VK_SUCCESS
orVK_INCOMPLETE
return code fromvkGetPerformanceStatisticsMVK()
? This approach seems limiting since all you get is a success or failure indication and not version information. For instance if you always want to uselatest
, and optionally useprevious
(if available), how would you go about determing that at runtime?