layers: GH785, Validate rasterinfo->polygonMode
authorMark Lobodzinski <mark@lunarg.com>
Tue, 9 Aug 2016 19:10:51 +0000 (13:10 -0600)
committerMark Lobodzinski <mark@lunarg.com>
Mon, 15 Aug 2016 22:48:04 +0000 (16:48 -0600)
If fillModeNonSolid is not enabled, polygonMode cannot be set to
POINT or LINE.

Change-Id: I6cfdfac8f5c9ff7d27b94bf0aa80ae1249b0ce25

layers/parameter_validation.cpp

index 2b12366..b93ded1 100644 (file)
@@ -2794,6 +2794,16 @@ bool PreCreateGraphicsPipelines(VkDevice device, const VkGraphicsPipelineCreateI
                         "unrecognized enumerator");
                 return false;
             }
+
+            if ((pCreateInfos->pRasterizationState->polygonMode != VK_POLYGON_MODE_FILL) &&
+                (data->physical_device_features.fillModeNonSolid == false)) {
+                log_msg(
+                    mdd(device), VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
+                    DEVICE_FEATURE, LayerName,
+                    "vkCreateGraphicsPipelines parameter, VkPolygonMode pCreateInfos->pRasterizationState->polygonMode cannot be "
+                    "VK_POLYGON_MODE_POINT or VK_POLYGON_MODE_LINE if VkPhysicalDeviceFeatures->fillModeNonSolid is false.");
+                return false;
+            }
         }
 
         int i = 0;