platform/upstream/Vulkan-LoaderAndValidationLayers.git
7 years agoscripts:Mark 639 unimplemented in the database
Tobin Ehlis [Wed, 23 Nov 2016 20:10:13 +0000 (13:10 -0700)]
scripts:Mark 639 unimplemented in the database

I believe VALIDATION_ERROR_00639 was marked as implemented because the
case is handled in parameter_checker, but the code itself has not been
updated so I'm switching it back to 'N' in the database for now until
the error code is actually updated.

7 years agoscripts:Add exception for error 1790
Tobin Ehlis [Wed, 23 Nov 2016 20:08:01 +0000 (13:08 -0700)]
scripts:Add exception for error 1790

VALIDATION_ERROR_01790 is a special case that provides an exception
for valid usage when VK_AMD_negative_viewport_height extension is
enabled. There's no actual error to flag here, but the code does
handle the exception case correctly so adding it as an exception
in the stat script as well to reflect that it's implemented.

7 years agotests:Update AllocDescriptorFromEmptyPool
Tobin Ehlis [Wed, 23 Nov 2016 19:52:48 +0000 (12:52 -0700)]
tests:Update AllocDescriptorFromEmptyPool

Update the AllocDescriptorFromEmptyPool test with a new case where
we attempt to allocate more sets than available.
Update the error checking for both cases to use the unique error enum
instead of string matching.

Also update database file to reflect new test case.

7 years agolayers:Unique enums for vkAllocateDescriptorSets
Tobin Ehlis [Wed, 23 Nov 2016 19:23:32 +0000 (12:23 -0700)]
layers:Unique enums for vkAllocateDescriptorSets

Add appropriate unique error enums to the code for allocating
descriptor sets from a pool without enough sets left and without
enough descriptors left.
These were already flagged as implemented but the enums hadn't been
added to the code.

7 years agolayers:Separate push constant max size errors
Tobin Ehlis [Wed, 23 Nov 2016 17:47:26 +0000 (10:47 -0700)]
layers:Separate push constant max size errors

There's separate valid usage language regarding the relationship
between a device's maxPushConstantsSize and the size and offset of
VkPushConstantRange. Splitting up the validation callbacks to flag
these two errors separately along with their respective unique error
enums.

7 years agolayers:Separate two error checks
Tobin Ehlis [Wed, 23 Nov 2016 16:41:12 +0000 (09:41 -0700)]
layers:Separate two error checks

There's separate valid usage language for VkPushConstantRange size
being non-zero and being multiple of 4. Breaking the validation
callbacks to flag these two errors separately along with their
respective unique error enums.

7 years agolayers: Handle partial failure in vkCreate*Pipelines
Maciej Jesionowski [Wed, 23 Nov 2016 09:44:34 +0000 (10:44 +0100)]
layers: Handle partial failure in vkCreate*Pipelines

This applies to vkCreate*Pipelines creating multiple objects with
a single call.

Creation of *some* pipelines may fail and an error code will be
returned. In this case invalid handles will be set to NULL, and
the remaining handles must be managed properly.

7 years agoexternals: Update glslang and spriv-tools revision
Mark Young [Wed, 23 Nov 2016 22:23:32 +0000 (15:23 -0700)]
externals: Update glslang and spriv-tools revision

Update glslang to commit 1c573fb and spirv-tools to commit
6fa6a37.

Change-Id: I22692c213fdc1bada0ee14f110373b1d8c76b043

7 years agolayers: Fix windows build warnings
Mark Lobodzinski [Wed, 23 Nov 2016 18:28:30 +0000 (11:28 -0700)]
layers: Fix windows build warnings

Change-Id: Ifead20bae1e3c4f237ffc6f49422f20621b6349e

7 years agotests: Update misc image VE enums for desired msgs
Mark Lobodzinski [Tue, 22 Nov 2016 21:54:44 +0000 (14:54 -0700)]
tests: Update misc image VE enums for desired msgs

Change-Id: I08413ccb984f71a91ea89233be742a23331059d7

7 years agotests: GH1182, Add buffer/image copy test cases
Mark Lobodzinski [Tue, 22 Nov 2016 21:48:36 +0000 (14:48 -0700)]
tests: GH1182, Add buffer/image copy test cases

Added cases to MiscImageLayerTest and updated the VE database.

Change-Id: Ic76d9c5aafc1532cc761c92feaffbf5745e86f93

7 years agolayers: GH1182, Validate VkBufferImageCopy depth
Mark Lobodzinski [Tue, 22 Nov 2016 21:46:39 +0000 (14:46 -0700)]
layers: GH1182, Validate VkBufferImageCopy depth

