aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2016-06-22 14:16:06 -0600
committerTobin Ehlis <tobine@google.com>2016-06-23 13:49:43 -0600
commitf6df420d230f3f0de7f16b084896074015ec10a8 (patch)
treea706826092df1fe76a8b712845232f100dc5a1ed /layers/core_validation.cpp
parent1f6e712ca82a1ee53d0048b29c8a8360ba6499c8 (diff)
downloadusermoji-f6df420d230f3f0de7f16b084896074015ec10a8.tar.xz
layers: Add sample count check at CreateFramebuffer time
When creating a framebuffer make sure that samples for its attachments match samples for corresponding renderpass attachments. This is a valid usage requirement for CreateFramebuffer. Also need to store swapchain images with default samples value of VK_SAMPLE_COUNT_1_BIT to avoid false errors.
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index 2e1136d2..82050326 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -8250,7 +8250,7 @@ static bool ValidateFramebufferCreateInfo(layer_data *dev_data, const VkFramebuf
"renderPass (0x%" PRIxLEAST64 ") being used to create Framebuffer.",
pCreateInfo->attachmentCount, rpci->attachmentCount, reinterpret_cast<const uint64_t &>(pCreateInfo->renderPass));
} else {
- // attachmentCounts match, so make sure corresponding Formats match
+ // attachmentCounts match, so make sure corresponding attachment details line up
const VkImageView *image_views = pCreateInfo->pAttachments;
for (uint32_t i = 0; i < pCreateInfo->attachmentCount; ++i) {
VkImageViewCreateInfo *ivci = getImageViewData(dev_data, image_views[i]);
@@ -8264,11 +8264,17 @@ static bool ValidateFramebufferCreateInfo(layer_data *dev_data, const VkFramebuf
i, string_VkFormat(ivci->format), string_VkFormat(rpci->pAttachments[i].format),
reinterpret_cast<const uint64_t &>(pCreateInfo->renderPass));
}
-#if 0 // Enabling 1 new check/test at a time
const VkImageCreateInfo *ici = &getImageNode(dev_data, ivci->image)->createInfo;
if (ici->samples != rpci->pAttachments[i].samples) {
- // TODO : ERROR
+ skip_call |= log_msg(
+ dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT,
+ reinterpret_cast<const uint64_t &>(pCreateInfo->renderPass), __LINE__, DRAWSTATE_RENDERPASS_INCOMPATIBLE,
+ "DS", "vkCreateFramebuffer(): VkFramebufferCreateInfo attachment #%u has %s samples that do not match "
+ "the %s samples used by the corresponding attachment for renderPass (0x%" PRIxLEAST64 ").",
+ i, string_VkSampleCountFlagBits(ici->samples), string_VkSampleCountFlagBits(rpci->pAttachments[i].samples),
+ reinterpret_cast<const uint64_t &>(pCreateInfo->renderPass));
}
+#if 0 // Enabling 1 new check/test at a time
// Verify that view only has a single mip level
if (ivci->subresourceRange.levelCount != 1) {
// TODO
@@ -9973,6 +9979,7 @@ GetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t *pCoun
image_ci.arrayLayers = swapchain_node->createInfo.imageArrayLayers;
image_ci.usage = swapchain_node->createInfo.imageUsage;
image_ci.format = swapchain_node->createInfo.imageFormat;
+ image_ci.samples = VK_SAMPLE_COUNT_1_BIT;
image_ci.extent.width = swapchain_node->createInfo.imageExtent.width;
image_ci.extent.height = swapchain_node->createInfo.imageExtent.height;
image_ci.sharingMode = swapchain_node->createInfo.imageSharingMode;