anv: Don't resolve or ambiguate non-existent layers
authorJason Ekstrand <jason.ekstrand@intel.com>
Mon, 12 Feb 2018 17:48:12 +0000 (09:48 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 12 Feb 2018 23:14:57 +0000 (15:14 -0800)
commitf37bd726c7211e8680f4a903b2167dacc4de94f2
tree76a8370877be76034bd1205ea25683bae8e1f6bd
parentc2c4e5bae3ba27bbdaafd8787a3e96266f82e70c
anv: Don't resolve or ambiguate non-existent layers

The previous code was trying to avoid non-existent layers by taking a
MAX with anv_image_aux_layers.  Unfortunately, it wasn't taking into
account that layer_count starts at base_layer which may not be zero.
Instead, we need to subtract base_layer from anv_image_aux_layers with
a guard against roll-over.

Fixes: de3be6180169f9 "anv/cmd_buffer: Rework aux tracking"
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
src/intel/vulkan/genX_cmd_buffer.c