Validate that for buffer<-->image copies that (for 1D and 2D image
types) the offset is 0 and the depth is 1.

Change-Id: I8114ce78be926411a2938148bf4c60d86006f8a4

7 years agolayers: Removed obsolete CV validation checks
Mark Lobodzinski [Tue, 22 Nov 2016 18:40:48 +0000 (11:40 -0700)]
layers: Removed obsolete CV validation checks

Removed obsolete CopyImageToBuffer/CopyBufferToImage checks
that output errors if the layerCount was zero and removed
corresponding LVT.

Change-Id: I0a2bada5f896c30fb13cad8a4b3fe157d6d788d3

7 years agolayers: Moved image/buffer aspect check
Mark Lobodzinski [Tue, 22 Nov 2016 18:18:46 +0000 (11:18 -0700)]
layers: Moved image/buffer aspect check

Moved this validation check into a routine shared by both
copyImageToBuffer and copyBufferToImage.

Change-Id: If53581cb7dd847492f52b9c2c95b0be25654074f

7 years agolayers: Update ValidateBufferImageCopyData err enums
Mark Lobodzinski [Tue, 22 Nov 2016 17:44:37 +0000 (10:44 -0700)]
layers: Update ValidateBufferImageCopyData err enums

Updated enums and database.

Change-Id: If04fa10a233ffab9a1622a6bcdaad803de9c84a6

7 years agolayers: Update BufferImageCopy var names for style
Mark Lobodzinski [Tue, 22 Nov 2016 16:37:10 +0000 (09:37 -0700)]
layers: Update BufferImageCopy var names for style

Change-Id: If39d85522b27e571ab3e7c0e9fb8cc4e63ac0cf9

7 years agolayers: Update call structure for BufferImageCopies
Mark Lobodzinski [Tue, 22 Nov 2016 16:33:23 +0000 (09:33 -0700)]
layers: Update call structure for BufferImageCopies

Converted over to PreCallValidate structure for CmdCopyImageToBuffer
and CmdCopyBufferToImage.

Change-Id: I9e68376bbcaa4c7058eb820b55125c524983b1be

7 years agolayers: Clarify BufferImageCopy validation name
Mark Lobodzinski [Tue, 22 Nov 2016 16:17:10 +0000 (09:17 -0700)]
layers: Clarify BufferImageCopy validation name

This routine was used in both ImageToBuffer and BufferToImage but
the name was misleading.

Change-Id: I8ff99cff1757dbaa888cf543451e6a3a4872b003

7 years agolayers: Fix BindImageMemory typo
Mark Lobodzinski [Tue, 22 Nov 2016 22:29:38 +0000 (15:29 -0700)]
layers: Fix BindImageMemory typo

Change-Id: I77359a73635d4cdae066255e774a096a9b643a3e

7 years agolayers:Avoid copy of cmd buffer set
Tobin Ehlis [Mon, 21 Nov 2016 22:23:51 +0000 (15:23 -0700)]
layers:Avoid copy of cmd buffer set

No need to copy the entire unordered_set<GLOBAL_CB_NODE *> in
invalidateCommandBuffers(). Change it to take a "const &" instead.

7 years agolayers:Use ptr to cmd buffer object in log_msg
Tobin Ehlis [Mon, 21 Nov 2016 22:15:52 +0000 (15:15 -0700)]
layers:Use ptr to cmd buffer object in log_msg

This new error was incorrectly referencing the ptr to the cb_node,
which is internal validation state, instead of the cmd buffer object
that the node wraps.

7 years agoscripts: Improve paths in update_ext_resources.sh
Mark Lobodzinski [Tue, 22 Nov 2016 15:02:59 +0000 (08:02 -0700)]
scripts: Improve paths in update_ext_resources.sh

Script was relying on $PWD for determining the current path which
is unreliable in some situations. Updated to a more robust method
allowing spaces in paths.

Change-Id: Ibdb780c479ad7fa831d113e445cc598830806806

7 years agobuild: Add check for spirv-headers revision file
Mark Lobodzinski [Fri, 18 Nov 2016 20:48:44 +0000 (13:48 -0700)]
build: Add check for spirv-headers revision file

Change-Id: I9bc225275c4d890f44c7ab4dd2076b981778ac20

7 years agobuild: Move revision files into external_revisions
Mark Lobodzinski [Fri, 18 Nov 2016 20:20:36 +0000 (13:20 -0700)]
build: Move revision files into external_revisions

