Skip to content
  • Kenneth Graunke's avatar
    iris: Track valid data range and infer unsynchronized mappings. · 77449d7c
    Kenneth Graunke authored
    Applications frequently call glBufferSubData() to consecutive regions
    of a VBO to append new vertex data.  If no data exists there yet, we
    can promote these to unsynchronized writes, even if the buffer is busy,
    since the GPU can't be doing anything useful with undefined content.
    This can avoid a bunch of unnecessary blitting on the GPU.
    
    u_threaded_context would do this for us, and in fact prohibits us from
    doing so (see TC_TRANSFER_MAP_NO_INFER_UNSYNCHRONIZED).  But we haven't
    hooked that up yet, and it may be useful to disable u_threaded_context
    when debugging...at which point we'd still want this optimization.  At
    the very least, it would let us measure the benefit of threading
    independently from this optimization.  And it's not a lot of code.
    
    Removes most stall avoidance blits in "Total War: WARHAMMER."
    
    On my Skylake GT4e at 1920x1080, this appears to improve performance
    in games by the following (but I did not do many runs for proper
    statistics gathering):
    
       ----------------------------------------------
       | DiRT Rally        | +2% (avg) | + 2% (max) |
       | Bioshock Infinite | +3% (avg) | + 9% (max) |
       | Shadow of Mordor  | +7% (avg) | +20% (max) |
       ----------------------------------------------
    77449d7c