Skip to content
  • Iago Toral's avatar
    anv/device: fix maximum number of images supported · f92c5bc8
    Iago Toral authored
    
    
    We had defined MAX_IMAGES as 8, which we used to size the array for
    image push constant data. The comment there stated that this was for
    gen8, but anv_nir_apply_pipeline_layout runs for all gens and writes
    that array, asserting that we don't exceed that number of images,
    which imposes a limit of MAX_IMAGES on all gens.
    
    Furthermore, despite this, we are exposing up to 64 images per shader
    stage on all gens, gen8 included.
    
    This patch lowers the number of images we expose in gen8 to 8 and
    keeps 64 images for gen9+ while making sure that only pre-SKL gens
    use push constant space to handle images.
    
    v2:
     - <= instead of < in the assert (Eric, Lionel)
     - Change the way the assertion is written (Eric)
    
    v3:
     - Revert the way the assertion is written to the form it had in v1,
       the version in v2 was not equivalent and was incorrect. (Lionel)
    
    v4:
     - gen9+ doesn't need push constants for images at all (Jason)
    
    Cc: mesa-stable@lists.freedesktop.org
    Reviewed-by: default avatarJason Ekstrand <jason@jlekstrand.net>
    Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v3)
    f92c5bc8