Moved glslang, spirv-tools and spirv-headers revision files into
the external_revisions subdirectory.  Modified the Win/Lin update
external sources files to use the new locations.

Change-Id: I56138d5ae21430bcc564e6a42723accae1bcb9de

7 years agodocs: Fix loader doc mention of linux dirs
Mark Young [Tue, 22 Nov 2016 15:44:21 +0000 (08:44 -0700)]
docs: Fix loader doc mention of linux dirs

The Linux "Properly-Installed ICDs" section wasn't coming across
into HTML properly.

Change-Id: I2538b3c027c88ad5923d23f554bba1734c60ec06

7 years agoloader: Fix debug report memory leaks
Mark Young [Mon, 21 Nov 2016 23:20:06 +0000 (16:20 -0700)]
loader: Fix debug report memory leaks

Found a couple of memory leaks in the debug report code in the loader
while testing out allocators in cube.

Change-Id: I56b401394ca43bd8eb9b4f85baa52dfa597a6f49

7 years agoscripts:Some database clean-ups
Tobin Ehlis [Mon, 21 Nov 2016 22:51:45 +0000 (15:51 -0700)]
scripts:Some database clean-ups

Fix a bad test name in database file.
Update two checks which are implemented but didn't have "Y" in their
implemented column of the database file.
Fix a bug in stats script that failed to turn off red txt coloring.

7 years agotests: Update layer doc to reflect recent test changes
Karl Schultz [Tue, 22 Nov 2016 01:31:48 +0000 (18:31 -0700)]
tests: Update layer doc to reflect recent test changes

Change-Id: I52ed15e0455b88ad7cf7474baa1d1790a13a86f0

7 years agolayers:Database update
Tobin Ehlis [Mon, 21 Nov 2016 20:58:59 +0000 (13:58 -0700)]
layers:Database update

Update database to record that check 1006 is implemented and has a test

7 years agotests:Add InvalidQueryPoolCreate test
Tobin Ehlis [Mon, 21 Nov 2016 19:33:49 +0000 (12:33 -0700)]
tests:Add InvalidQueryPoolCreate test

This test intentionally creates a device with the
pipelineStatisticsQuery feature disabled and then attempts to create a
QueryPool that for queryType VK_QUERY_TYPE_PIPELINE_STATISTICS.

7 years agolayers:Verify pipe stats are enabled for device
Tobin Ehlis [Mon, 21 Nov 2016 19:30:06 +0000 (12:30 -0700)]
layers:Verify pipe stats are enabled for device

From Riku Salminen

At vkCreateQueryPool() time, make sure that if PIPELINE_STATISTICS
are requested, then the device must have pipelineStatisticsQuery
enabled.

7 years agotests:Add DSUpdateEmptyBinding test
Tobin Ehlis [Mon, 21 Nov 2016 17:36:16 +0000 (10:36 -0700)]
tests:Add DSUpdateEmptyBinding test

Try to update an empty descriptor binding and verify that correct error
is flagged.

Also updated database file to record testname and the fact that the
check is implemented.

7 years agotests:Use unique error enum
Tobin Ehlis [Mon, 21 Nov 2016 17:33:40 +0000 (10:33 -0700)]
tests:Use unique error enum

Update InvalidDSUpdateIndex test to use unique error enum.

Update database to record test for this case.

7 years agolayers:Remove redundant periods
Tobin Ehlis [Mon, 21 Nov 2016 16:50:49 +0000 (09:50 -0700)]
layers:Remove redundant periods

These error messages are all amended to error messages that already
include a period at the end so deleting the extra periods.

7 years agolayers:Check for update of empty binding
Tobin Ehlis [Mon, 21 Nov 2016 16:41:57 +0000 (09:41 -0700)]
layers:Check for update of empty binding

Validation error if descriptor update performed on an empty binding.

7 years agolayers: Tweak comments for swapchain checks to be less brittle
Chris Forbes [Mon, 31 Oct 2016 04:20:22 +0000 (17:20 +1300)]
layers: Tweak comments for swapchain checks to be less brittle

Referring to specific lines within an expression breaks every time this
code changes.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
7 years agolayers: Remove (mostly poor) descriptions from CV error enums
Chris Forbes [Mon, 17 Oct 2016 02:01:40 +0000 (15:01 +1300)]
layers: Remove (mostly poor) descriptions from CV error enums

Signed-off-by: Chris Forbes <chrisforbes@google.com>
7 years agotest: Disable the existing WSI tests
Chris Forbes [Wed, 12 Oct 2016 22:59:22 +0000 (11:59 +1300)]
test: Disable the existing WSI tests

