platform/upstream/Vulkan-Tools.git
8 years agolayers: NV_dedicated_allocation support for unique_objects
Dustin Graves [Thu, 14 Jul 2016 23:28:11 +0000 (17:28 -0600)]
layers: NV_dedicated_allocation support for unique_objects

Add ID substitution support for the
VkDedicatedAllocationMemoryAllocateInfoNV extension structure to the
unique_objects layer.  The current implementation is specific to the
case where the vkAllocateMemory pAllocateInfo parameter references
a single VkDedicatedAllocationMemoryAllocateInfoNV struct.

Issues-Addressed: GitHub #755
Change-Id: I33c3f00d32149044694ecafe808673e5d90107b4

8 years agomisc: Update to Vulkan header version 21
Karl Schultz [Mon, 18 Jul 2016 18:04:39 +0000 (12:04 -0600)]
misc: Update to Vulkan header version 21

Change-Id: I112bb3d53daf067b231532620f45cd8891537cbb

8 years agobuild: Update glslang to e4821e
Karl Schultz [Mon, 18 Jul 2016 15:40:37 +0000 (09:40 -0600)]
build: Update glslang to e4821e

This includes applying a patch to glslang to revert glslang
commit a5c33d, which fixes a texel fetch problem that many IHV
drivers are not ready to cope with yet.

8 years agolayers: Fix minor completeness/performance issue
Mark Mueller [Wed, 13 Jul 2016 20:49:35 +0000 (14:49 -0600)]
layers: Fix minor completeness/performance issue

The first time the condition is discovered it will
be the same as every subsequent time, so there is
no need to continue. Also, the whole structure must
be compared, so memcmp assures that will happen
with good efficiency

Change-Id: I71f608c71f83ebcd02212bb391a30bdf15279ff6

8 years agowindows: Return exit code from build script if any step fails
Cody Northrop [Wed, 13 Jul 2016 21:59:22 +0000 (15:59 -0600)]
windows: Return exit code from build script if any step fails

8 years agolayers: Update clearValueCount check
Tobin Ehlis [Fri, 15 Jul 2016 22:01:13 +0000 (16:01 -0600)]
layers: Update clearValueCount check

The pClearValues array is indexed by the attachment index which
means that it must be at least as large as the last LOAD_OP_CLEAR
attachment in the renderpass. Updating this check to reflect this
requirement.

8 years agolayers: PR767, Fix crash exiting smoketest
Mark Lobodzinski [Fri, 15 Jul 2016 19:53:44 +0000 (13:53 -0600)]
layers: PR767, Fix crash exiting smoketest

Commit a86b57c caused a Windows crash when shutting down smoketest.
Command buffer cleanup for object bindings wasn't happening when
calling DestroyCommandPool.

Change-Id: Ie233763e37ed9bc6988dddbf932aa3eda2960940

8 years agolayers: LX555/GH663, Update details doc
Mark Lobodzinski [Thu, 14 Jul 2016 18:09:12 +0000 (12:09 -0600)]
layers: LX555/GH663, Update details doc

Add entry for new buffer/image memory binding checks.

Change-Id: Ic02c97cd8dd7e054ca67a66d82fc5728bf9167be

8 years agolayers: LX555/GH663, Add BindXxxMemory validation
Mark Lobodzinski [Thu, 14 Jul 2016 15:54:11 +0000 (09:54 -0600)]
layers: LX555/GH663, Add BindXxxMemory validation

If the user neglected to call BindImageMemory or BindBufferMemory,
validation gave not indication of the failure which then results in
a driver or layer crash. This commit extends and generalizes the
checks done for CreateImageView and CreateBufferView to cover all
the bound memory checks for the 'recording commands in command
buffer' case in spec section 11.6

Change-Id: I3b4a3d130e9b6c242413fc0ad14c1624295b33b3

8 years agolayers: Handle binding between cmd buffer and query pools
Tobin Ehlis [Fri, 8 Jul 2016 20:22:01 +0000 (14:22 -0600)]
layers: Handle binding between cmd buffer and query pools

For the CmdBind* functions that involve queryPool object, add a binding between
the cmd buffer and the queryPool.

In the event that a queryPool is destroyed, invalidate any bound cmd buffers
and make sure invalid reporting is handled correctly for query pools.

When a cmd buffer is destroyed that has query pool bindings, those bindings
will be cleared under existing object_binding cleanup in resetCB.

8 years agolayers: Set cmd buffer invalid on event destroy
Tobin Ehlis [Thu, 7 Jul 2016 22:47:10 +0000 (16:47 -0600)]
layers: Set cmd buffer invalid on event destroy

When an event is destroyed, set any cmd buffers that it was bound
to to the CB_INVALID state.

Also added getEventNode() helper and made use of it where appropriate.

8 years agolayers: Rework Destroy/Free data structure cleanup
Tobin Ehlis [Wed, 13 Jul 2016 15:41:09 +0000 (09:41 -0600)]
layers: Rework Destroy/Free data structure cleanup

When destroying dispatchable objects we must cleanup internal data
structures prior to calling down the chain in the event that another
thread were to prempt execution and re-allocate a freed handle prior
to the layer cleanup code executing.

For non-dispatchable handles this shouldn't be a requirement due to
the fact that layers only see unique handles. However, moved some
non-dispatchable cleanup before the call to ICD as well for consistency
and to be extra safe.

8 years agolayers: threading with cmd buffer handle reuse
Mike Stroyan [Wed, 13 Jul 2016 17:07:27 +0000 (11:07 -0600)]
layers: threading with cmd buffer handle reuse

A driver may reuse a command buffer handle in another thread.
The threading layer needs to remove command buffer information
before calling FreeCommandBuffers.
This addresses part of github issue #719.

8 years agolayers: Remove unused vars from vk-layer-generate.py
Tobin Ehlis [Thu, 14 Jul 2016 20:45:54 +0000 (14:45 -0600)]
layers: Remove unused vars from vk-layer-generate.py

8 years agolayers: On Free/Destroy fix unique_objects map cleanup
Tobin Ehlis [Thu, 14 Jul 2016 20:37:51 +0000 (14:37 -0600)]
layers: On Free/Destroy fix unique_objects map cleanup

When an object is freed or destroyed, unique_objects must clean up its
map entry prior to calling down the chain. This is becase the ICD may
be preempted just after object deletion, and the same object handle
could then be allocated before returning to validation. In that case,
unique_objects would delete the entry for the newly-created object.

8 years agolayers: faster threading layer for single thread
Mike Stroyan [Wed, 13 Jul 2016 16:10:25 +0000 (10:10 -0600)]
layers: faster threading layer for single thread

Add a check to the threading layer to detect a single thread case.
If the application has only called vulkan from one thread at a time,
then skip access counters for externally synchronized parameters.
This greatly reduces the overhead of the layer for applications
that don't truly use vulkan in a multi-threaded way.

8 years agolayers: Use type-specific mutexes in thread layer
Mike Stroyan [Thu, 30 Jun 2016 19:21:37 +0000 (13:21 -0600)]
layers: Use type-specific mutexes in thread layer

Use type-specific mutexes to reduce lock contention.

8 years agoloader: mr739 - Link VKstatic against shlwapi
Nekotekina [Fri, 8 Jul 2016 12:49:13 +0000 (15:49 +0300)]
loader: mr739 - Link VKstatic against shlwapi

Change-Id: I40345f39ece1d580139cb09ae01c1a36d43016dd

8 years agolayers: Fix core_validation Win32 build
Mark Lobodzinski [Wed, 13 Jul 2016 20:59:41 +0000 (14:59 -0600)]
layers: Fix core_validation Win32 build

Change-Id: Ib15d5c6fad234c0d657b59613293f38d28969697

8 years agolayers: Add binding between cmd buffer and pipeline
Tobin Ehlis [Fri, 8 Jul 2016 21:42:38 +0000 (15:42 -0600)]
layers: Add binding between cmd buffer and pipeline

Track all pipelines bound to a cmd buffer and if any of them are destroyed
set the cmd buffer as invalid.

8 years agolayers: Handle binding between cmd buffer and query pools
Tobin Ehlis [Fri, 8 Jul 2016 20:22:01 +0000 (14:22 -0600)]
layers: Handle binding between cmd buffer and query pools

For the CmdBind* functions that involve queryPool object, add a binding between
the cmd buffer and the queryPool.

In the event that a queryPool is destroyed, invalidate any bound cmd buffers
and make sure invalid reporting is handled correctly for query pools.

When a cmd buffer is destroyed that has query pool bindings, those bindings
will be cleared under existing object_binding cleanup in resetCB.

8 years agolayers: Add addCommandBufferBinding() utility function
Tobin Ehlis [Fri, 8 Jul 2016 19:27:48 +0000 (13:27 -0600)]
layers: Add addCommandBufferBinding() utility function

Created addCommandBufferBinding() utility function that creates a link between the
cb_binding data struct of an object and the object_binding data struct of the cmd
buffer.

Currently updated events to use this utility function, but will expand to other
object types in the future.

8 years agolayers: Set cmd buffer invalid on event destroy
Tobin Ehlis [Thu, 7 Jul 2016 22:47:10 +0000 (16:47 -0600)]
layers: Set cmd buffer invalid on event destroy

When an event is destroyed, set any cmd buffers that it was bound
to to the CB_INVALID state.

Also added getEventNode() helper and made use of it where appropriate.

