platform/upstream/Vulkan-Tools.git
6 years agobuild: Limit control flow guard to loader/demos
Mark Lobodzinski [Thu, 5 Oct 2017 17:18:52 +0000 (11:18 -0600)]
build: Limit control flow guard to loader/demos

Change-Id: Ibb95a7192bd95195797d3d10ccc0ed34fe030268

6 years agolayers: Implement vkCreateDescriptorPool() checks
Petr Kraus [Wed, 27 Sep 2017 16:56:51 +0000 (18:56 +0200)]
layers: Implement vkCreateDescriptorPool() checks

Check explicit validity of vkCreateDescriptorPool():
- maxSets > 0
- pPoolSizes[].descriptorCount > 0

+ implement relevant tests

6 years agoscripts: Generate copy assignment operators for safe_*
Chris Forbes [Wed, 4 Oct 2017 01:11:54 +0000 (18:11 -0700)]
scripts: Generate copy assignment operators for safe_*

6 years agotravis: Add 64-bit to Android build
Cody Northrop [Fri, 29 Sep 2017 20:50:54 +0000 (14:50 -0600)]
travis: Add 64-bit to Android build

This is done as a parallel build, so should not impact wait time.

6 years agoandroid: Update toolchain build to handle single ABI
Cody Northrop [Fri, 29 Sep 2017 21:34:45 +0000 (15:34 -0600)]
android: Update toolchain build to handle single ABI

This reduces local arm32 toolchain build from 3m30s to 42s.

Also update Travis-CI config to use the new flag, greatly reducing
Android build time.

6 years agolayers:Fix renderPass<->cmdBuffer binding
Tobin Ehlis [Thu, 28 Sep 2017 19:20:53 +0000 (13:20 -0600)]
layers:Fix renderPass<->cmdBuffer binding

At BeginRenderPass() time bind the active renderPass to the cmdBuffer.
Don't bind the renderPass used to create the framebuffer. The
renderPass lifetime rules allow the renderPass used in FB creation to
be destroyed after FB creation.

6 years agolayers:Remove invalid renderPass binding
Tobin Ehlis [Thu, 28 Sep 2017 18:46:58 +0000 (12:46 -0600)]
layers:Remove invalid renderPass binding

There's no reason to create a binding between RP used in pipeline
creation and the cmd buffer that pipeline is bound to. This can lead
to a bug where CB is incorrectly invalidated if that RP is destroyed
after pipeline is bound to CB.

6 years agolayers: Avoid potential NULL pointer dereference
Józef Kucia [Fri, 22 Sep 2017 16:01:07 +0000 (18:01 +0200)]
layers: Avoid potential NULL pointer dereference

The boundDescriptorSets vector may be resized in
PreCallRecordCmdBindDescriptorSets().

6 years agoheader: revert constexpr change in vulkan.hpp
Mike Schuchardt [Tue, 19 Sep 2017 21:00:40 +0000 (15:00 -0600)]
header: revert constexpr change in vulkan.hpp

constexpr was previously removed to preserve compatibility with Visual
Studio 2013.  This causes linker errors when vulkan.hpp is included in
multiple file.

Change-Id: I3a301c669ceb300f49982abacdb21543ea8ee764

6 years agobuild: Update for 1.0.61.0 SDK
Lenny Komow [Mon, 18 Sep 2017 23:07:00 +0000 (17:07 -0600)]
build: Update for 1.0.61.0 SDK

Change-Id: I4b1f0289dace648153b6efdbfea0d83d37b28e60

6 years agolayers: Correctly check if descriptor was updated
Józef Kucia [Thu, 21 Sep 2017 15:07:37 +0000 (17:07 +0200)]
layers: Correctly check if descriptor was updated

6 years agolayers:Pipe state owns render pass ptr
Tobin Ehlis [Mon, 18 Sep 2017 14:38:37 +0000 (08:38 -0600)]
layers:Pipe state owns render pass ptr

Pipeline can outlive the renderPass that it's created with so add
shared_ptr to RENDER_PASS_STATE to PIPELINE_STATE to make sure
renderPass is available for the life of the pipeline.

6 years agolayers: use VU for index buffer alignment check
Chris Forbes [Fri, 15 Sep 2017 18:07:53 +0000 (11:07 -0700)]
layers: use VU for index buffer alignment check

6 years agolayers: Implement VU check for BUFFER_USAGE_VERTEX_BUFFER_BIT
Chris Forbes [Thu, 14 Sep 2017 23:03:37 +0000 (16:03 -0700)]
layers: Implement VU check for BUFFER_USAGE_VERTEX_BUFFER_BIT

6 years agolayers: Implement VU check for BUFFER_USAGE_INDEX_BUFFER_BIT
Chris Forbes [Thu, 14 Sep 2017 18:13:34 +0000 (11:13 -0700)]
layers: Implement VU check for BUFFER_USAGE_INDEX_BUFFER_BIT

6 years agolayers:Kill push descriptor perf warning
Tobin Ehlis [Wed, 13 Sep 2017 17:49:54 +0000 (11:49 -0600)]
layers:Kill push descriptor perf warning

6 years agolayers:Use existing ds layout to create push desc
Tobin Ehlis [Wed, 13 Sep 2017 17:11:14 +0000 (11:11 -0600)]
layers:Use existing ds layout to create push desc

Just look up descriptor set layout for given set from pipeline layout
state when creating a push descriptor.
No need to re-create the layout on the fly.

6 years agolayers: Use layout flags to test for push descriptor sets
Józef Kucia [Sun, 10 Sep 2017 09:24:08 +0000 (11:24 +0200)]
layers: Use layout flags to test for push descriptor sets

6 years agolayers: Fix memory leak in PreCallRecordCmdPushDescriptorSetKHR()
Józef Kucia [Sun, 10 Sep 2017 09:02:31 +0000 (11:02 +0200)]
layers: Fix memory leak in PreCallRecordCmdPushDescriptorSetKHR()

6 years agoloader: Fix crash from loading invalid ICD
Lenny Komow [Wed, 13 Sep 2017 04:54:21 +0000 (22:54 -0600)]
loader: Fix crash from loading invalid ICD

Addresses LunarXchange issue 711

Change-Id: Ia67441a3adde5ddf9d72ffd12c8cc5fb44071b96

6 years agodemos: Add support for headless XCB
Andreas Bergmeier [Wed, 13 Sep 2017 13:55:16 +0000 (15:55 +0200)]
demos: Add support for headless XCB

For headless XCB we cannot create a surface. Simply ignore XCB if
connection could not be established or any other error occured.

Change-Id: I32db6aa3fc14887658d4290dcabbe8a1930cd8b3

6 years agodemos: Print XCB errors to stderr
Andreas Bergmeier [Wed, 6 Sep 2017 19:49:50 +0000 (21:49 +0200)]
demos: Print XCB errors to stderr

Printing to stdout is weird.

Change-Id: If53e8708b853989ae8a9ea61fa4d57f27b24b45c

6 years agoRevert "layers: Fix Graphics Pipeline pointers not ignored"
Mark Lobodzinski [Tue, 12 Sep 2017 15:50:25 +0000 (09:50 -0600)]
Revert "layers: Fix Graphics Pipeline pointers not ignored"

This caused segfaults on Intel Skylake, NexusPlayer, and
Samsung Galaxy S8 (Mali).

This reverts commit 367d276ffe5c0748ff9d8e2b3551d4a00c9fc3c2.

6 years agolayers: Fix Graphics Pipeline pointers not ignored
Petr Kraus [Sun, 10 Sep 2017 00:26:33 +0000 (02:26 +0200)]
layers: Fix Graphics Pipeline pointers not ignored

Some VkGraphicsPipelineCreateInfo pointers must be ignored under some
conditions, but were not in the layers.

Add relevant tests.

Fix tests found broken (using depth or color without attachment in
subpass)

Change-Id: I3e2a3f61a52c72ce3a11483ff8b031189f4c61c9

6 years agolayers: Add support for VK_AMD_mixed_attachment_samples
Maciej Jesionowski [Wed, 6 Sep 2017 09:25:36 +0000 (11:25 +0200)]
layers: Add support for VK_AMD_mixed_attachment_samples

Change-Id: I2ee0ab4c2ba7510316f190689fd3d81db27cb04f

6 years agoscripts: Check toolchain revisions, remove if they differ
Cody Northrop [Fri, 8 Sep 2017 16:33:53 +0000 (10:33 -0600)]
scripts: Check toolchain revisions, remove if they differ

This script compares tracked revisions against those under external
and deletes them if they differ.

6 years agoheader: Update to 1.0.60
Mike Schuchardt [Tue, 5 Sep 2017 22:10:20 +0000 (16:10 -0600)]
header: Update to 1.0.60

Change-Id: I118be4455c68800e27fd9b8293699037449f1413

6 years agoscripts: Fix VkShaderModuleCreateInfo safe struct
Mike Schuchardt [Mon, 4 Sep 2017 17:38:42 +0000 (11:38 -0600)]
scripts: Fix VkShaderModuleCreateInfo safe struct

