[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

vulkan: Changes to 'upstream-unstable'



Rebased ref, commits from common ancestor:
commit 71ce6bb34a5e552f2ed5eb6f7414aa18ff723808
Author: Jon Ashburn <jon@lunarg.com>
Date:   Fri Mar 11 14:43:57 2016 -0700

    loader: make sure createDevice uses ICDs physicalDevice
    
    Trampoline CreateDevice was using the terminator's physicalDevice instead of
    the ICDs.
    
    Change-Id: Ifdc6497fe4130e1ac1440b225401e65600b2a999

diff --git a/loader/loader.c b/loader/loader.c
index b67e1db..104dc9e 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -1181,6 +1181,8 @@ static void loader_icd_destroy(struct loader_instance *ptr_inst,
         dev = next_dev;
     }
 
+    if (icd->phys_devs != NULL)
+        loader_heap_free(ptr_inst, icd->phys_devs);
     loader_heap_free(ptr_inst, icd);
 }
 
@@ -3934,10 +3936,19 @@ terminator_EnumeratePhysicalDevices(VkInstance instance,
         return VK_ERROR_OUT_OF_HOST_MEMORY;
 
     for (i = 0; idx < copy_count && i < inst->total_icd_count; i++) {
+        icd = phys_devs[i].this_icd;
+        if (icd->phys_devs != NULL) {
+            loader_heap_free(inst, icd->phys_devs);
+        }
+        icd->phys_devs = loader_heap_alloc(inst,
+                              sizeof(VkPhysicalDevice) * phys_devs[i].count,
+                              VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
+
         for (j = 0; j < phys_devs[i].count && idx < copy_count; j++) {
             loader_set_dispatch((void *)&inst->phys_devs_term[idx], inst->disp);
             inst->phys_devs_term[idx].this_icd = phys_devs[i].this_icd;
             inst->phys_devs_term[idx].phys_dev = phys_devs[i].phys_devs[j];
+            icd->phys_devs[j] = phys_devs[i].phys_devs[j];
             pPhysicalDevices[idx] =
                 (VkPhysicalDevice)&inst->phys_devs_term[idx];
             idx++;
diff --git a/loader/loader.h b/loader/loader.h
index 89755eb..3560a90 100644
--- a/loader/loader.h
+++ b/loader/loader.h
@@ -200,7 +200,7 @@ struct loader_icd {
     // pointers to find other structs
     const struct loader_scanned_icds *this_icd_lib;
     const struct loader_instance *this_instance;
-
+    VkPhysicalDevice *phys_devs;  // physicalDevice object from icd
     struct loader_device *logical_device_list;
     VkInstance instance; // instance object from the icd
     PFN_vkGetDeviceProcAddr GetDeviceProcAddr;
diff --git a/loader/trampoline.c b/loader/trampoline.c
index f4370a5..a26d8c5 100644
--- a/loader/trampoline.c
+++ b/loader/trampoline.c
@@ -629,8 +629,9 @@ vkCreateDevice(VkPhysicalDevice physicalDevice,
         return VK_ERROR_OUT_OF_HOST_MEMORY;
     }
 
+    //TODO handle more than one phys dev per icd (icd->phys_devs[0])
     res = loader_add_device_extensions(
-        inst, icd, phys_dev->phys_dev,
+        inst, icd, icd->phys_devs[0],
         phys_dev->this_icd->this_icd_lib->lib_name, &icd_exts);
     if (res != VK_SUCCESS) {
         loader_platform_thread_unlock_mutex(&loader_lock);

commit 6f84c371801771162f6317c33603cf8f2f4930d5
Author: Karl Schultz <karl@lunarg.com>
Date:   Fri Mar 11 13:17:40 2016 -0700

    spirv: Pick up SPIRV-Tools fix for version generation script.
    
    This bug would only occur when building spirv-tools outside
    of a git repo, such as inside of an SDK install.  When
    outside of a git repo, the version generation script
    would hit a corner case, making the python script fail.
    
    Change-Id: I5c3a8ce35e8379396e8d19281bbe3331a3f75820

diff --git a/spirv-tools_revision b/spirv-tools_revision
index 7d3b7db..e83c901 100644
--- a/spirv-tools_revision
+++ b/spirv-tools_revision
@@ -1 +1 @@
-9dd1cd7f31779dc60ac49d550ec4c164b2fd7be4
+9149a66ca406d86967b104cac209bad309fd2c33

commit dee52f480fcb16abc266dd0928406c1d3de11e99
Author: Jon Ashburn <jon@lunarg.com>
Date:   Fri Mar 11 10:58:56 2016 -0700

    loader: Fix cmake on win for list of normal and opt sources
    
    Change-Id: I5eb7836ba0606628fc663ecfa8cd3ca4d535a8b9

diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt
index 2b38b88..654c2a2 100644
--- a/loader/CMakeLists.txt
+++ b/loader/CMakeLists.txt
@@ -13,7 +13,7 @@ endif()
 set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG")
 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
 
-set(LOADER_SRCS
+set(NORMAL_LOADER_SRCS
     loader.c
     loader.h
     vk_loader_platform.h
@@ -26,24 +26,32 @@ set(LOADER_SRCS
     gpa_helper.h
     cJSON.c
     cJSON.h
-    dev_ext_trampoline.c
     murmurhash.c
     murmurhash.h
 )
 
+set (OPT_LOADER_SRCS
+    dev_ext_trampoline.c
+)
+
+set (LOADER_SRCS ${NORMAL_LOADER_SRCS} ${OPT_LOADER_SRCS})
 
 if (WIN32)
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
-    # Build dev_ext_trampoline with -O2 to allow tail-call optimization.
-    # We have to disable Real Time Checks when we specify -O2.
-    # Unfortunately, this also disables them for all of the loader.
-    STRING (REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
-    STRING (REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
-    set_source_files_properties(dev_ext_trampoline.c PROPERTIES COMPILE_FLAGS -O2)
-
-    add_library(vulkan-${MAJOR} SHARED ${LOADER_SRCS} dirent_on_windows.c ${CMAKE_CURRENT_BINARY_DIR}/vulkan-${MAJOR}.def)
+    # Build dev_ext_trampoline.c with -O2 to allow tail-call optimization.
+    # Build other C files with normal options
+    # setup two Cmake targets (loader-norm and loader-opt) for the different compilation flags
+    separate_arguments(LOCAL_C_FLAGS_DBG WINDOWS_COMMAND ${CMAKE_C_FLAGS_DEBUG})
+    set(CMAKE_C_FLAGS_DEBUG " ")
+    separate_arguments(LOCAL_C_FLAGS_REL WINDOWS_COMMAND ${CMAKE_C_FLAGS_RELEASE})
+
+    add_library(loader-norm OBJECT ${NORMAL_LOADER_SRCS} dirent_on_windows.c)
+    target_compile_options(loader-norm PUBLIC "$<$<CONFIG:DEBUG>:${LOCAL_C_FLAGS_DBG}>")
+    add_library(loader-opt OBJECT ${OPT_LOADER_SRCS})
+    target_compile_options(loader-opt PUBLIC "$<$<CONFIG:DEBUG>:${LOCAL_C_FLAGS_REL}>")
+    add_library(vulkan-${MAJOR} SHARED $<TARGET_OBJECTS:loader-opt> $<TARGET_OBJECTS:loader-norm> ${CMAKE_CURRENT_BINARY_DIR}/vulkan-${MAJOR}.def)
     set_target_properties(vulkan-${MAJOR} PROPERTIES LINK_FLAGS "/DEF:${CMAKE_CURRENT_BINARY_DIR}/vulkan-${MAJOR}.def")
-    add_library(VKstatic.${MAJOR} STATIC ${LOADER_SRCS} dirent_on_windows.c)
+    add_library(VKstatic.${MAJOR} STATIC $<TARGET_OBJECTS:loader-opt> $<TARGET_OBJECTS:loader-norm>)
     set_target_properties(VKstatic.${MAJOR} PROPERTIES OUTPUT_NAME VKstatic.${MAJOR})
     target_link_libraries(vulkan-${MAJOR} shlwapi)
 else()

commit c6b744fe7e3c4c2d4f3af44766b5f40a4609b37b
Author: David Pinedo <david@lunarg.com>
Date:   Thu Mar 10 16:50:50 2016 -0700

    loader: fix cmake file so it doesn't always build loader with DEBUG

diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt
index ec8ffc2..2b38b88 100644
--- a/loader/CMakeLists.txt
+++ b/loader/CMakeLists.txt
@@ -34,11 +34,12 @@ set(LOADER_SRCS
 
 if (WIN32)
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
-	# build dev_ext_trampoline with release flags to allow tail-call optimization
-	# cmake and MSVC doesn't make this easy to do
-    set_source_files_properties(${LOADER_SRCS} PROPERTIES COMPILE_FLAGS ${CMAKE_C_FLAGS_DEBUG})
-	set(CMAKE_C_FLAGS_DEBUG "")
-	set_source_files_properties(dev_ext_trampoline.c PROPERTIES COMPILE_FLAGS ${CMAKE_C_FLAGS_RELEASE})
+    # Build dev_ext_trampoline with -O2 to allow tail-call optimization.
+    # We have to disable Real Time Checks when we specify -O2.
+    # Unfortunately, this also disables them for all of the loader.
+    STRING (REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
+    STRING (REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
+    set_source_files_properties(dev_ext_trampoline.c PROPERTIES COMPILE_FLAGS -O2)
 
     add_library(vulkan-${MAJOR} SHARED ${LOADER_SRCS} dirent_on_windows.c ${CMAKE_CURRENT_BINARY_DIR}/vulkan-${MAJOR}.def)
     set_target_properties(vulkan-${MAJOR} PROPERTIES LINK_FLAGS "/DEF:${CMAKE_CURRENT_BINARY_DIR}/vulkan-${MAJOR}.def")

commit 9ca1f47dd3efcc35fdad3f88cb7b4f9af0588742
Author: Mark Lobodzinski <mark@lunarg.com>
Date:   Thu Mar 10 16:46:23 2016 -0700

    layers: Add in Michael's fix for the Source2 crashes, remove workaround
    
    Change-Id: I76879d9883d6233ad2d042cd91da2b9220697608

diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp
index e8289f3..b4fadf7 100644
--- a/layers/draw_state.cpp
+++ b/layers/draw_state.cpp
@@ -6950,12 +6950,6 @@ VkBool32 FindDependency(const int index, const int dependent, const std::vector<
     if (processed_nodes.count(index))
         return VK_FALSE;
 
-    // TODO: This is a Workaround to prevent DOTA2/RenderSystemTest subscript-out-of-range assertions
-    //       This should be replaced with the actual fix when it is available.
-    if (index >= subpass_to_node.size())
-        return VK_FALSE;
-    //       End Workaround
-
     processed_nodes.insert(index);
     const DAGNode &node = subpass_to_node[index];
     // Look for a dependency path. If one exists return true else recurse on the previous nodes.
@@ -7099,21 +7093,21 @@ VkBool32 ValidateDependencies(const layer_data *my_data, const VkRenderPassBegin
             uint32_t attachment = subpass.pInputAttachments[j].attachment;
             input_attachment_to_subpass[attachment].push_back(i);
             for (auto overlapping_attachment : overlapping_attachments[attachment]) {
-                input_attachment_to_subpass[attachment].push_back(overlapping_attachment);
+                input_attachment_to_subpass[overlapping_attachment].push_back(i);
             }
         }
         for (uint32_t j = 0; j < subpass.colorAttachmentCount; ++j) {
             uint32_t attachment = subpass.pColorAttachments[j].attachment;
             output_attachment_to_subpass[attachment].push_back(i);
             for (auto overlapping_attachment : overlapping_attachments[attachment]) {
-                output_attachment_to_subpass[attachment].push_back(overlapping_attachment);
+                output_attachment_to_subpass[overlapping_attachment].push_back(i);
             }
         }
         if (subpass.pDepthStencilAttachment && subpass.pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) {
             uint32_t attachment = subpass.pDepthStencilAttachment->attachment;
             output_attachment_to_subpass[attachment].push_back(i);
             for (auto overlapping_attachment : overlapping_attachments[attachment]) {
-                output_attachment_to_subpass[attachment].push_back(overlapping_attachment);
+                output_attachment_to_subpass[overlapping_attachment].push_back(i);
             }
         }
     }

commit 06ae475b0b7ee43b38ba7c86bfa11c5b0808debe
Author: Jon Ashburn <jon@lunarg.com>
Date:   Thu Mar 10 14:21:09 2016 -0700

    layers: Fix helper script to not dereference strings with a NULL pointer.
    
    Fixes the string helper functions.
    
    Change-Id: I4177e498b734af9188088188a16a09aa2a6113b3

diff --git a/vk_helper.py b/vk_helper.py
index 05e104e..88f1fa2 100755
--- a/vk_helper.py
+++ b/vk_helper.py
@@ -1063,7 +1063,11 @@ class StructWrapperGen:
                         sh_funcs.append('        ss[%u].str("address");' % (index))
                     elif 'char' in self.struct_dict[s][m]['type'].lower() and self.struct_dict[s][m]['ptr']:
                         sh_funcs.append('%s' % lineinfo.get())
-                        sh_funcs.append('    ss[%u] << pStruct->%s;' % (index, self.struct_dict[s][m]['name']))
+                        sh_funcs.append('    if (pStruct->%s != NULL) {' % self.struct_dict[s][m]['name'])
+                        sh_funcs.append('        ss[%u] << pStruct->%s;' % (index, self.struct_dict[s][m]['name']))
+                        sh_funcs.append('     } else {')
+                        sh_funcs.append('        ss[%u] << "";' % index)
+                        sh_funcs.append('     }')
                     else:
                         sh_funcs.append('%s' % lineinfo.get())
                         (po, pa) = self._get_struct_print_formatted(self.struct_dict[s][m])

commit 1f8942b0045c5862f82fc4a8f560ae2f92b5f4d4
Author: Mark Lobodzinski <mark@lunarg.com>
Date:   Thu Mar 10 08:38:07 2016 -0700

    layers: Temporary SDK workaround to prevent DOTA2/RST crashes
    
    To be replaced with the final fix when available. This commit
    should NOT go into Master.
    
    Change-Id: Ica091dff033bd5b6eb754ef60615b67370257826

diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp
index ee4888a..e8289f3 100644
--- a/layers/draw_state.cpp
+++ b/layers/draw_state.cpp
@@ -6949,6 +6949,13 @@ VkBool32 FindDependency(const int index, const int dependent, const std::vector<
     // If we have already checked this node we have not found a dependency path so return false.
     if (processed_nodes.count(index))
         return VK_FALSE;
+
+    // TODO: This is a Workaround to prevent DOTA2/RenderSystemTest subscript-out-of-range assertions
+    //       This should be replaced with the actual fix when it is available.
+    if (index >= subpass_to_node.size())
+        return VK_FALSE;
+    //       End Workaround
+
     processed_nodes.insert(index);
     const DAGNode &node = subpass_to_node[index];
     // Look for a dependency path. If one exists return true else recurse on the previous nodes.

commit 12961925f3956fcdcc2c5b25622f99b6e54c742b
Author: Mark Lobodzinski <mark@lunarg.com>
Date:   Thu Mar 10 09:53:53 2016 -0700

    layers: Update layer validation details document
    
    Change-Id: I4990f7882061ce36f4520ce20655b0ceb06ba168

diff --git a/layers/vk_validation_layer_details.md b/layers/vk_validation_layer_details.md
index 62b467b..5b05464 100644
--- a/layers/vk_validation_layer_details.md
+++ b/layers/vk_validation_layer_details.md
@@ -6,13 +6,25 @@
 
 ### VK_LAYER_LUNARG_standard_validation Overview
 
-This is a meta-layer managed by the loader. Specifying this layer name will cause the loader to load the all of the standard validation layers in the following optimal order: VK_LAYER_GOOGLE_threading, VK_LAYER_LUNARG_param_checker, VK_LAYER_LUNARG_device_limits, VK_LAYER_LUNA    RG_object_tracker, VK_LAYER_LUNARG_image, VK_LAYER_LUNARG_mem_tracker, VK_LAYER_LUNARG_draw_state, VK_LAYER_LUNARG_swapchain, and VK_LAYER_GOOGLE_unique_objects. Other layers can be specified and the loader will remove duplicates. See the following individual layer descriptions for layer details.
+This is a meta-layer managed by the loader. Specifying this layer name will cause the loader to load the all of the standard validation layers in the following optimal order:
+
+ - VK_LAYER_GOOGLE_threading
+ - VK_LAYER_LUNARG_param_checker
+ - VK_LAYER_LUNARG_device_limits
+ - VK_LAYER_LUNARG_object_tracker
+ - VK_LAYER_LUNARG_image
+ - VK_LAYER_LUNARG_mem_tracker
+ - VK_LAYER_LUNARG_draw_state
+ - VK_LAYER_LUNARG_swapchain
+ - VK_LAYER_GOOGLE_unique_objects
+
+Other layers can be specified and the loader will remove duplicates. See the following individual layer descriptions for layer details.
 
 ## VK_LAYER_LUNARG_draw_state
 
 ### VK_LAYER_LUNARG_draw_state Overview
 
-The VK_LAYER_LUNARG_draw_state layer tracks state leading into Draw cmds. This includes the Pipeline state, dynamic state, shaders, and descriptor set state. VK_LAYER_LUNARG_draw_state validates the consistency and correctness between and within these states. VK_LAYER_LUNARG_draw_state also includes SPIR-V validation which functionality is recorded under the VK_LAYER_LUNARG_ShaderChecker section below.
+The VK_LAYER_LUNARG_draw_state layer tracks state leading into Draw commands. This includes the Pipeline state, dynamic state, shaders, and descriptor set state. VK_LAYER_LUNARG_draw_state validates the consistency and correctness between and within these states. VK_LAYER_LUNARG_draw_state also includes SPIR-V validation which functionality is recorded under the VK_LAYER_LUNARG_ShaderChecker section below.
 
 ### VK_LAYER_LUNARG_draw_state Details Table
 
@@ -96,26 +108,12 @@ The VK_LAYER_LUNARG_draw_state layer tracks state leading into Draw cmds. This i
 ### VK_LAYER_LUNARG_draw_state Pending Work
 Additional checks to be added to VK_LAYER_LUNARG_draw_state
 
- 7. Lifetime validation (See [bug 13383](https://cvs.khronos.org/bugzilla/show_bug.cgi?id=13383))
-	 8. XGL_DESCRIPTOR_SET
-		 9. Cannot be deleted until no longer in use on GPU, or referenced in any pending command.
-                 10. Sets in XGL_DESCRIPTOR_REGION_USAGE_NON_FREE regions can never be deleted. Instead the xglClearDescriptorRegion() deletes all sets.
-		 11. Sets in XGL_DESCRIPTOR_REGION_USAGE_DYNAMIC regions can be deleted.
-	 12. XGL_DESCRIPTOR_SET_LAYOUT
-		 13. What do IHVs want here?
-		 14. Option 1 (assuming this one): Must not be deleted until all sets and layout chains referencing the set layout are deleted.
-		 15. Option 2: Can be freely deleted after usage.
-	 19. XGL_DESCRIPTOR_REGION
-		 20. Cannot be deleted until no longer in use on the GPU, or referenced in any pending command.
-	 21. XGL_BUFFER_VIEW, XGL_IMAGE_VIEW, etc
-		 22. Cannot be deleted until the descriptors referencing the objects are deleted.
-	 23. For ClearAttachments function, verify that the index of referenced attachment actually exists
- 24. GetRenderAreaGranularity - The pname:renderPass parameter must be the same as the one given in the sname:VkRenderPassBeginInfo structure for which the render area is relevant.
- 28. Verify that all relevent dynamic state objects are bound (See https://cvs.khronos.org/bugzilla/show_bug.cgi?id=14323)
- 30. At PSO creation time, there is no case when NOT including a FS should flag an error since there exist dynamic state configurations that can be set to cause a FS to not be required. Instead, in the case when no FS is in the PSO, validation should detect at runtime if dynamic state will require a FS, and in those case issue a runtime warning about undefined behavior. (see bug https://cvs.khronos.org/bugzilla/show_bug.cgi?id=14429)
- 31. Error if a cmdbuffer is submitted on a queue whose family doesn't match the family of the pool from which it was created.
- 32. Update Gfx Pipe Create Info shadowing to remove new/delete and instead use unique_ptrs for auto clean-up
- 33. Add validation for Pipeline Derivatives (see Pipeline Derivatives) section of the spec
+ 1. Lifetime validation (See [bug 13383](https://cvs.khronos.org/bugzilla/show_bug.cgi?id=13383))
+ 2. GetRenderAreaGranularity - The pname:renderPass parameter must be the same as the one given in the sname:VkRenderPassBeginInfo structure for which the render area is relevant.
+ 3. Update Gfx Pipe Create Info shadowing to remove new/delete and instead use unique_ptrs for auto clean-up
+ 4. Add validation for Pipeline Derivatives (see Pipeline Derivatives) section of the spec
+ 
+ See the Khronos github repository for Vulkan-LoaderAndValidationLayers for additional pending issues, or to submit new validation requests
 
 ## VK_LAYER_LUNARG_ShaderChecker
 
@@ -147,6 +145,7 @@ depends on the pair of pipeline stages involved.
 ### VK_LAYER_LUNARG_ShaderChecker Pending Work
 - Additional test cases for variously broken SPIRV images
 - Validation of a single SPIRV image in isolation (the spec describes many constraints)
+ See the Khronos github repository for Vulkan-LoaderAndValidationLayers for additional pending issues, or to submit new validation requests
 
 ## VK_LAYER_LUNARG_param_checker
 
@@ -166,7 +165,7 @@ The VK_LAYER_LUNARG_param_checker layer validates parameter values and flags err
 Additional work to be done
 
  1. Source2 was creating a VK_FORMAT_R8_SRGB texture (and image view) which was not supported by the underlying implementation (rendersystemtest imageformat test).  Checking that formats are supported by the implementation is something the validation layer could do using the VK_FORMAT_INFO_TYPE_PROPERTIES query.   There are probably a bunch of checks here you could be doing around vkCreateImage formats along with whether image/color/depth attachment views are valid.  I’m not sure how much of this is already there.
- 2.  From AMD: we were using an image view with a swizzle of VK_COLOR_COMPONENT_FORMAT_A with a BC1_RGB texture, which is not valid because the texture does not have an alpha channel.  In general, should validate that the swizzles do not reference components not in the texture format.
+ 2. From AMD: we were using an image view with a swizzle of VK_COLOR_COMPONENT_FORMAT_A with a BC1_RGB texture, which is not valid because the texture does not have an alpha channel.  In general, should validate that the swizzles do not reference components not in the texture format.
  3. When querying VK_PHYSICAL_DEVICE_INFO_TYPE_QUEUE_PROPERTIES must provide enough memory for all the queues on the device (not just 1 when device has multiple queues).
  4. INT & FLOAT bordercolors. Border color int/float selection must match associated texture format.
  5. Flag error on VkBufferCreateInfo if buffer size is 0
@@ -175,6 +174,8 @@ Additional work to be done
  8. Check for valid VkIndexType in vkCmdBindIndexBuffer() should be in PreCmdBindIndexBuffer() call
  9. Check for valid VkPipelineBindPoint in vkCmdBindPipeline() & vkCmdBindDescriptorSets() should be in PreCmdBindPipeline() & PreCmdBindDescriptorSets() calls respectively.
 
+ See the Khronos github repository for Vulkan-LoaderAndValidationLayers for additional pending issues, or to submit new validation requests
+
 ## VK_LAYER_LUNARG_image
 
 ### VK_LAYER_LUNARG_image Layer Overview
@@ -204,7 +205,7 @@ DETAILS TABLE PENDING
 | NA | Enum used for informational messages | NONE | | NA | None |
 
 ### VK_LAYER_LUNARG_image Pending Work
-Additional work to be done
+ See the Khronos github repository for Vulkan-LoaderAndValidationLayers for additional pending issues, or to submit new validation requests
 
 ## VK_LAYER_LUNARG_mem_tracker
 
@@ -236,20 +237,14 @@ The VK_LAYER_LUNARG_mem_tracker layer tracks memory objects and references and v
 | NA | Enum used for errors in the layer itself. This does not indicate an app issue, but instead a bug in the layer. | INTERNAL_ERROR | | NA | None |
 
 ### VK_LAYER_LUNARG_mem_tracker Pending Work
+ See the Khronos github repository for Vulkan-LoaderAndValidationLayers for additional pending issues, or to submit new validation requests
 
 #### VK_LAYER_LUNARG_mem_tracker Enhancements
 
-1.  Flag any memory hazards: Validate that the pipeline barriers for buffers are sufficient to avoid hazards
-2.  Make sure that the XGL_IMAGE_VIEW_ATTACH_INFO.layout matches the layout of the image as determined by the last IMAGE_MEMORY_BARRIER
-3.  Verify that the XGL_IMAGE_MEMORY_BARRIER.oldLayout matches the actual previous layout (this one was super important for previous work in dealing with out-of-order command buffer generation). Note that these need to be tracked for each subresource.
-4.  Update for new Memory Binding Model
-5.  Consolidate error messages and make them consistent
-7.  Add validation for having mapped objects in a command list - GPU writing to mapped object is warning
-8.  Add validation for maximum memory references, maximum object counts, and object leaks
-9. When performing clears on surfaces that have both Depth and Stencil, WARN user if subresource range for depth and stencil are not both set (see blit_tests.cpp VkCmdClearDepthStencilTest test).
-11. Warn on image/buffer deletion if USAGE bits were set that were not needed
-12. Modify INVALID_FENCE_STATE to be WARNINGs instead of ERROR
-13. Report destroy or modify of resources in use on queues and not cleared by fence or WaitIdle. Could be fence, semaphore, or objects used by submitted CommandBuffers.
+1. Consolidate error messages and make them consistent
+2. Add validation for maximum memory references, maximum object counts, and object leaks
+3. Warn on image/buffer deletion if USAGE bits were set that were not needed
+4. Modify INVALID_FENCE_STATE to be WARNINGs instead of ERROR
 
 ## VK_LAYER_LUNARG_object_tracker
 
@@ -274,12 +269,12 @@ The VK_LAYER_LUNARG_object_tracker layer maintains a record of all Vulkan object
 
 ### VK_LAYER_LUNARG_object_tracker Pending Work
 
- 4. Verify images have CmdPipelineBarrier layouts matching new layout parameters to Cmd*Image* functions
- 6. For specific object instances that are allowed to be NULL, update object validation to verify that such objects are either NULL or valid
- 7. Verify cube array VkImageView objects use subresourceRange.arraySize (or effective arraySize when VK_REMAINING_ARRAY_SLICES is specified) that is a multiple of 6. 
- 8. Make object maps specific to instance and device.  Objects may only be used with matching instance or device.
- 9. Use reference counting for non-dispatchable objects.  Multiple object creation calls may return identical handles.
- 10. Update codegen for destroy_obj & validate_obj to generate all of the correct signatures and use the generated code
+ 1. Verify images have CmdPipelineBarrier layouts matching new layout parameters to Cmd*Image* functions
+ 2. For specific object instances that are allowed to be NULL, update object validation to verify that such objects are either NULL or valid
+ 3. Verify cube array VkImageView objects use subresourceRange.arraySize (or effective arraySize when VK_REMAINING_ARRAY_SLICES is specified) that is a multiple of 6. 
+ 4. Make object maps specific to instance and device.  Objects may only be used with matching instance or device.
+
+ See the Khronos github repository for Vulkan-LoaderAndValidationLayers for additional pending issues, or to submit new validation requests
 
 ## VK_LAYER_GOOGLE_threading
 
@@ -315,7 +310,7 @@ It cannot insure that there is no latent race condition.
 | NA | Enum used for informational messages | NONE | | NA | None |
 
 ### VK_LAYER_GOOGLE_threading Pending Work
-Additional work to be done
+ See the Khronos github repository for Vulkan-LoaderAndValidationLayers for additional pending issues, or to submit new validation requests
 
 ## VK_LAYER_LUNARG_device_limits
 
@@ -353,6 +348,8 @@ For the second category of errors, VK_LAYER_LUNARG_device_limits stores its own
 
  1. For all Formats, call vkGetPhysicalDeviceFormatProperties to pull their properties for the underlying device. After that point, if the app attempts to use any formats in violation of those properties, flag errors (this is done for Images).
 
+ See the Khronos github repository for Vulkan-LoaderAndValidationLayers for additional pending issues, or to submit new validation requests
+
 ## VK_LAYER_LUNARG_swapchain
 
 ### Swapchain Overview
@@ -418,6 +415,8 @@ Additional checks to be added to VK_LAYER_LUNARG_swapchain
  2. One issue that has already come up is correct UsageFlags for WSI SwapChains and SurfaceProperties.
  3. Tons of other stuff including semaphore and synchronization validation.
 
+ See the Khronos github repository for Vulkan-LoaderAndValidationLayers for additional pending issues, or to submit new validation requests
+
 ## VK_LAYER_GOOGLE_unique_objects
 
 ### VK_LAYER_GOOGLE_unique_objects Overview

commit b7bf0c502b5aa1a5a9ba8af807ad7c701ad11e8b
Author: Karl Schultz <karl@lunarg.com>
Date:   Thu Mar 10 09:13:00 2016 -0700

    Update BUILD.md
    
    Update for upcoming SDK release.
    Reword to make it less necessary to change this file for future SDK releases.

diff --git a/BUILD.md b/BUILD.md
index 91a83de..ae14b68 100644
--- a/BUILD.md
+++ b/BUILD.md
@@ -1,60 +1,68 @@
 # Build Instructions
-These instructions are for Linux and Windows.
+This document contains the instructions for building this repository on Linux and Windows.
 
-It is strongly suggested that you first install a Vulkan-capable driver, obtained from your graphics hardware vendor.
+This repository does not contain a Vulkan-capable driver.
+Before proceeding, it is strongly recommended that you obtain a Vulkan driver from your graphics hardware vendor
+and install it.
 
-Note: The sample Vulkan Intel driver for Linux (ICD) has been moved to the
-[VulkanTools repo](https://github.com/LunarG/VulkanTools).
-Further instructions regarding the ICD are available there.
+Note: The sample Vulkan Intel driver for Linux (ICD) is being deprecated in favor of other driver options from Intel.
+This driver has been moved to the [VulkanTools repo](https://github.com/LunarG/VulkanTools).
+Further instructions regarding this ICD are available there.
 
 ## Git the Bits
 
-If you intend to contribute, the preferred work flow is to fork the repo, create a branch in your forked repo, do the work, and create a pull request on GitHub to integrate that work back into the repo.
-
 To create your local git repository:
 ```
 git clone https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers 
-# Or substitute the URL from your forked repo for https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers above.
 ```
 
+If you intend to contribute, the preferred work flow is for you to develop your contribution
+in a fork of this repo in your GitHub account and then submit a pull request.
+Please see the CONTRIBUTING.md file in this respository for more details.
+
 ## Linux Build
 
-The build process uses cmake and should work with the usual cmake options and utilities.
+The build process uses CMake to generate makefiles for this project.
 The build generates the loader, layers, and tests.
 
 This repo has been built and tested on Ubuntu 14.04.3 LTS, 14.10, 15.04 and 15.10.
 It should be straightforward to use it on other Linux distros.
 
-These packages should be installed 
+These packages are needed to build this repository: 
 ```
 sudo apt-get install git cmake build-essential bison libxcb1-dev
 ```
 
 Example debug build:
 ```
-cd YOUR_DEV_DIRECTORY  # cd to the root of the Vulkan-LoaderAndValidationLayers git repository
+cd Vulkan-LoaderAndValidationLayers  # cd to the root of the cloned git repository
 ./update_external_sources.sh  # Fetches and builds glslang and spirv-tools
 cmake -H. -Bdbuild -DCMAKE_BUILD_TYPE=Debug
 cd dbuild
 make
 ```
 
-To run Vulkan programs you must tell the icd loader where to find the libraries.
-This is described in a [specification](https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/blob/sdk-1.0.3/loader/LoaderAndLayerInterface.md#vulkan-installable-client-driver-interface-with-the-loader).
-
-This specification describes both how ICDs and layers should be properly
-packaged, and how developers can point to ICDs and layers within their builds.
+If you have installed a Vulkan driver obtained from your graphics hardware vendor, the install process should
+have configured the driver so that the Vulkan loader can find and load it.
 
-For example, you may wish to point to your just-built loader and layers with:
+If you want to use the loader and layers that you have just built:
 ```
-export LD_LIBRARY_PATH=<path to your build root>/dbuild/loader
-export VK_LAYER_PATH=<path to your build root>/dbuild/layers
+export LD_LIBRARY_PATH=<path to your repository root>/dbuild/loader
+export VK_LAYER_PATH=<path to your repository root>/dbuild/layers
 ```
+Note that if you have installed the [LunarG Vulkan SDK](https://vulkan.lunarg.com),
+you will also have the SDK version of the loader and layers installed in your default system libraries.
+
+You can run the `vulkaninfo` application to see which driver, loader and layers are being used.
+
+The `LoaderAndLayerInterface` document in the `loader` folder in this repository is a specification that
+describes both how ICDs and layers should be properly
+packaged, and how developers can point to ICDs and layers within their builds.
 
 ## Validation Test
 
-The test executables can be found in the dbuild/tests directory. The tests use the Google
-gtest infrastructure. Tests available so far:
+The test executables can be found in the dbuild/tests directory. 
+Some of the tests that are available:
 - vk_layer_validation_tests: Test Vulkan layers.
 
 There are also a few shell and Python scripts that run test collections (eg,
@@ -62,10 +70,11 @@ There are also a few shell and Python scripts that run test collections (eg,
 
 ## Linux Demos
 
-The demos executables can be found in the dbuild/demos directory.
+Some demos that can be found in the dbuild/demos directory are:
 - vulkaninfo: report GPU properties
 - tri: a textured triangle (which is animated to demonstrate Z-clipping)
 - cube: a textured spinning cube
+- smoke/smoke: A "smoke" test using a more complex Vulkan demo
 
 ## Windows System Requirements
 
@@ -109,9 +118,9 @@ Optional software packages:
 
 Cygwin is used in order to obtain a local copy of the Git repository, and to run the CMake command that creates Visual Studio files.  Visual Studio is used to build the software, and will re-run CMake as appropriate.
 
-Example debug x64 build (e.g. in a "Developer Command Prompt for VS2013" window):
+To build all Windows targets (e.g. in a "Developer Command Prompt for VS2013" window):
 ```
-cd YOUR_DEV_DIRECTORY  # cd to the root of the Vulkan-LoaderAndValidationLayers git repository
+cd Vulkan-LoaderAndValidationLayers  # cd to the root of the cloned git repository
 update_external_sources.bat --all
 build_windows_targets.bat 
 ```
@@ -121,25 +130,7 @@ At this point, you can use Windows Explorer to launch Visual Studio by double-cl
 Vulkan programs must be able to find and use the vulkan-1.dll libary. Make sure it is either installed in the C:\Windows\System32 folder, or the PATH environment variable includes the folder that it is located in.
 
 To run Vulkan programs you must tell the icd loader where to find the libraries.
-This is described in a [specification](https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/blob/sdk-1.0.3/loader/LoaderAndLayerInterface.md#vulkan-installable-client-driver-interface-with-the-loader).
-
+This is described in a `LoaderAndLayerInterface` document in the `loader` folder in this repository.
 This specification describes both how ICDs and layers should be properly
 packaged, and how developers can point to ICDs and layers within their builds.
 
-### Windows 64-bit Installation Notes
-If you plan on creating a Windows Install file (done in the windowsRuntimeInstaller sub-directory) you will need to build for both 32-bit and 64-bit Windows since both versions of EXEs and DLLs exist simultaneously on Windows 64.
-
-To do this, simply create and build the release versions of each target:
-```
-cd LoaderAndTools  # cd to the root of the Vulkan git repository
-update_external_sources.bat --all
-mkdir build
-cd build
-cmake -G "Visual Studio 12 Win64" ..
-msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Release
-mkdir build32
-cd build32
-cmake -G "Visual Studio 12" ..
-msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Release
-```
-

commit 4b9dd0c0820d7084206c9ecc719f0b67c57b1743
Author: Jon Ashburn <jon@lunarg.com>
Date:   Thu Mar 10 09:05:27 2016 -0700

    docs: Update README.md
    
    Change-Id: Idba8b7e07d3a71e49c01e406825b96ccbb342efa

diff --git a/README.md b/README.md
index eef7e35..39b383e 100755
--- a/README.md
+++ b/README.md
@@ -1,18 +1,22 @@
 # Vulkan Ecosystem Components
 *Version 1.0, January 25, 2016*
 
-This project provides loader and validation layers for Vulkan developers on Windows and Linux.
+This project provides Khronos offical ICD loader and validation layers for Vulkan developers on Windows and Linux.
 
 ## Introduction
 
-Vulkan is an Explicit API, enabling direct control over how GPUs actually work. No (or very little) validation or error checking is done inside a VK driver. Applications have full control and responsibility. Any errors in how VK is used are likely to result in a crash. This project provides layered utility libraries to ease development and help guide developers to proven safe patterns.
+Vulkan is an Explicit API, enabling direct control over how GPUs actually work. No (or very little) validation
+or error checking is done inside a Vulkan driver. Applications have full control and responsibility. Any errors in
+how Vulkan is used often result in a crash. This project provides standard validation layers that can be enabled to ease development by 
+helping developers verify their applications correctly use the Vulkan API.
 
-New with Vulkan is an extensible layered architecture that enables validation libraries to be implemented as layers. The loader is essential in supporting multiple drivers and GPUs along with layer library enablement.
+Vulkan supports multiple GPUs and multiple global contexts (VkInstance). The ICD loader is necessary to support multiple GPUs  and the VkInstance level Vulkan commands.  Additionally, the loader manages inserting Vulkan layer libraries,
+including validation layers between the application and the ICD.
 
 The following components are available in this repository:
 - Vulkan header files
-- [*ICD Loader*](loader) and [*Layer Manager*](layers/README.md, loader/README.md
-- Core [*Validation Layers*](layers/)
+- [*ICD Loader*](loader/)
+- [*Validation Layers*](layers/)
 - Demos and tests for the loader and validation layers
 
 
@@ -24,18 +28,18 @@ includes directions for building all the components, running the validation test
 Information on how to enable the various Validation layers is in
 [layers/README.md](layers/README.md).
 
+Architecture and interface information for the loader is in
+[loader/LoaderAndLayerInterface.md](loader/LoaderAndLayerInterface.md).
 
 ## License
-This work is intended to be released as open source under a MIT-style
-license once the Vulkan specification is public. Until that time, this work
-is covered by the Khronos NDA governing the details of the VK API.
+This work is released as open source under a MIT-style license from Khronos including a Khronos copyright.
+
+See LICENSE.txt for a full list of licenses used in this repository.
 
 ## Acknowledgements
-While this project is being developed by LunarG, Inc; there are many other
-companies and individuals making this possible: Valve Software, funding
-project development; Intel Corporation, providing full hardware specifications
-and valuable technical feedback; AMD, providing VK spec editor contributions;
-ARM, contributing a Chairman for this working group within Khronos; Nvidia,
-providing an initial co-editor for the spec; Qualcomm for picking up the
-co-editor's chair; and Khronos, for providing hosting within GitHub.
+While this project has been developed primarily by LunarG, Inc; there are many other
+companies and individuals making this possible: Valve Corporation, funding
+project development; Google providing significant contributions to the validation layers;
+Khronos providing oversight and hosting of the project.
+
 

commit 5e239817680c9d7f6b8f999ad531554d7984e5c8
Author: Mark Lobodzinski <mark@lunarg.com>
Date:   Wed Mar 9 15:42:55 2016 -0700

    layers: Fix draw_state handling of special image layouts in CmdPipelineBarrier
    
    Layer was ignoring VK_REMAINING_MIP_LEVELS and *ARRAY_LAYERS, resulting in
    Source2 applications hanging.
    
    Change-Id: I2ebecd3120eec9a97b6f3672984c15bd2e438c5c

diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp
index c6d0fcd..ee4888a 100644
--- a/layers/draw_state.cpp
+++ b/layers/draw_state.cpp
@@ -4773,6 +4773,30 @@ static void ResolveRemainingLevelsLayers(layer_data *dev_data, VkImageSubresourc
     }
 }
 
+/* Return the correct layer/level counts if the caller used the special
+ * values VK_REMAINING_MIP_LEVELS or VK_REMAINING_ARRAY_LAYERS.
+ */
+static void ResolveRemainingLevelsLayers(layer_data *dev_data, uint32_t* levels, uint32_t* layers,
+    VkImageSubresourceRange range, VkImage image) {
+    /* expects globalLock to be held by caller */
+
+    if ((range.levelCount != VK_REMAINING_MIP_LEVELS) && (range.layerCount != VK_REMAINING_ARRAY_LAYERS)) {
+        *levels = range.levelCount;
+        *layers = range.layerCount;
+    } else {
+        auto image_node_it = dev_data->imageMap.find(image);
+        if (image_node_it != dev_data->imageMap.end()) {
+            *levels = (range.levelCount == VK_REMAINING_MIP_LEVELS) ?
+                image_node_it->second.createInfo.mipLevels - range.baseMipLevel :
+                range.levelCount;
+
+            *layers = (range.layerCount == VK_REMAINING_ARRAY_LAYERS) ?
+                image_node_it->second.createInfo.arrayLayers - range.baseArrayLayer :
+                range.layerCount;
+        }
+    }
+}
+
 VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateImageView(VkDevice device, const VkImageViewCreateInfo *pCreateInfo,
                                                                  const VkAllocationCallbacks *pAllocator, VkImageView *pView) {
     layer_data *dev_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map);
@@ -6362,6 +6386,8 @@ VkBool32 TransitionImageLayouts(VkCommandBuffer cmdBuffer, uint32_t memBarrierCo
     layer_data *dev_data = get_my_data_ptr(get_dispatch_key(cmdBuffer), layer_data_map);
     GLOBAL_CB_NODE *pCB = getCBNode(dev_data, cmdBuffer);
     VkBool32 skip = VK_FALSE;
+    uint32_t levelCount;
+    uint32_t layerCount;
 
     for (uint32_t i = 0; i < memBarrierCount; ++i) {
         auto mem_barrier = &pImgMemBarriers[i];
@@ -6369,23 +6395,25 @@ VkBool32 TransitionImageLayouts(VkCommandBuffer cmdBuffer, uint32_t memBarrierCo
             continue;
         // TODO: Do not iterate over every possibility - consolidate where
         // possible
-        for (uint32_t j = 0; j < mem_barrier->subresourceRange.levelCount; j++) {
+        ResolveRemainingLevelsLayers(dev_data, &levelCount, &layerCount, mem_barrier->subresourceRange, mem_barrier->image);
+
+        for (uint32_t j = 0; j < levelCount; j++) {
             uint32_t level = mem_barrier->subresourceRange.baseMipLevel + j;
-            for (uint32_t k = 0; k < mem_barrier->subresourceRange.layerCount; k++) {
+            for (uint32_t k = 0; k < layerCount; k++) {
                 uint32_t layer = mem_barrier->subresourceRange.baseArrayLayer + k;
-                VkImageSubresource sub = {mem_barrier->subresourceRange.aspectMask, level, layer};
+                VkImageSubresource sub = { mem_barrier->subresourceRange.aspectMask, level, layer };
                 IMAGE_CMD_BUF_LAYOUT_NODE node;
                 if (!FindLayout(pCB, mem_barrier->image, sub, node)) {
-                    SetLayout(pCB, mem_barrier->image, sub, {mem_barrier->oldLayout, mem_barrier->newLayout});
+                    SetLayout(pCB, mem_barrier->image, sub, { mem_barrier->oldLayout, mem_barrier->newLayout });
                     continue;
                 }
                 if (mem_barrier->oldLayout == VK_IMAGE_LAYOUT_UNDEFINED) {
                     // TODO: Set memory invalid which is in mem_tracker currently
                 } else if (node.layout != mem_barrier->oldLayout) {
                     skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0,
-                                    __LINE__, DRAWSTATE_INVALID_IMAGE_LAYOUT, "DS", "You cannot transition the layout from %s "
-                                                                                    "when current layout is %s.",
-                                    string_VkImageLayout(mem_barrier->oldLayout), string_VkImageLayout(node.layout));
+                        __LINE__, DRAWSTATE_INVALID_IMAGE_LAYOUT, "DS", "You cannot transition the layout from %s "
+                        "when current layout is %s.",
+                        string_VkImageLayout(mem_barrier->oldLayout), string_VkImageLayout(node.layout));
                 }
                 SetLayout(pCB, mem_barrier->image, sub, mem_barrier->newLayout);
             }

commit 48a2c132284e71da237e5bac65affc74c3bf7007
Author: Mark Lobodzinski <mark@lunarg.com>
Date:   Wed Mar 9 13:29:00 2016 -0700

    layers:  Suppress swapchain warning message for the SDK release
    
    On certain hardware, layer was spewing the following warning message in
    the smoke demo:
    
    Swapchain(PERF): vkAcquireNextImageKHR() called when the application already
    owns all presentable images in this swapchain except for the image currently
    being displayed.  This call to vkAcquireNextImageKHR() cannot succeed unless
    another thread calls the vkQueuePresentKHR() function in order to release
    ownership of one of the presentable images of this swapchain.
    
    Change-Id: I7cafa361a79afdaa06f9aec0a8f351b1eb186bd7

diff --git a/layers/swapchain.cpp b/layers/swapchain.cpp
index a61449f..c2123f4 100644
--- a/layers/swapchain.cpp
+++ b/layers/swapchain.cpp
@@ -1781,6 +1781,9 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImageKHR(VkDevice de
             }
         }
         if (imagesOwnedByApp >= (pSwapchain->imageCount - 1)) {
+
+/*  TODO:  Temporarily disable for SDK release while correct behavior is being determined
+
             skipCall |= LOG_PERF_WARNING(VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, swapchain, "VkSwapchainKHR",
                                          SWAPCHAIN_APP_OWNS_TOO_MANY_IMAGES, "%s() called when the application "
                                                                              "already owns all presentable images "
@@ -1793,6 +1796,7 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImageKHR(VkDevice de
                                                                              "the presentable images of this "
                                                                              "swapchain.",
                                          __FUNCTION__, __FUNCTION__);
+*/
         }
     }
     if (!pImageIndex) {

commit 4cb5b318191ab8be61607b357ee61a241b6e9cb0
Author: Karl Schultz <karl@lunarg.com>
Date:   Wed Mar 9 12:48:04 2016 -0700

    Update CONTRIBUTING.md
    
    Rework info so that it can be used in the three repos.
    Fix typos

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index d95b6e7..cdc7214 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,16 +1,31 @@
-## How to Contribute to Vulkan-LoaderAndValidationLayers
+## How to Contribute to Vulkan Source Repositories
+
+### **The Repositories**
+
+The Vulkan source code is distributed across several GitHub repositories.
+The repositories sponsored by Khronos and LunarG are described here.
+In general, the canonical Vulkan Loader and Validation Layers sources are in the Khronos repository,
+while the LunarG repositories host sources for additional tools and sample programs.
+
+* [Khronos Vulkan-LoaderAndValidationLayers](https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers)
+* [LunarG VulkanTools](https://github.com/LunarG/VulkanTools)
+* [LunarG VulkanSamples](https://github.com/LunarG/VulkanSamples)
+
+As a convenience, the contents of the Vulkan-LoaderAndValidationLayers repository are downstreamed into the VulkanTools and VulkanSamples repositories via a branch named `trunk`.
+This makes the VulkanTools and VulkanSamples easier to work with and avoids compatibility issues 
+that might arise with Vulkan-LoaderAndValidationLayers components if they were obtained from a separate repository.
 
 ### **How to Submit Fixes**
 
-* **Ensure that the bug was not already reported or fixed** by searching on GitHub under [Issues](https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/issues)
-  and
-  [Pull Requests](https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/pulls).
+* **Ensure that the bug was not already reported or fixed** by searching on GitHub under Issues
+  and Pull Requests.
 * Use the existing GitHub forking and pull request process.
   This will involve [forking the repository](https://help.github.com/articles/fork-a-repo/),
   creating a branch with your commits, and then [submitting a pull request](https://help.github.com/articles/using-pull-requests/).
 * Please base your fixes on the master branch.  SDK branches are generally not updated except for critical fixes needed to repair an SDK release.
-* Please include the GitHub Issue or Pull Request number near the beginning of the commit text.
-    * Example: "GitHub PR 123: Fix missing init"
+* Please include the GitHub Issue number near the beginning of the commit text if applicable.
+    * Example: "GitHub 123: Fix missing init"
+* If your changes are restricted only to files from the Vulkan-LoaderAndValidationLayers repository, please direct your pull request to that repository, instead of VulkanTools or VulkanSamples.
 
 
 #### **Coding Conventions and Formatting**
@@ -18,21 +33,18 @@
 * Run clang-format on your changes to maintain formatting.
     * There are `.clang-format files` throughout the repository to define clang-format settings
       which are found and used automatically by clang-format.
-    * Note that there are some files that may not have been run through clang-format.
-      These should be obvious from their appearance and the number of changes that clang-format would make.
-      Don't format these files.
-      In other words, please run clang-format on your changes where appropriate.
     * A sample git workflow may look like:
 
 >        # Make changes to the source.
 >        $ git add .
->        $ clang-format -i < list of changed code files >
+>        $ clang-format -style=file -i < list of changed code files >
 >        # Check to see if clang-format made any changes and if they are OK.
 >        $ git add .
 >        $ git commit
 
 #### **Testing**
-* Run the existing tests in the repository before and after your changes to check for any regressions.
+* Run the existing tests in the repository before and after your changes to check for any regressions.  
+  There are some tests that appear in all repositories.
   These tests can be found in the following folders inside of your target build directory:
   (These instructions are for Linux)
 * In the `demos` directory, run:
@@ -51,14 +63,28 @@
 
 * Note that some tests may fail with known issues or driver-specific problems.
   The idea here is that your changes shouldn't change the test results, unless that was the intent of your changes.
+* Run tests that explicitly exercise your changes.
 * Feel free to subject your code changes to other tests as well!
 
 ### **Contributor License Agreement (CLA)**
 
+#### **Khronos Repository (Vulkan-LoaderAndValidationLayers)**
+
 The Khronos Group is still finalizing the CLA process and documentation,
 so the details about using or requiring a CLA are not available yet.
 In the meantime, we suggest that you not submit any contributions unless you are comfortable doing so without a CLA.
 
-### **Large or New Contributions**
- 
-All contributions made to the Vulkan-LoaderAndValidationLayers repository are Khronos branded and as such any new files need to have the Khronos license (MIT like) and copyright included. You can include your individual copyright after the Khronos copyright. See an existing file as an example.
+#### **LunarG Repositories**
+
+You'll be prompted with a "click-through" CLA as part of submitting your pull request in GitHub.
+
+### **License and Copyrights**
+
+All contributions made to the Vulkan-LoaderAndValidationLayers repository are Khronos branded and as such,
+any new files need to have the Khronos license (MIT style) and copyright included.
+Please see an existing file in this repository for an example.
+
+All contributions made to the LunarG repositories are to be made under the MIT license
+and any new files need to include this license and any applicable copyrights.
+
+You can include your individual copyright after any existing copyrights.

commit 491a3cd11793892b996a8b5771479cc539198f99
Author: Jon Ashburn <jon@lunarg.com>
Date:   Tue Mar 8 17:48:44 2016 -0700

    layers: clang-format  layers directory
    
    Change-Id: I318e3759829f33441e57aafedec1e9ec06d658c4

diff --git a/layers/.clang-format b/layers/.clang-format
new file mode 100644
index 0000000..cd70ac1
--- /dev/null
+++ b/layers/.clang-format
@@ -0,0 +1,6 @@
+---
+# We'll use defaults from the LLVM style, but with 4 columns indentation.
+BasedOnStyle: LLVM
+IndentWidth: 4
+ColumnLimit: 132
+...
diff --git a/layers/device_limits.cpp b/layers/device_limits.cpp
index c826314..75422bc 100644
--- a/layers/device_limits.cpp
+++ b/layers/device_limits.cpp
@@ -54,15 +54,15 @@
 
 // This struct will be stored in a map hashed by the dispatchable object
 struct layer_data {
-    debug_report_data                                  *report_data;
-    std::vector<VkDebugReportCallbackEXT>               logging_callback;
-    VkLayerDispatchTable                               *device_dispatch_table;
-    VkLayerInstanceDispatchTable                       *instance_dispatch_table;
+    debug_report_data *report_data;
+    std::vector<VkDebugReportCallbackEXT> logging_callback;
+    VkLayerDispatchTable *device_dispatch_table;
+    VkLayerInstanceDispatchTable *instance_dispatch_table;
     // Track state of each instance
-    unique_ptr<INSTANCE_STATE>                          instanceState;
-    unique_ptr<PHYSICAL_DEVICE_STATE>                   physicalDeviceState;
-    VkPhysicalDeviceFeatures                            actualPhysicalDeviceFeatures;
-    VkPhysicalDeviceFeatures                            requestedPhysicalDeviceFeatures;
+    unique_ptr<INSTANCE_STATE> instanceState;
+    unique_ptr<PHYSICAL_DEVICE_STATE> physicalDeviceState;
+    VkPhysicalDeviceFeatures actualPhysicalDeviceFeatures;
+    VkPhysicalDeviceFeatures requestedPhysicalDeviceFeatures;
     unordered_map<VkDevice, VkPhysicalDeviceProperties> physDevPropertyMap;
 
     // Track physical device per logical device
@@ -70,16 +70,9 @@ struct layer_data {
     // Vector indices correspond to queueFamilyIndex
     vector<unique_ptr<VkQueueFamilyProperties>> queueFamilyProperties;
 
-    layer_data() :
-        report_data(nullptr),
-        device_dispatch_table(nullptr),
-        instance_dispatch_table(nullptr),
-        instanceState(nullptr),


Reply to: