platform/upstream/Vulkan-Tools.git
8 years agotests: GH431 Add layer checks and tests for push constant
Karl Schultz [Fri, 6 May 2016 19:56:42 +0000 (13:56 -0600)]
tests: GH431 Add layer checks and tests for push constant

Change-Id: I46eb5f9adbe702a278cded0f73dc18d1617489f0

Fix windows compilation issues

Change-Id: Ic9b9795e34d1e1e68bae9838b8538bb2e37d18b4

8 years agoswapchain: avoid invalid GIPA call in vkCreateDevice
Chia-I Wu [Thu, 28 Apr 2016 08:04:15 +0000 (16:04 +0800)]
swapchain: avoid invalid GIPA call in vkCreateDevice

Save VkInstance in layer_data so that we query vkCreateDevice with a valid
instance.

8 years agoswapchain: improve GetInstanceProcAddr
Chia-I Wu [Thu, 28 Apr 2016 07:16:59 +0000 (15:16 +0800)]
swapchain: improve GetInstanceProcAddr

Handle device commands as well.  Move handling of interface functions to
v0's vkGetInstanceProcAddr.

8 years agoswapchain: refactor GetInstanceProcAddr
Chia-I Wu [Thu, 28 Apr 2016 06:38:57 +0000 (14:38 +0800)]
swapchain: refactor GetInstanceProcAddr

Split command intercepting out to intercept_core_instance_command and
intercept_khr_surface_command.

8 years agoswapchain: add intercept_khr_swapchain_command
Chia-I Wu [Thu, 5 May 2016 08:13:19 +0000 (16:13 +0800)]
swapchain: add intercept_khr_swapchain_command

It returns the function pointers for all intercepted VK_KHR_swapchain
commands.  Call intercept_khr_swapchain_command from GetDeviceProcAddr.

8 years agoswapchain: add intercept_core_device_command
Chia-I Wu [Thu, 28 Apr 2016 06:38:57 +0000 (14:38 +0800)]
swapchain: add intercept_core_device_command

It returns the function pointers for all intercepted core device commands.
Call intercept_core_device_command from GetDeviceProcAddr.  Assert that
device is valid in GetDeviceProcAddr.

8 years agoswapchain: improve EnumerateDeviceExtensionProperties
Chia-I Wu [Thu, 28 Apr 2016 06:21:13 +0000 (14:21 +0800)]
swapchain: improve EnumerateDeviceExtensionProperties

Call down the next layer unless pLayerName is swapchain.

8 years agoswapchain: add swapchain::swapchain_layer
Chia-I Wu [Thu, 28 Apr 2016 06:12:27 +0000 (14:12 +0800)]
swapchain: add swapchain::swapchain_layer

Replace swapchain_layers with swapchain_layer.  There is no plan to define
more than one layer in the same namespace.

8 years agoswapchain: drop vk prefix for layer functions
Chia-I Wu [Thu, 28 Apr 2016 06:01:30 +0000 (14:01 +0800)]
swapchain: drop vk prefix for layer functions

Drop VK_LAYER_EXPORT as well.

8 years agoswapchain: put layer functions into a namespace
Chia-I Wu [Thu, 28 Apr 2016 03:27:46 +0000 (11:27 +0800)]
swapchain: put layer functions into a namespace

Put all layer fucntions/data into swapchain namespace.  I had to add some
wrappers to make everything work.

8 years agoswapchain: move vkEnumerate*Properties around
Chia-I Wu [Thu, 28 Apr 2016 03:21:49 +0000 (11:21 +0800)]
swapchain: move vkEnumerate*Properties around

Move them toward the end of the file.

8 years agolayers: Determine whether command buffer can be ended with active render pass
Cody Northrop [Mon, 9 May 2016 22:15:57 +0000 (16:15 -0600)]
layers: Determine whether command buffer can be ended with active render pass

8 years agotests: Enhance doc validator to recognize Wsi tests
Tobin Ehlis [Wed, 11 May 2016 13:26:33 +0000 (07:26 -0600)]
tests: Enhance doc validator to recognize Wsi tests

Enable doc validator to recognize tests in VkWsiEnabledLayerTest group.

8 years agoloader: update linux so version
Jeremy Hayes [Thu, 12 May 2016 17:29:49 +0000 (11:29 -0600)]
loader: update linux so version

Change-Id: I027e6f9e0010074c0a83748e3724c7ef1cabb4f9

8 years agolayers: Additional vkCreateImageView validation
Dustin Graves [Wed, 27 Apr 2016 23:44:56 +0000 (17:44 -0600)]
layers: Additional vkCreateImageView validation

Add more vkCreateImageView parameter validation, based on the valid
usage section for VkImageViewCreateInfo in the Vulkan specification.

Issues-Addressed: LX #502
Change-Id: I7fd743312f43a8ff36f2db9f6b50569d630f9dca

8 years agolayers: Additional vkCreateImage param validation
Dustin Graves [Thu, 12 May 2016 00:31:44 +0000 (18:31 -0600)]
layers: Additional vkCreateImage param validation

Add more vkCreateImage parameter validation, based on the valid usage
section for VkImageCreateInfo.

Issues-Addressed: GitHub #354
Change-Id: Ia978a64f6c03c3cf115a07e707099253104e04a1

8 years agolayers: Adjust queue family index error messages
Dustin Graves [Thu, 21 Apr 2016 22:30:17 +0000 (16:30 -0600)]
layers: Adjust queue family index error messages

Adjust parameter_validation layer's validate_queue_family_indices
error messages:
- Split validate_queue_family_indices into separate functions for
  arrays of indices and single index values, allowing error messages
  to be formatted with and without array brackets when appropriate.
- Print the correct parameter name in error messages.

Change-Id: I9a77ccbd0ad14da4732362d2694ed205e13c3a40

8 years agobuild: Disable RTTI generation
Karl Schultz [Thu, 12 May 2016 16:28:57 +0000 (10:28 -0600)]
build: Disable RTTI generation

Disablng RTTI can save a little space.  And it will help keep
some C++ features from being used that are not (well) supported
on some platforms.

Change-Id: I8050009a65de640c2e41cdefb1ead43c88bb710a

8 years agolayers: Sync XML registry files from Vulkan-Docs
Dustin Graves [Tue, 10 May 2016 22:44:16 +0000 (16:44 -0600)]
layers: Sync XML registry files from Vulkan-Docs

Sync the vk.xml and related Python scripts with the latest revisions from
Vulkan-Docs:
 - Update local copy of vk.xml from Vulkan-Docs
 - Merge minor changes to genvk.py and generator.py from Vulkan-Docs to
   local copies
 - Add debug marker function pointers to VkLayerDispatchTable
 - Update parameter_validation code generation to support use of types
   across API features; The core API feature needs to be aware of a
   structure defined by the AMD_rasterization_order feature for the
   purpose of pNext validation
 - Modify thread_check code generation to add TODO messages for debug
   marker support

Change-Id: I4d5b98683592f4ef404cb46e5b0f6ad519912382

8 years agolayers: Remove unused var to fix android build
Tobin Ehlis [Wed, 11 May 2016 20:44:13 +0000 (14:44 -0600)]
layers: Remove unused var to fix android build

8 years agotests: Add required parameter/error code tests
Dustin Graves [Tue, 10 May 2016 17:42:58 +0000 (11:42 -0600)]
tests: Add required parameter/error code tests

Add tests for the parameter_validation REQUIRED_PARAMETER and
FAILURE_RETURN_CODE error codes to layer_validation_tests.

Change-Id: I324901e411eb92dbaf0c7d232ae1d8bf63d433b1

8 years agotests: Add unrecognized value tests
Dustin Graves [Mon, 9 May 2016 22:21:12 +0000 (16:21 -0600)]
tests: Add unrecognized value tests

Add tests for unrecognized Vulkan enumeration, VkFlags, and VkBool32
values to layer_validation_tests.

Change-Id: I01d913c3903a7ca959c4bccb60a864a5f91c8809

8 years agotests: Add struct validation tests
Dustin Graves [Mon, 9 May 2016 20:40:29 +0000 (14:40 -0600)]
tests: Add struct validation tests

Add Vulkan structure sType and pNext validation tests to
layer_validation_tests.

Change-Id: I774d316def6697f2f3ebf5f0c20270fb0ad2daae

8 years agolayers: Migrate INVALID_IMAGE_LAYOUT check to renderpass create time
Tobin Ehlis [Wed, 11 May 2016 16:38:29 +0000 (10:38 -0600)]
layers: Migrate INVALID_IMAGE_LAYOUT check to renderpass create time

Previously performing this check at CmdBeginRenderPass time, but we have
all of the data needed when renderpass is created so check there instead.

8 years agolayers: Remove MEMTRACK_INVALID_LAYOUT
Tobin Ehlis [Wed, 11 May 2016 14:47:55 +0000 (08:47 -0600)]
layers: Remove MEMTRACK_INVALID_LAYOUT

Use DRAWSTATE_INVALID_IMAGE_LAYOUT instead as MEMTRACK version was only used
in a single case and the check is more in-line with DRAWSTATE behavior.