Allocate and copy the entire shader program instead of just the first 4
bytes.

Change-Id: I24dd136d59952f9e8b690bf4fe1702106482a3be

6 years agolayers:Clean up shared_ptr use
Tobin Ehlis [Thu, 7 Sep 2017 20:24:36 +0000 (14:24 -0600)]
layers:Clean up shared_ptr use

Use make_shared to construct RENDER_PASS_STATE shared_ptr at
CreateRenderPass() time, return the shared_ptr by value from helper
function and accecpt rvalue ref in FRAMEBUFFER_STATE constructor.

6 years agolayers:Fix render pass lifetime hole
Tobin Ehlis [Thu, 7 Sep 2017 15:16:49 +0000 (09:16 -0600)]
layers:Fix render pass lifetime hole

A framebuffer can outlive the renderpass that it's created with so
update FRAMEBUFFER_STATE object to have a shared_ptr to render pass
state.

6 years agolayers:Remove is_multi from render pass check
Tobin Ehlis [Thu, 7 Sep 2017 14:43:19 +0000 (08:43 -0600)]
layers:Remove is_multi from render pass check

The is_multi bool is no longer needed in the render pass compatibility
check.

6 years agolayers:Don't access render pass map directly
Tobin Ehlis [Thu, 7 Sep 2017 14:39:50 +0000 (08:39 -0600)]
layers:Don't access render pass map directly

Use GetRenderPassState() helper function to create FRAMEBUFFER_STATE
object.

6 years agolayers:Consolidate render pass compatibility
Tobin Ehlis [Wed, 6 Sep 2017 20:28:45 +0000 (14:28 -0600)]
layers:Consolidate render pass compatibility

Remove duplicate render pass compatibility function and consolidate to
single function. Add error VUIDs for various draw-time errors related
to incompatible render passes and mis-matched subpass.

6 years agolayers:Migrate render pass compatibility check
Tobin Ehlis [Wed, 6 Sep 2017 19:27:52 +0000 (13:27 -0600)]
layers:Migrate render pass compatibility check

Update render pass compatibility check at BeginCommandBuffer time to
use the refactored common function. Phasing out the other compatibility
function.

6 years agolayers:Check renderPass/framebuffer compatibility
Tobin Ehlis [Wed, 6 Sep 2017 17:13:19 +0000 (11:13 -0600)]
layers:Check renderPass/framebuffer compatibility

Add check for VUID VALIDATION_ERROR_12000710. This is a check at
CmdBeginRenderPass time to make sure that the render pass being begun
is compatible with the render pass that the referenced framebuffer was
created with.

6 years agolayers:Generalize validateRenderPassCompatibility
Tobin Ehlis [Wed, 6 Sep 2017 16:46:41 +0000 (10:46 -0600)]
layers:Generalize validateRenderPassCompatibility

We have 2 separate function for checking render pass compatibility that
are nearly identical. This change is refactoring one of the functions
to make it more general-purpose so that it can be used for all of the
render pass compatibility checks. This includes passing through the
caller, a VUID, and some strings for the types of objects that are
having their render passes compared.

Added some temp comments on VUIDs that will be added for various render
pass compatibility checks.
Update framebuffer state struct to store render pass state ptr instead
of just the render pass create info.

6 years agoexternal: Update Android commit IDs
Mike Weiblen [Thu, 7 Sep 2017 16:40:58 +0000 (10:40 -0600)]
external: Update Android commit IDs

With this, LVL's Android externals match those of shaderc's known-good
as of cd52beb9

Change-Id: Ic408469d007b632f16229b3e2be0abe82abe5869

6 years agolayers: Add script to create VU stats in CSV
Mike Weiblen [Wed, 6 Sep 2017 19:41:19 +0000 (13:41 -0600)]
layers: Add script to create VU stats in CSV

A simple utility bash script to generate Valid Usage completion
statistics in CSV format, for loading and analyzing in a spreadsheet.

Change-Id: Id45a20ea83d555029cb11418ac5d19c38fd28a15

6 years agoexternal: Update spirv commit IDs
Mike Weiblen [Wed, 6 Sep 2017 20:09:37 +0000 (14:09 -0600)]
external: Update spirv commit IDs

Update externals commit IDs for spriv headers and tools.

With this, LVL's externals match those of shaderc's known-good as of cd52beb9

Change-Id: I610c68d1c7910e70acfa7065c64c23862a7d25c5

6 years agodocs: Update loader doc for pnp registry changes
Lenny Komow [Thu, 31 Aug 2017 23:19:17 +0000 (17:19 -0600)]
docs: Update loader doc for pnp registry changes

