platform/upstream/Vulkan-LoaderAndValidationLayers.git
6 years agolayers: Reimplement vkCmdSetViewport param val.
Petr Kraus [Tue, 9 Jan 2018 21:09:25 +0000 (22:09 +0100)]
layers: Reimplement vkCmdSetViewport param val.

6 years agolayers: Implement `VkViewport` parameter_validation
Petr Kraus [Tue, 9 Jan 2018 21:09:09 +0000 (22:09 +0100)]
layers: Implement `VkViewport` parameter_validation

6 years agoandroid: Update shaderc known-good 20180216
Cody Northrop [Fri, 16 Feb 2018 14:45:27 +0000 (07:45 -0700)]
android: Update shaderc known-good 20180216

6 years agotests: Add test to verify issue 2213 fixed
Jeremy Kniager [Fri, 2 Feb 2018 22:06:10 +0000 (15:06 -0700)]
tests: Add test to verify issue 2213 fixed

Change-Id: I9776db7e08a0d69260a80f50f708db9517c68d69

6 years agolayers: clang-format only
Dave Houlton [Wed, 7 Feb 2018 17:51:23 +0000 (10:51 -0700)]
layers: clang-format only

Whole-file clang-format of layers .h and .cpp files

Change-Id: I683ad38fa9bced371a923b86d8cc916f2c2aa947

6 years agotests: clang-format only
Dave Houlton [Wed, 7 Feb 2018 00:49:16 +0000 (17:49 -0700)]
tests: clang-format only

No code changes, just full clang-format.

Change-Id: I096d1b5509897bd642545e3369ccd83ca2849441

6 years agoloader: Don't add duplicate JSON files from Khronos registry path.
Norbert Garnys [Tue, 13 Feb 2018 15:32:03 +0000 (16:32 +0100)]
loader: Don't add duplicate JSON files from Khronos registry path.

To make sure we avoid enumerating old JSON files/drivers that might be present
in the non-device specific area of the registry when a newer device specific
JSON file is present, do a check before adding.
Find the file name, without path, of the JSON file found in the non-device
specific registry location. If the same JSON file name is already found in
the list, don't add it again.

6 years agolayers:Verify sparse image metadata is bound
Tobin Ehlis [Thu, 8 Feb 2018 21:10:35 +0000 (14:10 -0700)]
layers:Verify sparse image metadata is bound

Any image for which sparse memory requirements are bound, flag if that
image requires metadata. When binding sparse memory, for any image that
requires metadata and no metadata was bound, issue a warning.

6 years agolayers:Add sparse mem warning if reqs not checked
Tobin Ehlis [Thu, 8 Feb 2018 20:30:56 +0000 (13:30 -0700)]
layers:Add sparse mem warning if reqs not checked

If vkQueueBindSparse() is called to bind sparse memory to an image,
trigger a warning if the user has not queried sparse requirements for
that image.

6 years agolayers:Track sparse image requirements
Tobin Ehlis [Thu, 8 Feb 2018 18:19:10 +0000 (11:19 -0700)]
layers:Track sparse image requirements

Add image state tracking for if sparse memory requirements have been
queried and when they are queried, save the requirements.

6 years agolayers:Adding intercepts for sparse binding
Tobin Ehlis [Thu, 8 Feb 2018 15:59:22 +0000 (08:59 -0700)]
layers:Adding intercepts for sparse binding

Intercept vkGetImageSparseMemoryRequirements() and
vkGetPhysicalDeviceSparseImageFormatProperties() functions and their
2KHR equivalents in core_validation in preparation for adding sparse
checks. Initially just pass-through intercepts.

6 years agolayers: fix unexpected errors in layer tests
Jeremy Kniager [Thu, 25 Jan 2018 18:41:20 +0000 (11:41 -0700)]
layers: fix unexpected errors in layer tests

Adjusted to not conflict with PR #2387

Change-Id: I7afc90577cb269070beda4f33bb04ab2a2c28f40

6 years agolayers:Fix spelling truely->truly
Tobin Ehlis [Tue, 13 Feb 2018 16:35:47 +0000 (09:35 -0700)]
layers:Fix spelling truely->truly

6 years agoloader: Fix loader skipping layer files
Lenny Komow [Tue, 13 Feb 2018 17:30:02 +0000 (10:30 -0700)]
loader: Fix loader skipping layer files

Fix a bug where having a json file in the layer path that isn't a
valid layer would cause the other valid layers to be skipped

Change-Id: I8346bd223358f271a48799d249d3b3a941dd31f8

6 years agolayers:Fix typo databate->database
Tobin Ehlis [Tue, 13 Feb 2018 14:41:17 +0000 (07:41 -0700)]
layers:Fix typo databate->database

6 years agolayers:Remove TODO comments
Tobin Ehlis [Tue, 13 Feb 2018 14:36:54 +0000 (07:36 -0700)]
layers:Remove TODO comments

After discussion in Khronos, explicit VUIDs for these descriptor set
lifetime cases are not going to be added to the spec. There are no
similar VUs for related object lifetime cases so will continue using
the existing VUIDs for valid descriptor set handles which is a
reasonable compromise.

6 years agoloader: link with OneCore umbrella library
Slawomir Cygan [Thu, 25 Jan 2018 12:51:17 +0000 (13:51 +0100)]
loader: link with OneCore umbrella library

This change makes loader use OneCore umbrella[2] library, common
to all Windows 10 devices and required with for Universal
Windows drivers[1].

As this change may not be compatible with previous versions of
Windows, it's enabled via CMAKE option:
   -DENABLE_WIN10_ONECORE=1