8 years agodemos: Fix android build
Cody Northrop [Wed, 13 Jul 2016 16:01:10 +0000 (10:01 -0600)]
demos: Fix android build

8 years agodocs: GH422 Addition of Buffer Validation Tests
Mark Mueller [Thu, 7 Jul 2016 21:10:06 +0000 (15:10 -0600)]
docs: GH422 Addition of Buffer Validation Tests

Reflect new tests in documentation

Change-Id: Ib54179e4a1cea6aa38d2cf616bcf944c2e65eb08

8 years agolayers: GH422 Support addition of Buffer Validation Tests
Mark Mueller [Thu, 7 Jul 2016 17:57:59 +0000 (11:57 -0600)]
layers: GH422 Support addition of Buffer Validation Tests

Remove dead code by getting rid of deleteMemObjInfo function,
add check for freeMemObjInfo failure, and fix an incorrect
validation test

Change-Id: Ie84d16883abfb6d4d41b06d6fa210c7011861ecd

8 years agolayers: Handle special layerCount case
Dustin Graves [Tue, 12 Jul 2016 19:57:02 +0000 (13:57 -0600)]
layers: Handle special layerCount case

Make parameter validation logic for VkImageSubresource ignore
layerCount when it is set to VK_REMAINING_ARRAY_LAYERS.

Change-Id: Ib2e50e678c79f00850e085fe39c22631f9d00636
Issues-Addressed: GitHub VulkanTools #58

8 years agolayers: Don't use instance pointer after it has been destroyed
Cody Northrop [Tue, 12 Jul 2016 17:43:32 +0000 (11:43 -0600)]
layers: Don't use instance pointer after it has been destroyed

In unique_objects' explicit_DestroyInstance(), the recently introduced
second get_dispatch_table() was using a destroyed instance as a lookup
key, failing to find an entry (since the driver controls that memory
and probably freed it), and was crashing consistently on PixelC.

Instead, use the instance pointer to cleanup instanceExtMap before
calling down to the ICD's DestroyInstance.

Additionally, use the existing VkLayerInstanceDispatchTable* instead
of calling get_dispatch_table() twice.

8 years agolayers: Added return check for freeMemObjInfo call
Mark Mueller [Mon, 11 Jul 2016 21:03:44 +0000 (15:03 -0600)]
layers: Added return check for freeMemObjInfo call

In FreeMemory, the return value of freeMemObjInfo was
being ignored, which incorrectly allowed calls which
failed validation to still be passed to lower levels.
This change corrects that.

Change-Id: Iddbffad22f9502061441e961daef2e7fa26a5fcf

8 years agomisc: Update to Vulkan header version 20
Karl Schultz [Mon, 11 Jul 2016 21:09:57 +0000 (15:09 -0600)]
misc: Update to Vulkan header version 20

Changes:
vulkan.h
json files
linux SO version
loader and tests to reflect API change in vkCmdUpdateBuffer
vk.xml to match Vulkan-Docs

Change-Id: I1763bca6fccf619ad8e76c0363f68fa38ad69900

8 years agolayers: Fix WIN32 build
Dustin Graves [Fri, 8 Jul 2016 21:03:39 +0000 (15:03 -0600)]
layers: Fix WIN32 build

Fix a uint64_t to VkImage reinterpret_cast for 32-bit VS2013.  I
Missed this when reviewing the previous change.

Change-Id: I4a0865ab546b45792b8f4d841f6c6c04ff22501b

8 years agolayers: Remove cb_bindings when CB is reset
Tobin Ehlis [Fri, 8 Jul 2016 18:33:45 +0000 (12:33 -0600)]
layers: Remove cb_bindings when CB is reset

When a CB is reset (or freed) make sure to remove it from any image/buffer
cb_bindings that it was tied to.

8 years agodemos: Remove VkCommandBufferInheritanceInfo
Rene Lindsay [Thu, 7 Jul 2016 23:00:14 +0000 (16:00 -0700)]
demos: Remove VkCommandBufferInheritanceInfo

VkCommandBufferInheritanceInfo is only required for secondary buffers.
Remove from cube and tri.

Change-Id: I0000000000000decaf15bad00000000000000028

8 years agowinsdk: Fix error when installing from syswow64
Lenny Komow [Thu, 7 Jul 2016 22:45:34 +0000 (16:45 -0600)]
winsdk: Fix error when installing from syswow64

8 years agolayers: Hold lock during pipelineLayoutMap.erase()
Tobin Ehlis [Thu, 7 Jul 2016 19:40:29 +0000 (13:40 -0600)]
layers: Hold lock during pipelineLayoutMap.erase()

8 years agolayers: Remove entries from pipelineLayoutMap
Tobin Ehlis [Thu, 7 Jul 2016 18:04:20 +0000 (12:04 -0600)]
layers: Remove entries from pipelineLayoutMap

When VkPipelineLayout objects are destroyed, remove their corresponding
map entries.

8 years agolayers: Update layout compatibility to use stored state
Tobin Ehlis [Thu, 7 Jul 2016 17:06:26 +0000 (11:06 -0600)]
layers: Update layout compatibility to use stored state

When checking VkPipelineLayout compatibility, it's possible that the
VkPipelineLayout handle that was bound may have been subsequently deleted.

To account for this, store the PIPELINE_LAYOUT_NODE at bind time and
use that to do the compatibility check.

8 years agolayers: Rename vars
Tobin Ehlis [Thu, 7 Jul 2016 15:23:38 +0000 (09:23 -0600)]
layers: Rename vars

Migrate PIPELINE_LAYOUT_NODE members from camelcase.

8 years agolayers: Simplify PIPELINE_LAYOUT_NODE
Tobin Ehlis [Thu, 7 Jul 2016 15:20:13 +0000 (09:20 -0600)]
layers: Simplify PIPELINE_LAYOUT_NODE

Just use setLayout vector and kill duplicate descriptorSetLayout vector.

8 years agolayers: Store PIPELINE_LAYOUT_NODE directly in PIPELINE_NODE
Tobin Ehlis [Thu, 7 Jul 2016 14:14:48 +0000 (08:14 -0600)]
layers: Store PIPELINE_LAYOUT_NODE directly in PIPELINE_NODE

The layout and its associated node may be deleted after pipeline is
created so store a copy of the PIPELINE_LAYOUT_NODE in the
PIPELINE_NODE to make sure data is available when it's needed.

8 years agolayers: Rename pipelineLayout to pipeline_layout
Tobin Ehlis [Thu, 7 Jul 2016 14:12:03 +0000 (08:12 -0600)]
layers: Rename pipelineLayout to pipeline_layout

8 years agobuild: patch glslang to fix g++ 5.3 compilation issue
Karl Schultz [Thu, 7 Jul 2016 16:41:25 +0000 (10:41 -0600)]
build: patch glslang to fix g++ 5.3 compilation issue

Add GLSLANG_REVISION-sensitive step to update_external_sources
to patch glslang to allow compilation on Ubuntu 16.10,
Arch Linux and other platforms using g++ 5.3.

This patch won't happen if the GLSLANG_REVISION is changed.

Change-Id: I84a501cb44ee527f45f499d89b2745683e0c8e70

8 years agolayers: GH689 Disable perf warning for linear tiled textures
Tobin Ehlis [Wed, 6 Jul 2016 17:32:12 +0000 (11:32 -0600)]
layers: GH689 Disable perf warning for linear tiled textures

Linear tiled textures should use GENERAL layout so perf warning doesn't apply.

8 years agolayers: Minor refactor to save duplicate look-ups
Tobin Ehlis [Wed, 6 Jul 2016 17:23:05 +0000 (11:23 -0600)]
layers: Minor refactor to save duplicate look-ups

Pass layer_data* and GLOBAL_CB_NODE* to Verify[Dest|Source]ImageLayout() to avoid
a second look-up of the same data.

8 years agolayers: Fix handling of component qualifier on VS inputs
Chris Forbes [Wed, 6 Jul 2016 00:18:26 +0000 (12:18 +1200)]
layers: Fix handling of component qualifier on VS inputs

Interface matcher assumed no location aliasing, but this is allowed.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Migrate to validateImageUsageFlags function
Tobin Ehlis [Wed, 6 Jul 2016 14:36:19 +0000 (08:36 -0600)]
layers: Migrate to validateImageUsageFlags function

At ImageView creation time use validateImageUsageFlags function that avoids an
additional look-up for IMAGE_NODE. Kill previous validate_image_usage_flags()
function.

8 years agolayers: Remove validate_buffer_usage_flags() function
Tobin Ehlis [Wed, 29 Jun 2016 15:07:52 +0000 (09:07 -0600)]
layers: Remove validate_buffer_usage_flags() function

Replaced with validateBufferUsageFlags()

8 years agolayers: Invalidate Cmd Buffers on DestroyBuffer
Tobin Ehlis [Tue, 28 Jun 2016 22:36:47 +0000 (16:36 -0600)]
layers: Invalidate Cmd Buffers on DestroyBuffer

When buffer is destroyed, any command buffers that it's bound to must
be invalidated.

8 years agolayers: Invalidate Cmd Buffers on DestroyImage
Tobin Ehlis [Tue, 28 Jun 2016 22:24:17 +0000 (16:24 -0600)]
layers: Invalidate Cmd Buffers on DestroyImage

When image is destroyed, any command buffers that it's bound to must
be invalidated. Also clean-up DestroyImage() a bit.