8 years agotests: Remove invalid error enum MEM_OBJ_CLEAR_EMPTY_BINDINGS
Tobin Ehlis [Wed, 11 May 2016 14:10:27 +0000 (08:10 -0600)]
tests: Remove invalid error enum MEM_OBJ_CLEAR_EMPTY_BINDINGS

This error enum is no longer used and has been superceded by more specific errors.

8 years agotests: Remove invalid error enum MEMTRACK_MEMORY_BINDING_ERROR
Tobin Ehlis [Wed, 11 May 2016 14:04:32 +0000 (08:04 -0600)]
tests: Remove invalid error enum MEMTRACK_MEMORY_BINDING_ERROR

This error enum is no longer used and has been superceded by more specific errors.

8 years agoMerge pull request #523 from KhronosGroup/CoreValidationMessageCleanup
Mark Mueller [Wed, 11 May 2016 15:07:46 +0000 (08:07 -0700)]
Merge pull request #523 from KhronosGroup/CoreValidationMessageCleanup

layers:LX#470 Address poor use of hex vs dec output & w/a convention

8 years agolayers:LX#470 Fix poor use of hex vs dec output
Mark Mueller [Tue, 3 May 2016 19:17:29 +0000 (13:17 -0600)]
layers:LX#470 Fix poor use of hex vs dec output

1) Introduce convention of explicitly placing "0x" before hex
    format requests for clarity (don't use "%#")
2) All lower case in hex output (except w/stringstream which refuses
    to do anything but uppercase, possibly only on windows).
3) Decorated pointers are printed for all Vulkan structure types.
3) Some intelligence in generators based on Vulkan variable name:
     if the Vulkan variable name contains ("flag", "bit", "offset",
     "handle", "buffer", "object", "mask") it will be output in
     hexadecimal format

4) Remove "using namespace std;" from global scope of vk_struct_string_helper_cpp.h

Change-Id: Idbae73bfdaa3bc059543d43b209373cd0bcbc099

8 years agolayers:pass RENDER_PASS_NODE* around more
Chris Forbes [Fri, 6 May 2016 04:55:18 +0000 (16:55 +1200)]
layers:pass RENDER_PASS_NODE* around more

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Hold active RENDER_PASS_NODE rather than VkRenderPass in CB node
Chris Forbes [Fri, 6 May 2016 04:31:14 +0000 (16:31 +1200)]
layers: Hold active RENDER_PASS_NODE rather than VkRenderPass in CB node

Allows eliminating the bulk of the renderPassMap lookups

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Add VkRenderPass member to RENDER_PASS_NODE
Chris Forbes [Fri, 6 May 2016 04:11:29 +0000 (16:11 +1200)]
layers: Add VkRenderPass member to RENDER_PASS_NODE

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Trim down locked regions in CreateRenderPass
Chris Forbes [Fri, 6 May 2016 04:11:03 +0000 (16:11 +1200)]
layers: Trim down locked regions in CreateRenderPass

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Mark some layer_data const, remove unordered_map::operator[] use.
Chris Forbes [Fri, 6 May 2016 03:54:55 +0000 (15:54 +1200)]
layers: Mark some layer_data const, remove unordered_map::operator[] use.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Fix get_descriptor_binding
Chris Forbes [Wed, 11 May 2016 03:18:00 +0000 (15:18 +1200)]
layers: Fix get_descriptor_binding

Not sure where the `return` went... this worked by accidents of calling
conventions in debug, but was rightfully eaten by the optimizer in release.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Get rid of even more coupling between SC and rest of CV
Chris Forbes [Tue, 10 May 2016 04:47:02 +0000 (16:47 +1200)]
layers: Get rid of even more coupling between SC and rest of CV

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: have PIPELINE_LAYOUT_NODE hold ptrs to descriptor set layouts
Chris Forbes [Tue, 10 May 2016 04:02:49 +0000 (16:02 +1200)]
layers: have PIPELINE_LAYOUT_NODE hold ptrs to descriptor set layouts

Just holding the nondispatchable object handles forces
get_descriptor_binding to use layer_data, which we'd rather it didn't.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: add some asserts to spirv_inst_iter
Chris Forbes [Tue, 10 May 2016 23:44:12 +0000 (11:44 +1200)]
layers: add some asserts to spirv_inst_iter

These allow us to more easily catch in debug:
- Bogus zero-length instructions
- Reads off the end of the instruction

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Update fence to track all queues associated with it
Tobin Ehlis [Tue, 10 May 2016 18:09:30 +0000 (12:09 -0600)]
layers: Update fence to track all queues associated with it

Semaphore's can create cross-queue dependencies between fences.
This change updates the FENCE_NODE object to have an unordered_set
of all queues that a fence is tied to instead of just tracking the
last queue on which a fence has been submitted.

8 years agolayers: GH458 Fix cleanup of queue lastFences
Tobin Ehlis [Tue, 10 May 2016 16:16:23 +0000 (10:16 -0600)]
layers: GH458 Fix cleanup of queue lastFences

When waiting on fences, they were not being correctly removed from the
queue's lastFences vector. Updated the remove code and verified that
it's now working correctly.

8 years agolayers: Save swapchain image format for later validation compares
Tony Barbour [Fri, 6 May 2016 20:23:44 +0000 (14:23 -0600)]
layers: Save swapchain image format for later validation compares

This fixes the cube resize with validation enabled bug
LunarEx issue #501, Github Issue #275

Change-Id: Ifc73be13f09f332a7b30e08d1f9fe4f3894d2b78

8 years agobuild: GH316 include cinttypes instead of inttypes.h
Karl Schultz [Tue, 10 May 2016 17:36:08 +0000 (11:36 -0600)]
build: GH316 include cinttypes instead of inttypes.h

Fixes compilation problems on CentOS.

Change-Id: I92c5ea0ebea8684c40e67e9b386732e55cb47cc8

8 years agolayers: Add missing parameter_validation functions
Dustin Graves [Mon, 9 May 2016 23:36:57 +0000 (17:36 -0600)]
layers: Add missing parameter_validation functions

Add the following to address missing functionality in the
parameter_validation layer:
- Add parameter_validation_vkResetCommandBuffer call to
  vkResetCommandBuffer
- Add missing vkGetPhysicalDevice.* exports to GetInstanceProcAddress

Change-Id: I73944933b0c318f691a14c305c192aa7a0bf8ded

8 years agoloader: Update interface doc
Jon Ashburn [Tue, 10 May 2016 15:24:52 +0000 (09:24 -0600)]
loader: Update interface doc
The version 0 layer did not properly address the desktop loader requirements.
Split the layer interface into an Android section and a desktop section.

Change-Id: I782bdddd13da318274ad604ee0e48208bd1dc947

8 years agoMerge pull request #513 from chrisforbes/cv-tidy-more
Chris Forbes [Tue, 10 May 2016 04:42:02 +0000 (16:42 +1200)]
Merge pull request #513 from chrisforbes/cv-tidy-more

layers: Start cutting needless deps between SC and layer_data

8 years agolayers: Start cutting needless deps between SC and layer_data
Chris Forbes [Tue, 10 May 2016 03:30:22 +0000 (15:30 +1200)]
layers: Start cutting needless deps between SC and layer_data

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agotests: Add tests focussed on the Image validation layer
Tony Barbour [Thu, 5 May 2016 20:46:39 +0000 (14:46 -0600)]
tests: Add tests focussed on the Image validation layer

Change-Id: Ifa42ea77db06322157e54852f187d4d83579b51e

8 years agolayers: Update behavior for secondary cmdbuffers w/ *_SIMULTANEOUS_USE_BIT set
Tobin Ehlis [Mon, 9 May 2016 19:22:50 +0000 (13:22 -0600)]
layers: Update behavior for secondary cmdbuffers w/ *_SIMULTANEOUS_USE_BIT set

Spec clarification has been approved and secondary command buffers with
VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT may be in flight in multiple primary
command buffers at the same time.

This changes updates the error concerning secondary command buffers to be in-flight
on multiple primary command buffers to only appli if
VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT is not set.

8 years agoloader: lvlgh204, Fix calls to secure_getenv on glibc < 2.17
Jon Ashburn [Mon, 9 May 2016 17:31:40 +0000 (11:31 -0600)]
loader: lvlgh204, Fix calls to secure_getenv on glibc < 2.17

Change-Id: I2f98d8de343cf3f6a30fdc223b37201b32571e99

8 years agoheader: update that includes debug_marker extension
Jon Ashburn [Mon, 9 May 2016 13:59:14 +0000 (07:59 -0600)]
header: update that includes debug_marker extension

Change-Id: Ifb8b7e2f66ac3dcb6e1889d59879caba39805d53

8 years agolayers: Fix safe_struct gen to skip debug_marker struct
Jon Ashburn [Mon, 9 May 2016 14:51:17 +0000 (08:51 -0600)]
layers: Fix safe_struct gen to skip debug_marker struct

Safe structure doesn't work with static arrays; add an
exception so safe-struct is not generated for the strcuture in question.

Change-Id: I4605fdfb3dd840fb8e38371e7e59311fc6e1cb9f

8 years agotests: Add required parameter tests
Dustin Graves [Fri, 6 May 2016 17:20:38 +0000 (11:20 -0600)]
tests: Add required parameter tests

Add parameter_validation layer tests, to check the
parametert_validation::REQUIRED_PARAMETER error case.

Change-Id: I9ecb1ec914bdc093f007d5f61dbdc47ba0d5551c

8 years agolayers: Add error codes for parameter_validation
Dustin Graves [Thu, 5 May 2016 19:44:21 +0000 (13:44 -0600)]
layers: Add error codes for parameter_validation

Add error codes to the parameter_validation layer:
- Add parameter_validation::ErrorCode enum defining common parameter
  validation errors to parameter_validation_utils.h
- Replace the '1' in parameter_validation log_msg calls with the
  appropriate error code
- Add parameter_validation error code documentation to
  vk_validation_layer_details.md
- Remove 'typedef enum' declaration requirement for error code
  enumerations from vk_layer_documentation_generate.py; It will
  now recognize error code enmerations declared wihtout the typedef

Change-Id: Icf18b9124000159f7436f66e48a95d0c58047a07

8 years agolayers: Add parameter_validation namespace
Dustin Graves [Wed, 4 May 2016 18:56:08 +0000 (12:56 -0600)]
layers: Add parameter_validation namespace

Add parameter_validation namespace for utility functions.  Namespace will
be extended to include core layer functions in a future update.

Change-Id: I0929f5caacbf3e1b4509f051ea020566cce44e3e

8 years agotests: Add InvalidImageLayout tests
Tobin Ehlis [Wed, 4 May 2016 20:08:34 +0000 (14:08 -0600)]
tests: Add InvalidImageLayout tests

These hit 16/18 cases for INVALID_IMAGE_LAYOUT enum in core_validation.
The other 2 cases were already hit by object_tracker and another test.

8 years agocore_validation: avoid invalid GIPA call in vkCreateDevice
Chia-I Wu [Fri, 6 May 2016 04:19:33 +0000 (12:19 +0800)]
core_validation: avoid invalid GIPA call in vkCreateDevice

Save VkInstance in layer_data so that we query vkCreateDevice with a valid
instance.

8 years agocore_validation: handle device commands in GetInstanceProcAddr
Chia-I Wu [Fri, 6 May 2016 04:04:23 +0000 (12:04 +0800)]
core_validation: handle device commands in GetInstanceProcAddr

Per commit 5bf16c33b9c1f38fc467d94716f276620a265327, extension check is
bypassed in GetInstanceProcAddr for VK_KHR_swapchain functions.

8 years agocore_validation: no interface functions in layer functions
Chia-I Wu [Fri, 6 May 2016 03:58:01 +0000 (11:58 +0800)]
core_validation: no interface functions in layer functions

Move handling of interface functions in
core_validation::GetInstanceProcAddr to v0's vkGetInstanceProcAddr.

8 years agocore_validation: refactor GetInstanceProcAddr
Chia-I Wu [Fri, 6 May 2016 03:55:53 +0000 (11:55 +0800)]
core_validation: refactor GetInstanceProcAddr

Split command intercepting out to intercept_core_instance_command.  Assert
that instance is valid if intercept_core_instance_command returns nullptr.

8 years agocore_validation: add intercept_khr_swapchain_command
Chia-I Wu [Fri, 6 May 2016 03:51:11 +0000 (11:51 +0800)]
core_validation: add intercept_khr_swapchain_command

It returns the function pointers for all intercepted VK_KHR_swapchain
commands.  Call intercept_khr_swapchain_command from GetDeviceProcAddr.

8 years agocore_validation: add intercept_core_device_command
Chia-I Wu [Fri, 6 May 2016 03:44:32 +0000 (11:44 +0800)]
core_validation: add intercept_core_device_command

It returns the function pointers for all intercepted core device commands.
Call intercept_core_device_command from GetDeviceProcAddr.  Assert that
device is valid in GetDeviceProcAddr.

8 years agocore_validation: improve EnumerateDeviceExtensionProperties
Chia-I Wu [Fri, 6 May 2016 03:38:37 +0000 (11:38 +0800)]
core_validation: improve EnumerateDeviceExtensionProperties

Call down the next layer unless pLayerName is core_validation.

8 years agocore_validation: add core_validation::global_layer
Chia-I Wu [Fri, 6 May 2016 03:36:52 +0000 (11:36 +0800)]
core_validation: add core_validation::global_layer

Replace cv_global_layers and cv_device_layers with global_layer.  There is
no plan to define more than one layer in the same namespace.

8 years agocore_validation: drop vk prefix for layer functions
Chia-I Wu [Fri, 6 May 2016 03:32:54 +0000 (11:32 +0800)]
core_validation: drop vk prefix for layer functions

Drop VK_LAYER_EXPORT as well.

8 years agocore_validation: put layer functions into a namespace
Chia-I Wu [Fri, 6 May 2016 03:20:20 +0000 (11:20 +0800)]
core_validation: put layer functions into a namespace

Put all layer fucntions/data into core_validation namespace.  I had to add
some wrappers to make everything work.

8 years agocore_validation: move vkEnumerate*Properties around
Chia-I Wu [Fri, 6 May 2016 03:17:16 +0000 (11:17 +0800)]
core_validation: move vkEnumerate*Properties around

Move them toward the end of the file.

8 years agolayers: Properly set secondary cmd buffer inherited items.
Mark Young [Fri, 6 May 2016 19:48:26 +0000 (13:48 -0600)]
layers: Properly set secondary cmd buffer inherited items.

We failed to inherit the proper items in the secondary cmd buffer
in the core_validation layer when the
VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT bit was set.

Change-Id: I01579d889dde8e0d331ed5a65eb48ce7185d3d82

8 years agolayers: Fix usage flags validation of CreateImageView
Chris Forbes [Sat, 7 May 2016 22:19:14 +0000 (10:19 +1200)]
layers: Fix usage flags validation of CreateImageView

We need to validate the flags before calling down into the ICD. At least
one ICD (Anvil) asserts if it sees bad flags.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
8 years agolayers: Fix logical negate to bitwise negate in access flags checking
Chris Forbes [Fri, 6 May 2016 06:07:09 +0000 (18:07 +1200)]
layers: Fix logical negate to bitwise negate in access flags checking

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Correct object_tracker section in validation details doc
Mark Lobodzinski [Fri, 6 May 2016 21:40:49 +0000 (15:40 -0600)]
layers: Correct object_tracker section in validation details doc

Change-Id: If113a338674655b339e76d3bb14e50be3796f168

8 years agolayers: Fix object_tracker warnings in Android and Win32 builds
Mark Lobodzinski [Thu, 5 May 2016 17:45:57 +0000 (11:45 -0600)]
layers: Fix object_tracker warnings in Android and Win32 builds

Change-Id: If937c4c5aca0dc274aa67a9b52b99909723f082c

8 years agolayers: Fix object_tracker handling of pool-related validation failures
Mark Lobodzinski [Tue, 3 May 2016 14:39:24 +0000 (08:39 -0600)]
layers: Fix object_tracker handling of pool-related validation failures

Return codes weren't plumbed through, failures caused layer crashes.

Change-Id: If258d449a420d33b6c72dc5c289d77c7215f2c2f

8 years agotests: Round out object-tracker layer validation tests
Mark Lobodzinski [Mon, 2 May 2016 23:17:41 +0000 (17:17 -0600)]
tests: Round out object-tracker layer validation tests

Change-Id: I6aad451a44cf2053b078eca98adca6b72acbd0a0

8 years agolayers: Correct and/or remove obsolete object_tracker error enums
Mark Lobodzinski [Mon, 2 May 2016 19:19:15 +0000 (13:19 -0600)]
layers: Correct and/or remove obsolete object_tracker error enums

Change-Id: I6f759890749fb17226e00d28ab8391dc7cc0e80c

8 years agolayers: ObjectTracker dead code elimination
Mark Lobodzinski [Mon, 2 May 2016 19:11:50 +0000 (13:11 -0600)]
layers: ObjectTracker dead code elimination

Change-Id: I3244f8da58a7f150ebfa772a7c131422f75d0d8b

8 years agolayers: Remove 'using namespace std' in object_tracker
Mark Lobodzinski [Mon, 2 May 2016 18:08:24 +0000 (12:08 -0600)]
layers: Remove 'using namespace std' in object_tracker

Change-Id: Ic1ab57e5b4192ed98df8c7e6fc8c225aff631fd8

8 years agodoc: allow layers to ignore pAllocator
Chia-I Wu [Fri, 6 May 2016 00:41:52 +0000 (08:41 +0800)]
doc: allow layers to ignore pAllocator

8 years agolayers: GH494 Add constructors for IMAGE and BUFFER nodes
Tobin Ehlis [Fri, 6 May 2016 16:22:16 +0000 (10:22 -0600)]
layers: GH494 Add constructors for IMAGE and BUFFER nodes

Add proper constructors for IMAGE_NODE and BUFFER_NODE classes and
correctly initialize all of their data members.

Change-Id: I6c9d4a3ba6f3ef8e569de55793de9d6f7fd406b1

