-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix VK_KHR_separate_depth_stencil_layouts #1068
Fix VK_KHR_separate_depth_stencil_layouts #1068
Conversation
@pmuetschard I'm still unsure why the original code was failing to update the render pass object, any thoughts? |
@mikes-lunarg, how did you manage to notice the discrepancy -- examining the state in AGI perhaps? |
@mark-lunarg That's exactly how I found it. As an extra sanity check I went looking for the new extension data in the state tab of AGI and it wasn't there. |
Map access operations return a value not a reference.
|
Makes sense, thanks for the info! |
Are the a difference in handling lvalue and rvalue? |
@@ -366,7 366,7 @@ sub ref!RenderPassObject createRenderPassObjectFromInfo2( | |||
attachments := info.pAttachments[0:info.attachmentCount] | |||
for i in (0 .. info.attachmentCount) { | |||
attachment := attachments[i] | |||
renderPass.AttachmentDescriptions[i] = AttachmentDescription( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am having hard time to see how changing this solves the problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @AWoloszyn gave a pretty thorough answer, but the short version is:
I need to might need to modify this struct inside the pNext loop so I assign it to a local variable. Then, once I have the final version of the struct, I can put it in the map. Modifying it in-place in the map (the original code) won't work because the map access or will give me a copy of the data instead of a reference.
Based on the change are these two examples are semantically different? @AWoloszyn
|
Those are the same. What would be different is
The difference is that
is a no-op. This is something very subtle and error prone are there any way to fix this? |
This is more about with what value
This differs from a STD unordered_map which looks like
I.e. the [] operator in GAPIL returns a COPY of the element in the map, not a REFERENCE to the element in the map. |
Even though the test app captured and replayed without issue, the state view showed that `VkAttachmentDescriptionStencilLayout` was not saved for the render passes that included it. This is caused by the map access operation returning a copy instead of a reference, making in-place modification of `renderPass.AttachmentDescriptions[j].StencilLayout` impossible. The solution here is to assign it to the map after processing the pNext chain.
91aeaf9
to
2290b35
Compare
@yalcinmelihyasin What is our next step? Can we merge this fix or would you like to see additional changes? |
Even though the test app captured and replayed without issue, the state view showed that `VkAttachmentDescriptionStencilLayout` was not saved for the render passes that included it. This is caused by the map access operation returning a copy instead of a reference, making in-place modification of `renderPass.AttachmentDescriptions[j].StencilLayout` impossible. The solution here is to assign it to the map after processing the pNext chain.
Even though the test app captured and replayed without issue, the state view
showed that
VkAttachmentDescriptionStencilLayout
was not saved for therender passes that included it. This appears to be caused by the api
file silently failing to modify
renderPass.AttachmentDescriptions[i]
after initially setting it, so set it after processing the pNext chain
instead.