8 years agolayers: Add binding between images and cmd buffer
Tobin Ehlis [Tue, 28 Jun 2016 21:52:55 +0000 (15:52 -0600)]
layers: Add binding between images and cmd buffer

For cmds that use images, update cb_bindings to tie image to cmd
buffer. This will be used to track invalid cmd buffers due to
destroying images.

The function structure here is the same but I've updated all of the
calls to use mem bindings from IMAGE_NODE with a single call rather
than the old two-call mechanism.

The assumption is that parameter_checker should be above
core_validation so I haven't replicated a bunch of its checks in the
case of invalid objects. I've added some asserts as a last line of
defense to make debugging invalid object issues in core_validation
simpler, but if running with full validation stack and responding to
validation errors from parameter_checker, then the asserts should
never be hit.

8 years agolayers: Add image to IMAGE_NODE
Tobin Ehlis [Tue, 28 Jun 2016 20:52:11 +0000 (14:52 -0600)]
layers: Add image to IMAGE_NODE

Store image inside the image ptr so that once node is looked-up
all relevent data is available when just node ptr is passed around.

8 years agolayers: Add binding between buffer and cmd buffer
Tobin Ehlis [Tue, 28 Jun 2016 20:04:54 +0000 (14:04 -0600)]
layers: Add binding between buffer and cmd buffer

Updated call mechanism to create binding between a VkBuffer
and a VkCommandBuffer so that it occurs in a single call.
Removed old mem_tracker mechanism for looking up memory from
a buffer and just use mem in BUFFER_NODE instead.
Also simplified call to check valid buffer use flags in order
to avoid a redundant map look-up.

Will make similar changes for images next.

8 years agolayers: Bulk rename skipCall -> skip_call
Tobin Ehlis [Tue, 28 Jun 2016 16:28:02 +0000 (10:28 -0600)]
layers: Bulk rename skipCall -> skip_call

Trying to migrate to consistent lowercase variable naming and
skip_call was different all over the place to unifying in a
single commit.

8 years agoloader: Fix 2 warnings detected in VS2015.
Jamie Madill [Wed, 6 Jul 2016 15:19:42 +0000 (11:19 -0400)]
loader: Fix 2 warnings detected in VS2015.

warning C4456: declaration of 'i' hides previous local declaration
warning C4244: '=': conversion from 'int' to 'uint16_t', possible loss of data

Change-Id: I651de053b206afa36fce27af92ffbe0a608e89d0

8 years agolayers: Remove device_limits from Android build
Mark Lobodzinski [Wed, 29 Jun 2016 19:58:52 +0000 (13:58 -0600)]
layers: Remove device_limits from Android build

Change-Id: I4d63b740f046ee8378267082abc3792aa7a85418

8 years agoscripts: Fix device_limits details doc validation
Mark Lobodzinski [Wed, 29 Jun 2016 20:24:50 +0000 (14:24 -0600)]
scripts: Fix device_limits details doc validation

Change-Id: Idd383c1a28fa7007449fe24a205c2164b21dfe09

8 years agoloader: Remove device_limits layer
Mark Lobodzinski [Wed, 29 Jun 2016 20:18:30 +0000 (14:18 -0600)]
loader: Remove device_limits layer

Change-Id: I2660be2eb099ab6300b78e364991ca23f0abf26d

8 years agolayers: Deprecate device_limits layer
Mark Lobodzinski [Wed, 29 Jun 2016 20:15:10 +0000 (14:15 -0600)]
layers: Deprecate device_limits layer

Change-Id: Idd440935f3329d017ba4ee21d9ce87e432eec98e

8 years agodemos: Remove device_limits layer from cube and tri
Mark Lobodzinski [Wed, 29 Jun 2016 20:01:14 +0000 (14:01 -0600)]
demos: Remove device_limits layer from cube and tri

Change-Id: I834133e5054668433c355408886f46c042a2ec6f

8 years agotests: Add tests for invalid VkDescriptorBufferInfo
Tobin Ehlis [Sat, 2 Jul 2016 00:23:58 +0000 (18:23 -0600)]
tests: Add tests for invalid VkDescriptorBufferInfo

Hit 3 new checks just added for VkDescriptorBufferInfo:
1. offset larger than buffer
2. range of 0
3. range larger than buffer size minus offset

Also update descriptor write and copy update error enums to be more clear,
along with also updating documentation.

8 years agolayers: Add validation for VkDescriptorBufferInfo struct
Tobin Ehlis [Fri, 1 Jul 2016 23:36:48 +0000 (17:36 -0600)]
layers: Add validation for VkDescriptorBufferInfo struct

For a descriptor write update to a buffer type, verify that the contents of
VkDescriptorBufferInfo struct are valid according to valid usage guidelines
of the spec.

