anv: Fix pool allocator when first alloc needs to grow
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Fri, 12 Jul 2019 21:37:38 +0000 (14:37 -0700)
committerCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Sat, 13 Jul 2019 05:25:37 +0000 (22:25 -0700)
commit09c4037ddada76ad07cca2fd6b46f5451fa55f1b
tree5a965e3b6fd5dcd556bf8909f33840cb1e5a4c7c
parentaa139210792b8380ae937e932248ee0aba6a0e4c
anv: Fix pool allocator when first alloc needs to grow

When using softpin, the first allocation was not calculating the
padding and offset correctly for the case the first allocation needed
to grow.  We were missing initialize the state.end right after
expanding the pool for the first time.

This is not a problem for non-softpin since there we don't use
leftover padding so the ends would re-arrange incrementally.

This fixes running dEQP-VK.ssbo.phys.layout.random.16bit.scalar.13 in
SKL -- the test uses a shader larger than the initial size for the
instruction pool.

Fixes: dfc9ab2ccd9 "anv/allocator: Add padding information."
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/anv_allocator.c
src/intel/vulkan/meson.build
src/intel/vulkan/tests/block_pool_grow_first.c [new file with mode: 0644]