-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extensions/nv/low_latency2: Use
count
parameter for p_timings
"ar…
…ray" member As it turns out this extension has a rather suboptimal layout where the `vk::GetLatencyMarkerInfoNV` struct is not aware that its own `p_timings` field is an array, because it does not have a count field. Instead the length of this array is passed around via the `pTimingCount` pointer parameter of `get_latency_timings()`. A couple things are needed to set this straight: 1. The struct builder must be adjusted to accept a slice (without storing the length anywhere...); 2. The `get_latency_timings()` wrapper function should no longer accept a mutable slice of `vk::GetLatencyMarkerInfoNV`, but instead accept a single object that contains a pointer to the array (and `p_next`...); 3. This function must have a separate parameter to pass the length of the `p_timings` slice mentioned at 1., as we cannot reconstruct it from `vk::GetLatencyMarkerInfoNV` nor via its `p_timings` pointer; 4. The mutable struct and initialized `p_timings` array must still be passed fully by the user because both `vk::GetLatencyMarkerInfoNV` and `vk::LatencyTimingsFrameReportNV` have a `p_next` field that the user could initialize to point to some extension structure that they desire to be filled in. This info might also be relevant in the `_len()` query; 5. Asserts have been put in place to ensure correct use of this API with regards to `p_timings` being (not) NULL for querying the count or actual values, respectively.
- Loading branch information
Showing
3 changed files
with
69 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters