platform/upstream/Vulkan-Tools.git
8 years agolayers: GH785, Validate rasterinfo->polygonMode
Mark Lobodzinski [Tue, 9 Aug 2016 19:10:51 +0000 (13:10 -0600)]
layers: GH785, Validate rasterinfo->polygonMode

If fillModeNonSolid is not enabled, polygonMode cannot be set to
POINT or LINE.

Change-Id: I6cfdfac8f5c9ff7d27b94bf0aa80ae1249b0ce25

8 years agolayers: Fix missing PV WSI registration
Mark Lobodzinski [Mon, 15 Aug 2016 22:22:50 +0000 (16:22 -0600)]
layers: Fix missing PV WSI registration

Change-Id: I1c924977a420bc7a417710b82f0a42f4ae5dd4c3

8 years agowinsdk: Move uninstall log to temp
Lenny Komow [Mon, 15 Aug 2016 20:41:26 +0000 (14:41 -0600)]
winsdk: Move uninstall log to temp

8 years agolayers: Style fixup, don't use pass-by-reference params
Tobin Ehlis [Fri, 12 Aug 2016 20:26:31 +0000 (14:26 -0600)]
layers: Style fixup, don't use pass-by-reference params

Change pass-by-reference to a ptr to comply with Google style guide.
This way it's more clear that function is modifying param, especially when calling.

8 years agolayers: Naming corrections
Tobin Ehlis [Fri, 12 Aug 2016 20:12:44 +0000 (14:12 -0600)]
layers: Naming corrections

Some minor fix-ups to variable names and comments for memory aliasing code.

8 years agolayers: Refactor set/validate memory valid functions
Tobin Ehlis [Thu, 11 Aug 2016 01:11:54 +0000 (19:11 -0600)]
layers: Refactor set/validate memory valid functions

Create custom image and buffer versions of functions to minimize casting.

8 years agolayers: Push some casts into helper functions
Tobin Ehlis [Thu, 11 Aug 2016 00:01:27 +0000 (18:01 -0600)]
layers: Push some casts into helper functions

8 years agolayers: Handle memory mapped prior to object binding
Tobin Ehlis [Wed, 10 Aug 2016 23:00:51 +0000 (17:00 -0600)]
layers: Handle memory mapped prior to object binding

This adds initial support for memory that is updated via a MapMemory() call
prior to an object being bound. Initially any mapped allocation will just have
global_valid set for whole allocation. This value is then picked up by any
ranges made off of that allocation.

Really, we need to create new mapped regions and mark them valid, then make
sure that any overlapped objects pick up valid from mapped regions. This
requires more thought and design, though, so commiting this changes as a
simpler and incomplete initial fix.

8 years agolayers : Update memory valid to be per-range
Tobin Ehlis [Wed, 10 Aug 2016 22:08:00 +0000 (16:08 -0600)]
layers : Update memory valid to be per-range

We previously only tracked a single valid bool for an entire allocation.
That can easily get out of synch when multiple objects are bound to the
same allocation. This update moves the valid tracking to be per-range so
that it can be tracked on a per-object basis.

This does handle aliasing cases where various objects completely alias each
other, but there are still various aliased resource cases that aren't handled.

8 years agolayers: Refactor InsertMemoryRange
Tobin Ehlis [Wed, 10 Aug 2016 15:55:59 +0000 (09:55 -0600)]
layers: Refactor InsertMemoryRange

Work with local MEMORY_RANGE struct and insert to map at the end.
This avoids a loop pass and the awkward loop check of a range against itself.
Adds the slight complexity of storing aliases during loop and updating them
after the loop, but I prefer that to the alternative.

8 years agolayers: Update bound memory tracking and alias checking
Tobin Ehlis [Mon, 8 Aug 2016 18:33:11 +0000 (12:33 -0600)]
layers: Update bound memory tracking and alias checking

Store all ranges bound to a single memory allocation in a single map indexed by object id.
Add two separate unordered_sets for independent image and vector processing.

Added a set of aliases to MEMORY_RANGE struct to hold any aliased ranges.
Insert aliased ranges at create time and remove the aliases when a range
is destroyed.

Have a single function, rangesInterset, to track if regions bound to a memory
allocation overlap, and if linear/non-linear overlap in violation of the spec.

8 years agodemos : SAM6 Flip projection matrix, instead of vertex-shader
Rene Lindsay [Fri, 12 Aug 2016 23:56:09 +0000 (17:56 -0600)]
demos : SAM6 Flip projection matrix, instead of vertex-shader

Change-Id: I0000000000decaf15bad0000000000000000006b

8 years agowinsdk: Clean up confiure_runtime.c and docs
Lenny Komow [Fri, 12 Aug 2016 19:26:20 +0000 (13:26 -0600)]
winsdk: Clean up confiure_runtime.c and docs

8 years agowinsdk: Make RT installer use C program
Lenny Komow [Wed, 10 Aug 2016 16:31:07 +0000 (10:31 -0600)]
winsdk: Make RT installer use C program

8 years agowinsdk: Add C program for runtime configuration
Lenny Komow [Tue, 9 Aug 2016 21:56:15 +0000 (15:56 -0600)]
winsdk: Add C program for runtime configuration

8 years agodocs: Add renderpass tests from GH427
Tony Barbour [Wed, 10 Aug 2016 16:32:42 +0000 (10:32 -0600)]
docs: Add renderpass tests from GH427

Change-Id: I3804836836af714fd9ba3138518d5c78832fc4d5

8 years agospirv-headers : Add file to restrict to commit
Mark Young [Thu, 11 Aug 2016 14:46:55 +0000 (08:46 -0600)]
spirv-headers : Add file to restrict to commit

Restrict spirv-headers to a specific commit (just as we do to
spirv-tools and glslang) by creating a new file
(spirv-headers_revision) to track the commit we want to
syncrhonize to.  Also update the update_external_sources scripts
to use it.  This will make sure that we don't run into the
scenario where spirv-tools and spirv-headers are incompatible.

Change-Id: Ia4fdd921a5c1c500d7f751db08b6998b3d704f2d

8 years agolayers: Update PV variable names, clang-format
Mark Lobodzinski [Thu, 11 Aug 2016 19:25:38 +0000 (13:25 -0600)]
layers: Update PV variable names, clang-format

Change-Id: I1c1da95bbfa1dce31b2b109ec7dea0c770af44c9

8 years agolayers: Add WSI support to parameter_validation
Mark Lobodzinski [Tue, 9 Aug 2016 16:44:38 +0000 (10:44 -0600)]
layers: Add WSI support to parameter_validation

Change-Id: Ieb52e121632c6297eee5e37baeade5f0c8f8f3e5

8 years agolayers: Validate Enabled Features in PV
Mark Lobodzinski [Tue, 9 Aug 2016 19:41:09 +0000 (13:41 -0600)]
layers: Validate Enabled Features in PV

ParameterValidation was using the hardware supported feature set for
validation -- these are now replaced with the application-enabled
features at CreateDevice time.

Change-Id: If52d3ae3e55c69611e02437d33a651d88ba7043d

8 years agomisc: Add vulkan C++ header
Lenny Komow [Thu, 11 Aug 2016 17:23:15 +0000 (11:23 -0600)]
misc: Add vulkan C++ header

8 years agodemos: Fix useless NULL check in cube and tri
Lenny Komow [Thu, 11 Aug 2016 16:57:38 +0000 (10:57 -0600)]
demos: Fix useless NULL check in cube and tri

8 years agolayers: Refactor function names
Tobin Ehlis [Thu, 11 Aug 2016 13:43:03 +0000 (07:43 -0600)]
layers: Refactor function names

Capitalize first letter of Validate[Image|Buffer]UsageFlags() functions

8 years agolayers: Fixes GH846 Use IMAGE_USAGE bits for images
Tobin Ehlis [Thu, 11 Aug 2016 13:16:53 +0000 (07:16 -0600)]
layers: Fixes GH846 Use IMAGE_USAGE bits for images

Cut-and-paste bug. Various checks for images usage flags were being made
against BUFFER_USAGE enums instead of IMAGE_USAGE enums

8 years agolayers: Update details doc w/new queue family test
Mark Lobodzinski [Wed, 10 Aug 2016 19:12:23 +0000 (13:12 -0600)]
layers: Update details doc w/new queue family test

Added MismatchedQueueFamiliesOnSubmit() test for validating
DRAWSTATE_INVALID_QUEUE_FAMILY errors.

Change-Id: I86ff4da21840a679e755790ae6c7810a0f752028

8 years agolayers: GH790, Validate queue family at submit-time
Mark Lobodzinski [Tue, 9 Aug 2016 22:42:24 +0000 (16:42 -0600)]
layers: GH790, Validate queue family at submit-time

Command buffers must come from a command pool created with the same
queue family index as the queue they are submitted on.

Change-Id: Ifd1d73a09643c11852d807cb7edfc881827005dd

8 years agolayers: Adjust color/input attachment layout checks style
Chris Forbes [Tue, 9 Aug 2016 22:41:27 +0000 (10:41 +1200)]
layers: Adjust color/input attachment layout checks style

For consistency with depth

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agodemos: Fix operator precedence problem with window width
Tony Barbour [Wed, 10 Aug 2016 19:39:36 +0000 (13:39 -0600)]
demos: Fix operator precedence problem with window width

Change-Id: Ief0b260528a6eb38788f88ec8a463307522849e8

8 years agotoolchain: Fix SPIRV-Headers update script
Cody Northrop [Fri, 5 Aug 2016 20:21:21 +0000 (14:21 -0600)]
toolchain: Fix SPIRV-Headers update script

Without specifying a branch, git pull fails.

8 years agolayers: Fix MapMem image layout validation
Tobin Ehlis [Thu, 4 Aug 2016 16:17:19 +0000 (10:17 -0600)]
layers: Fix MapMem image layout validation

When mapping memory, check all of the bound image ranges and for any
that overlap with the map range, make sure that the image layout is
either PREINITIALIZED or GENERAL.

8 years agolayers: Rename validateMemRange()
Tobin Ehlis [Thu, 4 Aug 2016 15:33:02 +0000 (09:33 -0600)]
layers: Rename validateMemRange()

This function is only used in MapMemory case so renamed to
ValidateMapMemRange() and added a header comment to make use
more clear.

8 years agolayers: Rename DEVICE_MEM_INFO struct members
Tobin Ehlis [Thu, 4 Aug 2016 14:03:32 +0000 (08:03 -0600)]
layers: Rename DEVICE_MEM_INFO struct members

Update names from camelcase to lowercase w/ "_" as we're slowly migrating
to that uniform style

8 years agolayers: Remove image member from DEVICE_MEM_INFO
Tobin Ehlis [Thu, 4 Aug 2016 13:53:46 +0000 (07:53 -0600)]
layers: Remove image member from DEVICE_MEM_INFO

The image member is broken and was superceded by objBindings which track
all objects bound to a single memory allocation.

This is also temporarily disabling a check for image layout when mapping
memory, but that check was broken and will be fixed in subsequent CL.

8 years agolayers: Account for read-only depthstencil attachments in ValidateLayout
Chris Forbes [Mon, 8 Aug 2016 20:17:14 +0000 (08:17 +1200)]
layers: Account for read-only depthstencil attachments in ValidateLayout

The depth stencil attachment can be DEPTH_STENCIL_READ_ONLY_OPTIMAL.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Update validation layer details doc
Mark Lobodzinski [Fri, 5 Aug 2016 18:05:16 +0000 (12:05 -0600)]
layers: Update validation layer details doc

Added new image test for undefined format in CreateRenderPass
attachment description and updated notes for missing tests.

Change-Id: I6a928213da8dc86d59a33a704cbbec8bd3cfbd45

8 years agolayers: LX578, Add CreateRenderPass format check
Mark Lobodzinski [Fri, 5 Aug 2016 17:30:15 +0000 (11:30 -0600)]
layers: LX578, Add CreateRenderPass format check

Validate that AttachmentDescription.Format is not UNDEFINED.

Change-Id: Id348905aadfdc552c3b674a5752cdbc350022d8e

8 years agolayers: Add minor Image::CreateRenderPass updates
Mark Lobodzinski [Fri, 5 Aug 2016 17:20:21 +0000 (11:20 -0600)]
layers: Add minor Image::CreateRenderPass updates

Combined some repeated for-loops, code standards fixups, etc., in
the image layer.

Change-Id: I3952691d392898ce3c8fa7cc0a6762a40d06220d

8 years agodemos: Fix ifdefs to allow compilation without XLIB
Tony Barbour [Mon, 8 Aug 2016 17:04:17 +0000 (11:04 -0600)]
demos: Fix ifdefs to allow compilation without XLIB

Change-Id: I3fbed70e842bf327437d77f56cd0fa7848ab5d19

8 years agotests: Add ColorBlendLogicOpTests
Tobin Ehlis [Tue, 19 Jul 2016 19:25:12 +0000 (13:25 -0600)]
tests: Add ColorBlendLogicOpTests

This is a dual-purpose test. If the underlying device supports logicOp,
then attempt to use an invalid logicOp and verify that an error is flagged.
If the device doesn't support logicOp, attempt to use it and verify that
the correct error is flagged.

Also update documentation.

8 years agotests: Add IndexBufferNotBound test
Tobin Ehlis [Tue, 19 Jul 2016 17:22:29 +0000 (11:22 -0600)]
tests: Add IndexBufferNotBound test

Attempt and indexed draw with no index buffer bound.

8 years agolayers: Exclude index buffer from CBSTATUS_ALL mask
Tobin Ehlis [Tue, 19 Jul 2016 17:20:24 +0000 (11:20 -0600)]
layers: Exclude index buffer from CBSTATUS_ALL mask

The CBSTATUS_ALL mask is set to default all dynamic state to static in the
PSO. The index buffer doesn't fall under the other dynamic state umbrella
so excluding it from the CBSTATUS_ALL mask.