Spun off the usage bit validation into its own function ValidateBufferUsage().
Previous ValidateBufferUpdate() function now calls that function as well as
performing all of the checks for the buffer, range, and offset members of
VkDescriptorBufferInfo struct.

8 years agolayers: Skip UNUSED attachments in pColorAttachments array
Tobin Ehlis [Fri, 1 Jul 2016 19:54:41 +0000 (13:54 -0600)]
layers: Skip UNUSED attachments in pColorAttachments array

8 years agolayers: Use VkRenderPassCreateInfo to check compatibility
Tobin Ehlis [Thu, 30 Jun 2016 15:29:18 +0000 (09:29 -0600)]
layers: Use VkRenderPassCreateInfo to check compatibility

Make the two renderpass compatibility functions only use VkRenderPassCreateInfo.
At the call site, check renderPass handles and if they don't match, proceed to
call the compatibility function with valid VkRenderPassCreateInfo.

Note that saved renderPass handles are valid at the call site, as they are
stored in framebuffer, command buffer, or pipeline state. However it's possible
that renderPass itself was destroyed, so VkRenderPassCreateInfo is pulled from
the framebuffer or pipeline state in those cases.

8 years agolayers: GH690 Save renderPass create info in PSO
Tobin Ehlis [Mon, 27 Jun 2016 18:57:05 +0000 (12:57 -0600)]
layers: GH690 Save renderPass create info in PSO

The renderPass that a pipeline is created with may be destroyed before
the pipeline is used in a draw. In order to make sure that the renderPass
data will live as long as the pipeline, save the VkRenderPassCreateInfo
using a safe_VkRenderPassCreateInfo in the PIPELINE_NODE struct.

8 years agolayers: Init default safe_* struct ptrs to nullptr
Tobin Ehlis [Mon, 27 Jun 2016 18:55:49 +0000 (12:55 -0600)]
layers: Init default safe_* struct ptrs to nullptr

When default-constructing safe_* struct types, make sure that
any ptrs are set to nullptr.

8 years agodemos: Set window minimum size for tri.c
Rene Lindsay [Tue, 5 Jul 2016 19:26:05 +0000 (13:26 -0600)]
demos: Set window minimum size for tri.c

8 years agodemos: Set window minimum size on windows.
Rene Lindsay [Sat, 2 Jul 2016 00:00:30 +0000 (18:00 -0600)]
demos: Set window minimum size on windows.

Vulkan surface must be at least 1 pixel high, to prevent crash.

Change-Id: I0000000decaf15bad00000000000000000000026

8 years agolayers: gh376 Verify memory on vkCreateXXXView
Mark Young [Mon, 30 May 2016 19:28:35 +0000 (13:28 -0600)]
layers: gh376 Verify memory on vkCreateXXXView

Verify that a vkImage has memory bound to it when
vkCreateImageView is called.  Likewise, verify vkBuffer
memory at vkCreateBufferView time.

Also, add tests to vk_layer_validation_tests:
CreateBufferViewNoMemoryBoundToBuffer and
CreateImageViewNoMemoryBoundToImage.

Change-Id: If0cf1c972f721e5596f7b8a1c7652f6165401b2c

8 years agolayers: Use backing memory size rather than buffer size in barrier
Chris Forbes [Fri, 1 Jul 2016 04:43:59 +0000 (16:43 +1200)]
layers: Use backing memory size rather than buffer size in barrier

Fixes #648.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Track backing memory offset & size for buffers
Chris Forbes [Fri, 1 Jul 2016 04:39:20 +0000 (16:39 +1200)]
layers: Track backing memory offset & size for buffers

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Add BUFFER_NODE::mem{Offset,Size}
Chris Forbes [Fri, 1 Jul 2016 04:33:04 +0000 (16:33 +1200)]
layers: Add BUFFER_NODE::mem{Offset,Size}

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Remove unused var to fix android build
Tobin Ehlis [Fri, 1 Jul 2016 14:49:50 +0000 (08:49 -0600)]
layers: Remove unused var to fix android build

8 years agolayers: Fix swapchain GetDisplayPlanePropertyCount count check
Jon Ashburn [Fri, 1 Jul 2016 16:08:31 +0000 (10:08 -0600)]
layers: Fix swapchain GetDisplayPlanePropertyCount count check

Change-Id: I1b16a422349eb1c5a6564704f079a0243c5ea00d

8 years agoTweaks for review feedback
Chris Forbes [Fri, 1 Jul 2016 06:27:30 +0000 (18:27 +1200)]
Tweaks for review feedback

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Simplify draw-time subpass sample count handling
Chris Forbes [Wed, 29 Jun 2016 06:15:41 +0000 (18:15 +1200)]
layers: Simplify draw-time subpass sample count handling