Change-Id: I3d41b7b01140243457ac35cfa2c22235f35e4e83

6 years agoloader: Allow layer loading from pnp registry
Lenny Komow [Thu, 31 Aug 2017 22:35:08 +0000 (16:35 -0600)]
loader: Allow layer loading from pnp registry

Change-Id: I70682cf5904b95b52881457e14bbc2f9a772259d

6 years agoloader: Fix PnP 32-bit registry handling
Lenny Komow [Thu, 31 Aug 2017 16:44:17 +0000 (10:44 -0600)]
loader: Fix PnP 32-bit registry handling

Change-Id: I25eae83b4783e702ca5fbe74a99d7bdeae6218f0

6 years agolayers: Fix leaking backing sets for push descriptors
Chris Forbes [Sat, 2 Sep 2017 00:03:21 +0000 (17:03 -0700)]
layers: Fix leaking backing sets for push descriptors

We'd previously leak any temporary descriptor set left bound to the
pipeline at the end of the command buffer. Rearrange things so we can
use unique_ptr and assure it's always cleaned up correctly.

6 years agoheaders: Fix a typo in vk_icd.h
Lenny Komow [Tue, 5 Sep 2017 15:21:47 +0000 (09:21 -0600)]
headers: Fix a typo in vk_icd.h

Change-Id: I9ede42e379605329ffd25a9466e0971b3ab7dd77

6 years agobuild: Touch appveyor config to invalidate cache
Karl Schultz [Mon, 4 Sep 2017 14:16:23 +0000 (08:16 -0600)]
build: Touch appveyor config to invalidate cache

6 years agolayers: Remove remnants of old perf warning for disturbing sets
Chris Forbes [Fri, 1 Sep 2017 17:10:12 +0000 (10:10 -0700)]
layers: Remove remnants of old perf warning for disturbing sets

Half of this was removed, but the surrounding plumbing was left in
place. If we want to quietly add some 'was disturbed' bits so we can
produce a better error at a later draw, that should go on the
record-side of this validation, not here.

Removes the other case that the previous change missed, along with the
vestigial bits of the previous check.

Remove subtest and surrounding scaffolding that tested this

6 years agoCMake: GH1989, add wayland include dir to cmake
John Zupin [Mon, 21 Aug 2017 22:36:45 +0000 (16:36 -0600)]
CMake: GH1989, add wayland include dir to cmake

On some Linux distributions (e.g  openSUSE) the wayland headers are in
a subdirectory.
Adding WAYLAND_CLIENT_INCLUDE_DIR to include_directories in CMakeLists.txt
will fix this issue.

6 years agoexternal: Update commit ID: glslang
Mike Weiblen [Fri, 1 Sep 2017 17:25:50 +0000 (11:25 -0600)]
external: Update commit ID: glslang

Update to most recent glslang-specified commit.

Change-Id: I35d8438833319e2d662dcf20353199d52f0b2ac0

6 years agolayers: Account for push descriptor sets in CV
Mark Lobodzinski [Mon, 21 Aug 2017 16:33:07 +0000 (10:33 -0600)]
layers: Account for push descriptor sets in CV

Change-Id: I1095edce0f26e2a4ced6fa301143622dc5cd0afd

6 years agolayers: Match state record pattern for VOID APIs
Mark Lobodzinski [Thu, 17 Aug 2017 17:54:52 +0000 (11:54 -0600)]
layers: Match state record pattern for VOID APIs

Also straightened out the locking/unlocking for PushDescriptorSets.

Change-Id: Ic72bc693d16e7fa85df117d29abc1adc5a29ada6

6 years agolayers: Update desc binding state for PushDescSets
Mark Lobodzinski [Wed, 16 Aug 2017 20:02:21 +0000 (14:02 -0600)]
layers: Update desc binding state for PushDescSets

Using PushDescriptorSets in a pipeline with normal Allocated descriptor
sets resulted in incorrect descriptor binding validation errors.
PushDescriptors are now run through the descriptor binding
state-update functions.

Change-Id: Ib702949af6de0b8638401c7eeb841c2590998e82

6 years agolayers: Intercept PushDescriptorSets in CV
Mark Lobodzinski [Wed, 16 Aug 2017 16:25:59 +0000 (10:25 -0600)]
layers: Intercept PushDescriptorSets in CV

Change-Id: Ifabf7058b4ded33ab191a0043d9ef390b4c8cb06

6 years agolayers: Refactor CmdBindDescSets for pre/post
Mark Lobodzinski [Wed, 16 Aug 2017 15:30:32 +0000 (09:30 -0600)]
layers: Refactor CmdBindDescSets for pre/post

Validation and state updates are now somewhat less tangled.

Change-Id: Ia666215a73ce02d2fbc326fb5b37b3361d83bbe3

6 years agoandroid: Update shader toolchain revisions
Cody Northrop [Tue, 29 Aug 2017 21:09:39 +0000 (15:09 -0600)]
android: Update shader toolchain revisions

Pulled from:
https://github.com/google/shaderc/blob/90a90d6f745704ac05afe70b7e8f759bec2ff493/known_good.json

6 years agoloader: Fix GetProcAddress loading illegal funcs
Lenny Komow [Tue, 29 Aug 2017 22:08:39 +0000 (16:08 -0600)]
loader: Fix GetProcAddress loading illegal funcs

The loader would return an unknown device extension handler when
specifying a function from a layer that was available, but not
enabled.

Change-Id: I0d77a7489d66e4d77aa8446018ec545c930f5bcf

6 years agoexternal: Update commit IDs: glslang, tools, header
Mike Weiblen [Mon, 28 Aug 2017 22:18:37 +0000 (16:18 -0600)]
external: Update commit IDs: glslang, tools, header

Change-Id: Ic0777dda7b6958d2454dfec288630044e6f70db3

6 years agobuild: Improve component enables usage text
Jeff Juliano [Sat, 26 Aug 2017 14:22:22 +0000 (10:22 -0400)]
build: Improve component enables usage text

6 years agobuild: Add no-sync to update_ext_srcs batch file
Jeff Juliano [Sat, 26 Aug 2017 14:04:29 +0000 (10:04 -0400)]
build: Add no-sync to update_ext_srcs batch file

Complete support for cygwin environment by adding --no-sync support
to update_external_sources.bat. Also change command line parsing for
the the .bat script to be similar to the .sh script.

Change-Id: Ie813938654e7f4bb9575eef2587f36ca2933f30c

6 years agobuild: Improve cygwin build support
Jeff Juliano [Sat, 26 Aug 2017 12:20:51 +0000 (08:20 -0400)]
build: Improve cygwin build support

Partially support cygwin environment by adding --no-build to
update_external_sources.sh

Change-Id: I9fa35d6c720dd05a11c307d3da4d09415934899e

6 years agobuild: Add missing quotes
Jeff Juliano [Sat, 26 Aug 2017 12:28:57 +0000 (08:28 -0400)]
build: Add missing quotes

Change-Id: Icff4a71bbedc3ee95d2dc2b85224a3c2eee74cb6

6 years agoscripts: PV codegen handle multiple requires
Mike Schuchardt [Thu, 24 Aug 2017 21:15:02 +0000 (15:15 -0600)]
scripts: PV codegen handle multiple requires

Modify parameter validation codegen to handle multiple require blocks in
an extension, each with additional extension dependencies.

Change-Id: I336569ca19808f3dca342eb65fd076599c4fb329

6 years agolayers: use unique_ptr for pipeline map
Chris Forbes [Fri, 25 Aug 2017 16:32:34 +0000 (09:32 -0700)]
layers: use unique_ptr for pipeline map

6 years agoLoader: Fix out-of-memory handling in loaderGetDeviceRegistryFiles
Slawomir Cygan [Fri, 25 Aug 2017 08:54:03 +0000 (10:54 +0200)]
Loader: Fix out-of-memory handling in loaderGetDeviceRegistryFiles

Wrongly handled OOM error causes
dEQP-VK.api.object_management.alloc_callback_fail test to fail, because wrong
error code is returned.

6 years agolayers: Fix crash in CreateGraphicsPipelines reading from moved-from ptr
Chris Forbes [Fri, 25 Aug 2017 18:21:19 +0000 (11:21 -0700)]
layers: Fix crash in CreateGraphicsPipelines reading from moved-from ptr

6 years agoRevert "Revert "layers: unique_ptr for temp compute pipelines""
Chris Forbes [Fri, 25 Aug 2017 18:19:44 +0000 (11:19 -0700)]
Revert "Revert "layers: unique_ptr for temp compute pipelines""

This reverts commit 615dc4e3ea0495bc28130377b9e637e9979a560e.

6 years agoRevert "Revert "layers: Introduce some unique_ptr into pipeline creation""
Chris Forbes [Fri, 25 Aug 2017 18:19:39 +0000 (11:19 -0700)]
Revert "Revert "layers: Introduce some unique_ptr into pipeline creation""

This reverts commit 5d6aaa553b634747fb2761c6e5b665bdae54d206.

6 years agoRevert "layers: Introduce some unique_ptr into pipeline creation"
Chris Forbes [Fri, 25 Aug 2017 16:37:35 +0000 (09:37 -0700)]
Revert "layers: Introduce some unique_ptr into pipeline creation"

This reverts commit 7d35703bdc03d94cad272b5ea3ede8d586f57e88.

6 years agoRevert "layers: unique_ptr for temp compute pipelines"
Chris Forbes [Fri, 25 Aug 2017 16:37:28 +0000 (09:37 -0700)]
Revert "layers: unique_ptr for temp compute pipelines"

This reverts commit cfc1ed15584a12ef62e113c8daf673c6a68ce29c.

6 years agolayers: unique_ptr for temp compute pipelines
Chris Forbes [Fri, 25 Aug 2017 16:16:00 +0000 (09:16 -0700)]
layers: unique_ptr for temp compute pipelines

6 years agolayers: Introduce some unique_ptr into pipeline creation
Chris Forbes [Thu, 24 Aug 2017 22:45:08 +0000 (15:45 -0700)]
layers: Introduce some unique_ptr into pipeline creation

6 years agoscripts: Enable instance extension checks in PV
Mark Lobodzinski [Wed, 23 Aug 2017 21:23:23 +0000 (15:23 -0600)]
scripts: Enable instance extension checks in PV

Parameter_validation's hammer for excluding some pdev-ish checks was
too large.  This adds extension dependency checks for about 50 more
APIs.

Change-Id: Icb44cdb36c8c0384781e04e207ceb18d9f67ff0c

6 years agoheader: Update to version 1.0.59 of the vulkan hdr
Mark Lobodzinski [Mon, 21 Aug 2017 16:34:38 +0000 (10:34 -0600)]
header: Update to version 1.0.59 of the vulkan hdr

- updated vulkan.h
- updated vk.xml
- updated Win/Lin json files
- rebuilt and updated vulkan.hpp
- updated vk_validation_error_database.txt
- updated vk_validation_error_messages.h
- added new code-generated VUIDs (16) to error database
- modified object tracker for VUID corner-case
- updated vulkaninfo.c for STYPE name change

Change-Id: I0870e8bc4e84867e05bd466c13c7428b9b7365ac

6 years agolayers: Use correct data layer in vkCreateInstance in param validation
Gabríel Arthúr Pétursson [Sat, 19 Aug 2017 16:44:45 +0000 (16:44 +0000)]
layers: Use correct data layer in vkCreateInstance in param validation

6 years agolayers:Remove disturbed descriptor perf warning
Tobin Ehlis [Tue, 22 Aug 2017 19:11:23 +0000 (13:11 -0600)]
layers:Remove disturbed descriptor perf warning

Fixes #2020

Support from devs to remove this perf warning so just killing it.
Added a comment for future work where we can track which descriptors
are disturbed and reference that if a user attempts to use a
disturbed descriptor that isn't bound.

Also commented out associated test and filed #2022 to track enhancement
making note of disturbed descriptors if used unbound.

6 years agolayers: Fix memory leaks in functions
Jeremy Kniager [Wed, 16 Aug 2017 20:57:42 +0000 (14:57 -0600)]
layers: Fix memory leaks in functions

Change-Id: I8e25adabefde3a04be5536ce4c5c2d5920a76140

6 years agovkjson: Add support for Android
Cody Northrop [Wed, 16 Aug 2017 23:38:15 +0000 (17:38 -0600)]
vkjson: Add support for Android

This commit adds vkjson and vkjson_info to the Android build.
It is only generated as an executable for devices with root
access, but it could be expanded to an APK with some more
boilerplate work.

See updates to BUILD.md for how to build and run on the device.

6 years agolayers: Wire up static_status check for CmdSetScissor
Chris Forbes [Wed, 16 Aug 2017 20:29:41 +0000 (13:29 -0700)]
layers: Wire up static_status check for CmdSetScissor

6 years agolayers: Wire up static_status check for CmdSetViewport
Chris Forbes [Wed, 16 Aug 2017 20:26:00 +0000 (13:26 -0700)]
layers: Wire up static_status check for CmdSetViewport

6 years agolayers: Drop error for binding compute pipeline inside renderpass
Chris Forbes [Wed, 16 Aug 2017 20:18:37 +0000 (13:18 -0700)]
layers: Drop error for binding compute pipeline inside renderpass

It's perfectly valid to bind the compute pipeline inside a renderpass.
An application only may not /dispatch/ compute work inside a
renderpass.

