Skip to content

DX12 backend requests redraws too quickly and render queue fills up #488

@Systemcluster

Description

@Systemcluster

I'm encountering an issue where, with the DX12 backend, redraws are requested at a much higher pace than they are actually drawn. I could not reproduce it with the Vulkan or the DX11 backends.

With winit, I'm calling window.request_redraw() on the MainEventsCleared event as per the wgpu-rs examples. With the DX12 backend, this results in very fast updates, while what's rendered appears increasingly late (noticeable e.g. by moving imagery appearing in slow motion and inputs appearing delayed). This is accompanied by increasing memory usage, which I assume is a symptom of a growing render queue.

This occurs regardless of VSync or how GSync or max frame rate are configured in the driver. In rare cases the issue doesn't appear directly after starting, only after some time has passed and after some inputs, but I couldn't find out anything deterministic about it. The full code can be seen here, apart from the shaders there's not much more than the relevant code in it currently.

Info output during setup:
2020-02-09 18:31:30,019 INFO  [mathilda] mathilda 0.0.1 (debug build, windows [x86_64])
2020-02-09 18:31:30,372 INFO  [gfx_backend_dx11] DXGI version: Dxgi1_5
2020-02-09 18:31:30,462 INFO  [wgpu_core::instance] Adapter Dx12 AdapterInfo { name: "NVIDIA GeForce RTX 2060", vendor: 4318, device: 7944, device_type: DiscreteGpu }
2020-02-09 18:31:30,610 WARN  [wgpu_core::instance] max_bind_groups limit is missing
2020-02-09 18:31:30,610 INFO  [wgpu_core::device] creating swap chain SwapChainDescriptor { usage: OUTPUT_ATTACHMENT, format: Bgra8Unorm, width: 1024, height: 1024, present_mode: NoVsync }
2020-02-09 18:31:30,611 WARN  [wgpu_core::device] Surface does not support present mode: IMMEDIATE, falling back to FIFO
2020-02-09 18:31:31,126 INFO  [gfx_backend_dx12::device] Creating a pipeline layout with 1 sets and 0 root constants
2020-02-09 18:31:31,127 INFO  [gfx_backend_dx12::device] create_descriptor_pool with 64 max sets
2020-02-09 18:31:31,127 INFO  [gfx_backend_dx12::device] total 64 views and 0 samplers
2020-02-09 18:31:31,127 INFO  [gfx_backend_dx12::resource] allocate_set
2020-02-09 18:31:31,306 INFO  [gfx_backend_dx12::device] Creating a pipeline layout with 1 sets and 0 root constants
2020-02-09 18:31:31,306 INFO  [gfx_backend_dx12::device] create_descriptor_pool with 64 max sets
2020-02-09 18:31:31,307 INFO  [gfx_backend_dx12::device] total 192 views and 0 samplers
2020-02-09 18:31:31,307 INFO  [gfx_backend_dx12::resource] allocate_set
2020-02-09 18:31:31,315 INFO  [gfx_backend_dx12::device] Creating a pipeline layout with 1 sets and 0 root constants
2020-02-09 18:31:31,325 INFO  [gfx_backend_dx12::device] create_descriptor_pool with 64 max sets
2020-02-09 18:31:31,325 INFO  [gfx_backend_dx12::device] total 128 views and 64 samplers
2020-02-09 18:31:31,325 INFO  [gfx_backend_dx12::resource] allocate_set

System is Windows 10 1909 with a NVIDIA GeForce RTX 2060 and driver version 441.87. The issue is accompanied by issue gfx-rs/gfx#3088 after it appears, which might be related.

I'm not perfectly sure which repository this issue best belongs to, feel free transfer it if necessary. Please let me know if you need more information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help requiredWe need community help to make this happen.type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions