platform/upstream/Vulkan-Tools.git
8 years agolayers: Add check for descriptor count
Chris Forbes [Thu, 17 Mar 2016 22:21:35 +0000 (11:21 +1300)]
layers: Add check for descriptor count

We're not really determining how many descriptors the binding needs yet,
so this only catches the descriptorCount==0 case.

8 years agolayers: Just return the whole binding struct from has_descriptor_binding
Chris Forbes [Thu, 17 Mar 2016 22:14:27 +0000 (11:14 +1300)]
layers: Just return the whole binding struct from has_descriptor_binding

We're about to want the descriptorCount too. This was getting absurd.

8 years agoAllow REMAINING for subresources.
Michael Lentine [Fri, 18 Mar 2016 19:49:09 +0000 (14:49 -0500)]
Allow REMAINING for subresources.

8 years agolayers: Track lifetime when using cross-queue semaphores.
Michael Lentine [Thu, 17 Mar 2016 21:34:32 +0000 (16:34 -0500)]
layers: Track lifetime when using cross-queue semaphores.

8 years agowinrtinstaller: Set up proper Access Control for install/temp dirs and files
David Pinedo [Fri, 18 Mar 2016 19:15:27 +0000 (13:15 -0600)]
winrtinstaller: Set up proper Access Control for install/temp dirs and files

This change addresses:
   https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/issues/70

Also made a change to not require a reboot on uninstall if the install dir
is not empty.  This partially addresses:
   https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/issues/70
(A similar change needs to be made to the SDK installer.)

8 years agolayers: Additional null checks for param_checker
Dustin Graves [Thu, 17 Mar 2016 17:04:45 +0000 (11:04 -0600)]
layers: Additional null checks for param_checker

- Add null checks to validation code that dereferences potentially
  null pointers.
- Add asserts to functions that expect certain pointers to never
  be null.

Change-Id: I041b641289c9681ff9177bcec998fc95f6416985

8 years agolayers: Lock around changes to imageMap in image layer
Tony Barbour [Thu, 17 Mar 2016 16:24:10 +0000 (10:24 -0600)]
layers: Lock around changes to imageMap in image layer

Change-Id: I75382973eacf80e3ee84fb390c79bc7c19cc14d7

8 years agolayers: Lock around destroyedFramebuffers inserts in core_validation
Tony Barbour [Thu, 17 Mar 2016 20:50:55 +0000 (14:50 -0600)]
layers: Lock around destroyedFramebuffers inserts in core_validation

Change-Id: I32754ae405c01acbde8a82ebaef0938a5e314f73

8 years agolayers: Fix 'Debug Report callbacks not removed' error messages
Mark Lobodzinski [Thu, 17 Mar 2016 19:59:51 +0000 (13:59 -0600)]
layers: Fix 'Debug Report callbacks not removed' error messages

Change-Id: If214e07ab7fd8e50af0528c36595bf92716357f3

8 years agolayers: Fix validation of vkCmdBindDescriptorSets() during renderpass
Tobin Ehlis [Thu, 17 Mar 2016 19:37:40 +0000 (13:37 -0600)]
layers: Fix validation of vkCmdBindDescriptorSets() during renderpass

Spec allows vkCmdBindDescriptorSets() to be called inside or outside of a
renderpass so killing two core_validation checks that violate this behavior.

8 years agolayers: Consolidate VkDeviceMemory maps into a single map
Tobin Ehlis [Wed, 16 Mar 2016 22:00:36 +0000 (16:00 -0600)]
layers: Consolidate VkDeviceMemory maps into a single map

There were three separate maps in core_validation.cpp that used VkDeviceMemory for key.
This change consolidates those maps into a single map with DEVICE_MEM_INFO as the value.
To accomadate this I added data to DEVICE_MEM_INFO struct to track mapped image/buffer
ranges as well as image reference for memory with mapped image.

8 years agolayers: Consolidate properties checks in core_validation
Tobin Ehlis [Wed, 16 Mar 2016 20:20:54 +0000 (14:20 -0600)]
layers: Consolidate properties checks in core_validation

Remove global properties and only use properties from physDevProperties.properties.

8 years agolayers: Remove global wsi_enabled in core_validation
Tobin Ehlis [Wed, 16 Mar 2016 20:12:47 +0000 (14:12 -0600)]
layers: Remove global wsi_enabled in core_validation

core_validation layer only needs wsi_enabled bool from devExts struct.

8 years agolayers: Lock around image and buffer range erases in core validation
Tony Barbour [Thu, 17 Mar 2016 17:18:47 +0000 (11:18 -0600)]
layers: Lock around image and buffer range erases in core validation