6 years agolayers: Drop out some redundant checks already covered by OT
Chris Forbes [Wed, 16 Aug 2017 20:16:31 +0000 (13:16 -0700)]
layers: Drop out some redundant checks already covered by OT

6 years agolayers: Calculate viewport/scissor state bits correctly
Chris Forbes [Wed, 16 Aug 2017 19:58:48 +0000 (12:58 -0700)]
layers: Calculate viewport/scissor state bits correctly

6 years agolayers: (re)-add viewport and scissor cbstatus flags
Chris Forbes [Wed, 16 Aug 2017 19:56:01 +0000 (12:56 -0700)]
layers: (re)-add viewport and scissor cbstatus flags

We won't actually check these at draw time since we have more precise
per-viewport and per-scissor support there, but we need these in order
to easily reject CmdSetViewport/CmdSetScissor when the pipeline doesn't
have the appropriate dynamic state enabled.

6 years agoandroid: Updates for NDK r15
Cody Northrop [Wed, 16 Aug 2017 19:25:22 +0000 (13:25 -0600)]
android: Updates for NDK r15

Removes app_dummy from apps that use native activity.

For more details refer to: https://github.com/android-ndk/ndk/issues/381

6 years agolayers: Fix img layout state in CmdExecuteCommands
Alex Smith [Wed, 16 Aug 2017 08:23:27 +0000 (09:23 +0100)]
layers: Fix img layout state in CmdExecuteCommands

Previously the layout state in the primary command buffer was just
overwritten with the state in the secondary command buffer.

This can lead to spurious errors upon submission of the primary CB, if
an image used in the secondary CB is used prior to CmdExecuteCommands
in the primary CB with a different initial layout. This is because the
initialLayout field for the image on the primary CB is overwritten
with that of the secondary CB.

An example case that was incorrectly erroring (these commands refer to
the same image, newly created):

  (primary buffer)
  vkCmdPipelineBarrier, transition UNDEFINED -> TRANSFER_DST_OPTIMAL
  vkCmdExecuteCommands
    (secondary buffer)
    ...
    vkCmdCopyBufferToImage, layout TRANSFER_DST_OPTIMAL

Just before the CmdExecuteCommands, the image had initialLayout =
UNDEFINED and layout = TRANSFER_DST_OPTIMAL on the primary CB, and
initialLayout = layout = TRANSFER_DST_OPTIMAL on the secondary.

After CmdExecuteCommands, the primary CB state is overwritten, so
it has initialLayout = layout = TRANSFER_DST_OPTIMAL. At submission,
this then errors because the global image layout is UNDEFINED.

Fix by only setting initialLayout on the primary CB from the secondary
if the image hasn't already been used on the primary.

Change-Id: Iae248ed09b1f87598fd192ba3d6f0bcf7ad38ada

6 years agolayers: Copy queue submit fcns in CmdExecuteCommands
Alex Smith [Wed, 16 Aug 2017 08:17:54 +0000 (09:17 +0100)]
layers: Copy queue submit fcns in CmdExecuteCommands

When a secondary command buffer is executed, copy all functions in its
queue_submit_functions list to the primary command buffer.

This is needed e.g. to ensure that functions registered to validate and
update memory validity state for a command in the secondary CB get run
upon submission of the primary CB.

Fixes spurious memory invalid warnings on later commands after an
image's memory has been initially made valid inside a secondary CB.

Change-Id: I39d5a34f074942d5dedbf4c5a0295af957a92361

6 years agolayers: Update Database to fix CI
Mark Lobodzinski [Wed, 16 Aug 2017 18:08:12 +0000 (12:08 -0600)]
layers: Update Database to fix CI

Couple of VUIDS were not added to the database.

Change-Id: I8ad8868182c8d129622d616241f5e0a14cb5054e

6 years agolayers: Check cb::static_status for most dynamic state setters
Chris Forbes [Tue, 15 Aug 2017 22:07:37 +0000 (15:07 -0700)]
layers: Check cb::static_status for most dynamic state setters

6 years agolayers: Track static state bits separately
Chris Forbes [Tue, 15 Aug 2017 21:48:50 +0000 (14:48 -0700)]
layers: Track static state bits separately

This gives us two advantages:
- We no longer need to recalculate the state bits to remove for the old
pipeline when binding a new pipeline.
- We now have the set of bits to test against when trying to bind
dynamic state for #614

6 years agolayers: Invalidate old pipeline's static state when binding
Chris Forbes [Tue, 15 Aug 2017 19:28:16 +0000 (12:28 -0700)]
layers: Invalidate old pipeline's static state when binding