[2] https://msdn.microsoft.com/en-us/library/windows/desktop/mt654039(v=vs.85).aspx
[1] https://docs.microsoft.com/en-us/windows-hardware/drivers/develop/getting-started-with-universal-drivers

Change-Id: Ib677face131ab2edb3e8cd2f764fe4e0ca44cecc

6 years agoloader: use Unicode functions from cfgmgr32.lib
Slawomir Cygan [Thu, 25 Jan 2018 12:48:54 +0000 (13:48 +0100)]
loader: use Unicode functions from cfgmgr32.lib

This change improves loader compatibility with Universal
Windows drivers[1]: do not use removed ANSI-based functions,
use Unicode equivalentsexposed in umbrella[2] library.

[1] https://docs.microsoft.com/en-us/windows-hardware/drivers/develop/getting-started-with-universal-drivers
[2] https://msdn.microsoft.com/en-us/library/windows/desktop/mt654039(v=vs.85).aspx

Change-Id: I8ead9c46815d15e1b2f2226eb30110c8efa4ec75

6 years agoloader: remove references to shlwapi.lib
Slawomir Cygan [Wed, 24 Jan 2018 14:34:15 +0000 (15:34 +0100)]
loader: remove references to shlwapi.lib

This change improves loader compatibility with Universal
Windows drivers[1]: shlwapi.lib is not a part of allowed APIs.

It seems PathFileExists call was already redundant as
ERROR_MOD_NOT_FOUND was already returned by the loader in
cse of wrong dll path.

PathIsRelative is replaced by equivalent check.

[1] https://docs.microsoft.com/en-us/windows-hardware/drivers/develop/getting-started-with-universal-drivers

Change-Id: I36854f38078670ac033e8bd415dbf368391e8448

6 years agowinsdk: Update runtime installer copyright to 2018
Lenny Komow [Thu, 8 Feb 2018 17:55:26 +0000 (10:55 -0700)]
winsdk: Update runtime installer copyright to 2018

Change-Id: If27613c85c754d4a54f5afa4dd3a6976695b227e

6 years agobuild: Add min supported compiler versions to BUILD.md
Mark Lobodzinski [Wed, 7 Feb 2018 23:33:33 +0000 (16:33 -0700)]
build: Add min supported compiler versions to BUILD.md

Change-Id: I694aaf18e3f4f1d458fa2a4f84f84c4553e93a0a

6 years agolayers: Avoid warnings in vk_layer_logging.h
Mark Lobodzinski [Wed, 7 Feb 2018 17:00:22 +0000 (10:00 -0700)]
layers: Avoid warnings in vk_layer_logging.h

This file was often included in files where only a subset of the
functions were called, resulting in -Wunused_function warnings from
GCC. Made these functions inline to avoid the warnings.

Change-Id: Iaa3765ee51a290f0dd82d1a6a91116b6e1eec2c1

6 years agodemos: Let vulkaninfo accept empty DISPLAY variable
Petr Kraus [Tue, 6 Feb 2018 03:33:38 +0000 (04:33 +0100)]
demos: Let vulkaninfo accept empty DISPLAY variable

6 years agoandroid: Update to shaderc known-good revisions
Cody Northrop [Tue, 6 Feb 2018 22:12:36 +0000 (15:12 -0700)]
android: Update to shaderc known-good revisions

6 years agoexternal: Update glslang commit ID, fix LVT
Mark Lobodzinski [Tue, 6 Feb 2018 17:05:06 +0000 (10:05 -0700)]
external: Update glslang commit ID, fix LVT

Updated glslang revision to TOT, fixed layer validation test for
new spirv-validator message output.

Change-Id: I8c31d6cfc09cf73f4235b2159e3fe4e6ec289330

6 years agobuild: Adjust travis config for VT updates
Karl Schultz [Tue, 6 Feb 2018 13:12:35 +0000 (06:12 -0700)]
build: Adjust travis config for VT updates

- VT update external script no longer accepts jsoncpp flag
  so remove call to build it.  The script now builds it all the time.
- Add back cmake flag to turn off LVL layers build.  LVL should
  now build the layer utils even with layer build disabled.  VT
  needs the layer utils to build devsim.

Change-Id: I1c5421d4b5553b3d39f68f075ee5850588696775

6 years agoclang-format whitespace (sigh)
Dave Houlton [Fri, 2 Feb 2018 23:32:41 +0000 (16:32 -0700)]
clang-format whitespace (sigh)

Change-Id: I52d956163900465e434f68aa185618a2469f243f

6 years agotests: Fix Travis-visible errors
Dave Houlton [Fri, 2 Feb 2018 20:24:59 +0000 (13:24 -0700)]
tests: Fix Travis-visible errors

Fix a couple test errors that aren't visible to the local CI,
but are caught by Travis.

Change-Id: I618e102ccc7dd27b4d3ebeaa596d3fbe059a99f0

6 years agotests: Add test for new CreateImage VUs
Dave Houlton [Wed, 31 Jan 2018 20:01:42 +0000 (13:01 -0700)]
tests: Add test for new CreateImage VUs

Add ImageCreateInfoStructErrors positive test, provokes new
ImageCreateInfo struct VU errors.

Change-Id: Ia7b2b955ded6b4851d936758047eeb7462e630cc

6 years agotests: Fix existing tests that hit new VUs
Dave Houlton [Tue, 30 Jan 2018 22:03:43 +0000 (15:03 -0700)]
tests: Fix existing tests that hit new VUs

Fix existing tests that were inadvertently triggering the
newly added valid usage checks.

Change-Id: I0a6baa4df36c2316070e73f8959d55b4ca6a30f8

