From: Chris Forbes Date: Fri, 16 Sep 2016 05:11:50 +0000 (+1200) Subject: layers: Get rid of old CBSTATUS-based dynamic viewport and scissor X-Git-Tag: accepted/tizen/3.0.m2/mobile/20170105.023708~174 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9c4006684a13db43f0dbc8d0015a9ef34872ca09;p=platform%2Fupstream%2FVulkan-LoaderAndValidationLayers.git layers: Get rid of old CBSTATUS-based dynamic viewport and scissor These were superceded by the precise tracking of dynamic scissors and viewports. Fix up the tests to look for the precise errors, and get rid of the broken clearing of static scissors & viewports, which triggered other errors. Signed-off-by: Chris Forbes --- diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 09f4bcb..471237c 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -2240,11 +2240,7 @@ static bool isDynamic(const PIPELINE_NODE *pPipeline, const VkDynamicState state // Validate state stored as flags at time of draw call static bool validate_draw_state_flags(layer_data *dev_data, GLOBAL_CB_NODE *pCB, const PIPELINE_NODE *pPipe, bool indexedDraw) { - bool result; - result = validate_status(dev_data, pCB, CBSTATUS_VIEWPORT_SET, VK_DEBUG_REPORT_ERROR_BIT_EXT, DRAWSTATE_VIEWPORT_NOT_BOUND, - "Dynamic viewport state not set for this command buffer"); - result |= validate_status(dev_data, pCB, CBSTATUS_SCISSOR_SET, VK_DEBUG_REPORT_ERROR_BIT_EXT, DRAWSTATE_SCISSOR_NOT_BOUND, - "Dynamic scissor state not set for this command buffer"); + bool result = false; if (pPipe->graphicsPipelineCI.pInputAssemblyState && ((pPipe->graphicsPipelineCI.pInputAssemblyState->topology == VK_PRIMITIVE_TOPOLOGY_LINE_LIST) || (pPipe->graphicsPipelineCI.pInputAssemblyState->topology == VK_PRIMITIVE_TOPOLOGY_LINE_STRIP))) { @@ -4073,12 +4069,6 @@ static void set_cb_pso_status(GLOBAL_CB_NODE *pCB, const PIPELINE_NODE *pPipe) { CBStatusFlags psoDynStateMask = CBSTATUS_ALL; for (uint32_t i = 0; i < pPipe->graphicsPipelineCI.pDynamicState->dynamicStateCount; i++) { switch (pPipe->graphicsPipelineCI.pDynamicState->pDynamicStates[i]) { - case VK_DYNAMIC_STATE_VIEWPORT: - psoDynStateMask &= ~CBSTATUS_VIEWPORT_SET; - break; - case VK_DYNAMIC_STATE_SCISSOR: - psoDynStateMask &= ~CBSTATUS_SCISSOR_SET; - break; case VK_DYNAMIC_STATE_LINE_WIDTH: psoDynStateMask &= ~CBSTATUS_LINE_WIDTH_SET; break; @@ -7020,7 +7010,6 @@ CmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t v GLOBAL_CB_NODE *pCB = getCBNode(dev_data, commandBuffer); if (pCB) { skip_call |= addCmd(dev_data, pCB, CMD_SETVIEWPORTSTATE, "vkCmdSetViewport()"); - pCB->status |= CBSTATUS_VIEWPORT_SET; pCB->viewportMask |= ((1u<status |= CBSTATUS_SCISSOR_SET; pCB->scissorMask |= ((1u<SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, "Dynamic viewport state not set for this command buffer"); + m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, "Dynamic viewport(s) 0 are used by PSO, but were not provided"); VKTriangleTest(bindStateVertShaderText, bindStateFragShaderText, BsoFailViewport); m_errorMonitor->VerifyFound(); } @@ -6191,7 +6187,7 @@ TEST_F(VkLayerTest, DynamicScissorNotBound) { ASSERT_NO_FATAL_FAILURE(InitState()); // Dynamic scissor state - m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, "Dynamic scissor state not set for this command buffer"); + m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, "Dynamic scissor(s) 0 are used by PSO, but were not provided"); VKTriangleTest(bindStateVertShaderText, bindStateFragShaderText, BsoFailScissor); m_errorMonitor->VerifyFound(); }