Previously we'd only ever or in new bits, causing us to miss cases where
some state changes from static to dynamic within a CB.

Also only fiddle with the state masks when binding a graphics pipeline
-- previously we'd miss some other cases because binding a compute
pipeline would set all the state bits.

6 years agolayers: inline set_cb_pso_status into sole caller
Chris Forbes [Tue, 15 Aug 2017 18:23:40 +0000 (11:23 -0700)]
layers: inline set_cb_pso_status into sole caller

6 years agoSplit out dynamicstate->flags conversion
Chris Forbes [Tue, 15 Aug 2017 18:09:13 +0000 (11:09 -0700)]
Split out dynamicstate->flags conversion

6 years agolayers: Move PV custom funcptrs into map
Mark Lobodzinski [Tue, 8 Aug 2017 20:16:51 +0000 (14:16 -0600)]
layers: Move PV custom funcptrs into map

Simplifies steps necessary for new custom functions.

Change-Id: Ib2d80346ebc42011dce74fdd8cee62adb4b3432c

6 years agolayers: Re-architect parameter validation layer
Mark Lobodzinski [Tue, 1 Aug 2017 19:02:20 +0000 (13:02 -0600)]
layers: Re-architect parameter validation layer

Changed the codegen to autogenerate validation functions for any new
APIs without user intervention. Manual updates are only necessary to
extend PV functionality.

- parameter_validation.h is now checked into the layers directory
- parameter_validation.cpp is now generated
- parameter_validation_utils.cpp is new and contains any custom
      (non-generated) or housekeeping functions.
- parameter_validation_utils.h is deprecated
- updated database for new VUID coverage

Change-Id: Ib9261894386145573ba9e8906ba4ad4e9fecbdfd

6 years agolayers: Add checks for Image/ImageView usage
Jeremy Kniager [Tue, 18 Jul 2017 17:10:28 +0000 (11:10 -0600)]
layers: Add checks for Image/ImageView usage

Change-Id: Ibb2ac5b5f4b4176f5745007598c2fe64665237c2

6 years agodemos: Fix disappearing objects in smoketest
Karl Schultz [Tue, 15 Aug 2017 15:08:53 +0000 (09:08 -0600)]
demos: Fix disappearing objects in smoketest

When an object reaches the end of its "curve" path
it receives a new curve.  To ease the transition from
the old curve to the new curve, the origin of the new
curve is the ending point of the old curve.  However,
this can result in the starting point of the new curve
being out of the view.  This results in objects slowing
leaving the view.

Add code to move the origin of the new curve back inside
the original view bounds only if the end of the old curve
is out of the view bounds.  This does not add any additional
jarring because any object getting a new origin is already
outside the view anyway.

Change-Id: I50e88be453f31b9c37878f63c97d4c7c8154e718

6 years agoheader: Update to version 1.0.58 of the vulkan hdr
Mark Lobodzinski [Mon, 14 Aug 2017 21:26:30 +0000 (15:26 -0600)]
header: Update to version 1.0.58 of the vulkan hdr

- updated vulkan.h
- updated vk.xml
- updated cgenerator.py
- updated Win/Lin json files
- updated vulkan.hpp
- updated vk_validation_error_messages.h
- updated vk_validation_error_database.h

Change-Id: I8c525b6a2bd69914440c6d7984a67446b27e6c23

6 years agodemos: Add compositeAlphaFlags fix to cube.c
Tony Barbour [Mon, 14 Aug 2017 18:02:30 +0000 (12:02 -0600)]
demos: Add compositeAlphaFlags fix to cube.c

Change-Id: Id19d11e909ffc21c4aa6a419b071ba53594ae94f

6 years agodemos: cube.cpp - iterating over compositeAlphaFlags
gwizdz [Mon, 7 Aug 2017 23:17:01 +0000 (01:17 +0200)]
demos: cube.cpp - iterating over compositeAlphaFlags

Error in for loop condition

Change-Id: I8c775f961a6c05dd36e7acfdda6e94399365f90d

7 years agolayers: Fix layer settings file debug action name
Mark Lobodzinski [Thu, 10 Aug 2017 17:25:01 +0000 (11:25 -0600)]
layers: Fix layer settings file debug action name

Change-Id: Ic5a6828d57515efb50c12e21ef45e690c058c96a

7 years agolayers: GH1991, Implement BREAK debug action
Mark Lobodzinski [Thu, 10 Aug 2017 17:01:17 +0000 (11:01 -0600)]
layers: GH1991, Implement BREAK debug action

Change-Id: I19ee76db3a380116c7c25819a112751d988e23b4