8 years agotests: Add FramebufferIncompatible test
Tobin Ehlis [Tue, 19 Jul 2016 16:50:30 +0000 (10:50 -0600)]
tests: Add FramebufferIncompatible test

Test where secondary command buffer has different framebuffer than
primary command buffer, which is a violation.
Update documentation.

8 years agolayers: Remove duplicate framebuffer incompatible check
Tobin Ehlis [Tue, 19 Jul 2016 16:45:24 +0000 (10:45 -0600)]
layers: Remove duplicate framebuffer incompatible check

The existing DRAWSTATE_FRAMEBUFFER_INCOMPATIBLE check was a duplicate
of a check performed a few lines earlier in the validateFramebuffer()
function.
Update the check in that function to use the DRAWSTATE_FRAMEBUFFER_INCOMPATIBLE
enum and remove the duplicate check.

8 years agodemos: Fix cube to handle >1 event per frame
Tony Barbour [Fri, 5 Aug 2016 20:55:20 +0000 (14:55 -0600)]
demos: Fix cube to handle >1 event per frame

Change-Id: I6532f75f285b7428993da9314e128bfe5e476829

8 years agodemos: Fix Android build on OSX and Windows
Cody Northrop [Fri, 5 Aug 2016 18:30:44 +0000 (12:30 -0600)]
demos: Fix Android build on OSX and Windows

8 years agodemos: Flip cube texture on android
Mike Stroyan [Thu, 4 Aug 2016 17:20:14 +0000 (11:20 -0600)]
demos: Flip cube texture on android

Flip the cube texture on android to track commit cb7f374.
Recreate lunarg.ppm.h from lunarg.ppm using xxd.
xxd -g 1 -c 12 -i lunarg.ppm > android/include/lunarg.ppm.h

8 years agolayers: Reenable fix for DS layout transitions
Mark Lobodzinski [Fri, 5 Aug 2016 15:38:18 +0000 (09:38 -0600)]
layers: Reenable fix for DS layout transitions

Fix for GH650, plus added fix for cube/tri.

Change-Id: I66c2332c30eb34a0f022c033efd9b1c5b8284c32

8 years agoGH 818: Improve swapchain error for vkCreateSwapchainKHR()
Ian Elliott [Fri, 5 Aug 2016 15:08:30 +0000 (09:08 -0600)]
GH 818: Improve swapchain error for vkCreateSwapchainKHR()

When the the application calls vkCreateSwapchainKHR(), the
pCreateInfo->surface used must have been previously checked as supported,
by calling vkGetPhysicalDeviceSurfaceSupportKHR().  The error message needed
to be more clear about this.

8 years agobuild: pr787 - CMAKE_INSTALL_PREFIX default
davidhubbard [Thu, 21 Jul 2016 22:11:59 +0000 (15:11 -0700)]
build: pr787 - CMAKE_INSTALL_PREFIX default

CMAKE_INSTALL_PREFIX default is /usr/local on unix

In order to build with a custom CMAKE_INSTALL_PREFIX, the line
set (CMAKE_INSTALL_PREFIX "") must be removed.

CMake set will overwrite anything specified on the command
line with cmake -DCMAKE_INSTALL_PREFIX.

Change-Id: I3bc905b4ad8fb08917e500e4987eb0277ba74a40

8 years agowinsdk: Make installer version programmable
Lenny Komow [Thu, 4 Aug 2016 16:32:27 +0000 (10:32 -0600)]
winsdk: Make installer version programmable

8 years agolayers: Update string concatenation in struct_string_helper_cpp
Tobin Ehlis [Wed, 3 Aug 2016 22:51:43 +0000 (16:51 -0600)]
layers: Update string concatenation in struct_string_helper_cpp

For structs with many fields, the generation of the final string representation
created by vk_struct_string_helper_cpp.h was getting obscene. The final string
concatentation for VkPhysicalDeviceFeatures exceeded 3000 cols and was crashing
clang.
This change builds the final string in a number of steps rather than trying to
do it all on a single line.

8 years agoloader: support manifests in XDG locations
John Drinkwater [Mon, 1 Aug 2016 16:00:00 +0000 (17:00 +0100)]
loader: support manifests in XDG locations

Some users set the environment variable XDG_DATA_HOME to relocate
~/.local/share/ to a more friendly location and so it is not wise to
look solely at that location.

This change adds basic support for that env var without changing the
behaviour for typical users. If XDG_DATA_HOME is defined, the loader
checks XDG_DATA_HOME/vulkan/..., if HOME is defined the loader will
check HOME/.local/share/vulkan/..., and with neither it skips looking
for user manifests.

loader_get_manifest_files() now takes a relative location inside the
config path eg `/vulkan/implicit_layer.d` and appends that onto the
preferred location.

vk_loader_platform.h Linux defines got minor adjustments to support this
change, with an added bonus of being more readable.

Change-Id: I44e8a99f2a984f94dc33cdda122e6c417d3a3653

8 years agolayers: Fix function interception list for param validation
Chris Forbes [Thu, 4 Aug 2016 03:59:38 +0000 (15:59 +1200)]
layers: Fix function interception list for param validation

A bunch of things were missing here.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Disable previous fix for DS layout transitions
Tobin Ehlis [Thu, 4 Aug 2016 02:30:07 +0000 (20:30 -0600)]
layers: Disable previous fix for DS layout transitions

Fix to always transition both depth and stencil aspects for DS images
is causing errors on cube and tri. Disabling the fix and test for now
to avoid unwanted false positives.

8 years agolayers: GH650, Fix D/S image layout validation
Mark Lobodzinski [Mon, 1 Aug 2016 21:51:39 +0000 (15:51 -0600)]
layers: GH650, Fix D/S image layout validation

When an imageView of a depth/stencil image is used as a depth/stencil
framebuffer attachment, the aspectMask is ignored and both depth and
stencil image subresources are used. Validation was throwing errors
as only the specified aspectMask transition was tracked.

Change-Id: I4f45eec74040448ba3ed52b07268fab3b3cb9318

8 years agolayers: Check vtx buffer binding
Tobin Ehlis [Wed, 3 Aug 2016 15:59:17 +0000 (09:59 -0600)]
layers: Check vtx buffer binding

Need to check vtx buffer binding based on binding values set in
pVertexBindingDescriptions array if present.

8 years agoFix Android build for mips64: NULL -> VK_NULL_HANDLE
Ian Elliott [Wed, 3 Aug 2016 20:57:11 +0000 (14:57 -0600)]
Fix Android build for mips64: NULL -> VK_NULL_HANDLE

This should affect other architectures as well.  A handle can't be assigned to
NULL (may get 32-64 type issues).  Must set a Vulkan handle to VK_NULL_HANDLE.

8 years agodemos: Remove the need for QueueWaitIdle in cube
Tony Barbour [Thu, 28 Jul 2016 18:01:45 +0000 (12:01 -0600)]
demos: Remove the need for QueueWaitIdle in cube

Change-Id: Iddccf0d672632ad7f0821fb98c685c944c2b8b77

8 years agodemos: Use renderpass finalLayout to get to PRESENT_SRC_KHR
Tony Barbour [Thu, 28 Jul 2016 16:50:13 +0000 (10:50 -0600)]
demos: Use renderpass finalLayout to get to PRESENT_SRC_KHR

instead of an explicit memory barrier

Change-Id: I9c9c19ee6640fc696576d67ffc608b9205d84166

8 years agolayers: Fix bug in cmd buffer framebuffer binding
Tobin Ehlis [Fri, 22 Jul 2016 22:55:19 +0000 (16:55 -0600)]
layers: Fix bug in cmd buffer framebuffer binding

If cmd buffers were freed via DestroyCommandPool, then the framebuffer links to the
individual cb_nodes were not getting cleared. Fix that issue.

This is initial, simple solution to avoid crash, need smarter solution long-term.

8 years agotoolchain: Update revisions for Android
Cody Northrop [Mon, 1 Aug 2016 16:27:25 +0000 (10:27 -0600)]
toolchain: Update revisions for Android

Also add spirv-headers, a new dependency for shaderc.

8 years agolayers: Fix object_tracker build
Tobin Ehlis [Tue, 2 Aug 2016 16:50:29 +0000 (10:50 -0600)]
layers: Fix object_tracker build

This moves a static array of maps to be a vector of maps.
Building android from Windows crashes clang without this change.
clang in the NDK doesn't like arrays of unordered_maps.

8 years agolayers: Remove debug comments from OT.h
Mark Lobodzinski [Tue, 2 Aug 2016 15:30:28 +0000 (09:30 -0600)]
layers: Remove debug comments from OT.h

Change-Id: I1cf485ddb54223b873746ff218f0f34085a87450

8 years agolayers: Fix #808 broken mapping of image types to view types
Chris Forbes [Mon, 1 Aug 2016 20:08:16 +0000 (08:08 +1200)]
layers: Fix #808 broken mapping of image types to view types

This was trying to be too clever, and was foiled by bad assumptions
about the enum order.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Generate full vk_dispatch_table_helper
Mark Young [Mon, 1 Aug 2016 17:06:53 +0000 (11:06 -0600)]
layers: Generate full vk_dispatch_table_helper

Generate the full vk_dispatch_table-helper file for all platforms
as part of the build process now.  This includes all WSI
extension entry-points for all build targets we support increasing
portablility of the header.

Change-Id: Ie83423e7ea169f7251c5369992a6144a97db1ddc

8 years agolayers: gh793 gen vk_dispatch_table_helper.h
Johannes van Waveren [Fri, 22 Jul 2016 21:10:11 +0000 (16:10 -0500)]
layers: gh793 gen vk_dispatch_table_helper.h

Generate one vk_dispatch_table_helper.h for all platforms.

Change-Id: I17fa435bc69cacfdd75dd93fbb0a5a37222aaa2b

8 years agoloader : Fix segfault in vulkaninfo
Mark Young [Mon, 1 Aug 2016 17:34:36 +0000 (11:34 -0600)]
loader : Fix segfault in vulkaninfo

Last commit introduced a segfault in VulkanInfo.  This corrects it.

Change-Id: Ie4115bbe24191bdad9f539e5d9b1658982417f51

8 years agoloader: gh571 vkEnumerateInstanceLayerProperties()
davidhubbard [Thu, 28 Jul 2016 00:59:58 +0000 (17:59 -0700)]
loader: gh571 vkEnumerateInstanceLayerProperties()

This fixed a memory leak.

Steps to reproduce:
Run valgrind --leak_check=full on a this test file:
```

int main() {
  uint32_t layerCount = 0;
  vkEnumerateInstanceLayerProperties(&layerCount, nullptr);
  printf("layerCount=%u\n", layerCount);
  return 0;
}
```

valgrind output will look like:
```
==PID==
==PID== 49,920 bytes in 6 blocks are definitely lost in loss record 57 of 58
==PID==    at 0x40307C4: malloc (vg_replace_malloc.c:270)
==PID==    by 0x4A2B5F3: loader_instance_heap_alloc (loader/loader.c:178)
==PID==    by 0x4A2CB0D: loader_init_generic_list (loader/loader.c:858)
==PID==    by 0x4A2CBDE: loader_add_to_ext_list (loader/loader.c:889)
==PID==    by 0x4A30A32: loader_read_json_layer (loader/loader.c:2311)
==PID==    by 0x4A31373: loader_add_layer_properties (loader/loader.c:2509)
==PID==    by 0x4A3286F: loader_layer_scan (loader/loader.c:3032)
==PID==    by 0x4A38DFC: vkEnumerateInstanceLayerProperties (loader/trampoline.c:239)
==PID==
```

The fix is simple: vkEnumerateInstanceLayerProperties() in loader/trampoline.c should call loader_delete_layer_properties(), not loader_destroy_layer_list() in both places it frees resources associated with the instance_layer_list.

Change-Id: I3275195dd27703c2747971288327d546efe5ed25

8 years agolayers: Add some TODOs for weird code that should go away
Chris Forbes [Fri, 24 Jun 2016 05:04:54 +0000 (17:04 +1200)]
layers: Add some TODOs for weird code that should go away

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Drop QUEUE_NODE::device
Chris Forbes [Thu, 23 Jun 2016 05:03:55 +0000 (17:03 +1200)]
layers: Drop QUEUE_NODE::device

This was unused.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Track valid dynamic scissor and viewport indices with masks
Chris Forbes [Thu, 28 Jul 2016 02:15:38 +0000 (14:15 +1200)]
layers: Track valid dynamic scissor and viewport indices with masks

CmdSetViewport/CmdSetScissor were broken; they assumed the update
replaced all the viewports/scissors; further, the drawtime validation
was too aggressive -- nowhere does the spec require the number of valid
dynamic viewports/ dynamic scissors to be equal to the number used by
the PSO; just that all viewports/scissors used by the PSO must be
provided.

V2: Add more parens to quiet warnings in android build

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Validate image view type requirement for descriptor sets
Chris Forbes [Tue, 26 Jul 2016 05:06:10 +0000 (17:06 +1200)]
layers: Validate image view type requirement for descriptor sets

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Generate appropriate sets of requirement flags for OpTypeImage
Chris Forbes [Mon, 25 Jul 2016 06:12:05 +0000 (18:12 +1200)]
layers: Generate appropriate sets of requirement flags for OpTypeImage

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Add plumbing for descriptor requirements
Chris Forbes [Mon, 25 Jul 2016 06:10:41 +0000 (18:10 +1200)]
layers: Add plumbing for descriptor requirements

We want to be able to impose requirements on images & views bound to
descriptor sets based on their usage in the shader. This adds the
plumbing from pipelines into descriptor sets to enable that.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Add enum for descriptor requirements
Chris Forbes [Mon, 25 Jul 2016 06:11:50 +0000 (18:11 +1200)]
layers: Add enum for descriptor requirements

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agodemos: Flip cube texture and TC's, so image is no longer inverted
Rene Lindsay [Fri, 29 Jul 2016 17:49:11 +0000 (10:49 -0700)]
demos: Flip cube texture and TC's, so image is no longer inverted

