Skip to content
  • Faith Ekstrand's avatar
    anv/allocator: Allow state pools to allocate large states · f82d3d38
    Faith Ekstrand authored
    
    
    Previously, the maximum size of a state that could be allocated from a
    state pool was a block.  However, this has caused us various issues
    particularly with shaders which are potentially very large.  We've also
    hit issues with render passes with a large number of attachments when we
    go to allocate the block of surface state.  This effectively removes the
    restriction on the maximum size of a single state.  (There's still a
    limit of 1MB imposed by a fixed-length bucket array.)
    
    For states larger than the block size, we just grab a large block off of
    the block pool rather than sub-allocating.  When we go to allocate some
    chunk of state and the current bucket does not have state, we try to
    pull a chunk from some larger bucket and split it up.  This should
    improve memory usage if a client occasionally allocates a large block of
    state.
    
    This commit is inspired by some similar work done by Juan A. Suarez
    Romero <jasuarez@igalia.com>.
    
    Reviewed-by: default avatarJuan A. Suarez Romero <jasuarez@igalia.com>
    f82d3d38