• Zebediah Figura's avatar
    wined3d: Submit command buffers after 512 draw or dispatch commands. · cb723c6d
    Zebediah Figura authored
    This improves performance for the game "Grounded", on a AMD Radeon RX 6700 XT,
    with radv from Mesa 22.3.6. Testing was done with the "cb_access_map_w" option
    enabled, which also improves performance with the game by itself.
    
    Grounded generally makes about 4000 draw calls per frame, which seems not
    atypical. This change makes it submit at most an extra 8 times per frame, but in
    practice due to WINED3D_PERIODIC_SUBMIT_MAX_BUFFERS it submits less (usually
    only 2-3).
    
    The most demanding game I've seen made about 20,000 draw calls per frame, at
    which point the overhead of adapter_vk_draw_primitive() itself becomes a serious
    bottleneck. For such a game we would submit 40 more times per frame with these
    settings, although WINED3D_PERIODIC_SUBMIT_MAX_BUFFERS means we would likely
    submit less than that. In any case if submission itself becomes a bottleneck, we
    should offload it to a separate thread.
    
    Credit goes to Philip Rebohle and his work on DXVK for helping me to notice that
    periodic submission might make a difference.
    cb723c6d