aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Lobodzinski <mark@lunarg.com>2017-03-13 15:10:23 -0600
committerMark Lobodzinski <mark@lunarg.com>2017-03-13 16:02:59 -0600
commitf81dbf9ed3e4972c7c3f79cf651e9ca046392a0c (patch)
treed8844e6f6212ef3ea1abf5dd1cc4bab633454cb8
parent60bf33a652246fbdad453aee5e5bcc890f84db2a (diff)
downloadusermoji-f81dbf9ed3e4972c7c3f79cf651e9ca046392a0c.tar.xz
layers: Add depthBiasClamp device feature checks
Change-Id: I61e23e3c41a89763c9b65a2b5d7dbf92f015fa24
-rw-r--r--layers/core_validation.cpp23
-rw-r--r--layers/vk_validation_error_database.txt2
2 files changed, 22 insertions, 3 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index aa5f9965..15583a3c 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -3249,6 +3249,16 @@ static bool verifyPipelineCreateState(layer_data *dev_data, std::vector<PIPELINE
validation_error_map[VALIDATION_ERROR_01455]);
}
+ if (!isDynamic(pPipeline, VK_DYNAMIC_STATE_DEPTH_BIAS) &&
+ (pPipeline->graphicsPipelineCI.pRasterizationState->depthBiasClamp != 0.0) &&
+ (!dev_data->enabled_features.depthBiasClamp)) {
+ skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, DRAWSTATE_INVALID_FEATURE, "DS",
+ "vkCreateGraphicsPipelines(): the depthBiasClamp device feature is disabled: the depthBiasClamp "
+ "member of the VkPipelineRasterizationStateCreateInfo structure must be set to 0.0 unless the "
+ "VK_DYNAMIC_STATE_DEPTH_BIAS dynamic state is enabled");
+ }
+
// If rasterization is enabled...
if (pPipeline->graphicsPipelineCI.pRasterizationState->rasterizerDiscardEnable == VK_FALSE) {
auto subpass_desc = renderPass ? &renderPass->createInfo.pSubpasses[pPipeline->graphicsPipelineCI.subpass] : nullptr;
@@ -7157,8 +7167,17 @@ VKAPI_ATTR void VKAPI_CALL CmdSetDepthBias(VkCommandBuffer commandBuffer, float
GLOBAL_CB_NODE *pCB = GetCBNode(dev_data, commandBuffer);
if (pCB) {
skip_call |= ValidateCmd(dev_data, pCB, CMD_SETDEPTHBIASSTATE, "vkCmdSetDepthBias()");
- UpdateCmdBufferLastCmd(pCB, CMD_SETDEPTHBIASSTATE);
- pCB->status |= CBSTATUS_DEPTH_BIAS_SET;
+ if ((depthBiasClamp != 0.0) && (!dev_data->enabled_features.depthBiasClamp)) {
+ skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_01482, "DS",
+ "vkCmdSetDepthBias(): the depthBiasClamp device feature is disabled: the depthBiasClamp "
+ "parameter must be set to 0.0. %s",
+ validation_error_map[VALIDATION_ERROR_01482]);
+ }
+ if (!skip_call) {
+ UpdateCmdBufferLastCmd(pCB, CMD_SETDEPTHBIASSTATE);
+ pCB->status |= CBSTATUS_DEPTH_BIAS_SET;
+ }
}
lock.unlock();
if (!skip_call)
diff --git a/layers/vk_validation_error_database.txt b/layers/vk_validation_error_database.txt
index 8d1b59c9..526da220 100644
--- a/layers/vk_validation_error_database.txt
+++ b/layers/vk_validation_error_database.txt
@@ -1462,7 +1462,7 @@ VALIDATION_ERROR_01478~^~Y~^~None~^~vkCmdSetLineWidth~^~For more information ref
VALIDATION_ERROR_01479~^~N~^~Unknown~^~vkCmdSetLineWidth~^~For more information refer to Vulkan Spec Section '24.6. Line Segments' which states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdSetLineWidth)~^~implicit
VALIDATION_ERROR_01480~^~N~^~Unknown~^~vkCmdSetLineWidth~^~For more information refer to Vulkan Spec Section '24.6. Line Segments' which states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdSetLineWidth)~^~implicit
VALIDATION_ERROR_01481~^~N~^~Unknown~^~vkCmdSetDepthBias~^~For more information refer to Vulkan Spec Section '24.7.3. Depth Bias' which states 'The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_DEPTH_BIAS dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdSetDepthBias)~^~
-VALIDATION_ERROR_01482~^~N~^~Unknown~^~vkCmdSetDepthBias~^~For more information refer to Vulkan Spec Section '24.7.3. Depth Bias' which states 'If the depth bias clamping feature is not enabled, depthBiasClamp must be 0.0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdSetDepthBias)~^~
+VALIDATION_ERROR_01482~^~Y~^~None~^~vkCmdSetDepthBias~^~For more information refer to Vulkan Spec Section '24.7.3. Depth Bias' which states 'If the depth bias clamping feature is not enabled, depthBiasClamp must be 0.0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdSetDepthBias)~^~
VALIDATION_ERROR_01483~^~Y~^~None~^~vkCmdSetDepthBias~^~For more information refer to Vulkan Spec Section '24.7.3. Depth Bias' which states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdSetDepthBias)~^~implicit
VALIDATION_ERROR_01484~^~N~^~Unknown~^~vkCmdSetDepthBias~^~For more information refer to Vulkan Spec Section '24.7.3. Depth Bias' which states 'commandBuffer must be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdSetDepthBias)~^~implicit
VALIDATION_ERROR_01485~^~N~^~Unknown~^~vkCmdSetDepthBias~^~For more information refer to Vulkan Spec Section '24.7.3. Depth Bias' which states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdSetDepthBias)~^~implicit