Renderpass creation has already failed for any cases that would hit this
logic.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Require subpass attachments' sample counts to be consistent
Chris Forbes [Wed, 29 Jun 2016 03:12:29 +0000 (15:12 +1200)]
layers: Require subpass attachments' sample counts to be consistent

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Add validation for subpass multisample resolve rules
Chris Forbes [Tue, 28 Jun 2016 23:50:31 +0000 (11:50 +1200)]
layers: Add validation for subpass multisample resolve rules

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Make TransitionSubpassLayouts work with VK_ATTACHMENT_UNUSED
Chris Forbes [Thu, 30 Jun 2016 04:56:15 +0000 (16:56 +1200)]
layers: Make TransitionSubpassLayouts work with VK_ATTACHMENT_UNUSED

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Fix crash in ValidateDependencies with VK_ATTACHMENT_UNUSED
Chris Forbes [Thu, 30 Jun 2016 23:45:49 +0000 (11:45 +1200)]
layers: Fix crash in ValidateDependencies with VK_ATTACHMENT_UNUSED

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Fix crash in ValidateLayouts with VK_ATTACHMENT_UNUSED
Chris Forbes [Thu, 30 Jun 2016 23:28:00 +0000 (11:28 +1200)]
layers: Fix crash in ValidateLayouts with VK_ATTACHMENT_UNUSED

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Apply subpass 0 layout transitions at CmdBeginRenderPass
Chris Forbes [Thu, 30 Jun 2016 03:42:41 +0000 (15:42 +1200)]
layers: Apply subpass 0 layout transitions at CmdBeginRenderPass

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agolayers: Fix render pass begin handling of initial layout
Chris Forbes [Thu, 30 Jun 2016 00:43:36 +0000 (12:43 +1200)]
layers: Fix render pass begin handling of initial layout

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agotests: Add missing TODO tests to layer details doc
Karl Schultz [Thu, 30 Jun 2016 22:34:29 +0000 (16:34 -0600)]
tests: Add missing TODO tests to layer details doc

Change-Id: I55fb267772e94f9228e0a8b19aae5049cfccfe02

8 years agoloader: GH370 - re-enable allocator usage
Mark Young [Thu, 30 Jun 2016 19:02:42 +0000 (13:02 -0600)]
loader: GH370 - re-enable allocator usage

This reverts commit 5876cc2b7563f909c8ac8cb49f51f7ef715877f8.

This adds the previous fixes as well as additional fixes if Implicit
layers aren't present.  This is not a case that gets tested on Windows
as most SDK installs have at least 1 Implicit layer (RenderDoc).

This change passes an individual run on Jenkins Linux system.

Change-Id: I466cc54b72946e2a9f6477bd4c3d4e4e72eb9579

8 years agolayers: Fix compilation errors for KHR_display ext
Jon Ashburn [Thu, 30 Jun 2016 16:21:55 +0000 (10:21 -0600)]
layers: Fix compilation errors for KHR_display ext

For Android remove KHR_display entry points from intercept generation and
from header files.

Change-Id: Ic1386a94a2229c45a1ffaac3651326324105351e

8 years agolayers: Add some comments to swapchain for more KHR_display validation
Jon Ashburn [Thu, 30 Jun 2016 15:01:27 +0000 (09:01 -0600)]
layers: Add some comments to swapchain for more KHR_display validation

Change-Id: I9d5cf4f6f8f0f9c5177155deaa18fe521c7620a9

8 years agolayers: Fix unique_objects creation of VkDisplayKHR
Jon Ashburn [Wed, 29 Jun 2016 22:12:51 +0000 (16:12 -0600)]
layers: Fix unique_objects creation of VkDisplayKHR

Make an explict_GetPhysicalDeviceDisplayProperties.

Change-Id: I39411d0dd97ca03dbf42d7e79b02243ef8988078

8 years agolayers: FIx object_tracker displayKHR and displayModeKHR creation
Jon Ashburn [Tue, 28 Jun 2016 22:59:36 +0000 (16:59 -0600)]
layers: FIx object_tracker displayKHR and displayModeKHR creation

For displayModeKHR  there are two separate Vulkan commands that can
create these objects.
For displayKHR there is one command that creates the object:
GetPhysicalDeviceDisplayPropertiesKHR.  GetDisplayPlaneSupportedDisplaysKHR
doesn't create new objects but returns existing objects.  The existing code
had the creation in  GetDisplayPlaneSupportedDisplaysKHR rather than in
GetPhysicalDeviceDisplayPropertiesKHR.

Change-Id: I63df7c41a0d17acd8b06ebb1a5742ac032159a09