The existing support in Swapchain for this is going to be generalized to
every known extension entrypoint in PV, but that hasn't happened yet.

Disable this test for now so we don't get random breakage as other bits
of swapchain get disassembled.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
7 years agolayers: Remove husk of capabilities tracking from swapchain
Chris Forbes [Wed, 12 Oct 2016 02:00:46 +0000 (15:00 +1300)]
layers: Remove husk of capabilities tracking from swapchain

Signed-off-by: Chris Forbes <chrisforbes@google.com>
7 years agolayers: Remove remaining bits of image tracking from swapchain
Chris Forbes [Wed, 12 Oct 2016 01:57:25 +0000 (14:57 +1300)]
layers: Remove remaining bits of image tracking from swapchain

Signed-off-by: Chris Forbes <chrisforbes@google.com>
7 years agolayers: Remove husks of Acquire/Present from swapchain
Chris Forbes [Wed, 12 Oct 2016 00:31:00 +0000 (13:31 +1300)]
layers: Remove husks of Acquire/Present from swapchain

Signed-off-by: Chris Forbes <chrisforbes@google.com>
7 years agolayers: Move too many images case to CV
Chris Forbes [Wed, 12 Oct 2016 00:27:13 +0000 (13:27 +1300)]
layers: Move too many images case to CV

Signed-off-by: Chris Forbes <chrisforbes@google.com>
7 years agolayers: Move most of remaining swapchain creation checks to CV
Chris Forbes [Tue, 11 Oct 2016 23:24:44 +0000 (12:24 +1300)]
layers: Move most of remaining swapchain creation checks to CV

Signed-off-by: Chris Forbes <chrisforbes@google.com>
7 years agolayers: Move complaints about presenting on bad queues to CV
Chris Forbes [Tue, 11 Oct 2016 21:21:19 +0000 (10:21 +1300)]
layers: Move complaints about presenting on bad queues to CV

Signed-off-by: Chris Forbes <chrisforbes@google.com>
7 years agolayers: Have the instance WSI flags unconditionally exist
Chris Forbes [Tue, 11 Oct 2016 21:18:39 +0000 (10:18 +1300)]
layers: Have the instance WSI flags unconditionally exist

Code that changes its behavior based on these flags shouldn't also need
to be a mess of ifdef.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
7 years agolayers: Track surface support for gpu+queue
Chris Forbes [Tue, 11 Oct 2016 19:55:03 +0000 (08:55 +1300)]
layers: Track surface support for gpu+queue

Signed-off-by: Chris Forbes <chrisforbes@google.com>
7 years agolayers: Move caps query / swapchain creation interaction to CV
Chris Forbes [Tue, 11 Oct 2016 03:21:32 +0000 (16:21 +1300)]
layers: Move caps query / swapchain creation interaction to CV

Signed-off-by: Chris Forbes <chrisforbes@google.com>
7 years agolayers: Capture surface capabilities
Chris Forbes [Tue, 11 Oct 2016 02:57:55 +0000 (15:57 +1300)]
layers: Capture surface capabilities

Signed-off-by: Chris Forbes <chrisforbes@google.com>
7 years agobuild: Fix 32-bit Linux notes
Karl Schultz [Mon, 21 Nov 2016 20:25:32 +0000 (13:25 -0700)]
build: Fix 32-bit Linux notes

7 years agodemos: Set attachment description flag bits in cube
Tony Barbour [Mon, 21 Nov 2016 19:56:25 +0000 (12:56 -0700)]
demos: Set attachment description flag bits in cube

Fixes a cubepp crash running on AMD

Change-Id: Ie8ef8625a2e8a8a416bcbfe4a62871fef5e07f71

7 years agobuild: Update docs for Linux 32-bit
Karl Schultz [Sat, 19 Nov 2016 17:24:47 +0000 (10:24 -0700)]
build: Update docs for Linux 32-bit

Change-Id: I38c19a166b25af8dba6bdac4d4c09eb1cfdc698d

7 years agobuild: loader: Fix warnings for 32-bit linux
Karl Schultz [Sat, 19 Nov 2016 16:02:27 +0000 (09:02 -0700)]
build: loader: Fix warnings for 32-bit linux

Change-Id: Ied7668aa7edeef01675dd4f358916d3e8bc07b27

7 years agobuild: Update .gitignore w/new __pycache__ location
Mark Lobodzinski [Fri, 18 Nov 2016 22:10:27 +0000 (15:10 -0700)]
build: Update .gitignore w/new __pycache__ location