Change-Id: Id975474ef331369e5dc57a24ea6051253fb657cf

8 years agolayers: Consolidate swapchainMaps in core_validation
Tobin Ehlis [Wed, 16 Mar 2016 19:52:20 +0000 (13:52 -0600)]
layers: Consolidate swapchainMaps in core_validation

Remove old mem_tracker swapchainMap and consolidate all swapchain tracking
into the devExts struct swapchainMap.

8 years agoandroid: Fix android build
Tobin Ehlis [Thu, 17 Mar 2016 12:48:27 +0000 (06:48 -0600)]
android: Fix android build

layer_utils needs vk_loader_platform.h

8 years agolayers: validate capabilities against device features
Chris Forbes [Mon, 14 Mar 2016 21:12:48 +0000 (10:12 +1300)]
layers: validate capabilities against device features

V2: squashed in feedback.
V3: More careful about VkBool32

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Fix layer debug action initialization
Dustin Graves [Thu, 17 Mar 2016 00:43:34 +0000 (18:43 -0600)]
layers: Fix layer debug action initialization

Fix for debug_action option retrieval.

Change-Id: Icd601b337b40830d2f2231cdb0ec22469b5e8ec5

8 years agolayers: Update validation layer details doc for layer renaming
Mark Lobodzinski [Wed, 16 Mar 2016 23:09:02 +0000 (17:09 -0600)]
layers: Update validation layer details doc for layer renaming

Delete mem_tracker
Delete draw_state
Add    core_validation

Change-Id: Idc84160b94febf5c4d81ea0c6f34b9f51592e472

8 years agolayers: Move lock around add_object_create_info in core_validation
Tony Barbour [Wed, 16 Mar 2016 23:07:04 +0000 (17:07 -0600)]
layers: Move lock around add_object_create_info in core_validation

Change-Id: I9b183e1231fecc7dce8db9899ee115c5e7a2be3e

8 years agolayers: Move layer debug action initialization into layer_utils
Mark Lobodzinski [Tue, 15 Mar 2016 20:21:59 +0000 (14:21 -0600)]
layers: Move layer debug action initialization into layer_utils

Also removed dead code from the layer generation script.

Change-Id: I64fdcaaf1aed8152de62079568c8e247333d8c61

8 years agowinrtinstaller: Allow layers from SDK older than RT to be configured for use
David Pinedo [Wed, 16 Mar 2016 20:41:56 +0000 (14:41 -0600)]
winrtinstaller: Allow layers from SDK older than RT to be configured for use

Layers from SDK can be used by an RT if their major, minor, and patch numbers
are the same.

For example, if SDK 1.0.5.0 is already installed, and then RT 1.0.5.1 is
installed. During the RT installation, the layer registry entries will be set
to point to the layers in SDK 1.0.5.0.

8 years agolayers: Update doc validation to use core_validation filenames
Tobin Ehlis [Wed, 16 Mar 2016 17:06:44 +0000 (11:06 -0600)]
layers: Update doc validation to use core_validation filenames

8 years agodemos: Put smoketest exe in same dir as cube and tri
Tony Barbour [Tue, 15 Mar 2016 22:24:46 +0000 (16:24 -0600)]
demos: Put smoketest exe in same dir as cube and tri

Change-Id: I35dec36d3e67912375180192e1ca8ed1fa2abe75

8 years agolayers: Replace draw_state and mem_tracker with core validation
Mark Lobodzinski [Tue, 15 Mar 2016 23:23:12 +0000 (17:23 -0600)]
layers: Replace draw_state and mem_tracker with core validation

Change-Id: Ib8eb7491f6c60bc6d05da64a2311c8cfa5f88d60

8 years agocmake: Find spirv/glslang dependencies
Dustin Graves [Tue, 15 Mar 2016 21:39:08 +0000 (15:39 -0600)]
cmake: Find spirv/glslang dependencies

Replace the hardcoded glslang and spirv-tools path with
CMake find macros to find the include, library, and programs.

Change-Id: Id498ad75d663f2795207b39b40a11ddfe2c03920

8 years agowinrtinstaller: Install both x86 and x64 redist's if either is not installed
David Pinedo [Tue, 15 Mar 2016 22:42:14 +0000 (16:42 -0600)]
winrtinstaller: Install both x86 and x64 redist's if either is not installed

Fix for issue:
  https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/issues/109

8 years agolayers: Add some defensive code to core_validation
Tobin Ehlis [Tue, 15 Mar 2016 21:52:11 +0000 (15:52 -0600)]
layers: Add some defensive code to core_validation

