Skip to content

Commit

Permalink
Remove unnecessary flush in dxgi
Browse files Browse the repository at this point in the history
gfx_d3d11_end_frame() already includes flushing, which comes right before gfx_dxgi_swap_buffers_begin() gets called.
  • Loading branch information
Spodi committed Feb 21, 2025
1 parent 9e13931 commit 0a4ac2c
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/graphic/Fast3D/gfx_dxgi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -830,19 +830,7 @@ static bool gfx_dxgi_is_frame_ready() {

static void gfx_dxgi_swap_buffers_begin() {
LARGE_INTEGER t;
ComPtr<ID3D11Device> device;
dxgi.swap_chain_device.As(&device);

if (device != nullptr) {
ComPtr<ID3D11DeviceContext> dev_ctx;
device->GetImmediateContext(&dev_ctx);

if (dev_ctx != nullptr) {
// Always flush the immediate context before forcing a CPU-wait, otherwise the GPU might only start
// working when the SwapChain is presented.
dev_ctx->Flush();
}
}
QueryPerformanceCounter(&t);
int64_t next = qpc_to_100ns(dxgi.previous_present_time.QuadPart) +
FRAME_INTERVAL_NS_NUMERATOR / (FRAME_INTERVAL_NS_DENOMINATOR * 100);
Expand Down

0 comments on commit 0a4ac2c

Please sign in to comment.