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

Adjust Variable Length Array Sizes on Replay #349

Merged
merged 7 commits into from
Apr 23, 2020

Conversation

dustin-lunarg
Copy link
Contributor

For replay of API calls that retrieve arrays with variable sizes, adjust the size of each array to match the size returned by the replay size query. Previous behavior was to use the size that was recorded on capture, which could produce VK_INCOMPELTE errors when capture and replay sizes did not match.

Fixes #189

Consumer member functions receiving const reference parameters for
Decoder class types were modifying the internal contents of the Decoder
objects by retrieving non-const pointers to internal values through const
member functions (e.g. 'int* GetIntPtr() const { return &i; }' in
expressions like 'i->GetIntPtr()[0] = 0')

The types for the Consumer member function parameters have been changed
from const reference to non-const pointers to make it clear that these
values may be changed by operations like replay handle mapping.  Decoder
member functions have also been updated to return const pointers from
functions declared as const.

Change-Id: I20e4421da03e628472e05ba597914ff550065054
Update HandlePointerDecoder to use the memory that is allocated
internally by its PointerDecoder member, which is intended to store
output parameter values, to store handle values.  Removes a separate
allocation that was managed directly by HandlePointerDecoder.

Change-Id: Ifff9fe9343059b90ec6448ab4861f8ced5a93afb
When processing capture files, memory for handles was allocated when
decoding API call packets.  Handle memory is currently only used by the
replay consumer when mapping handles that are created during replay.
The other consumers did not use the memory that was being allocated for
handles, so memory allocation for handles is now done in the consumer
instead of during decode.

Change-Id: Ibf2f73fa02bc642768262f87ecb012a03c353497
Fix the replay override for vkEnumeratePhysicalDevices to return the
array sized retrieved on replay.  This override had been returning the
captured size.

Change-Id: I36d54c342436e6feec5d9425b663e78ea9e439bc
For replay of API calls that retrieve variable size arrays, the
size received from the first call is now stored so that the size of the
array provided to the second call can be adjusted.

Change-Id: Ia2c5a749854e3c869c913cb401e887bdef7241aa
For replay of API calls that retrieve arrays with variable sizes,
adjust the size of each array to match the size returned by the
replay size query.

Change-Id: I11e2f138e596687fd3887c60e6a37731855d51ac
Only allocate memory for output parameters at replay if the parameter
was not null at capture.

Change-Id: Idcd21806450acc691eb5643b24baa24de11c6fa5
@dustin-lunarg dustin-lunarg merged commit 4fbe332 into LunarG:dev Apr 23, 2020
@dustin-lunarg dustin-lunarg deleted the feature-adjust-array-sizes branch April 23, 2020 18:29
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