6 years agolayers: Add CreateImage valid usage checks
Dave Houlton [Mon, 29 Jan 2018 20:39:56 +0000 (13:39 -0700)]
layers: Add CreateImage valid usage checks

Adds 17 valid usage checks of ImageCreateInfo struct. 13 in core
validation, 4 in parameter validation.

Change-Id: I4bfe195f88d5e14237c1b01c5aca2de7c578aa67

6 years agobuild: Move layer_utils build to top-level cmake
Mark Lobodzinski [Fri, 2 Feb 2018 20:58:41 +0000 (13:58 -0700)]
build: Move layer_utils build to top-level cmake

DevSim requires this library, but it is only built in LVL if LAYERS
are built. Moved the generation of this library out of the layers
cmake file and into the root cmake file.

Change-Id: I1c633e981fa1843cfb49204d2ac130beb8d99dfc

6 years agoicd: Remove dead code from CMakeLists.txt
Mark Lobodzinski [Fri, 2 Feb 2018 18:40:50 +0000 (11:40 -0700)]
icd: Remove dead code from CMakeLists.txt

Change-Id: I6b60b2e71568a3a88a3366b04ab7cf911fa05526

6 years agoscripts: Update android-generate to support UUID
Cody Northrop [Mon, 5 Feb 2018 19:03:10 +0000 (12:03 -0700)]
scripts: Update android-generate to support UUID

This allows use of the script as is, automatically
selecting git_dir vs. rev_file based on detected paths.

