aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Forbes <chrisforbes@google.com>2017-08-15 14:48:50 -0700
committerChris Forbes <chrisf@ijw.co.nz>2017-08-16 10:39:46 -0700
commit41ab73b6458cf91f47c564b589f1126e94fdceb2 (patch)
tree165e4807404a039907a46678167aa81c24908793
parentf4b743276f57e70ce280a2f22cf3d6bfc663045a (diff)
downloadusermoji-41ab73b6458cf91f47c564b589f1126e94fdceb2.tar.xz
layers: Track static state bits separately
This gives us two advantages: - We no longer need to recalculate the state bits to remove for the old pipeline when binding a new pipeline. - We now have the set of bits to test against when trying to bind dynamic state for #614
-rw-r--r--layers/core_validation.cpp9
-rw-r--r--layers/core_validation_types.h2
2 files changed, 6 insertions, 5 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index 855c132e..c1310754 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -1712,6 +1712,7 @@ static void resetCB(layer_data *dev_data, const VkCommandBuffer cb) {
pCB->state = CB_NEW;
pCB->submitCount = 0;
pCB->status = 0;
+ pCB->static_status = 0;
pCB->viewportMask = 0;
pCB->scissorMask = 0;
@@ -5132,12 +5133,10 @@ VKAPI_ATTR void VKAPI_CALL CmdBindPipeline(VkCommandBuffer commandBuffer, VkPipe
auto pipe_state = getPipelineState(dev_data, pipeline);
if (VK_PIPELINE_BIND_POINT_GRAPHICS == pipelineBindPoint) {
- auto old_pipe_state = cb_state->lastBound[pipelineBindPoint].pipeline_state;
- if (old_pipe_state) {
- cb_state->status &= ~MakeStaticStateMask(old_pipe_state->graphicsPipelineCI.ptr()->pDynamicState);
- }
+ cb_state->status &= ~cb_state->static_status;
if (pipe_state) {
- cb_state->status |= MakeStaticStateMask(pipe_state->graphicsPipelineCI.ptr()->pDynamicState);
+ cb_state->static_status = MakeStaticStateMask(pipe_state->graphicsPipelineCI.ptr()->pDynamicState);
+ cb_state->status |= cb_state->static_status;
}
}
if (pipe_state) {
diff --git a/layers/core_validation_types.h b/layers/core_validation_types.h
index 2b109ea2..800610b7 100644
--- a/layers/core_validation_types.h
+++ b/layers/core_validation_types.h
@@ -641,6 +641,8 @@ struct GLOBAL_CB_NODE : public BASE_NODE {
CB_STATE state; // Track cmd buffer update state
uint64_t submitCount; // Number of times CB has been submitted
CBStatusFlags status; // Track status of various bindings on cmd buffer
+ CBStatusFlags static_status; // All state bits provided by current graphics pipeline
+ // rather than dynamic state
// Currently storing "lastBound" objects on per-CB basis
// long-term may want to create caches of "lastBound" states and could have
// each individual CMD_NODE referencing its own "lastBound" state