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

Add Replay Overrides for Functions that Retrieve Array Sizes #189

Closed
dustin-lunarg opened this issue Feb 19, 2019 · 1 comment
Closed

Add Replay Overrides for Functions that Retrieve Array Sizes #189

dustin-lunarg opened this issue Feb 19, 2019 · 1 comment
Labels
enhancement New feature or request task Work to be performed

Comments

@dustin-lunarg
Copy link
Contributor

dustin-lunarg commented Feb 19, 2019

Implement overrides for functions that retrieve an array size and are used with the following pattern:

vkEnumeratePhysicalDevices(instance, &size, nullptr);
data = new VkPhsicalDevice[size];
vkEnumeratePhysicalDevices(instance, size, data);

Current replay behavior is to always use the size value read from the file. If the size value read from the capture file is smaller than the size value returned by the first call in the above example, the replay of the second call will produce a VK_INCOMPLETE return value.

The replay tool will print an error message for the VK_INCOMPLETE return value, but the replay tool will not use the data retrieved by the call, so it should be safe to ignore the message.

Short term, this could be addressed by silencing the VK_INCOMPLETE error message, but long term we will need to implement a portability override, which does the following to make the call with the correct array size:

  • When the array parameter is null, skip replay of the call.
  • When the array parameter is not null, first call the function with a null array value to obtain the appropriate size, then allocate memory for the array and make the call with retrieved size and allocated memory.

Although this is primarily a portability issue, where the size value would only be different for replay on a different GPU/driver, the vkGetPipelineCacheData has been observed to return different sizes when replayed on the same system used for capture, resulting in the VK_INCOMPLETE error message on replay, which should be addressed for the 'non-portability' replay case.

@dustin-lunarg
Copy link
Contributor Author

Closed with #349

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request task Work to be performed
Projects
No open projects
Development

No branches or pull requests

1 participant