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

dx12 option: GFXRECON_CAPTURE_DRAW_CALLS #1680

Open
wants to merge 15 commits into
base: dev
Choose a base branch
from

Conversation

locke-lunarg
Copy link
Contributor

@locke-lunarg locke-lunarg commented Aug 22, 2024

  • dx12 option: GFXRECON_CAPTURE_DRAW_CALLS
    Specify one index or a range indices drawacalls(include dispatch) based on a ExecuteCommandList index and a CommandList index to capture. The index is 1-based. The args are one submit index, one command index, one or a range indices of draw calls, one or a range indices of bundle drawcalls(option), like "1,1,1" or "1,1,1-2" or "1,1,1,1-2". The forth arg is an option for bundle case. If the the 3rd arg is a bundle commandlist, but it doesn't set the 4th arg, it will set 1 as default. Default is: Empty string (all drawcalls are captured).
    Dump resources doesn't the 4th arg. Although three args are enough for dump resources, it will add the 4th arg on it.

  • Not unwrapped objects for override functions
    Override functions need wrapped objects and wrappers.

  • Split commandlist into three for target drawcalls
    It does something similar to dump resources, but a bit different. Trimming drawcalls is not like dump resources that could browse the captured file to find target commandlist and drawcall before replay.
    For trimming drawcalls, it doesn't know the target commandlist until running the target ExecuteCommandLists. In this case, it assumes every commandlist could be the target commandlist. Every commandlist has three splitted commandlists and add command to the splitted commandlists.
    It also can't know which drawcall is the target in advance, commandlist has a drawcall_count to count it. Splitted commandlists will add some redundant commands since it couldn't know the target drawcall in advance, But it shouldn't affect the result and performance.

Based on #1727

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 240395.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4641 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4641 passed.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 240636.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4649 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 240733.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4651 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4651 passed.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 240809.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4652 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 240824.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 240825.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4654 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4654 passed.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 240912.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 240914.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 240932.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 240933.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 240954.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 265682.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4908 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4908 passed.

Specify one index or a range indices drawacalls(include dispatch)
based on a ExecuteCommandList index and a CommandList index to
capture. The index is 1-based. The args are one submit index,
one command index, one or a range indices of draw calls, one
or a range indices of bundle drawcalls(option), like "1,1,1" or
"1,1,1-2" or "1,1,1,1-2". The forth arg is an option for bundle
case. If the the 3rd arg is a bundle commandlist, but it doesn't
set the 4th arg, it will set 1 as default. Default is: Empty string
(all drawcalls are captured).
Override functions need wrapped objects and wrappers.
It does something similar to dump resources,
but a bit different. Trimming drawcalls is not like
dump resources that could browse the captured file
to find target commandlist and drawcall before replay.

For trimming drawcalls, it doesn't know the
target commandlist until running the target
ExecuteCommandLists. In this case, it assumes every
commandlist could be the target commandlist. Every
commandlist has three splitted commandlists and
add command to the splitted commandlists.

It also can't know which drawcall is the target in
advance, commandlist has a drawcall_count to count it.
Splitted commandlists will add some redundant commands
since it couldn't know the target drawcall in advance,
But it shouldn't affect the result and performance.
For copy swapchain buffers:
1. The queue has to been swapchain's queue.
2. One ExecuteCommandLists could work for only one swapchain buffer.
3. The current back buffer index has to match the swapchain buffer.
4. After ExecuteCommandLists, the current back buffer index has to back init.
The original code skips writing and tracking extra ExecuteCommandLists.
But the tracking is necessary for the correct resource states.
The extra ExecuteCommandLists are for splitted commandlists of trimming drawcalls.
@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 265824.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4912 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4912 passed.

Move before extra ExecuteCommandLists from PreProcess_ID3D12CommandQueue_ExecuteCommandLists to OverrideID3D12CommandQueue_ExecuteCommandLists.

All three extra ExecuteCommandLists are in OverrideID3D12CommandQueue_ExecuteCommandLists to make the code simpler.
@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 265859.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4913 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4913 passed.

Move code from Override functions to individual functions
DATA_STATIC could cause error for splitted commandlists. DATA_STATIC_WHILE_SET_AT_EXECUTE is better. Both trimming draw calls on capture and dump resources on replay have this issue.
@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 266668.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4923 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4923 passed.

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.

3 participants