OSDN Git Service

anv/device: fix maximum number of images supported
authorIago Toral Quiroga <itoral@igalia.com>
Thu, 10 Jan 2019 12:34:07 +0000 (13:34 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Tue, 29 Jan 2019 17:44:27 +0000 (17:44 +0000)
commit252beed9457255426af3178d3f6fe0ac6a3b9a59
treeb10da7e1b2c69aff5e4d09502a28de496a126c80
parent5f25cfdaf6a59d6b8bcc6835ef3f45792f88c40d
anv/device: fix maximum number of images supported

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: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v3)
(cherry picked from commit f92c5bc8f3f517f3dadab27c5fcf28a6c2747204)
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_nir_apply_pipeline_layout.c
src/intel/vulkan/anv_private.h
src/intel/vulkan/genX_cmd_buffer.c