Change-Id: I096d61d7e1ff20ab34672efe24a3cfaa888f0018

7 years agobuild: Move vk.xml file into scripts dir
Mark Lobodzinski [Fri, 18 Nov 2016 22:04:50 +0000 (15:04 -0700)]
build: Move vk.xml file into scripts dir

- Update android-generate batch/script files
- Update layers CMakeLists.txt file

Change-Id: I6423f441d61daa20aef2cc5e8bc719113fd7978d

7 years agobuild: Move XML codegen scripts into scripts dir
Mark Lobodzinski [Fri, 18 Nov 2016 21:58:57 +0000 (14:58 -0700)]
build: Move XML codegen scripts into scripts dir

- Update android-generate.bat and android-generate.sh
- Updated layer CMakeLists.txt files for new path

Change-Id: I1b1c9dbc9e944c90e95542fcfdda1d2e804517f3

7 years agobuild: Move codegen scripts into scripts dir
Mark Lobodzinski [Fri, 18 Nov 2016 21:44:37 +0000 (14:44 -0700)]
build: Move codegen scripts into scripts dir

- Set SCRIPTS_DIR in root CMakeLists.txt
- Update android-generate.bat and android-generate.sh
- Updated layer/loader/tests CMakeLists.txt files for new path
- Updated test layer doc scripts for new location

Change-Id: I2d519ec40883ebeec4e9daab8641ad65515bb08c

7 years agoscripts: Move determine_vs_version into scripts dir
Mark Lobodzinski [Fri, 18 Nov 2016 21:12:01 +0000 (14:12 -0700)]
scripts: Move determine_vs_version into scripts dir

- Moved determine_vs_version.py into scripts dir
- Updated build_windows_targets.bat
- Updated update_external_sources.bat

Change-Id: I951a05763a7004f2ba641dad72ae3c109ce0aa5c

7 years agolayers:Warn on cmd buffer invalidate
Tobin Ehlis [Mon, 21 Nov 2016 15:31:01 +0000 (08:31 -0700)]
layers:Warn on cmd buffer invalidate

From Mikko Strandborg

When a resource gets deleted, any command buffer that references it
gets invalidated, and an error gets thrown whenever that command buffer
is submitted. However, for a developer, it's quite hard to deduce what
exactly caused that to happen. This patch emits a warning whenever a
command buffer that's in CB_RECORDING state (meaning that it has had
its vkBeginCommandBuffer called but not End). This way the developer
can set a breakpoint on that to see exactly what causes the buffer to
be invalidated.

Destroying a resource that's being used in an open command buffer is
almost certainly a bug, but there might still be cases where it might
be valid behavior (for example, when the application decides to abort
an operation), therefore it's not an error but a warning instead.

7 years agoscripts:Update unique error enums as of 11/21/16
Tobin Ehlis [Mon, 21 Nov 2016 15:08:17 +0000 (08:08 -0700)]
scripts:Update unique error enums as of 11/21/16

4 Updated checks and 1 new check.

Cmd line was:
python spec.py -update -remap 918-768,2:1096-936:2170-1964 > output.txt

7 years agoscripts:Check image.cpp for unique error enums
Tobin Ehlis [Fri, 18 Nov 2016 23:56:15 +0000 (16:56 -0700)]
scripts:Check image.cpp for unique error enums

Stats script wasn't checking image.cpp when looking for implemented
unique error enums.

Also updated script to include number of enums that it finds which are
claiming to be implemented but not located in source.

7 years agoUpdate out of range attachment check to use unique enum
Chris Forbes [Sun, 20 Nov 2016 21:45:39 +0000 (10:45 +1300)]
Update out of range attachment check to use unique enum

Signed-off-by: Chris Forbes <chrisforbes@google.com>
7 years agolayers: Only call ValidateLayouts if no prior error
Chris Forbes [Wed, 16 Nov 2016 01:30:05 +0000 (14:30 +1300)]
layers: Only call ValidateLayouts if no prior error

The long-term solution here is to merge some of this code together, but
validating the layouts later and only if nothing else was bogus is a
good start.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
7 years agotests: Add a test for an out of range attachment reference.
Chris Forbes [Tue, 15 Nov 2016 19:59:10 +0000 (08:59 +1300)]
tests: Add a test for an out of range attachment reference.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
7 years agolayers: Improve wording of attachment-index-out-of-range error
Chris Forbes [Tue, 15 Nov 2016 19:58:32 +0000 (08:58 +1300)]
layers: Improve wording of attachment-index-out-of-range error

