diff options
| author | Michael Lentine <mlentine@google.com> | 2016-02-04 18:07:38 -0600 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2016-02-05 07:18:19 -0700 |
| commit | 493d07ec89f23cd494e2971f130ce1fa08fa6bca (patch) | |
| tree | 3d2c5c099db6a90d102a1650730f79c3d97651cd | |
| parent | 54def46e3669be514d85da2e0847d87414dfb777 (diff) | |
| download | usermoji-493d07ec89f23cd494e2971f130ce1fa08fa6bca.tar.xz | |
layers: MR213 GL126 Fix render pass compatibility check
Use correct array size and add early-out if primary and secondary passes exactly match.
| -rw-r--r-- | layers/draw_state.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp index 59978e5f..2ddeff1d 100644 --- a/layers/draw_state.cpp +++ b/layers/draw_state.cpp @@ -6539,7 +6539,7 @@ bool validateSubpassCompatibility(layer_data* dev_data, VkCommandBuffer primaryB if (i < primary_desc.colorAttachmentCount) { primary_color_attach = primary_desc.pColorAttachments[i].attachment; } - if (i < secondary_desc.inputAttachmentCount) { + if (i < secondary_desc.colorAttachmentCount) { secondary_color_attach = secondary_desc.pColorAttachments[i].attachment; } skip_call |= validateAttachmentCompatibility(dev_data, primaryBuffer, primaryPass, primary_color_attach, secondaryBuffer, secondaryPass, secondary_color_attach, is_multi); @@ -6547,7 +6547,7 @@ bool validateSubpassCompatibility(layer_data* dev_data, VkCommandBuffer primaryB if (i < primary_desc.colorAttachmentCount && primary_desc.pResolveAttachments) { primary_resolve_attach = primary_desc.pResolveAttachments[i].attachment; } - if (i < secondary_desc.inputAttachmentCount && secondary_desc.pResolveAttachments) { + if (i < secondary_desc.colorAttachmentCount && secondary_desc.pResolveAttachments) { secondary_resolve_attach = secondary_desc.pResolveAttachments[i].attachment; } skip_call |= validateAttachmentCompatibility(dev_data, primaryBuffer, primaryPass, primary_resolve_attach, secondaryBuffer, secondaryPass, secondary_resolve_attach, is_multi); @@ -6565,6 +6565,9 @@ bool validateSubpassCompatibility(layer_data* dev_data, VkCommandBuffer primaryB bool validateRenderPassCompatibility(layer_data* dev_data, VkCommandBuffer primaryBuffer, VkRenderPass primaryPass, VkCommandBuffer secondaryBuffer, VkRenderPass secondaryPass) { bool skip_call = false; + // Early exit if renderPass objects are identical (and therefore compatible) + if (primaryPass == secondaryPass) + return skip_call; auto primary_data = dev_data->renderPassMap.find(primaryPass); auto secondary_data = dev_data->renderPassMap.find(secondaryPass); if (primary_data == dev_data->renderPassMap.end() || primary_data->second == nullptr) { |