8 years agodemos: Remove unused function parameter.
Rene Lindsay [Fri, 29 Jul 2016 17:43:47 +0000 (10:43 -0700)]
demos: Remove unused function parameter.

8 years agodocs: Clean up LoaderAndLayerInterface markdown
Mark Young [Fri, 22 Jul 2016 14:51:05 +0000 (08:51 -0600)]
docs: Clean up LoaderAndLayerInterface markdown

Perform some wordsmithing and general clean-up of the
LoaderAndLayerInterface markdown file.

Change-Id: I286d0f1d01241b376ba2f4dfa97d2329b04d515d

8 years agolayers: GH722 Add query function calls from secondary buffers.
Michael Lentine [Thu, 21 Jul 2016 22:24:56 +0000 (17:24 -0500)]
layers: GH722 Add query function calls from secondary buffers.

8 years agotests: Create APK version of layer validation tests
Cody Northrop [Wed, 13 Jul 2016 23:24:59 +0000 (17:24 -0600)]
tests: Create APK version of layer validation tests

8 years agodemos: Fix cube to handle seperate gfx / present queues
Tony Barbour [Mon, 18 Jul 2016 19:21:06 +0000 (13:21 -0600)]
demos: Fix cube to handle seperate gfx / present queues

Change-Id: I92497bb966aa6d35746184249e921155ed26d67e

8 years agoloader: return incomplete when count < available
Jeremy Hayes [Wed, 6 Jul 2016 18:02:03 +0000 (12:02 -0600)]
loader: return incomplete when count < available

The list was being destroyed before the check.

Change-Id: I500a22c8e2fffa8c852235f688026cd80f84088d

8 years agoandroid: Lift global offset table size limit (-mxgot)
Cody Northrop [Tue, 26 Jul 2016 20:25:45 +0000 (14:25 -0600)]
android: Lift global offset table size limit (-mxgot)

Currently the mips64 build for Android is broken due to size
increases of core_validation.  If you disabled optimizations (-O0),
you'll get the following error:

    relocation truncated to fit: R_MIPS_CALL16

The linker flag to lift the limit is -mxgot, documented here:

    https://gcc.gnu.org/onlinedocs/gcc-4.0.0/gcc/MIPS-Options.html

It is a slight de-optimization for global symbol lookups (3 inst
instead of 1).  Hopefully we aren't using global lookups in
performance critical code.

8 years agoTools: Bump spirv-tools revision to include fix
Tony Barbour [Tue, 26 Jul 2016 16:17:28 +0000 (10:17 -0600)]
Tools: Bump spirv-tools revision to include fix

Covers fix for SPIRV-Tools issue #270 - access violation in
Vulkan conformance test

Change-Id: Idc3470f9ba68d9189d3536fe776459ce2ccba388

8 years agolayers: Restore OT WSI GPA prefixes
Mark Lobodzinski [Fri, 22 Jul 2016 21:30:27 +0000 (15:30 -0600)]
layers: Restore OT WSI GPA prefixes

Change-Id: Ia83e40c8c5c92a8ac50dc2d5bf5bf9b2b255594b

8 years agolayers: Fix copy-paste "DEPTH" instead of "STENCIL"
Tobin Ehlis [Thu, 21 Jul 2016 20:48:21 +0000 (14:48 -0600)]
layers: Fix copy-paste "DEPTH" instead of "STENCIL"

8 years agolayers: Fix image aspect checks
Tobin Ehlis [Tue, 19 Jul 2016 23:39:34 +0000 (17:39 -0600)]
layers: Fix image aspect checks

Previously validation required DS images to have both DEPTH and STENCIL
aspect bits set, but spec only requires that at least one is set.
Also, we weren't checking case of depth or stencil only formats, or
color format to make sure that correct aspect mask was set.

8 years agotests: Update doc validation script
Mark Lobodzinski [Thu, 21 Jul 2016 15:13:18 +0000 (09:13 -0600)]
tests: Update doc validation script

Changed object_tracker location, status.

Change-Id: I2b9834002cdeb8a3b48e83d8da6f727edfd2ffdd

8 years agolayers: Update codegen for OT removal
Mark Lobodzinski [Thu, 21 Jul 2016 15:09:35 +0000 (09:09 -0600)]
layers: Update codegen for OT removal

Removed object_tracker code from vk_layer_generate.py.

Change-Id: I0ebd1c379deabfb0712d6692751145f34b430459

8 years agolayers: Fixup OT error messages
Mark Lobodzinski [Mon, 18 Jul 2016 23:06:52 +0000 (17:06 -0600)]
layers: Fixup OT error messages

