-
Notifications
You must be signed in to change notification settings - Fork 117
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
Trim swapchain buffer #1727
Trim swapchain buffer #1727
Conversation
CI gfxreconstruct build queued with queue ID 250630. |
CI gfxreconstruct build # 4787 running. |
CI gfxreconstruct build # 4787 passed. |
swapchain = reinterpret_cast<IDXGISwapChain3*>(swapchain_info->object); | ||
while (extra_info->buffer_index != swapchain->GetCurrentBackBufferIndex()) | ||
{ | ||
swapchain->Present(0, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making the Present()
calls here will inject extra frames when a trimmed capture is recaptured. Dx12ReplayConsumerBase::ProcessSetSwapchainImageStateCommand
can also inject Present()
frames. Those get reported in the output of gfxrecon-info
as Blank frames
. Dx12StatsConsumer
tracks those here:
gfxreconstruct/framework/decode/dx12_stats_consumer.h
Lines 298 to 304 in 9c295b4
virtual void ProcessSetSwapchainImageStateCommand(format::HandleId device_id, | |
format::HandleId swapchain_id, | |
uint32_t current_buffer_index, | |
const std::vector<format::SwapchainImageStateInfo>& image_state) | |
{ | |
dummy_trim_frame_count_ = current_buffer_index; | |
} |
The value of Blank frames
is used by our CI to offset screenshot frame indices after recapture. However this PR passed the CI tests. So some follow up questions are:
- Why didn't this change affect CI success?
- Do we need to account for these Present calls in
Blank frames
, and if so, how can it be done?
One thought I have as a solution for 2 (if it is needed) is that we add a new meta data command that is like InitSubresourceCommand
but is specific for swapchain images, something like InitDxgiSwapchainBufferCommand
and use that for restoring swapchain buffer data instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For question 1:
The test needs to trimming capture, and then capture the trimmed file again, and then replay the file, it will happen the Blank frames
issue. Our ci didn't do that kind of test.
Plus, although, some original files were trimmed captured files, those files were captured by old code. The old code didn't write swapchain buffer, so even it captured the trim captured files, it didn't include Blank frames
.
Dx12ReplayConsumerBase::ProcessSetSwapchainImageStateQueueSubmit
that initialize swapchain buffer index also runs Present to match the correct buffer index if in need. So Blank frames
issue exists for long.
5b3dde3
to
36eba5d
Compare
CI gfxreconstruct build queued with queue ID 251211. |
CI gfxreconstruct build # 4792 running. |
CI gfxreconstruct build # 4792 passed. |
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.
36eba5d
to
a545e40
Compare
CI gfxreconstruct build queued with queue ID 251278. |
CI gfxreconstruct build # 4793 running. |
CI gfxreconstruct build # 4793 passed. |
No description provided.