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

Brad rebase and refactor fix for staging buffer memory types #1

Conversation

bradgrantham-lunarg
Copy link

Elevate the logic for choosing the device memory properties into the functions that have that context

mizhen and others added 10 commits May 8, 2023 14:39
* Fix raytracing trim capture crash

The commit fix raytracing trim capture crash issue for a d3d12 title.
In trim handling of BuildRaytracingAccelerationStructure, some alias
resource cause GetResourceWrapperForGpuVa return wrong resource and
trigger GPU crash later, the commit fix the issue.

* Add some changes to address review comments

Remove default argument to use both GPUVA and buffer size for searching
resource, add copyright info.

* Add new functions to address review comments

Add new functions for searching resource wrapper through
GetAccelerationStructureResourceWrapperForGpuVa which return
resource used for raytracing acceleration structure.

* Add some changes for review comments

Add resource desc struct in the ID3D12ResourceInfo so resource desc info
can be used without injecting API call, remove
GetAccelerationStructureResourceWrapperForGpuVa and combine its function
into GetResourceWrapperForGpuVa.

* Add some changes for source code optimization

Change function names and optimize some source code to address
review comments.

* Add changes for GPUVA searching function

Add changes for checking resource initial state to find matched
acceleration structurer resouce, remove resource desc in resource info
and also remove checking resource flags.

* Change function pointer name

Change function pointer name used for checking acceleration structure
resource and add some other changes to address review comments.

* Change function pointer type and parameter name

Change function pointer tyoe and parameter name to more specific name
and add some other code optimization changes.

* Add some minor change

Change function GetResourceWrapperForGpuVa parameter name to be more
specific.

* Add some change to address review comments

Remove checking resource initial state in
TrackBuildRaytracingAccelerationStructure method when searching GPUVA for
D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS, remove unnecessary
assert.

---------

Co-authored-by: Zheng <[email protected]>
The problem
The message is out of date.

The solution
Update the message.
Allocating the backing store for all these containers on every call
to the function and then freeing it on every exit can be avoided
by having them be member variables that are cleared on each call.
At least for the vectors this should change their size but not their
capacity, and thus not hitting the heap allocation functions once
a steady state of reserved capacity is reached.
It forces to using only QueueFamilyIndex: 0 and queueCount: 1 on
capturing to avoid replay error for unavailble VkQueue.
* Annotate GPUVA

Problem
If a title updated DXR resource data by Shader and dispatch the shader at
same commandlist as DXR call, GFXR was not able to read out the DXR data
and patch it.

Solution
GFXR capturer annotates all GPUVA, GPU Descriptor Handle and ShaderID
during capture, scans managed CPU memory and marks the data which have been
annotated. When replay the trace file, GFXR only need to translate the marked
value.

Test
If there were artifacts during capture, try to change the MASK of GPUVA by ENV.

* Meger dev branch
@bradgrantham-lunarg
Copy link
Author

Hi, @jacobv-nvidia ! If this PR looks good to you, and you merge it with your branch, then LunarG#1115 is probably ready to merge.

@bradgrantham-lunarg bradgrantham-lunarg changed the title Brad tweak 1115 Brad rebase and refactor fix for staging buffer memory types Jun 29, 2023
@jacobv-nvidia
Copy link
Owner

Hey, sorry for the delay. Seeing how these changes have already been merged as part of LunarG#1173, I'll close this out. Thanks!

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.

6 participants