Skip to content

DX12 wrong swap-chain buffer reference error #5094

Description

@valaphee

Description
Pull request #4899 with desired_maximum_frame_latency set to 2 seem to not work at least on my PC, as all examples now run with 1.0 FPS and the error

ID3D12CommandQueue::ExecuteCommandLists: A command list, which writes to a swapchain back buffer, may only be executed when that back buffer is the back buffer that will be presented during the next call to Present*. Such a back buffer is also re
ferred to as the "current back buffer". Swap Chain: 0x0000015343D9C8A0:'Unnamed Object' - Current Back Buffer Buffer: 0x0000015343E96EB0:'Unnamed ID3D12Resource Object' - Attempted Write Buffer: 0x0000015343C9C4A0:'Unnamed ID3D12Resource Object' [ STATE_SETTING ERROR #907: EXECUTECOMMANDLISTS_WRONGSWAPCHAINBUFFERREFERENCE]

appears 3 times each frame.

The water example directly crashes:

[2024-01-19T00:04:14Z ERROR wgpu_hal::auxil::dxgi::exception] ID3D12Device::RemoveDevice: Device removal has been triggered for the following reason (DXGI_ERROR_ACCESS_DENIED: The application attempted to use a resource it does not access to.  This  could be, for example, rendering to a texture while only having read access.). [ EXECUTION ERROR #232: DEVICE_REMOVAL_PROCESS_AT_FAULT]
[2024-01-19T00:04:14Z ERROR wgpu_hal::auxil::dxgi::result] Buffer creation failed: 0x887A0005
[2024-01-19T00:04:14Z ERROR wgpu::backend::wgpu_core] Handling wgpu errors as fatal by default
thread 'main' panicked at 'wgpu error: Validation Error

Caused by:
    In Queue::write_buffer
    Parent device is lost

Repro steps
Running the examples using the dx12 backend

Expected vs observed behavior
Fallback/default to 3 if 2 doesn't work for desired_maximum_frame_latency, or working desired_maximum_frame_latency with set to 2

Extra materials

Platform
Windows 11 23H2, RX 6900 XT (driver version 23.12.1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions