From b127bd60f48402ee949511b0df88be034d0d94dd Mon Sep 17 00:00:00 2001 From: Courtney Goeltzenleuchter Date: Mon, 21 Sep 2015 17:19:25 -0600 Subject: bug-14365: add dynamic state to PSO This commit covers phase 2 of the removal of dynamic state objects. Now, an application can include an array of VK_DYNAMIC_STATE_* values that tell the driver which PSO dynamic state elements to use. I.e. if VK_DYNAMIC_STATE_LINE_WIDTH was specified in the pDynamicState array then the ICD should use the lineWidth defined at PSO create time and ignore any set using vkCmdSetLineWidth. To accomplish that the driver will make a copy of the dynamic state specified in the PSO as well as a bitmask of the affected state. When vkCmdSet* is called, the driver will check if a PSO override is current and ignore the call if so. At PSO bind time the command buffer's dynamic state will be updated and the PSO override bitmask set so that any future vkCmdSet*'s will be appropriately ignored. TODO: Validation layer should probably indicate a warning if app tries to do vkCmdSet on state defined by the PSO. --- layers/draw_state.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'layers/draw_state.cpp') diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp index f6b6a6d2..a0780fda 100644 --- a/layers/draw_state.cpp +++ b/layers/draw_state.cpp @@ -2332,7 +2332,12 @@ VK_LAYER_EXPORT void VKAPI vkCmdDraw(VkCmdBuffer cmdBuffer, uint32_t firstVertex if (pCB->state == CB_UPDATE_ACTIVE) { pCB->drawCount[DRAW]++; skipCall |= validate_draw_state(pCB, VK_FALSE); - /* TODO: Check that scissor and viewport counts are the same */ + /* TODOVV: Check that scissor and viewport counts are the same */ + /* TODOVV: Do we need to check that viewportCount given in pipeline's + * VkPipelineViewportStateCreateInfo matches scissor & viewport counts + * given as dynamic state? Or is the count given in VkPipelineViewportStateCreateInfo + * simply indicate the number of viewport / scissor to use at this time? + */ // TODO : Need to pass cmdBuffer as srcObj here skipCall |= log_msg(mdd(cmdBuffer), VK_DBG_REPORT_INFO_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_NONE, "DS", "vkCmdDraw() call #%lu, reporting DS state:", g_drawCount[DRAW]++); -- cgit v1.2.3