8 years agolayers: Fix param check debug report level
Dustin Graves [Fri, 6 May 2016 16:17:12 +0000 (10:17 -0600)]
layers: Fix param check debug report level

Change VkFlags and enumeration debug report levels from WARNING to
ERROR.

Change-Id: I06bf454c77dee2cd46db29cd1ffcb67febfba666

8 years agolayers: Add missing vkCmdSetStencil param checks
Dustin Graves [Fri, 6 May 2016 16:16:06 +0000 (10:16 -0600)]
layers: Add missing vkCmdSetStencil param checks

Add missing parameter validation for vkCmdSetStencil* functions.

Change-Id: Ib2d2527341815412bc441427ba1dbf6d3826f3c6

8 years agolayers: Fix core_validation issues GH103 and GH240
Mark Young [Wed, 4 May 2016 20:38:51 +0000 (14:38 -0600)]
layers: Fix core_validation issues GH103 and GH240

Perform pipeline sample and attachment count validation at draw
time instead of vkCmdNextSubpass() time.  Also validate that
an active renderpass exists.

Change-Id: I912947287eef29d532519220750c3a93a3554565

8 years agolayers: Further descriptorSet cleanup fixes
Tobin Ehlis [Thu, 5 May 2016 21:09:11 +0000 (15:09 -0600)]
layers: Further descriptorSet cleanup fixes

Clear the pools list of sets when pool is reset.
Also make sure to remove sets from pool as they are freed.
Added a related fix to testing to correctly free descriptorSets
in DescriptorSetCompatibility test.

8 years agolayers: Correctly invalidate cmd buffers when descriptor pool cleared/freed
Tobin Ehlis [Thu, 5 May 2016 19:49:42 +0000 (13:49 -0600)]
layers: Correctly invalidate cmd buffers when descriptor pool cleared/freed

When a DescriptorSet pool is Destroyed or Reset we destroy all underlying
descriptorSets, but we weren't invalidating cmd buffers bound to those sets
in these cases. This adds a common function, freeDescriptorSet(), to make
sure anytime a descriptor set is destroyed, any bound cmd buffers get
invalidated and the set is removed from setMap and then destroyed.

8 years agolayers: Fix descriptorSet cleanup bugs
Tobin Ehlis [Thu, 5 May 2016 19:18:20 +0000 (13:18 -0600)]
layers: Fix descriptorSet cleanup bugs

When we deleted DescriptorSet* objects we weren't removing them
from the setMap.

8 years agolayers: Migrate VerifyUpdateConsistency to DescriptorSetLayout class
Tobin Ehlis [Thu, 5 May 2016 18:03:44 +0000 (12:03 -0600)]
layers: Migrate VerifyUpdateConsistency to DescriptorSetLayout class

This was in the DescriptorSet class, but really belonged in the Layer.
There was also a bug where it did not correctly handle the case of an
initial offset that oversteps the size of the first binding being updated.
That is legal according to the spec so added code to handle that case by
walking the bindings until we get to the actual binding on which the first
update will occur.

8 years agolayers: Store layout bindings_ by value instead of ptr
Tobin Ehlis [Thu, 5 May 2016 17:04:44 +0000 (11:04 -0600)]
layers: Store layout bindings_ by value instead of ptr

Kill the ptr to safe_VkDescriptorSetLayoutBinding in DescriptorSetLayout
class. This saves us the "new" and the need for a custom destructor.
Couldn't do this initially but I've since added copy constructors
to all of the safe_* struct types.

8 years agolayers: Kill unused shadowUpdateNode()
Tobin Ehlis [Thu, 5 May 2016 16:50:58 +0000 (10:50 -0600)]
layers: Kill unused shadowUpdateNode()

No longer needed with migration to DescriptorSet class.

8 years agolayers: Fix stale comments in core_validation
Tobin Ehlis [Thu, 5 May 2016 16:43:30 +0000 (10:43 -0600)]
layers: Fix stale comments in core_validation

8 years agolayers: Remove unused IsUpdated(uint32_t) from DescriptorSet class
Tobin Ehlis [Thu, 5 May 2016 16:36:24 +0000 (10:36 -0600)]
layers: Remove unused IsUpdated(uint32_t) from DescriptorSet class

All of the functionality that I thought I would need this for is contained
in the ValidateDrawState() function.

8 years agolayers: Removed unused full_update_ from DescriptorSet class
Tobin Ehlis [Thu, 5 May 2016 16:30:46 +0000 (10:30 -0600)]
layers: Removed unused full_update_ from DescriptorSet class

I originally added this thinking it would be useful but currently
unused and not correctly tracked so just killing it.