Print object type explicitly; also fixup a couple of format
specifiers.

Change-Id: I6f5036f70cae05bd5f7ee9320e24b2e16bdc811b

8 years agolayers: Fix thread-safety fails in OT FreeXxx APIs
Mark Lobodzinski [Wed, 13 Jul 2016 17:29:00 +0000 (11:29 -0600)]
layers: Fix thread-safety fails in OT FreeXxx APIs

Tracking data was cleaned up after calling down the chain in
FreeCommandBuffers and FreeDescriptorSets -- this left a hole that
another thread could walk through and corrupt the tracking data.

Change-Id: I7cc9c9bfae9f1ea179122125dd09952650f14d81

8 years agolayers: Update object_tracker layer
Mark Lobodzinski [Fri, 1 Jul 2016 16:53:31 +0000 (10:53 -0600)]
layers: Update object_tracker layer

Removed dead code, added per-instance and per-device object tracking,
(this was broken in codegen'd version with no cross-device
validation), updated for new layer architectures and coding standards,
removed OT-related codegen -- it is now a standalone cpp file.

Change-Id: I64464b855e1b4841c8e3a581387e0e9065b006f7

8 years agolayers : gh682 move gipa dispatch table init
Mark Young [Tue, 5 Jul 2016 22:41:50 +0000 (16:41 -0600)]
layers : gh682 move gipa dispatch table init

Move the GIPA setup of the dispatch tables for layers into
the layer_init_device_dispatch_table call since we're already
doing a majority of it there.  This removes the need to separately
setup the WSI extension entry-points.

Additionally, memset the table to 0, just to make sure anything
that gets added in the future is obvoiusly not set.

Change-Id: I63c7c107cd9f7957e2766fdbeb8a06bc1ae0eda6

8 years agodocs: Remove extra line in doc headers
Mark Young [Thu, 21 Jul 2016 15:45:32 +0000 (09:45 -0600)]
docs: Remove extra line in doc headers

GitHub markdown adds a line after H1 and H2 entries.  Normal
markdown doesn't do this.  So my WSYIWYG editor incorrectly showed
the results of my previous edits.

Change-Id: I3c197c1fb1f364bf4b1050d1eaa1141affefe9d1

8 years agomisc: Support for cross-platform trace/replay
David Pinedo [Thu, 21 Jul 2016 16:56:27 +0000 (10:56 -0600)]
misc: Support for cross-platform trace/replay

Change-Id: If77890356911fa90d22af28a449a05284ad2097f

8 years agolayers: Check BUFFER_CREATE_SPARSE_BINDING_BIT for buffers
Tobin Ehlis [Thu, 21 Jul 2016 12:46:12 +0000 (06:46 -0600)]
layers: Check BUFFER_CREATE_SPARSE_BINDING_BIT for buffers

8 years agolayers: Validation buffer descriptor updates for bound memory
Tobin Ehlis [Wed, 20 Jul 2016 20:04:20 +0000 (14:04 -0600)]
layers: Validation buffer descriptor updates for bound memory

When updating buffer descriptors, make sure that there is memory bound to any
non-sparse buffer.
Add comment that we don't need to do this for image descriptor updates
because they require the imageView (not just image) and we already validate
at imageView creation that memory is bound to image.

8 years agolayers: Refactor buffer/image validation functions
Tobin Ehlis [Wed, 20 Jul 2016 19:27:33 +0000 (13:27 -0600)]
layers: Refactor buffer/image validation functions

Add some consts and put fwd decls in core_validation_types.h so that these
can be used by descriptor_set class.

8 years agoloader: Clean up some things in the MD file
Mark Young [Wed, 20 Jul 2016 17:38:53 +0000 (11:38 -0600)]
loader: Clean up some things in the MD file

Clean up some documentation in the LoaderAndLayerInterface
markdown.  Over the next few weeks, I'll be working on
cleaning up the format and language of this doc.

Change-Id: I7858981293de9befb34701c31542d88c664cd6d8

8 years agolayers: Change pNext validation error to warning
Dustin Graves [Tue, 19 Jul 2016 19:43:53 +0000 (13:43 -0600)]
layers: Change pNext validation error to warning

Change the severity level of the parameter_validation layer's pNext
parameter validation messages from error to warning.  Also add an
explanation that the warning is derived from the Valid Usage
language from version X of the Vulkan spec/header, which may be out
of date:

This warning is based on the Valid Usage documentation for version %d
of the Vulkan header.  It is possible that you are using a struct
from a private extension or an extension that was added to a later
version of the Vulkan header, in which case your use of pNext is
perfectly valid but is not guaranteed to work correctly with
validation enabled

Issues-Addressed: LunarXchange 560
Change-Id: I97f55cba7538506d246e45ef603a86db9ad1adcb