-
Notifications
You must be signed in to change notification settings - Fork 327
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
Copy depth aspect by rendering in overdraw #2079
Conversation
232d4a0
to
39f43b8
Compare
gapis/api/vulkan/image_primer.go
Outdated
@@ -1047,44 +1074,45 @@ func (h *ipRenderHandler) free() { | |||
} | |||
} | |||
|
|||
func imageBarrierAspectFlags(aspect VkImageAspectFlagBits, fmt VkFormat) VkImageAspectFlags { |
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.
Personally I'd prefer name it ipImageBarrierAspectFlags
. imageBarrierAspectFlags
sounds quite general to me, and should be reserved for api utility subroutines or extern functions.
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.
Done
gapis/api/vulkan/image_primer.go
Outdated
memory.Nullptr, | ||
0, | ||
memory.Nullptr, | ||
1, |
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.
uint32(len(dstBarriers))
?
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.
Done
gapis/api/vulkan/image_primer.go
Outdated
input.image.Info().ArrayLayers(), // layerCount | ||
), | ||
)) | ||
dstBarriers = append(dstBarriers, |
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.
-
Prefer to have a check to see if the
finalLayout
and the current layout is the same. Because for primeByRendering jobs, the layout of input attachments are guaranteed to be SHADER_READ_ONLY_OPTIMAL before the rendering (line 80), so this is not necessary for those cases, also the barriers for the input attachments in theinputSrcBarriers
above. -
When
render()
is called from places other thanprimeByRendering
for aspects other than ONLY stencil, not used when priming for COLOR or DEPTH aspects, so that layout transitions for input attachments can be missed.
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.
Sorry, the 2) point is not valid, and for the 1) not necessary for the inputSrcBarriers
, I misunderstood the code here.
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.
Done
Specifically do this for the store end (i.e. new depth/stencil image to old image), so that we don't have to add TRANSFER_DST to all depth images.
39f43b8
to
3eb3aec
Compare
|
Also adding a fix for an incorrect handling of clear values that led to the stencil aspect being cleared to the wrong value sometimes. |
Specifically do this for the store end (i.e. new depth/stencil image to
old image), so that we don't have to add TRANSFER_DST to all depth
images.
Additionally, remove the conditions in gapii and always add the transfer_src flag to images, so that we can use it to copy from at the start of the overdraw renderpass.