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
pCB->state = CB_NEW;
pCB->submitCount = 0;
pCB->status = 0;
+ pCB->static_status = 0;
pCB->viewportMask = 0;
pCB->scissorMask = 0;
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) {
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