From 60bf33a652246fbdad453aee5e5bcc890f84db2a Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Mon, 13 Mar 2017 09:45:07 -0600 Subject: layers: Add sparseResidencyAliased feature check Change-Id: I173c3d6e696e674c7a791838f6921763f03d1660 --- layers/buffer_validation.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'layers/buffer_validation.cpp') diff --git a/layers/buffer_validation.cpp b/layers/buffer_validation.cpp index bf897260..355eba8e 100644 --- a/layers/buffer_validation.cpp +++ b/layers/buffer_validation.cpp @@ -675,6 +675,14 @@ bool PreCallValidateCreateImage(layer_data *device_data, const VkImageCreateInfo validation_error_map[VALIDATION_ERROR_02143]); } + if ((pCreateInfo->flags & VK_IMAGE_CREATE_SPARSE_ALIASED_BIT) && (!GetEnabledFeatures(device_data)->sparseResidencyAliased)) { + skip_call |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, + DRAWSTATE_INVALID_FEATURE, "DS", + "vkCreateImage(): the sparseResidencyAliased device feature is disabled: Images cannot be created with the " + "VK_IMAGE_CREATE_SPARSE_ALIASED_BIT set."); + } + return skip_call; } @@ -2198,6 +2206,14 @@ bool PreCallValidateCreateBuffer(layer_data *device_data, const VkBufferCreateIn "vkCreateBuffer(): the sparseResidencyBuffer device feature is disabled: Buffers cannot be created with the " "VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT set."); } + + if ((pCreateInfo->flags & VK_BUFFER_CREATE_SPARSE_ALIASED_BIT) && (!GetEnabledFeatures(device_data)->sparseResidencyAliased)) { + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, + DRAWSTATE_INVALID_FEATURE, "DS", + "vkCreateBuffer(): the sparseResidencyAliased device feature is disabled: Buffers cannot be created with the " + "VK_BUFFER_CREATE_SPARSE_ALIASED_BIT set."); + } return skip; } -- cgit v1.2.3