8 years agolayers: Remove use of map at() function from descriptor_set class
Tobin Ehlis [Thu, 5 May 2016 16:16:02 +0000 (10:16 -0600)]
layers: Remove use of map at() function from descriptor_set class

8 years agolayers: Clean up access to descriptors_ vector
Tobin Ehlis [Thu, 5 May 2016 15:04:33 +0000 (09:04 -0600)]
layers: Clean up access to descriptors_ vector

Migrate a number of unneccessary .at() calls to just use [] operator.
Also replace push_back() calls at descriptor creation time with emplace_back().

8 years agolayers: Kill SET_NODE construct and just use DescriptorSet class
Tobin Ehlis [Thu, 5 May 2016 14:25:02 +0000 (08:25 -0600)]
layers: Kill SET_NODE construct and just use DescriptorSet class

Migrated setMap to just use DescriptorSet class natively. SET_NODE was
just wrapping that class but that's not necessary so killing extra indirection.

8 years agolayers: Rearchitect Descriptor Set validation code
Tobin Ehlis [Tue, 3 May 2016 14:31:08 +0000 (08:31 -0600)]
layers: Rearchitect Descriptor Set validation code

This change pulls all of the DescriptorSet code out of core_validation.cpp and into
its own files/classes in descriptor_set.h/cpp.

See header file for complete class documentation.

These changes pass tri/cube/smoketest --validate.
All related layer validation tests are also updated and passing.
Finally, I ran it through mustpass CTS and did not hit any issues related to these changes.

These changes not only update the descriptor interface but fix some known lingering
bugs with how descriptor updates occurred. This includes now correctly handling
updates that cross binding boundaries and updates that write a subset of a binding.

Going forward this is a general outline for how we would like to evolve core_validation.
That is, we'd like to move the functionality of the checks into reasonable classes and
just have core_validation call into those classes to do the majority of the work.

8 years agolayers: Clear cmdbufs and prior fences after processed in decrement.
Michael Lentine [Thu, 5 May 2016 21:20:16 +0000 (16:20 -0500)]
layers: Clear cmdbufs and prior fences after processed in decrement.

8 years agodocs: Add contrib info and link
Karl Schultz [Thu, 5 May 2016 21:16:56 +0000 (15:16 -0600)]
docs: Add contrib info and link

8 years agodocs: Elevate contrib info, add link
Karl Schultz [Thu, 5 May 2016 21:14:59 +0000 (15:14 -0600)]
docs: Elevate contrib info, add link

8 years agolayers: #471 swapchin layer to use find() for map lookups
Ian Elliott [Thu, 5 May 2016 20:10:49 +0000 (14:10 -0600)]
layers: #471 swapchin layer to use find() for map lookups

This fixes a long-standing (day-1) defect in the swapchain layer (perhaps
cloned from another layer at the time?).  Several unordered maps are used to
keep track of things.  The layer was using the [] operator for both adding a
new entry to a map, and for looking up entries that should already be in a map.
This latter usage is where the bug is.  If a handle is passed in that hasn't
been seen before, the use of the [] operator will add a new entry to the
map--one that hasn't been initialized.  The new EnableWsiBeforeUse test caused
a crash in the swapchain layer when it used VK_NULL_HANDLE.

The new code uses the find() element-lookup function of the unordere map class,
and compares this to end().  If the found value is equal to end() (i.e. it
currently isn't in the map), NULL is used for the pointer (the desired behavior
in the swapchain layer).

Two new macros were used in order to keep the code minimal and consistent in
its use of find()/end().

8 years agolayers: Fix "count" tests in swapchain layer.
Ian Elliott [Thu, 5 May 2016 20:06:53 +0000 (14:06 -0600)]
layers: Fix "count" tests in swapchain layer.

The swapchain layer was attempting to test if the application gave a value for
a *Count variable (e.g. pSurfaceFormatCount for the
vkGetPhysicalDeviceSurfaceFormatsKHR() function) that was larger than what that
function returned previously (i.e. when the non-count variable was NULL).
However, the test was made after calling down the call-chain, which may modify
the value given by the application.  This test is now made before calling down
the chain.

In addition, a new test is made that tries to ensure that the application did
call the function with the non-Count variable equal to NULL **before** calling
the function with a non-NULL non-Count variable.

8 years agoloader: added Windows resource file for vulkan-1.dll
David Pinedo [Thu, 5 May 2016 19:52:37 +0000 (13:52 -0600)]
loader: added Windows resource file for vulkan-1.dll

Properties->Details on vulkan-1.dll will display valid
version and build information

Address:
  https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/issues/473