OSDN Git Service

anv/allocator: Correctly set the number of buckets
authorJason Ekstrand <jason.ekstrand@intel.com>
Sat, 27 Aug 2016 02:31:05 +0000 (19:31 -0700)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 1 Sep 2016 10:39:47 +0000 (11:39 +0100)
commit1ce414accf69a8ef6853f521fd62487f42d78ad7
tree03f27c2375f1ad2f9ef0a629934213f768887fd2
parente12b7486b33ef67bf3276c2434530b388afe2381
anv/allocator: Correctly set the number of buckets

The range from ANV_MIN_STATE_SIZE_LOG2 to ANV_MAX_STATE_SIZE_LOG2 should
be inclusive and we have asserts that ensure that you never try to allocate
a state larger than (1 << ANV_MAX_STATE_SIZE_LOG2).  However, without
adding 1 to the difference, we allocate 1 too few bucckts and so, even
though we have an assert, anything landing in the last bucket will fail to
allocate properly..

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit a0f5c496e348b918a556dd275289d4dda63b94c9)
src/intel/vulkan/anv_private.h