Missed a NULL check and assert when I merged in the bindingToIndexMap fix for descriptor type/stageFlags.

8 years agocmake: Fix windows debug build for large object files
Mark Lobodzinski [Tue, 15 Mar 2016 16:31:44 +0000 (10:31 -0600)]
cmake: Fix windows debug build for large object files

The core_validation layer is presently large.

Change-Id: Id1ab0dd0af0a3bc18078bdd50bf42add46d77339

8 years agolayers: Fix crash in core_validation layer
Mark Lobodzinski [Tue, 15 Mar 2016 15:49:03 +0000 (09:49 -0600)]
layers: Fix crash in core_validation layer

CommandBuffers were getting added to commandPoolMap twice.

Change-Id: I115757751ef0aebb1f2599217b3117beca3cd0b7

8 years agolayers: Add json files for core_validation layer
Mark Lobodzinski [Tue, 15 Mar 2016 15:33:14 +0000 (09:33 -0600)]
layers: Add json files for core_validation layer

Change-Id: I69495151be84fa18feb5a55848eb536ac9e73100

8 years agolayers: Fix core_validation compilation error
Mark Lobodzinski [Tue, 15 Mar 2016 15:19:59 +0000 (09:19 -0600)]
layers: Fix core_validation compilation error

Change-Id: I1ed4fffbf607465239afbce4d7d28b11bceaa548

8 years agolayers: Merge mem_tracker and draw_state layers into core_validation layer
Tobin Ehlis [Wed, 9 Mar 2016 23:12:48 +0000 (16:12 -0700)]
layers:  Merge mem_tracker and draw_state layers into core_validation layer

cube & tri --validate now use core_validation instead of MT & DS

Very little efficiency has been pulled out for this initial merge.
A few maps have been merged, but otherwise almost all of the mem_tracker
code is pulled intact and surrounded in "#if MTMERGE" blocks.

Change-Id: Icf060bfc0177fc8c9fa7d8d57f7ddc446357b665

8 years agolayers: GH130 Fix to correctly get type/flags from set binding
Tobin Ehlis [Tue, 15 Mar 2016 13:59:11 +0000 (07:59 -0600)]
layers: GH130 Fix to correctly get type/flags from set binding

We were using bindingToIndexMap to do look-ups into type and stage vectors which is incorrect.
bindingToIndexMap is to index into the original pBindings map that was passed in when the
layout was created. This fix does this to correctly pull type and stage of a binding in draw_state.

8 years agowinrtinstaller: Verify vulkan-1-*dll has correct file name format
David Pinedo [Tue, 15 Mar 2016 17:07:19 +0000 (11:07 -0600)]
winrtinstaller: Verify vulkan-1-*dll has correct file name format

8 years agolayers: PR118, Remove erroneous validation error from swapchain
szdarkhack [Sat, 12 Mar 2016 16:41:19 +0000 (18:41 +0200)]
layers: PR118, Remove erroneous validation error from swapchain

Remove error when selecting VK_PRESENT_MODE_FIFO_KHR (required to be supported)
without enumerating the supported presentation modes first.

Change-Id: Iacc8fa55dec1b1f72011041813b423f95912a092

8 years agolayers: GH132 Event handle should be printed as a hexadecimal value
Dominik Witczak [Tue, 15 Mar 2016 10:48:25 +0000 (11:48 +0100)]
layers: GH132 Event handle should be printed as a hexadecimal value

8 years agoandroid: Fix android build
Tobin Ehlis [Tue, 15 Mar 2016 13:40:49 +0000 (07:40 -0600)]
android: Fix android build

Account for update of draw_state to include SPIRV/spirv.hpp.

8 years agolayers: draw state image/layout cleanup
Dustin Graves [Fri, 11 Mar 2016 23:06:39 +0000 (16:06 -0700)]
layers: draw state image/layout cleanup

Remove tracked device memory, subresource, and layout data associated
with an image when that image is destroyed.  Eliminates spurious
draw state messages that report invalid layout issues when the
destroyed image's handle is recylced and the new image state is
validated with the old image's data.

Change-Id: Ia956a3f7c60a34e6357f4d0d4d9dfe760910e97c

8 years agolayers: Change header path for spirv.h in draw_state
Jon Ashburn [Mon, 14 Mar 2016 20:28:12 +0000 (14:28 -0600)]
layers: Change header path for spirv.h in draw_state

Change-Id: I8d2739daa17fc6b971e9e093158b22b211920558

