aboutsummaryrefslogtreecommitdiff
path: root/layers
diff options
context:
space:
mode:
authorChris Forbes <chrisforbes@google.com>2017-08-15 12:28:16 -0700
committerChris Forbes <chrisf@ijw.co.nz>2017-08-16 10:39:46 -0700
commitf4b743276f57e70ce280a2f22cf3d6bfc663045a (patch)
tree2bfe08df12f201c312fca14ae2a5ab3f96ae800a /layers
parent6feaec9534d1c294702e5feb7d553b31c1fb63ca (diff)
downloadusermoji-f4b743276f57e70ce280a2f22cf3d6bfc663045a.tar.xz
layers: Invalidate old pipeline's static state when binding
Previously we'd only ever or in new bits, causing us to miss cases where some state changes from static to dynamic within a CB. Also only fiddle with the state masks when binding a graphics pipeline -- previously we'd miss some other cases because binding a compute pipeline would set all the state bits.
Diffstat (limited to 'layers')
-rw-r--r--layers/core_validation.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index 2bd6b8ac..855c132e 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -5130,10 +5130,18 @@ VKAPI_ATTR void VKAPI_CALL CmdBindPipeline(VkCommandBuffer commandBuffer, VkPipe
}
// TODO: VALIDATION_ERROR_18000612 VALIDATION_ERROR_18000616
- PIPELINE_STATE *pipe_state = getPipelineState(dev_data, pipeline);
+ 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);
+ }
+ if (pipe_state) {
+ cb_state->status |= MakeStaticStateMask(pipe_state->graphicsPipelineCI.ptr()->pDynamicState);
+ }
+ }
if (pipe_state) {
cb_state->lastBound[pipelineBindPoint].pipeline_state = pipe_state;
- pCB->status |= MakeStaticStateMask(pipe_state->graphicsPipelineCI.ptr()->pDynamicState);
set_pipeline_state(pipe_state);
skip |= validate_dual_src_blend_feature(dev_data, pipe_state);
} else {