This wasn't correct for the == case.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
7 years agovulkaninfo: Fix variable, struct and function names
joey-lunarg [Mon, 7 Nov 2016 18:27:00 +0000 (11:27 -0700)]
vulkaninfo: Fix variable, struct and function names

Cleanup to match Google c++ style guide.

Change-Id: Ifecbf5c8680159684e24a184421e907d1d815627

7 years agovulkaninfo: Add surface present modes
joey-lunarg [Wed, 2 Nov 2016 20:36:19 +0000 (14:36 -0600)]
vulkaninfo: Add surface present modes

Change-Id: Icb6c30a81743cf5854fd7ecc974d87e814be856d

7 years agodemos: fix validation error
Jeremy Hayes [Fri, 18 Nov 2016 18:59:55 +0000 (11:59 -0700)]
demos: fix validation error

Change-Id: Idd89d98bf8932c07df2c1452f27d2f3002fb2d8a

7 years agodemos: call DeviceWaitIdle before DestroyDevice
Jeremy Hayes [Wed, 16 Nov 2016 21:54:41 +0000 (14:54 -0700)]
demos: call DeviceWaitIdle before DestroyDevice

Change-Id: Ic5819027b706e8c5d66ae78d0d0da1133c16085b

7 years agodemos: make present mode a command line option
Jeremy Hayes [Wed, 16 Nov 2016 21:47:13 +0000 (14:47 -0700)]
demos: make present mode a command line option

Change-Id: I0dedd685225f5aecaba968ba81da487e5d05da26

7 years agodemos: move staging texture to demo struct
Jeremy Hayes [Wed, 16 Nov 2016 21:15:25 +0000 (14:15 -0700)]
demos: move staging texture to demo struct

Change-Id: I8b0319d0f0bab8aba6c41e8fa324f0a9f7128baf

7 years agodemos: move cmd bfr creation out of layout util
Jeremy Hayes [Wed, 16 Nov 2016 20:42:08 +0000 (13:42 -0700)]
demos: move cmd bfr creation out of layout util

Change-Id: I01c4f59497f4ac22f2a96bda535c7965d34156d8

7 years agoheader: Update header files to version 1.0.34
Mark Lobodzinski [Fri, 18 Nov 2016 15:36:15 +0000 (08:36 -0700)]
header: Update header files to version 1.0.34

 - Updated vulkan.h
 - Updated vk.xml
 - updated windows/linux *.json files
 - updated Linux SOVERSION
 - updated vulkan.hpp

Change-Id: I288e2646445aec88aa4a3a9243dd65293fe1028a

7 years agolayers:Check reqs before call to BindImageMemory
Tobin Ehlis [Thu, 17 Nov 2016 20:51:54 +0000 (13:51 -0700)]
layers:Check reqs before call to BindImageMemory

There's an implicit spec requirement that GetImageMemoryRequirements()
should be called prior to calling BindImageMemory() b/c various return
values from GetImageMemoryRequirements() are expected to be complied
with.

This change adds a warning if GetImageMemoryRequirements() has not
been called prior to BindImageMemory(). In this case it will make the
call itself in order to populate internal state tracking.

7 years agolayers:Check reqs before call to BindBufferMemory
Tobin Ehlis [Thu, 17 Nov 2016 20:39:57 +0000 (13:39 -0700)]
layers:Check reqs before call to BindBufferMemory

There's an implicit spec requirement that GetBufferMemoryRequirements()
should be called prior to calling BindBufferMemory() b/c various return
values from GetBufferMemoryRequirements() are expected to be complied
with.

This change adds a warning if GetBufferMemoryRequirements() has not
been called prior to BindBufferMemory(). In this case it will make the
call itself in order to populate internal state tracking.

7 years agolayers:Rename BUFFER_NODE->BUFFER_STATE
Tobin Ehlis [Wed, 16 Nov 2016 16:30:23 +0000 (09:30 -0700)]
layers:Rename BUFFER_NODE->BUFFER_STATE

7 years agolayers:Check all memory bindings
Tobin Ehlis [Tue, 15 Nov 2016 22:37:18 +0000 (15:37 -0700)]
layers:Check all memory bindings

There are a few places in the code where we assume that an image or
buffer doesn't have a sparse binding. These cases break with sparse
bindings.

To fix I added a function to BINDING class to retrieve all memory
bindings and then updated a few spots with bad assumption to make use
of this new GetBoundMemory() function.