8 years agolayers: Fix GetDisplayModePropertiesKHR unique_objects code
Jon Ashburn [Tue, 28 Jun 2016 20:46:12 +0000 (14:46 -0600)]
layers: Fix GetDisplayModePropertiesKHR unique_objects code

Add the available DisplayModes to the map for use by CreateDisplayPlaneSurfaceKHR

Change-Id: I94754259069a844bb516d3cf9d4e130473dbc2e3

8 years agolayers: Finish add support to validation for VK_KHR_display extension
Jon Ashburn [Wed, 15 Jun 2016 14:19:07 +0000 (08:19 -0600)]
layers: Finish add support to validation for VK_KHR_display extension

Swapchain, object_tracker and unique_objects now intercept and perform
validation checks for this extension.
Change-Id: I2e78d1dc516103de165ef83b99665eaad05b73d9

8 years agoAdded WSI KHR_display support to validation
Petros Bantolas [Fri, 15 Apr 2016 10:02:59 +0000 (11:02 +0100)]
Added WSI KHR_display support to validation

Add support for this extension to object_tracker and swapchain layers.

Change-Id: Ifdf6095958a9d9d01720fde92e0bbd0a8a9a3216

8 years agoRevert "loader: GH370 - re-enable allocator usage"
Mark Young [Thu, 30 Jun 2016 17:03:59 +0000 (11:03 -0600)]
Revert "loader: GH370 - re-enable allocator usage"

This reverts commit 0860f9dbac51b241a9690d23b53db14f307b0181.

8 years agoloader: GH370 - re-enable allocator usage
Mark Young [Thu, 30 Jun 2016 00:33:53 +0000 (18:33 -0600)]
loader: GH370 - re-enable allocator usage

Re-enable reverted changes done in commit
d6f491b88eaf11f6953c02638d079f6a76806658.  But also include
fixes for the Linux and Windows release runs.

Change-Id: I7644bb305faab068b3229eb9c1d8a67b052af165

8 years agoRevert "loader: GH370 - re-enable allocator usage"
Chris Forbes [Wed, 29 Jun 2016 23:56:45 +0000 (11:56 +1200)]
Revert "loader: GH370 - re-enable allocator usage"

This reverts commit aa32dbbf147d86257a0c9e091258e0ea2be5a013.

This is broken in both debug and release 64bit linux.

8 years agodemos: GH692 Added a supporting of wayland wsi
Mun Gwan-gyeong [Sun, 26 Jun 2016 20:34:44 +0000 (05:34 +0900)]
demos: GH692 Added a supporting of wayland wsi

Added a supporting of wayland wsi to cube, tri and smoke.

Change-Id: Ifa291d334cb1ed54018573c970078051c6867d96
Signed-off-by: Mun Gwan-gyeong <elongbug@gmail.com>
8 years agolayers: Don't produce spurious validation errors for sample count
Chris Forbes [Tue, 28 Jun 2016 22:50:41 +0000 (10:50 +1200)]
layers: Don't produce spurious validation errors for sample count

Previously we would emit a spurious validation error if the only
color or depth attachment references were VK_ATTACHMENT_UNUSED.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agoloader: GH370 - re-enable allocator usage
Mark Young [Fri, 3 Jun 2016 21:11:02 +0000 (15:11 -0600)]
loader: GH370 - re-enable allocator usage

Re-enable the allocator usage in the loader.  Also, fix several
memory leaks.  The leaks were especially noticeable during the Vulkan
conformance object_management.alloc_callback_fail.instance and
object_management.alloc_callback_fail.device tests because the
tests were designed to intentionally fail the Alloc calls.

This change now fully passes the Vulkan CTS
object_management.alloc_callback_fail tests when the loader
uses application-provided Allocators.

Change-Id: I03f2a09bc33259442e02c917a34d78f8937808d8

8 years agomisc: GH691 Remove duplicated line.
Karl Schultz [Wed, 29 Jun 2016 22:24:03 +0000 (16:24 -0600)]
misc: GH691 Remove duplicated line.

Change-Id: I5af06e880a7a71a42503e1ce6acdd1557e445169

8 years agolayers: Update layer details doc
Mark Lobodzinski [Tue, 28 Jun 2016 20:51:06 +0000 (14:51 -0600)]
layers: Update layer details doc

Updated new CV and PV checks

Change-Id: I3fb2a1ebe2319b07e146804b9d8714a58e4ad67a

8 years agolayers: Take care of DevLimits cleanup items
Mark Lobodzinski [Wed, 29 Jun 2016 16:53:51 +0000 (10:53 -0600)]
layers: Take care of DevLimits cleanup items

Added some simplifying make_unique() calls, changed param_validation
Log_msg calls to use LayerName var, added variable init to
constructor, and fixed some c-style casts.

Change-Id: I718e0d51b62a4b91a4c9b3645ff796d114a4432f