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
Enhance/fix some little things in Vulkan RD #55954
Conversation
102c37b
to
ee580ba
Compare
46dc49d
to
4e23797
Compare
2f69ae9
to
0d9c76e
Compare
972fd78
to
b52f9a8
Compare
@@ -1963,7 +1963,7 @@ RID RenderingDeviceVulkan::texture_create(const TextureFormat &p_format, const T | |||
image_memory_barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; | |||
image_memory_barrier.pNext = nullptr; | |||
image_memory_barrier.srcAccessMask = 0; | |||
image_memory_barrier.dstAccessMask = VK_ACCESS_SHADER_READ_BIT; | |||
image_memory_barrier.dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT; |
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 we can fine grain a bit more here. SHADER_WRITE_BIT would make sense only of the storage usage bit is set.
If the texture has color buffer usage, then we can mask COLOR_ATTACHMENT_OUTPUT_BIT. Likewise, if it has depth stencil usage you can use EARLY_FRAGMENT_TESTS_BIT, and if it can be updated, then TRANSFER_BIT.
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've removed the change and added instead a new commit with new logic for this barrier.
I think overall looks really good. I think the read/write hazzard fix may impose problems with barriers and my feeling is that this is a bug in the validation layer that we should discuss with Khronos. |
214739d
to
59f7bdb
Compare
377e05a
to
9696011
Compare
4d17177
to
aeb7686
Compare
aeb7686
to
aa27e32
Compare
aa27e32
to
f1e3aa3
Compare
0b67853
to
de7c456
Compare
21e8169
to
155174c
Compare
155174c
to
2652c95
Compare
Might need a rebase for good measure as last update was a month ago. |
- Initialize queue indices to values meaning 'unset' - Remove unused parameters & members - Make texture update access flags consistent with texture copy - Fix style and pass type of some parameters - Synchronize setup-draw in flush with a semaphore - Add no current list validation to draw_list_begin_splits() - Update texture usage flags on destination of copy - Fix misuse of Vulkan flag
2652c95
to
a82352c
Compare
Rebased and smoke re-tested! |
Thanks! |
I've grouped most changes in a single commit since they were minimal. Others have been kept in separate commits as I think they are important enough to be tracked separately.
Commits
Apply some small fixes/enhancements to the Vulkan RD
Fix misuse of _buffer_memory_barrier()'s p_sync_with_draw parameterRemove superfluous pre Vector resize checks 🆕Fix passing dst stage mask only to single window semaphore in Vulkan RD(Removed since was done in another PR.)Optimize texture update in Vulkan RD
Stop debug time full barriers preventing layout transitions in Vulkan RD
Issue finer grained barrier on texture creation in Vulkan RDClear confusion between Vulkan and RD storage buffer usage values 🆕
Redefine RenderingDevice::BARRIER_MASK_NO_BARRIER to be 0 🆕Avoid manual memory management of certain arrays in Vulkan RD 🆕🆕