8 years ago#include formatting changes for relative look-up.
Aaron Karp [Sun, 13 Mar 2016 20:41:59 +0000 (16:41 -0400)]
#include formatting changes for relative look-up.

- <> notation skips relative path searching in Visual Studio with some settings (and per language spec if I'm not mistaken).  Switched to "" notation for includes where relative look-up seemed to be the intention.

8 years agodemos: Fix typo in tri.c that prevented validate arg from working correctly
Mark Lobodzinski [Mon, 14 Mar 2016 14:26:01 +0000 (08:26 -0600)]
demos: Fix typo in tri.c that prevented validate arg from working correctly

Change-Id: I8562e601c27e2413071f47ed97fe5ffd9f46bd07

8 years agolayers: Add pNext parameter checking
Dustin Graves [Wed, 9 Mar 2016 00:48:20 +0000 (17:48 -0700)]
layers: Add pNext parameter checking

Validate pNext based on the validextensionstructs tag from the XML
registry.  If the tag provides a list of valid structures, walk the
pNext list and check each node's sType value agains the
VkStructureType value associated with the structs from the list.
If no valid structure list is provided, ensure that pNext is NULL.

Invalid struct types produce errors similar to the following:
ERROR: [PARAMCHECK] Code 1 : vkCreateImage: pCreateInfo->pNext chain
 includes a structure with unexpected VkStructureType
 VK_STRUCTURE_TYPE_APPLICATION_INFO; Allowed structures are
 [VkInstanceCreateInfo, VkDeviceCreateInfo]

Change-Id: I2c2471a068cb304120c66cb4156331999f8548cd

8 years agoloader: make sure createDevice uses ICDs physicalDevice
Jon Ashburn [Fri, 11 Mar 2016 21:43:57 +0000 (14:43 -0700)]
loader: make sure createDevice uses ICDs physicalDevice

Trampoline CreateDevice was using the terminator's physicalDevice instead of
the ICDs.

Change-Id: Ifdc6497fe4130e1ac1440b225401e65600b2a999

8 years agospirv: Pick up SPIRV-Tools fix for version generation script.
Karl Schultz [Fri, 11 Mar 2016 20:17:40 +0000 (13:17 -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

8 years agoloader: Fix cmake on win for list of normal and opt sources
Jon Ashburn [Fri, 11 Mar 2016 17:58:56 +0000 (10:58 -0700)]
loader: Fix cmake on win for list of normal and opt sources

Change-Id: I5eb7836ba0606628fc663ecfa8cd3ca4d535a8b9

8 years agolayers: GH67: Add missing mem_tracker interception for vkCmdBlitImage() calls
Dominik Witczak [Fri, 11 Mar 2016 09:32:34 +0000 (10:32 +0100)]
layers: GH67: Add missing mem_tracker interception for vkCmdBlitImage() calls

Change-Id: I5d683323f6d038907ecb82e62c418e00aeaa5315

8 years agolayers: Fix overlapping attachment aliasing dependency check in draw_state
Michael Lentine [Thu, 10 Mar 2016 20:36:28 +0000 (14:36 -0600)]
layers: Fix overlapping attachment aliasing dependency check in draw_state

Change-Id: I3707afae288ed8edb644d68a6cacc9781ed11558

8 years agolayers: Enfoce that unique objects if enabled happens before draw_state in the chain.
Michael Lentine [Fri, 4 Mar 2016 17:16:30 +0000 (11:16 -0600)]
layers: Enfoce that unique objects if enabled happens before draw_state in the chain.

8 years agolayers: Fix draw_state handling of special image layouts in CmdPipelineBarrier
Mark Lobodzinski [Wed, 9 Mar 2016 22:42:55 +0000 (15:42 -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

8 years agoloader: fix cmake file so it doesn't always build loader with DEBUG
David Pinedo [Thu, 10 Mar 2016 23:50:50 +0000 (16:50 -0700)]
loader: fix cmake file so it doesn't always build loader with DEBUG

8 years agolayers: Fix helper script to not dereference strings with a NULL pointer.
Jon Ashburn [Thu, 10 Mar 2016 21:21:09 +0000 (14:21 -0700)]
layers: Fix helper script to not dereference strings with a NULL pointer.

Fixes the string helper functions.

Change-Id: I4177e498b734af9188088188a16a09aa2a6113b3

8 years agolayers: Update layer validation details document
Mark Lobodzinski [Thu, 10 Mar 2016 16:53:53 +0000 (09:53 -0700)]
layers: Update layer validation details document

Change-Id: I4990f7882061ce36f4520ce20655b0ceb06ba168

8 years agolayers: GH99 Track all command buffers submitted at once at the same time.
Michael Lentine [Thu, 10 Mar 2016 18:08:30 +0000 (12:08 -0600)]
layers: GH99 Track all command buffers submitted at once at the same time.

8 years agolayers: GH96 Fix error messages for bad layout
Tobin Ehlis [Thu, 10 Mar 2016 15:53:58 +0000 (08:53 -0700)]
layers: GH96 Fix error messages for bad layout

Instead of printing attachements as #s in the error messages, print the layout string.

8 years agolayers: GH98 Only check fence in-use once per QueueSubmit
Tobin Ehlis [Thu, 10 Mar 2016 16:18:20 +0000 (09:18 -0700)]
layers: GH98 Only check fence in-use once per QueueSubmit

In vkQueueSubmit, perform the fence in-use check first.
Then validate each submit, which includes marking the current fence in-use.

8 years agodocs: Update README.md
Jon Ashburn [Thu, 10 Mar 2016 16:05:27 +0000 (09:05 -0700)]
docs: Update README.md

Change-Id: Idba8b7e07d3a71e49c01e406825b96ccbb342efa

8 years agoUpdate BUILD.md
Karl Schultz [Thu, 10 Mar 2016 16:13:00 +0000 (09:13 -0700)]
Update BUILD.md

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

8 years agoUpdate CONTRIBUTING.md
Karl Schultz [Wed, 9 Mar 2016 22:14:19 +0000 (15:14 -0700)]
Update CONTRIBUTING.md

Fix typos

8 years agolayers: GH94 Correctly map bindingToIndex in draw_state (thanks @baldurk)
Tobin Ehlis [Wed, 9 Mar 2016 20:28:02 +0000 (13:28 -0700)]
layers: GH94 Correctly map bindingToIndex in draw_state (thanks @baldurk)

8 years agoUpdate CONTRIBUTING.md
Karl Schultz [Wed, 9 Mar 2016 19:48:04 +0000 (12:48 -0700)]
Update CONTRIBUTING.md

Rework info so that it can be used in the three repos.

8 years agolayers: Add checking for may alias bit.
Michael Lentine [Tue, 1 Mar 2016 22:51:06 +0000 (16:51 -0600)]
layers: Add checking for may alias bit.

8 years agolayers: Format updates for attachments overlapping memory code in draw_state
Michael Lentine [Mon, 29 Feb 2016 20:22:59 +0000 (14:22 -0600)]
layers: Format updates for attachments overlapping memory code in draw_state

8 years agolayers: Lighten object tracker slightly
Chris Forbes [Tue, 8 Mar 2016 23:06:45 +0000 (12:06 +1300)]
layers: Lighten object tracker slightly

Just avoiding some repeated unordered_map lookups.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Remove documentation for now-defunct check "FS_MIXED_BROADCAST"
Tobin Ehlis [Wed, 9 Mar 2016 14:29:31 +0000 (07:29 -0700)]
layers: Remove documentation for now-defunct check "FS_MIXED_BROADCAST"

8 years agolayers: Add descriptor type matching to DrawState
Chris Forbes [Mon, 7 Mar 2016 03:09:00 +0000 (16:09 +1300)]
layers: Add descriptor type matching to DrawState

(Squashed from 6 commits of WIP series)

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: clang-format layers directory
Jon Ashburn [Wed, 9 Mar 2016 00:48:44 +0000 (17:48 -0700)]
layers: clang-format  layers directory

Change-Id: I318e3759829f33441e57aafedec1e9ec06d658c4

8 years agolayers: Add string array parameter checking
Dustin Graves [Tue, 8 Mar 2016 21:42:59 +0000 (14:42 -0700)]
layers: Add string array parameter checking

The param_checker layer had previously peformed a NULL
check on the pointer to a string array, but had not
performed a NULL check for the individual strings in the
array.  This adds NULL checks for the individual strings.

Change-Id: Id4527f670086187e8cd1f146027bfdfd1e134b7b

8 years agolayers: Remove redundant/unused param checker code
Dustin Graves [Tue, 8 Mar 2016 20:34:49 +0000 (13:34 -0700)]
layers: Remove redundant/unused param checker code

Removes param checker sType and NULL check code that is now
 auto-generated.  Also remove empty functions and conditional
statements.

Change-Id: I8be8aab0bf3a8fa60219e1066a7d3d6c9d26ec05

8 years agolayers: LX430, Modfiy object_tracker to handle multiple instances
Mark Lobodzinski [Tue, 8 Mar 2016 22:10:00 +0000 (15:10 -0700)]
layers: LX430, Modfiy object_tracker to handle multiple instances

Upon DestroyInstance, OT indicated that all objects in all maps were
not properly destroyed. Made this reporting work on a per-instance basis.

Change-Id: I9b4eae4364a24597cb449610a31bf9b872c45225

8 years agolayers: GH83 Fix updates of copies descriptor sets in draw_state
Tobin Ehlis [Tue, 8 Mar 2016 23:31:06 +0000 (16:31 -0700)]
layers: GH83 Fix updates of copies descriptor sets in draw_state

When a copied descriptor update is valid, need to update pUpdateStructs
for the destination set. There are still some issues with how copied
descriptors are handled in draw_state (noted in TODO on line 3049) but
this fix addresses specific issue in GH83.

8 years agolayers: Fix layer documentation so that it can be auto-validated
Tobin Ehlis [Tue, 8 Mar 2016 23:14:52 +0000 (16:14 -0700)]
layers: Fix layer documentation so that it can be auto-validated

Validator currently requires each table entry to be on a single line. Fixing a couple of multi-line entries.

8 years agolayers: Count attachments as the same if they have overlapping memory.
Michael Lentine [Mon, 29 Feb 2016 20:22:59 +0000 (14:22 -0600)]
layers: Count attachments as the same if they have overlapping memory.

8 years agoloader: Fix issue passing wrong instance if layer wraps instances
Jon Ashburn [Tue, 8 Mar 2016 22:21:30 +0000 (15:21 -0700)]
loader: Fix issue passing wrong instance if layer wraps instances

Change-Id: Iafd0f7dc3e4a911b165d3df1dadddf4d45fbef10

8 years agolayers: LX405 Avoid some checks when rastrization is disabled.
Karl Schultz [Tue, 8 Mar 2016 17:30:21 +0000 (10:30 -0700)]
layers: LX405 Avoid some checks when rastrization is disabled.

When rasterization is disabled, some pipeline state checks can
be skipped since they would not be used, including sample
counts and viewport/scissor counts.
Add rasterization state to graphics pipelines in the
test suite because it is required.

Change-Id: I88f76038c2acc0abd0565f1655ceeed128557f77

8 years agocodegen: LX424 Generate code for WSI-specific funs in GIPA.
Karl Schultz [Tue, 8 Mar 2016 22:14:11 +0000 (15:14 -0700)]
codegen: LX424 Generate code for WSI-specific funs in GIPA.

For the unique_objects and object_tracker layers, generate
system types (xcb, xlib, wayland, mir) in GetInstanceProcAddr.
The previous code would only generate code for one display
system, even if more than one was selected by the CMake config.
The code to return these proc addresses is conditionally compiled
with the corresponding USE_PLATFORM #ifdef, and the CMake config
can go ahead and set multiple USE_PLATFORM defines.
The result is that GIPA resolves proc address requests for these
functions and allows them to be hooked properly when the layers
are loaded.

Change-Id: I2fa38847863f0a1187dd17d882ef9d94f546527f

8 years agoBump api_version to 1.0.5 in json files
Tony Barbour [Tue, 8 Mar 2016 21:50:03 +0000 (14:50 -0700)]
Bump api_version to 1.0.5 in json files

Change-Id: I71a03cd8043906074f6c3be98af0006e1aeaf5ee

8 years agolayers: Add func pointer NULL checks
Dustin Graves [Tue, 8 Mar 2016 00:52:14 +0000 (17:52 -0700)]
layers: Add func pointer NULL checks

Add code generated NULL checks for function pointers.  This enables
parameter checking for the VkAllocationCallbacks struct, with
param_checker additions for the vkDestroy functions that
receive VkAllocationCallbacks parameters.

Change-Id: I9910c52026aa584bb013ee5015b5cb04b2d6ddcd

8 years agolayers: GH41 Flag error if cmd buffer references destroyed framebuffer
Tobin Ehlis [Tue, 8 Mar 2016 18:19:34 +0000 (11:19 -0700)]
layers: GH41 Flag error if cmd buffer references destroyed framebuffer

Create framebuffer node and include set of cmd buffers that reference that FB.
At the time when RenderPass is bound to cmd buffer, or when secondary cmd buffer
is created with framebuffer inheritence, store a reference from FB to cmd buffer.

When FB destroyed, set any cmd buffers referencing it as INVALID and store FB ref.

At submit time, if CB is INVALID, check for any destroyed FBs and report them.

8 years agolayers: Fix android build of draw_state
Tobin Ehlis [Tue, 8 Mar 2016 17:51:34 +0000 (10:51 -0700)]
layers: Fix android build of draw_state

Need to static cast NULL to VkFence in FENCE_NODE constructor.

8 years agolayers: Fix android build from linux or Win32 system
Tobin Ehlis [Tue, 8 Mar 2016 17:39:10 +0000 (10:39 -0700)]
layers: Fix android build from linux or Win32 system

When we codegen layers for android build, cmd line is long which was causing us to not customize build based on "Android" option on cmd line.

Handling "Android" as special case currently so android can easily be built from Win32 or linux.
Need to clean this code up at some point to make it easier to build various targets from different dev system types.

8 years agoUse size_t types for output size_t.
Michael Lentine [Tue, 8 Mar 2016 16:34:05 +0000 (10:34 -0600)]
Use size_t types for output size_t.

8 years agobuild: Enable Xlib support to default ON on Linux builds
Jon Ashburn [Tue, 8 Mar 2016 17:04:06 +0000 (10:04 -0700)]
build: Enable Xlib support to default ON on Linux builds

Change-Id: I5a89e81caf31b6cc5a5f0668a97fb05e8e6462aa

8 years agoloader: gllvl #50, Add support for the WSI extension KHR_display
Jon Ashburn [Tue, 8 Mar 2016 16:30:30 +0000 (09:30 -0700)]
loader: gllvl #50, Add support for the WSI extension KHR_display

Change-Id: I8d5ecc7500beba3042a6b9147b2f3fd3055b3b1d

8 years agolayers: LX431, FENCE_NODE structures not initialized
Mark Lobodzinski [Mon, 7 Mar 2016 23:43:57 +0000 (16:43 -0700)]
layers: LX431, FENCE_NODE structures not initialized

The fenceMap structures are never initialized, resulting in indeterminate
behavior including bad draw_state validation messages from the smoke
test. Added a default constructor to FENCE_MAP.

Change-Id: I27e6b48e485bbb1e8774e2d5789e1e8d1b48020b

8 years agobuild: Fix CMake Xlib DisplayServer name.
Karl Schultz [Tue, 8 Mar 2016 15:07:13 +0000 (08:07 -0700)]
build: Fix CMake Xlib DisplayServer name.

Change-Id: Ia50157cd4f245971208a1baa28c823a62683dcd3

8 years agoloader: VulkanTools PR 13 Resolve ...XlibPresentationSupportKHR
Karl Schultz [Tue, 8 Mar 2016 14:55:27 +0000 (07:55 -0700)]
loader: VulkanTools PR 13 Resolve ...XlibPresentationSupportKHR

Change-Id: I1177e20b657ab00f41e9e4eb6f9ac997f7be459e

8 years agodemos: Change layer order in cube.c to put param_check sooner.
Karl Schultz [Tue, 8 Mar 2016 00:54:07 +0000 (17:54 -0700)]
demos: Change layer order in cube.c to put param_check sooner.

Also make the order match the standard meta layer.

Change-Id: Id250b9fe89b9d85d9e8ab6b803474f2c449fc6b1

8 years agoglslang / spirv-tools: get latest versions
GregF [Mon, 7 Mar 2016 23:53:42 +0000 (16:53 -0700)]
glslang / spirv-tools: get latest versions

8 years agodemos: Remove allocation callback code from tri demo
Tony Barbour [Mon, 7 Mar 2016 22:48:06 +0000 (15:48 -0700)]
demos: Remove allocation callback code from tri demo

From LoaderAndValidationLayers issue #84:
demos/tri.c implements VkAllocationCallbacks with aligned_alloc/_aligned_malloc, free/_aligned_free, and realloc.

I belive that is broken in many ways:

realloc does not return a pointer with the necessary alignment.
realloc(_aligned_malloc(...)) crashes.
_aligned_free(realloc(...)) crashes.
aligned_alloc requires that size must be a multiple of alignment, while Vulkan provides no such guarantee to these callbacks.
On POSIX-based implementations, aligned_alloc requires that alignment must be a multiple of sizeof(void *) as well as a power of two, while Vulkan merely requires it to be a power of two.
aligned_alloc(0), realloc(p, 0) might return non-NULL, while I think Vulkan requires NULL.
_aligned_malloc(0, a) is documented to invoke the invalid parameter handler (although I'm not sure it actually does in practice).
Implementing a valid allocator is quite non-trivial, so it may be best to just delete the allocator entirely from the demo.

(See also KhronosGroup/Vulkan-Docs#21 and KhronosGroup/Vulkan-Docs#103 for related discussions.)

Change-Id: I3ef3ba19c64127bd65a7dbe7b0b54de42e68ebb0

8 years agolayers: GHLVL88, Fix ValidateBarriers in draw_state
Mark Lobodzinski [Mon, 7 Mar 2016 23:11:47 +0000 (16:11 -0700)]
layers: GHLVL88, Fix ValidateBarriers in draw_state

Apps using QUEUE_FAMILY_IGNORED might get bad validation errors.

Change-Id: I3c8b3723701b8b24e2e9cd81a20f7192bcef15a7

8 years agolayers: GHLVL87, Fix cut/paste VerifyImageLayout call in draw_state
Mark Lobodzinski [Mon, 7 Mar 2016 22:45:49 +0000 (15:45 -0700)]
layers: GHLVL87, Fix cut/paste VerifyImageLayout call in draw_state

Change-Id: I4c34930338805ac964f0a4c70c2356977c1adabd

8 years agolayers: LX402, Invalid CmdBindPipeline validation error
Mark Lobodzinski [Mon, 7 Mar 2016 19:23:52 +0000 (12:23 -0700)]
layers: LX402, Invalid CmdBindPipeline validation error

The draw_state layer was emitting an error if this API was
called outside a renderPass, which is indeed valid.

Change-Id: I712b381e7ea9d9e66e091ba7325ab8d884f56edb

8 years agoheader: update to version 1.0.5
Jon Ashburn [Mon, 7 Mar 2016 20:01:35 +0000 (13:01 -0700)]
header: update to version 1.0.5

Change-Id: I2c7fdb2349d50d06b0a875e4da0c9ab50d2249de

8 years agomisc: Update to header version 1.0.4
Jon Ashburn [Mon, 7 Mar 2016 18:07:19 +0000 (11:07 -0700)]
misc: Update to header version 1.0.4

Change-Id: I61657dc28c7850075b787413955a6c880447a03d

8 years agolayers: Add param checks for CreateInstance/Device
Dustin Graves [Thu, 3 Mar 2016 21:17:08 +0000 (14:17 -0700)]
layers: Add param checks for CreateInstance/Device

Add parameter checks for vkCreateDevice and vkCreateInstance.
Includes a local fix for GitHub Vulkan-Docs issue #104 to
prevent false positives from being generated for the
pCreateInfo->pEnabledFeatures == NULL case.

Change-Id: I1f3642e7e18c8bfb32b0996b6e2e57a5f9d8e011

8 years agolayers: Add NULL/sType checks for struct members
Dustin Graves [Thu, 3 Mar 2016 01:23:29 +0000 (18:23 -0700)]
layers: Add NULL/sType checks for struct members

Add param_checker support for validating struct members.  Messages
are logged for the following conditions, based on conditions
specified in vk.xml:
 - A pointer is NULL and is not marked as optional in the XML
 - An array is NULL and is not marked as optional in the XML, unless
   its count is 0
 - An array count is 0 and is not marked as optional in the XML
 - A structure's sType value does not match the value specified
   in the XML

Addresses GL105, GL109, GH82

Change-Id: I7063fe2582b30fdfc0006fe945a0f9c84a2aa66a

8 years agolayers: Handle indirection in param_checker
Dustin Graves [Mon, 29 Feb 2016 20:35:07 +0000 (13:35 -0700)]
layers: Handle indirection in param_checker

Code was being generated for param_checker that looked like:
  validate_pointer(pAllocInfo);
  validate_array(pAllocInfo->count, array);
Where validate_array could dereference a NULL pointer.  The code
generator was updated to insert NULL checks for this case:
  validate_pointer(pAllocInfo);
  if (pAllocInfo != NULL) {
      validate_array(pAllocInfo->count, array);
  }

Change-Id: I1eda66530dbff2e95d604a20d122179be172bedf

8 years agolayers: Add vkFreeCommandBuffers param check
Dustin Graves [Fri, 26 Feb 2016 18:53:28 +0000 (11:53 -0700)]
layers: Add vkFreeCommandBuffers param check

Add NULL pointer checks for vkFreeCommandBuffers.

Change-Id: I7bef6a9d55fda6607b483c873485156b8c8148a1

8 years agolayers: LX413, Fix dynamicOffsets crash in draw_state
Mark Lobodzinski [Mon, 7 Mar 2016 17:39:59 +0000 (10:39 -0700)]
layers: LX413, Fix dynamicOffsets crash in draw_state

Properly handle CmdBindDescriptorSets being called multiple times
consecutively. DynamicOffsets being overwritten on subsequent calls,
resulting in a crash when the array was indexed out-of-bounds.