7 years agolayers:Check buffer offset against required size
Tobin Ehlis [Wed, 16 Nov 2016 16:01:28 +0000 (09:01 -0700)]
layers:Check buffer offset against required size

Fixes #1030

Use the required memory size instead of bound memory size when
validating the offset into a memory buffer. This will correctly handle
both sparse and non-sparse cases.

7 years agolayers:Save memory requirements
Tobin Ehlis [Wed, 16 Nov 2016 15:57:22 +0000 (08:57 -0700)]
layers:Save memory requirements

Add memory requirements member to the BINDABLE class and save memory
requirements for images and buffers in their respective
Get*MemoryRequirements() functions.

7 years agocodegen: change script to handle NV ext structs
David Pinedo [Thu, 17 Nov 2016 22:03:16 +0000 (15:03 -0700)]
codegen: change script to handle NV ext structs

Modified vk_helper.py to handle NV-specific structures

7 years agolayers: GH949, Fix ObjTrkr to destroy NULL handles
Mark Lobodzinski [Thu, 17 Nov 2016 17:56:14 +0000 (10:56 -0700)]
layers: GH949, Fix ObjTrkr to destroy NULL handles

ObjectTracker emitted errors when a destroy/free call was made with
VK_NULL_HANDLE, which *is* allowed by the spec.

Change-Id: I2b4e19999e539d68b5856139566d4a7a8a530ca6

7 years agotests:Add test DynamicOffsetWithInactiveBinding
Tobin Ehlis [Thu, 17 Nov 2016 17:54:13 +0000 (10:54 -0700)]
tests:Add test DynamicOffsetWithInactiveBinding

This is a positive test that features an inactive binding with a
dynamic descriptor and an associated dynamic offset passed in at bind
time.

This previously caused an invalid validation error b/c we weren't
skipping entries in the dynamic offset array for inactive bindings

7 years agolayers:Fix descriptor dynamic offset handling
Tobin Ehlis [Thu, 17 Nov 2016 17:50:52 +0000 (10:50 -0700)]
layers:Fix descriptor dynamic offset handling

Fixes #1162

The dynamic offsets passed in at descriptor bind time are ordered based
on the binding order and any consecutive array indicies within those
bindings. When we validate the dynamic offsets at draw time, we were
using the entire dynamic offset array, but only the active bindings.

If we had an inactive dynamic binding before the end of the bindings
we would use the wrong offsets.

This change fixes the issue by creating a mapping between bindings and
dynamic offset array indicies at descriptor layout creation time. At
draw time the mapping is then used to lookup the correct dynamic offset
array index for a given binding.

7 years agoRevert "layers: Update vulkan.py with new extensions"
Mark Lobodzinski [Thu, 17 Nov 2016 17:20:12 +0000 (10:20 -0700)]
Revert "layers: Update vulkan.py with new extensions"

This reverts commit f504ff6e45bb15a0517a8de2e2d75e90df7e4627.
This caused huge issues in the VulkanTools repo, reverting for
now.

7 years agolayers: Update vulkan.py with new extensions
Mark Lobodzinski [Wed, 16 Nov 2016 21:53:26 +0000 (14:53 -0700)]
layers: Update vulkan.py with new extensions

Change-Id: I1b0623587d7d02849ece97de00ddb1c6bad58819

7 years agoheader: Update header files to version 1.0.33
Mark Lobodzinski [Wed, 16 Nov 2016 22:34:26 +0000 (15:34 -0700)]
header: Update header files to version 1.0.33

- Updated vulkan.h
- Updated vk.xml
- updated windows/linux *.json files
- updated Linux SOVERSION
- updated vulkan.hpp

Change-Id: I8128a610d1cd24a1ac49712f28d566f712f4cc94

7 years agodocs: add libxkbcommon dependency (Keyboard handling)
Rene Lindsay [Thu, 17 Nov 2016 01:52:55 +0000 (18:52 -0700)]
docs: add libxkbcommon dependency (Keyboard handling)

7 years agolayers: Update error enum database
Mark Lobodzinski [Tue, 15 Nov 2016 16:40:32 +0000 (09:40 -0700)]
layers: Update error enum database

Updated status for new MappedMemoryRanges device limits checks.

Change-Id: Id5e1973fa2b7d798abfa3e54f751b69c1b29f2d1

7 years agotests: Add LVTs for MapMemRange device limits
Mark Lobodzinski [Tue, 15 Nov 2016 16:38:51 +0000 (09:38 -0700)]
tests: Add LVTs for MapMemRange device limits

Tacked them onto InvalidMemoryMapping test.

