aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej Jesionowski <maciej.jesionowski@amd.com>2017-09-06 11:25:36 +0200
committerMark Lobodzinski <mark@lunarg.com>2017-09-11 16:58:17 -0600
commitdcf124b1ec4b84e57e0fa408bd99a6b2a2de5aa3 (patch)
tree4ec58298081f6321c2fa6599b92af54c72db0676
parent2ba5768193b84ac5cd072b97b7dd0ed74a96ddc2 (diff)
downloadusermoji-dcf124b1ec4b84e57e0fa408bd99a6b2a2de5aa3.tar.xz
layers: Add support for VK_AMD_mixed_attachment_samples
Change-Id: I2ee0ab4c2ba7510316f190689fd3d81db27cb04f
-rw-r--r--layers/core_validation.cpp41
-rw-r--r--layers/vk_validation_error_database.txt4
2 files changed, 41 insertions, 4 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index b0bc39b8..78e72aaf 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -1047,7 +1047,8 @@ static bool ValidatePipelineDrawtimeState(layer_data const *dev_data, LAST_BOUND
subpass_num_samples |= (unsigned)render_pass_info->pAttachments[attachment].samples;
}
- if (subpass_num_samples && static_cast<unsigned>(pso_num_samples) != subpass_num_samples) {
+ if (!dev_data->extensions.vk_amd_mixed_attachment_samples &&
+ ((subpass_num_samples & static_cast<unsigned>(pso_num_samples)) != subpass_num_samples)) {
skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
HandleToUint64(pPipeline->pipeline), __LINE__, DRAWSTATE_NUM_SAMPLES_MISMATCH, "DS",
"Num samples mismatch! At draw-time in Pipeline (0x%" PRIxLEAST64
@@ -1512,6 +1513,28 @@ static bool ValidatePipelineUnlocked(layer_data *dev_data, std::vector<std::uniq
}
}
+ if (dev_data->extensions.vk_amd_mixed_attachment_samples) {
+ VkSampleCountFlagBits max_sample_count = static_cast<VkSampleCountFlagBits>(0);
+ for (uint32_t i = 0; i < subpass_desc->colorAttachmentCount; ++i) {
+ if (subpass_desc->pColorAttachments[i].attachment != VK_ATTACHMENT_UNUSED) {
+ max_sample_count = std::max(max_sample_count, pPipeline->render_pass_ci.pAttachments[subpass_desc->pColorAttachments[i].attachment].samples);
+ }
+ }
+ if (subpass_desc->pDepthStencilAttachment && subpass_desc->pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) {
+ max_sample_count = std::max(max_sample_count, pPipeline->render_pass_ci.pAttachments[subpass_desc->pDepthStencilAttachment->attachment].samples);
+ }
+ if (pPipeline->graphicsPipelineCI.pMultisampleState->rasterizationSamples != max_sample_count) {
+ skip |=
+ log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
+ HandleToUint64(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_09600bc2, "DS",
+ "vkCreateGraphicsPipelines: pCreateInfo[%d].pMultisampleState->rasterizationSamples (%s) != max attachment samples (%s) "
+ "used in subpass %u. %s",
+ pipelineIndex, string_VkSampleCountFlagBits(pPipeline->graphicsPipelineCI.pMultisampleState->rasterizationSamples),
+ string_VkSampleCountFlagBits(max_sample_count), pPipeline->graphicsPipelineCI.subpass,
+ validation_error_map[VALIDATION_ERROR_09600bc2]);
+ }
+ }
+
return skip;
}
@@ -7866,6 +7889,19 @@ static bool ValidateRenderpassAttachmentUsage(layer_data *dev_data, const VkRend
i, j, color_desc.format, resolve_desc.format, validation_error_map[VALIDATION_ERROR_140006a4]);
}
}
+
+ if (dev_data->extensions.vk_amd_mixed_attachment_samples &&
+ subpass.pDepthStencilAttachment && subpass.pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) {
+ const auto depth_stencil_sample_count = pCreateInfo->pAttachments[subpass.pDepthStencilAttachment->attachment].samples;
+ if (pCreateInfo->pAttachments[attachment].samples > depth_stencil_sample_count) {
+ skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_14000bc4, "DS",
+ "CreateRenderPass: Subpass %u pColorAttachments[%u] has %s which is larger than "
+ "depth/stencil attachment %s. %s",
+ i, j, string_VkSampleCountFlagBits(pCreateInfo->pAttachments[attachment].samples),
+ string_VkSampleCountFlagBits(depth_stencil_sample_count), validation_error_map[VALIDATION_ERROR_14000bc4]);
+ }
+ }
}
}
@@ -7883,7 +7919,8 @@ static bool ValidateRenderpassAttachmentUsage(layer_data *dev_data, const VkRend
skip |= ValidateAttachmentIndex(dev_data, attachment, pCreateInfo->attachmentCount, "Input");
}
- if (sample_count && !IsPowerOfTwo(sample_count)) {
+ if (!dev_data->extensions.vk_amd_mixed_attachment_samples &&
+ sample_count && !IsPowerOfTwo(sample_count)) {
skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
__LINE__, VALIDATION_ERROR_0082b401, "DS",
"CreateRenderPass: Subpass %u attempts to render to "
diff --git a/layers/vk_validation_error_database.txt b/layers/vk_validation_error_database.txt
index d080a3d9..a91e958d 100644
--- a/layers/vk_validation_error_database.txt
+++ b/layers/vk_validation_error_database.txt
@@ -542,7 +542,7 @@ VALIDATION_ERROR_096005f6~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGra
VALIDATION_ERROR_096005f8~^~N~^~Unknown~^~vkCreateGraphicsPipelines~^~VUID-VkGraphicsPipelineCreateInfo-flags-00764~^~(VK_KHX_device_group)~^~The spec valid usage text states 'flags must not contain the VK_PIPELINE_CREATE_DISPATCH_BASE_KHX flag.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-flags-00764)~^~
VALIDATION_ERROR_09600b06~^~N~^~None~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-subpass-01411~^~(VK_NV_framebuffer_mixed_samples)~^~The spec valid usage text states 'If subpass has a depth/stencil attachment and depth test, stencil test, or depth bounds test are enabled, then the rasterizationSamples member of pMultisampleState must be the same as the sample count of the depth/stencil attachment' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-01411)~^~
VALIDATION_ERROR_09600b08~^~N~^~None~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-subpass-01412~^~(VK_NV_framebuffer_mixed_samples)~^~The spec valid usage text states 'If subpass has any color attachments, then the rasterizationSamples member of pMultisampleState must be greater than or equal to the sample count for those subpass attachments' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-01412)~^~
-VALIDATION_ERROR_09600bc2~^~N~^~None~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-subpass-01505~^~(VK_AMD_mixed_attachment_samples)~^~The spec valid usage text states 'If subpass uses color and/or depth/stencil attachments, then the rasterizationSamples member of pMultisampleState must equal the maximum of the sample counts of those subpass attachments' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-01505)~^~
+VALIDATION_ERROR_09600bc2~^~Y~^~None~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-subpass-01505~^~(VK_AMD_mixed_attachment_samples)~^~The spec valid usage text states 'If subpass uses color and/or depth/stencil attachments, then the rasterizationSamples member of pMultisampleState must equal the maximum of the sample counts of those subpass attachments' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-subpass-01505)~^~
VALIDATION_ERROR_09600be2~^~N~^~None~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01521~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT, and the sampleLocationsEnable member of a VkPipelineSampleLocationsStateCreateInfoEXT structure chained to the pNext chain of pMultisampleState is VK_TRUE, sampleLocationsInfo.sampleLocationGridSize.width must evenly divide VkMultisamplePropertiesEXT::sampleLocationGridSize.width as returned by vkGetPhysicalDeviceMultisamplePropertiesEXT with a samples parameter equaling rasterizationSamples' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01521)~^~
VALIDATION_ERROR_09600be4~^~N~^~None~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01522~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT, and the sampleLocationsEnable member of a VkPipelineSampleLocationsStateCreateInfoEXT structure chained to the pNext chain of pMultisampleState is VK_TRUE, sampleLocationsInfo.sampleLocationGridSize.height must evenly divide VkMultisamplePropertiesEXT::sampleLocationGridSize.height as returned by vkGetPhysicalDeviceMultisamplePropertiesEXT with a samples parameter equaling rasterizationSamples' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01522)~^~
VALIDATION_ERROR_09600be6~^~N~^~None~^~VkGraphicsPipelineCreateInfo~^~VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01523~^~(VK_EXT_sample_locations)~^~The spec valid usage text states 'If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT, and the sampleLocationsEnable member of a VkPipelineSampleLocationsStateCreateInfoEXT structure chained to the pNext chain of pMultisampleState is VK_TRUE, sampleLocationsInfo.sampleLocationsPerPixel must equal rasterizationSamples' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01523)~^~
@@ -1335,7 +1335,7 @@ VALIDATION_ERROR_140006ae~^~Y~^~CreateRenderPassAttachments~^~vkCreateRenderPass
VALIDATION_ERROR_140006b0~^~N~^~Unknown~^~vkCreateRenderPass~^~VUID-VkSubpassDescription-flags-00856~^~(VK_NVX_multiview_per_view_attributes)~^~The spec valid usage text states 'If flags includes VK_SUBPASS_DESCRIPTION_PER_VIEW_POSITION_X_ONLY_BIT_NVX, it must also include VK_SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSubpassDescription-flags-00856)~^~
VALIDATION_ERROR_14000b12~^~N~^~None~^~VkSubpassDescription~^~VUID-VkSubpassDescription-pColorAttachments-01417~^~core~^~The spec valid usage text states 'All attachments in pColorAttachments that are not VK_ATTACHMENT_UNUSED must have the same sample count' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubpassDescription-pColorAttachments-01417)~^~
VALIDATION_ERROR_14000b14~^~N~^~None~^~VkSubpassDescription~^~VUID-VkSubpassDescription-pDepthStencilAttachment-01418~^~!(VK_AMD_mixed_attachment_samples)+!(VK_NV_framebuffer_mixed_samples)~^~The spec valid usage text states 'If pDepthStencilAttachment is not VK_ATTACHMENT_UNUSED and any attachments in pColorAttachments are not VK_ATTACHMENT_UNUSED, they must have the same sample count' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubpassDescription-pDepthStencilAttachment-01418)~^~
-VALIDATION_ERROR_14000bc4~^~N~^~None~^~VkSubpassDescription~^~VUID-VkSubpassDescription-pColorAttachments-01506~^~(VK_AMD_mixed_attachment_samples)~^~The spec valid usage text states 'All attachments in pColorAttachments that are not VK_ATTACHMENT_UNUSED must have a sample count that is smaller than or equal to the sample count of pDepthStencilAttachment if it is not VK_ATTACHMENT_UNUSED' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSubpassDescription-pColorAttachments-01506)~^~
+VALIDATION_ERROR_14000bc4~^~Y~^~None~^~VkSubpassDescription~^~VUID-VkSubpassDescription-pColorAttachments-01506~^~(VK_AMD_mixed_attachment_samples)~^~The spec valid usage text states 'All attachments in pColorAttachments that are not VK_ATTACHMENT_UNUSED must have a sample count that is smaller than or equal to the sample count of pDepthStencilAttachment if it is not VK_ATTACHMENT_UNUSED' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkSubpassDescription-pColorAttachments-01506)~^~
VALIDATION_ERROR_14009001~^~Y~^~Unknown~^~vkCreateRenderPass~^~VUID-VkSubpassDescription-flags-parameter~^~core~^~The spec valid usage text states 'flags must be a valid combination of VkSubpassDescriptionFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubpassDescription-flags-parameter)~^~implicit
VALIDATION_ERROR_14011001~^~Y~^~Unknown~^~vkCreateRenderPass~^~VUID-VkSubpassDescription-pColorAttachments-parameter~^~core~^~The spec valid usage text states 'If colorAttachmentCount is not 0, pColorAttachments must be a pointer to an array of colorAttachmentCount valid VkAttachmentReference structures' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubpassDescription-pColorAttachments-parameter)~^~implicit
VALIDATION_ERROR_14012a01~^~N~^~Unknown~^~vkCreateRenderPass~^~VUID-VkSubpassDescription-pDepthStencilAttachment-parameter~^~core~^~The spec valid usage text states 'If pDepthStencilAttachment is not NULL, pDepthStencilAttachment must be a pointer to a valid VkAttachmentReference structure' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkSubpassDescription-pDepthStencilAttachment-parameter)~^~implicit