6 years agoscripts: Fix error if spirv-tools dir had no .git (#2346)
Cort Stratton [Fri, 2 Feb 2018 07:25:21 +0000 (23:25 -0800)]
scripts: Fix error if spirv-tools dir had no .git (#2346)

external_revision_generator.py generates a UUID for
VkValidationCacheEXT objects created by the layers, based on
the commit ID of the HEAD revision in the spirv-tools repo
used to build those layers. This implicitly required that
the spirv-tools source is hosted in a Git repository, which
is not the case in all validation layers build environments.

The script has been modified to accept *either* a path to
a Git working directory to query *or* a path to a file whose
contents are SHA1-hashed (if necessary) and treated as the
"commit ID" for the project.

Call sites for the script in the CMake and Android build paths
have been updated to use the --git_dir approach by default,
which matches the pre-existing behavior.

6 years agolayers: Improve validation cache ID parsing
Cort Stratton [Fri, 2 Feb 2018 07:14:50 +0000 (23:14 -0800)]
layers: Improve validation cache ID parsing

- Code previously assumed that SPIRV_TOOLS_COMMIT_ID was a SHA1 hash;
  this assumption is now more explicit.
- Replace some literal constants with VK_UUID_SIZE.
- Handle the purely hypothetical case where VK_UUID_SIZE*2 > SHA1 size

6 years agolayers: Add err-id/coverage for 'recording state'
John Zulauf [Tue, 30 Jan 2018 22:04:56 +0000 (15:04 -0700)]
layers: Add err-id/coverage for 'recording state'

Added map from CMD_TYPE to validation error for "must be in the
recording state" valid usage ID.  Add complete check coverage
(except vendor/KHX extensions) for this class of VUID.  Coverted
existing checks to use common code.

Change-Id: I38f71cce2a0f090f2685074239a1b429bbf95d8c

6 years agolayers: Fully normalize/populate CMD_TYPE enum
John Zulauf [Tue, 30 Jan 2018 16:24:38 +0000 (09:24 -0700)]
layers: Fully normalize/populate CMD_TYPE enum

Add all vkCmd.* (plus vkEndCommandBuffer) to the CMD_TYPE, normalizing
the naming to be consistent with the function names.

Change-Id: I50503a4e180d726b330c42db050a1336221213f6

6 years agocmake: Move LVL temp/worker targets into subfolder
Mark Lobodzinski [Thu, 1 Feb 2018 16:27:03 +0000 (09:27 -0700)]
cmake: Move LVL temp/worker targets into subfolder

This sets up cmake to locate the temporary or worker MSVC projects
into a subfolder called lvl_cmake_targets. This simply unclutters
the Visual Studio Solution Explorer projects pane, and does not
affect functionality.

Change-Id: I6933d05758d6f174a4f66ceaef51d43627210e4f

6 years agotests: Fix various issues in VkLayerTest.IncompatibleRenderPass
Chris Forbes [Wed, 31 Jan 2018 19:44:53 +0000 (11:44 -0800)]
tests: Fix various issues in VkLayerTest.IncompatibleRenderPass

- Swap the roles of the two renderpasses to avoid CmdBeginRenderPass
complaining about mismatches between framebuffer and rp
- Get rid of spurious input attachment which caused extra error
messages. If the input attachment case is interesting, we should test
for it separately. The rest of this test only cares about a format
difference between the renderpasses.

6 years agobuild: Need to build LVL layers in CI to get utils
Karl Schultz [Thu, 1 Feb 2018 21:31:01 +0000 (14:31 -0700)]
build: Need to build LVL layers in CI to get utils

Layer utils now exist only in LVL, so when we build VulkanTools
in LVL CI (just to get devsim layer), we need to turn on LVL
layer building in order to get the layer util libs.

Change-Id: I4cc6df4ed0a782afeec19c61dc05bcc2bad47756

6 years agolayers: Add LAYER_EXPORT specifiers to vk_layer_config
Mark Lobodzinski [Thu, 1 Feb 2018 19:14:30 +0000 (12:14 -0700)]
layers: Add LAYER_EXPORT specifiers to vk_layer_config

Required for hassle-free linking to layer_utils lib.

6 years agodemos: Fix output location of smoketest
Mark Lobodzinski [Tue, 30 Jan 2018 23:09:08 +0000 (16:09 -0700)]
demos: Fix output location of smoketest

6 years agotests: Positive test case for KHR bind mem 2
Mike Schuchardt [Thu, 18 Jan 2018 23:54:57 +0000 (16:54 -0700)]
tests: Positive test case for KHR bind mem 2

Add positive test case with simple usage of VK_KHR_bind_memory2 that was
causing incorrect validation errors.

Change-Id: I9502b5f933e288c6d20f909d9d007b3b1e3abdef

6 years agolayers: Pass through bind mem 2 entry point names
Mike Schuchardt [Thu, 25 Jan 2018 20:44:17 +0000 (13:44 -0700)]
layers: Pass through bind mem 2 entry point names

Change-Id: I62510d1759c7cd3ca81b3c7e57a153b7c863250b

6 years agolayers: Bind mem 2 entry points
Mike Schuchardt [Fri, 19 Jan 2018 00:59:06 +0000 (17:59 -0700)]
layers: Bind mem 2 entry points

Add entry points for VK_KHR_bind_memory2 and wire up to existing
validation

Change-Id: Iab17ead7a6f6f44fdbdf2ad5033d2ea7e47447d0

6 years agotests: Positive test case for KHR memory req 2
Mike Schuchardt [Wed, 10 Jan 2018 22:05:11 +0000 (15:05 -0700)]
tests: Positive test case for KHR memory req 2

Add positive test case with simple usage of
VK_KHR_get_memory_requirements2 that was causing incorrect validation
errors.

Change-Id: I07355823fddc865a7d5e1369ffe45d5bf1fe3f8e

6 years agolayers: Mem reqs 2 entry points
Mike Schuchardt [Wed, 10 Jan 2018 22:11:06 +0000 (15:11 -0700)]
layers: Mem reqs 2 entry points

Add entry points for VK_KHR_get_memory_requirements2 and wire up to
existing validation.

Change-Id: I3f9170b0171efc5a22ddb1e3b68185cedd17bca5

6 years agotests: Add unit test for push descriptor set VUIDs
John Zulauf [Fri, 26 Jan 2018 18:46:12 +0000 (11:46 -0700)]
tests: Add unit test for push descriptor set VUIDs

Add the unit test case for the following added checks.
VALIDATION_ERROR_1be02415
VALIDATION_ERROR_1be002d6
VALIDATION_ERROR_1be002da
VALIDATION_ERROR_1be002d8
VUID-vkCmdPushDescriptorSetKHR-commandBuffer-recording

Change-Id: Ib9aa008ab87dddead3eb086d5c8ed3fb94f5f187

6 years agotests: Add queue family selection utility
John Zulauf [Fri, 26 Jan 2018 18:35:17 +0000 (11:35 -0700)]
tests: Add queue family selection utility

Add additional queue family selection utility for choosing queue
families based on both required and restricted capabilities.  Refactored
existing utility to use new utility.

Change-Id: I3c92cfdbbe6463bf1730f2173e91424e082063ce

6 years agolayers: Add CmdPushDescriptorSet parameter checks
John Zulauf [Fri, 26 Jan 2018 18:23:10 +0000 (11:23 -0700)]
layers: Add CmdPushDescriptorSet parameter checks

Added the stateful parameter checks for push descriptor.

VALIDATION_ERROR_1be02415
  VUID-vkCmdPushDescriptorSetKHR-commandBuffer-cmdpool
  The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations
VALIDATION_ERROR_1be002d6
  VUID-vkCmdPushDescriptorSetKHR-pipelineBindPoint-00363
  pipelineBindPoint must be supported by the commandBuffer's parent VkCommandPool's queue family
VALIDATION_ERROR_1be002da
  VUID-vkCmdPushDescriptorSetKHR-set-00365
  set must be the unique set number in the pipeline layout that uses a descriptor set layout that was created with VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR
VALIDATION_ERROR_1be002d8
  VUID-vkCmdPushDescriptorSetKHR-set-00364
  set must be less than VkPipelineLayoutCreateInfo::setLayoutCount provided when layout was created
// Not implemented using VUID as ValidateCmd currently doesn't support (TODO)
VUID-vkCmdPushDescriptorSetKHR-commandBuffer-recording
  commandBuffer must be in the recording state

Change-Id: I52f39780003e23953dd2dc46ec007e884c04fa5b

6 years agolayers: Improve doc validation init-list parsing
John Zulauf [Fri, 26 Jan 2018 20:42:08 +0000 (13:42 -0700)]
layers: Improve doc validation init-list parsing

Change VALIDATION_ERROR_ parsing to correctly recognize error ids in
initializer lists, including the formatting as done by clang-format.
{VALIDATION_ERRROR_nnnn, ... VALIDATION_ERROR_nnnn}

Change-Id: I25a1c0d0c9181ece458f7c83d2f184abea8d1f4a

6 years agotests: Add test for push descriptor allocation
John Zulauf [Wed, 24 Jan 2018 18:56:18 +0000 (11:56 -0700)]
tests: Add test for push descriptor allocation

Add unit test case for attempting to use vkAllocateDescriptorSets with a
descriptor set layout created with the push descriptor flag
VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR set.

Test cases added:
VALIDATION_ERROR_04c00268
    VUID-VkDescriptorSetAllocateInfo-pSetLayouts-00308

Change-Id: If11e12a3dd51f4c796178b89d8e9077a5227407c

6 years agolayers: Add check for push descriptor allocation
John Zulauf [Wed, 24 Jan 2018 18:54:05 +0000 (11:54 -0700)]
layers: Add check for push descriptor allocation

Add validation check for attempting to use vkAllocateDescriptorSets with
a descriptor set layout create with the push descriptor flag
VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR set.

Checks added:
VALIDATION_ERROR_04c00268
    VUID-VkDescriptorSetAllocateInfo-pSetLayouts-00308

Change-Id: I81bed8e7eb5396f7a716b6a14b648b5051127259

6 years agotests: Add tests for push DS layout create VUIDs
John Zulauf [Tue, 23 Jan 2018 18:57:46 +0000 (11:57 -0700)]
tests: Add tests for push DS layout create VUIDs

Added tests for additional valid usage checks:
VALIDATION_ERROR_05000230  VkDescriptorSetLayoutCreateInfo-flags-00280
VALIDATION_ERROR_05000232  VkDescriptorSetLayoutCreateInfo-flags-00281

Added test for "required extension" present check for creation of DS
layout with push descriptors flag set.

Change-Id: Ia274d9ce3ee38ec686e52c4101a6d0573294f852

6 years agolayers: Add push descriptor set layout create VUID
John Zulauf [Tue, 23 Jan 2018 18:27:35 +0000 (11:27 -0700)]
layers: Add push descriptor set layout create VUID

Add VUID checks to vkCreateDescriptorSetLayout for push descriptor sets.
Additional checks include:

VALIDATION_ERROR_05000230  VkDescriptorSetLayoutCreateInfo-flags-00280
VALIDATION_ERROR_05000232  VkDescriptorSetLayoutCreateInfo-flags-00281

Also added check for use of
VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR when the
required extension VK_KHR_push_descriptor is not enabled.

Updated CreateDescriptorSetBindingWithIgnoredSamplers test, which
violated the above check.

Change-Id: Ie009019bbb7859553df92473796a1a929a9464f7

6 years agoicd: Add VK_KHR_push_descriptor to blacklist
John Zulauf [Tue, 23 Jan 2018 23:30:00 +0000 (16:30 -0700)]
icd: Add VK_KHR_push_descriptor to blacklist

As VK_KHR_get_physical_device_properties2 pNext structure queries are
not implemented within mock_icd,
VkPhysicalDevicePushDescriptorPropertiesKHR::maxPushDescriptors cannot
be queried by the validation layers, causing numerous test failures when
this limit is checked (in a subsequen commit).  Added to ignore until
such time it is correctly reported.

Change-Id: I77b9a37c9ab2ce3e730b7fa6596e23ccc2be8d8c

6 years agolayer: Add utility template for sType init
John Zulauf [Tue, 23 Jan 2018 18:20:50 +0000 (11:20 -0700)]
layer: Add utility template for sType init

Add utility function to auto populate sType field based on typename
given to autogen of typemap helper. Return value optimization (copy
elision) should make this perfomance neutral vs. inline init.

Change-Id: I231cf92d5063c19f9ad5b14189dd162fdac76a43

6 years agoDon't complain about unused vertex buffers being VK_NULL_HANDLE
Chris Forbes [Wed, 24 Jan 2018 18:53:21 +0000 (10:53 -0800)]
Don't complain about unused vertex buffers being VK_NULL_HANDLE

6 years agodemos: Update cube/smoke for submodule compatibility
Mark Lobodzinski [Wed, 24 Jan 2018 00:54:26 +0000 (17:54 -0700)]
demos: Update cube/smoke for submodule compatibility

6 years agocmake: Fix glslang validator cmake hint path
Mark Lobodzinski [Tue, 23 Jan 2018 22:56:01 +0000 (15:56 -0700)]
cmake: Fix glslang validator cmake hint path

Change-Id: I098b4ce4dcb924bcc1fc15da50332118a0756a43

6 years agotests: Clean up/use framework in DSUsageBitsErrors
John Zulauf [Thu, 18 Jan 2018 23:55:22 +0000 (16:55 -0700)]
tests: Clean up/use framework in DSUsageBitsErrors

Cleaned up DSUsageBitsError, using the framework calls to reduce
boilerplate code to improve maintainability and readability.

Change-Id: I38f40ab2392f9877939f25c1df54ef07d74c0f36

6 years agotests: Add create_info to two additional wrappers
John Zulauf [Thu, 18 Jan 2018 23:53:07 +0000 (16:53 -0700)]
tests: Add create_info to two additional wrappers

Added create_info utilies to BufferView and DescriptorPool in
vk_testing.

Change-Id: I0039aa7177e34a0acc40ec3be5f59957b242bcb6

6 years agotests: Add barrier queue family index tests
John Zulauf [Tue, 16 Jan 2018 18:48:49 +0000 (11:48 -0700)]
tests: Add barrier queue family index tests

Add validation layer tests for Buffer and Image memory barriers.

VUIDs test refactored(*)/new:
VALIDATION_ERROR_0a000960*   VUID-VkImageMemoryBarrier-image-01200
VALIDATION_ERROR_0a000962    VUID-VkImageMemoryBarrier-image-01201
VALIDATION_ERROR_0a00096a    VUID-VkImageMemoryBarrier-image-01205
VALIDATION_ERROR_0a000dce    VUID-VkImageMemoryBarrier-image-01767
VALIDATION_ERROR_0a000dd0    VUID-VkImageMemoryBarrier-image-01768
VALIDATION_ERROR_0a00095e    VUID-VkImageMemoryBarrier-image-01199
VALIDATION_ERROR_0a000aca    VUID-VkImageMemoryBarrier-image-01381
VALIDATION_ERROR_0a000dcc    VUID-VkImageMemoryBarrier-image-01766

VALIDATION_ERROR_0180094e    VUID-VkBufferMemoryBarrier-buffer-01191
VALIDATION_ERROR_01800dc6    VUID-VkBufferMemoryBarrier-buffer-01763
VALIDATION_ERROR_01800952    VUID-VkBufferMemoryBarrier-buffer-01193
VALIDATION_ERROR_01800dca    VUID-VkBufferMemoryBarrier-buffer-01765
VALIDATION_ERROR_01800dc8    VUID-VkBufferMemoryBarrier-buffer-01764
VALIDATION_ERROR_0180094c    VUID-VkBufferMemoryBarrier-buffer-01190
VALIDATION_ERROR_01800950    VUID-VkBufferMemoryBarrier-buffer-01192
VALIDATION_ERROR_01800958    VUID-VkBufferMemoryBarrier-buffer-01196

Change-Id: Icf5d7f1ddbeeab90324cfb034648813741a65398

6 years agotests: Add VK_SHARING_MODE_CONCURRENT support
John Zulauf [Tue, 16 Jan 2018 18:15:15 +0000 (11:15 -0700)]
tests: Add VK_SHARING_MODE_CONCURRENT support

Added support for the creation of buffer and image resources with
VK_SHARING_MODE_CONCURRENT in framework.

Change-Id: Ie3c042d20a01b6988a15e225427a547689de96d1

6 years agolayers: Refactor and add image/buffer barrier VUID
John Zulauf [Fri, 5 Jan 2018 21:15:35 +0000 (14:15 -0700)]
layers: Refactor and add image/buffer barrier VUID

Refactor existing image barrier VUIDs for source and destination queue
family index validation to include all queue family tests.  Refactor
validation enables reuse by buffers, all VUID's have parallel usages.

Extant test for VUID...1200 was converted to use VALIDATION_ERROR_...
semantics.

VUIDs refactored(*)/new:
VALIDATION_ERROR_0a000960*   VUID-VkImageMemoryBarrier-image-01200
VALIDATION_ERROR_0a000962    VUID-VkImageMemoryBarrier-image-01201
VALIDATION_ERROR_0a00096a    VUID-VkImageMemoryBarrier-image-01205
VALIDATION_ERROR_0a000dce    VUID-VkImageMemoryBarrier-image-01767
VALIDATION_ERROR_0a000dd0    VUID-VkImageMemoryBarrier-image-01768
VALIDATION_ERROR_0a00095e*   VUID-VkImageMemoryBarrier-image-01199
VALIDATION_ERROR_0a000aca    VUID-VkImageMemoryBarrier-image-01381
VALIDATION_ERROR_0a000dcc    VUID-VkImageMemoryBarrier-image-01766

VALIDATION_ERROR_0180094e    VUID-VkBufferMemoryBarrier-buffer-01191
VALIDATION_ERROR_01800dc6    VUID-VkBufferMemoryBarrier-buffer-01763
VALIDATION_ERROR_01800952    VUID-VkBufferMemoryBarrier-buffer-01193
VALIDATION_ERROR_01800dca    VUID-VkBufferMemoryBarrier-buffer-01765
VALIDATION_ERROR_01800dc8    VUID-VkBufferMemoryBarrier-buffer-01764
VALIDATION_ERROR_0180094c    VUID-VkBufferMemoryBarrier-buffer-01190
VALIDATION_ERROR_01800950    VUID-VkBufferMemoryBarrier-buffer-01192
VALIDATION_ERROR_01800958    VUID-VkBufferMemoryBarrier-buffer-01196

Change-Id: I9568e8f77df1cf030dfaf60877deab37e8e12e38

6 years agocmake: Fix externals for submodule/subtree builds
Mark Lobodzinski [Mon, 22 Jan 2018 23:42:02 +0000 (16:42 -0700)]
cmake: Fix externals for submodule/subtree builds

Change-Id: Ia1c31ff75c9bf5c3d1ae9b903213437c3ae1ef06

6 years agoscripts: Exit from vuid_mapping.py with status 1 on errors
Jean-François Roy [Mon, 22 Jan 2018 23:05:11 +0000 (15:05 -0800)]
scripts: Exit from vuid_mapping.py with status 1 on errors

This patch modifies scripts/vuid_mapping.py to exit with status 1 on
errors. This allows the build system to fail code generation rules that
depend on this script.

Change-Id: I5659ae80e1989ea7530c9257e7619a9b35cc7294

6 years agocmake: Add PROJECT_BINARY_DIR to cmake files
Mark Lobodzinski [Fri, 19 Jan 2018 19:04:16 +0000 (12:04 -0700)]
cmake: Add PROJECT_BINARY_DIR to cmake files

Tests and test/layers CMakeLists.txt files were missing
this include path variable. This prevents LVL from building when
used as a submodule.

Change-Id: I0746b9ef280ca0bdd75a0a539c5bdc78114a60ba

6 years agocmake: Fix non-existant cmake variable
Mark Lobodzinski [Fri, 19 Jan 2018 18:50:58 +0000 (11:50 -0700)]
cmake: Fix non-existant cmake variable

Specified cmake variable does not exist, caused problems in some
out-of-source builds.

Change-Id: I526117ef060efea40451752e5fe7bad1e7a5589e

6 years agoloader: Fix static library initialization
Lenny Komow [Fri, 19 Jan 2018 18:22:28 +0000 (11:22 -0700)]
loader: Fix static library initialization

Fix the loader's global initialization being skipped when the loader
is built as a static library on windows

Change-Id: I492f87104fb3bf32aed3c7d251dee2caeb4f00ba

6 years agoloader: Restore pNext data in CreateDevice
Joey Bzdek [Mon, 23 Oct 2017 23:13:33 +0000 (17:13 -0600)]
loader: Restore pNext data in CreateDevice

In the terminator for CreateDevice, the
VkDeviceGroupDeviceCreateInfoKHX struct in the pNext chain is
replaced by a copy that has VkPhysicalDevice handles remapped. At the
end of the terminator, restore the modified pNext pointer to
partially comply to the const argument and give consistent behavior
to the caller.

Change-Id: I83a60a0102a736d056729383733e62b38b0ace2c

6 years agotravis: fix clang-format nit
Dave Houlton [Fri, 19 Jan 2018 22:11:51 +0000 (15:11 -0700)]
travis: fix clang-format nit

Change-Id: I119143fbe481fcbdea527b44d0d64e6a150ce186

6 years agotests: add test for new multiplanar VUIDs
Dave Houlton [Fri, 19 Jan 2018 19:55:14 +0000 (12:55 -0700)]
tests: add test for new multiplanar VUIDs

Change-Id: Ie3d95d1de3363f81eae31bc11cf9d3fe4655dec7

6 years agolayers: Add GetImgSubrscLayout multi-planar VUIDs
Dave Houlton [Fri, 19 Jan 2018 19:17:05 +0000 (12:17 -0700)]
layers: Add GetImgSubrscLayout multi-planar VUIDs

Adds new VUIDs defined in the VK_KHR_sampler_ycbcr_conversion
extension to vkGetImageSubresourceLayouts(), and corrects the
false positive error reported in GH issue #2350.

Change-Id: Ia2814291291c7109fabd33af6119a9209e08dd51

6 years agotests: Add positive test, repro GH issue 2350
Dave Houlton [Fri, 19 Jan 2018 00:04:13 +0000 (17:04 -0700)]
tests: Add positive test, repro GH issue 2350

GetImageSubresourceLayout() validation produces a false positive
when the image uses a multi-planar format defined in the
VK_KHR_sampler_ycbcr_conversion extension. This test reproduces
the error reported in github issue #2350.

Change-Id: I358c041ce6a5847dec9aaa60fa4d94f2deb302a6

6 years agoloader: Fix enabling extensions from layers
Lenny Komow [Wed, 17 Jan 2018 20:53:59 +0000 (13:53 -0700)]
loader: Fix enabling extensions from layers

This resolves a bug where it was impossible to enable an extension
that was defined in a layer if that layer was not passed by the
application. This applied to implicit layers, explicit layers enabled
by environment variables, and metalayers.

Change-Id: I03bee6fb778936d970f78b9142679654424f80ae

6 years agotests: Add validation for layout lifetime issues
John Zulauf [Wed, 17 Jan 2018 18:23:49 +0000 (11:23 -0700)]
tests: Add validation for layout lifetime issues

Add unit tests for valid usages that flag when descriptor set update
operations are being performed with descriptor sets create from
destroyed descriptor set layouts. The tests use overloaded VUIDs
(generic "must be valid * handles) which need to be replaced (and
unclaimed) with specific ones when they are added to the spec.

    VALIDATION_ERROR_15c00280 (write dst must be valid) ->
            write dst created from destroyed layout
    VALIDATION_ERROR_03207601 (copy dst must be valid) ->
            copy dst created from destroyed layout
    VALIDATION_ERROR_0322d201 (copy src must be valid) ->
            copy src created from destroyed layout

Change-Id: Ic37a745120899c072e2e5d8ceb96c5d93074355e

6 years agolayers: Add validation for destroyed layouts
John Zulauf [Wed, 17 Jan 2018 18:06:34 +0000 (11:06 -0700)]
layers: Add validation for destroyed layouts

Add three tests to flag with descriptor set update operations are being
done to descriptor sets with destroyed descriptor set layouts. The tests
use overload VUID (generic "must be valid * handles) which need to be
replaced with specific ones when they are added to the spec.

VALIDATION_ERROR_15c00280 (write dst must be valid) ->
write dst created from destroyed layout
VALIDATION_ERROR_03207601 (copy dst must be valid) ->
copy dst created from destroyed layout
VALIDATION_ERROR_0322d201 (copy src must be valid) ->
copy src create from destroyed layout

Change-Id: I8a3edc67b3e86037cdaa6353176814abfddef1a0

6 years agolayers: Add printf style formatting of std::string
John Zulauf [Wed, 17 Jan 2018 18:00:22 +0000 (11:00 -0700)]
layers: Add printf style formatting of std::string

Added utility for formatting output to std::string, using sprintf style
arguments.

Change-Id: Ib95fb55f38cc85a1b24cf6aac7761fc9b7c67376

6 years agolayers: clang-format parameter_validation_utils.cpp
Dave Houlton [Wed, 17 Jan 2018 17:13:33 +0000 (10:13 -0700)]
layers: clang-format parameter_validation_utils.cpp

Change-Id: I3ade2b8c7dc63f0b902b17d8cc3f9c48ca21fb23

6 years agotests: Add tests for CmdDispatch params
Dave Houlton [Tue, 16 Jan 2018 21:56:08 +0000 (14:56 -0700)]
tests: Add tests for CmdDispatch params

Change-Id: I087f412f3eccd02f040936d917eeea057e55407e

6 years agolayers: Add group size param checks to CmdDispatch
Dave Houlton [Fri, 12 Jan 2018 00:09:16 +0000 (17:09 -0700)]
layers: Add group size param checks to CmdDispatch

Added parameter validation checks to group size parameters against
device limits, for vkCmdDispatch() and vkCmdDispatchBaseKHX().

Change-Id: Ic41031d694c6d311431fc49f48b1427a2b042337

6 years agolayers: Fix doc validation file list check
John Zulauf [Tue, 16 Jan 2018 22:32:45 +0000 (15:32 -0700)]
layers: Fix doc validation file list check

The check for required files was counting the files multiple times and
aborting silently.  The check now correct counts files and exits with
non-zero exit code on failure.

Change-Id: I5b158f7cca0dd541571d95c00c3450139daf32c4

6 years agoheader: Update to version 1.0.68 of the Vulkan hdr
Mark Lobodzinski [Tue, 16 Jan 2018 17:40:16 +0000 (10:40 -0700)]
header: Update to version 1.0.68 of the Vulkan hdr

- updated vulkan.h
- updated vk.xml
- updated layer json files
- built and updated vulkan.hpp
- updated vk_validation_error_messages.h
- updated vk_validation_error_database.txt

Change-Id: I5aff6147531f9b91164849ee590f7f86e46e4652

6 years agoloader: Clean up mutexes on destruction
Lenny Komow [Mon, 15 Jan 2018 22:43:36 +0000 (15:43 -0700)]
loader: Clean up mutexes on destruction

Change-Id: I7d1524da9167a576420c109ebbce8ebb5121cad0

6 years agoLoader: fix open registry handle leak
Slawomir Cygan [Tue, 16 Jan 2018 16:17:07 +0000 (17:17 +0100)]
Loader: fix open registry handle leak

Each handle returned by RegOpenKey*() API functions should be
closed using RegCloseKey().

This change fixes AppVerifier warning on leaklin HKEY objects.

6 years agolayers: Add checks for extention DynamicViewports
Jeremy Kniager [Wed, 15 Nov 2017 20:27:03 +0000 (13:27 -0700)]
layers: Add checks for extention DynamicViewports

Change-Id: I2819d47ab163519689ece94535c6c880f275bf72

6 years agoRevert "MikeW's private development tools."
Mike Weiblen [Tue, 16 Jan 2018 18:54:01 +0000 (11:54 -0700)]
Revert "MikeW's private development tools."

This reverts commit b103ee6a86b3296c4db52598d77ce792127a6082.

6 years agoRevert "TEST: Create pre-instance intercept test case"
Mike Weiblen [Tue, 16 Jan 2018 18:53:43 +0000 (11:53 -0700)]
Revert "TEST: Create pre-instance intercept test case"

This reverts commit 6cc77123f101f88d246a8cbdf85cc601b5fde82c.

6 years agobuild: Fix linux 32-bit assembly config
Lenny Komow [Mon, 15 Jan 2018 21:56:08 +0000 (14:56 -0700)]
build: Fix linux 32-bit assembly config

This fixes a bug whereby 32-bit Linux builds would not be able to
use the assembly code as the try_compile command would fail when it
attempted to link with compiler flags

Change-Id: I6e4479fb7926169a7fa5c01876834cdae8c3b637

6 years agobuild: Use DevSim from a VulkanTools build in CI
Karl Schultz [Fri, 12 Jan 2018 21:41:55 +0000 (14:41 -0700)]
build: Use DevSim from a VulkanTools build in CI

- Change Travis-CI to build VulkanTools and use the resulting
  DevSim binary instead of the one checked into the repo.
- Delete the DevSim binary and JSON file from layers/linux.
- Remove CMake rules related to DevSim binary.

6 years agolayers: Fix Android build
Yuly Novikov [Fri, 12 Jan 2018 23:54:12 +0000 (18:54 -0500)]
layers: Fix Android build

ndk-bundle/sources/cxx-stl/llvm-libc++/include/set
expects comparator's operator() to be const.

6 years agolayers: Fix typos in ValidateUpdateDescriptorSets
Artem Kharytoniuk [Fri, 12 Jan 2018 13:17:41 +0000 (14:17 +0100)]
layers: Fix typos in ValidateUpdateDescriptorSets

6 years agolayers: Make bind more robust to invalid memory
John Zulauf [Thu, 11 Jan 2018 23:39:30 +0000 (16:39 -0700)]
layers: Make bind more robust to invalid memory

Added nullptr check to BindBufferMemory and BindImageMemory validation
to cope with invalid memory arguments (reported elsewhere).

Change-Id: I52266490ccfe9eff7d5f451cddc4d3bbf94b3c5d

6 years agotests: Add buffer creation zero size test
Petr Kraus [Thu, 11 Jan 2018 20:59:39 +0000 (21:59 +0100)]
tests: Add buffer creation zero size test

6 years agotests: Add mipLevels and arrayLayers zero tests
Petr Kraus [Thu, 11 Jan 2018 20:35:45 +0000 (21:35 +0100)]
tests: Add mipLevels and arrayLayers zero tests

6 years agotests: Update CreateImageLimitsViolationMinWidth
Petr Kraus [Fri, 5 Jan 2018 03:30:57 +0000 (04:30 +0100)]
tests: Update CreateImageLimitsViolationMinWidth

- add descriptions
- simplify param selection (format, usage)
- test all possible cases, not just width
- update vuids (fix on unexpected msg)

6 years agolayers: Make ValidateGreaterThan report vuid etc.
Petr Kraus [Fri, 5 Jan 2018 03:05:12 +0000 (04:05 +0100)]
layers: Make ValidateGreaterThan report vuid etc.

- make ValidateGreaterThan report proper vuid and other log_msg
parameters
- make ValidateGreaterThanZero to avoid having to convert common 0
literal (for template deduction)
- update check and remove redundant ones in core_validation

6 years agotests: add tests for descriptor limit VUs
Dave Houlton [Mon, 8 Jan 2018 21:06:35 +0000 (14:06 -0700)]
tests: add tests for descriptor limit VUs

Add per-stage limit check for input attachments to existing test.
Add new test for all-stages summed descriptor limits VUs.

Change-Id: I3a245f34ebaff524f1de17c0174bba63bbd0f537