layers: Use resolved range to avoid long loops
layers: Use resolved range to avoid long loops

Fixes #1251.
Use the resolvedRange instead of the raw range, which
could include VK_REMAINING_MIP_LEVELS and/or
VK_REMAINING_ARRAY_LAYERS, which are really big numbers.

This fixes a near-infinite loop issue when running the
input_attachment sample with validation.

Change-Id: I250118db74a6faaecd2b3cd4cb43f44c07ae436d

KhronosGroup/Vulkan-Tools,KhronosGroup/Vulkan-Tools,KhronosGroup/Vulkan-Tools,KhronosGroup/Vulkan-Tools