layers: Validate barrier subresource range.

Check subresource range for image memory barriers.
diff --git a/demos/cube.c b/demos/cube.c
index a4e9943..60be497 100644
--- a/demos/cube.c
+++ b/demos/cube.c
@@ -505,7 +505,7 @@
         .oldLayout = old_image_layout,
         .newLayout = new_image_layout,
         .image = image,
-        .subresourceRange = { aspectMask, 0, 1, 0, 0 }
+        .subresourceRange = { aspectMask, 0, 1, 0, 1 }
     };
 
     if (new_image_layout == VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL) {