Change-Id: I62a094461730bcac14649a2ad6adf5cfdd0f2c58

7 years agotests: Fix unexpected errors in InvalidMemoryMapping
Mark Lobodzinski [Tue, 15 Nov 2016 16:14:24 +0000 (09:14 -0700)]
tests: Fix unexpected errors in InvalidMemoryMapping

Old tests for offset/size range violations did not respect device
limits.

Change-Id: I83a1360197db1cdf6a2d9fcc521627643d3ef74d

7 years agolayers: GH329, Add MappedMemoryRanges limits checks
Mark Lobodzinski [Mon, 14 Nov 2016 23:28:01 +0000 (16:28 -0700)]
layers: GH329, Add MappedMemoryRanges limits checks

When VkMappedMemoryRange structures are used, the offset and size
members must be a multiple of the device limit nonCoherentAtomSize.
Added these checks in core_validation.

Change-Id: If7eded4c52d31c1a25740ac08ec5434c93c5cecc

7 years agolayers: Fixup MappedMemRanges call ordering
Mark Lobodzinski [Tue, 15 Nov 2016 14:59:58 +0000 (07:59 -0700)]
layers: Fixup MappedMemRanges call ordering

Moved validation out of API calls.

Change-Id: I95f3b24d69d469ea98b7c955bbab56c9b47ad487

7 years agolayers: Fixup MappedMemory variable names for style
Mark Lobodzinski [Tue, 15 Nov 2016 14:48:49 +0000 (07:48 -0700)]
layers: Fixup MappedMemory variable names for style

Change-Id: I4f8aae213753dc69ae28a945d7f34cff2af7ccd9

7 years agolayers: Fixup validateMemoryIsMapped for style
Mark Lobodzinski [Tue, 15 Nov 2016 20:55:22 +0000 (13:55 -0700)]
layers: Fixup validateMemoryIsMapped for style

Var names.

Change-Id: I69b441f986c017f2d34a62669c8b3e7511a2dd5f

7 years agolayers: Update ValidateMemIsMapped error enums
Mark Lobodzinski [Tue, 15 Nov 2016 15:56:03 +0000 (08:56 -0700)]
layers: Update ValidateMemIsMapped error enums

Plumbed in VU error enums, updated tests and database.

Change-Id: I114d269c686cddd6b1d3acb098d0b2f5fe4fdc17

7 years agolayers: Updated error database for new check
Mark Lobodzinski [Tue, 15 Nov 2016 20:40:03 +0000 (13:40 -0700)]
layers: Updated error database for new check

Vertex attribute formats, 1413.

Change-Id: Ieddd05c0f40a643db074ade79659f9c09699c436

7 years agotests: Add test for Vtx Attr Format check
Mark Lobodzinski [Tue, 15 Nov 2016 20:30:38 +0000 (13:30 -0700)]
tests: Add test for Vtx Attr Format check

Change-Id: Iee24796050cc87d6f912033ccdf0b18785bb2f60

7 years agolayers: GH1143, Validate vertex attribute formats
Mark Lobodzinski [Wed, 16 Nov 2016 18:12:30 +0000 (11:12 -0700)]
layers: GH1143, Validate vertex attribute formats

Formats specified as vertex attributes (createGraphicsPipelines->
pCreateInfos->pVertexInputState->pVertexAttributeDescriptions.format)
must have the VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT set.

Change-Id: I907c37e2edbcfb7bcb405f912cea8d215acccb11

7 years agolayers: Save PDev in device's layer data
Mark Lobodzinski [Wed, 16 Nov 2016 19:12:56 +0000 (12:12 -0700)]
layers: Save PDev in device's layer data

Needed for physical-device calls or to access data belonging to
the physical device.

Change-Id: I2a1f6eadcaf82c2247a68c91c39d97ef3284b22a

7 years agolayers: Update CGP var names for style
Mark Lobodzinski [Wed, 16 Nov 2016 17:11:02 +0000 (10:11 -0700)]
layers: Update CGP var names for style

Changed CreateGraphicsPipeline local vars to match style guidelines.

Change-Id: I3204ce878b37ef3cb0ce58ecff00d65a4fed4f28

7 years agolayers: Move val to PreCallCreateGraphicsPipelines
Mark Lobodzinski [Wed, 16 Nov 2016 17:05:30 +0000 (10:05 -0700)]
layers: Move val to PreCallCreateGraphicsPipelines

In core validation, created a pre-call function and moved the
validation calls into it.

Change-Id: Ib7831c3d2f36628e24b90083be902ac724f25483