-
Notifications
You must be signed in to change notification settings - Fork 29.7k
[Impeller] remove transfer barriers from render pass, drop blit, tighten up graphics on level 3. #165584
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
[Impeller] remove transfer barriers from render pass, drop blit, tighten up graphics on level 3. #165584
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
|
|
||
| fml::Status TextureSourceVK::SetLayout(const BarrierVK& barrier) const { | ||
| const auto old_layout = SetLayoutWithoutEncoding(barrier.new_layout); | ||
| if (barrier.new_layout == old_layout) { |
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.
This isn't correct because we can transition across the same layout with different stage masks - dropping the barrier makes it incorrect.
| private: | ||
| SharedHandleVK<vk::Framebuffer> framebuffer_; | ||
| SharedHandleVK<vk::RenderPass> render_pass_; | ||
| mutable RWMutex layout_mutex_; |
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.
This mutex is incorrect. The layout depends on code submitted to the queue, not the order of encoded operations. so layout_ is only a best guess and isn't correct if there is shared texture usage across more than one thread.
We don't do that today so there aren't any drawbacks to the bug.
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.
We don't do what today? We don't use the textures across more than one thread?
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.
Correct. And if we did, this mutex would still be wrong because it records layout at recording time whereas the layout only actually changes at submit time.
| } | ||
| if (ahb_desc.usage & AHARDWAREBUFFER_USAGE_GPU_FRAMEBUFFER) { | ||
| image_usage_flags |= vk::ImageUsageFlagBits::eColorAttachment; | ||
| } |
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.
This was wrong, AHARDWAREBUFFER_USAGE_COMPOSER_OVERLAY isn't used by vulkan.
| ? ahb_size.MipCount() | ||
| : 1u; | ||
| if (ahb_desc.usage & AHARDWAREBUFFER_USAGE_COMPOSER_OVERLAY) { | ||
| if (ahb_desc.usage & AHARDWAREBUFFER_USAGE_GPU_FRAMEBUFFER) { |
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.
typo should be framebuffer
| deps[0].srcAccessMask = vk::AccessFlagBits::eShaderRead | | ||
| vk::AccessFlagBits::eTransferRead | | ||
| vk::AccessFlagBits::eColorAttachmentWrite; | ||
| if (is_swapchain_) { |
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.
A comment wouldn't hurt 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.
I tried :)
| private: | ||
| SharedHandleVK<vk::Framebuffer> framebuffer_; | ||
| SharedHandleVK<vk::RenderPass> render_pass_; | ||
| mutable RWMutex layout_mutex_; |
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.
We don't do what today? We don't use the textures across more than one thread?
gaaclarke
left a comment
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.
This stuff is hard to review. LGTM as long as there is automated tests that are executing this, preferably with validation layers turned on.
|
reason for revert: render pass compatibility issue. |
…lit, tighten up graphics on level 3. (#165584)" (#165898) <!-- start_original_pr_link --> Reverts: #165584 <!-- end_original_pr_link --> <!-- start_initiating_author --> Initiated by: jonahwilliams <!-- end_initiating_author --> <!-- start_revert_reason --> Reason for reverting: render pass compatibility issue. <!-- end_revert_reason --> <!-- start_original_pr_author --> Original PR Author: jonahwilliams <!-- end_original_pr_author --> <!-- start_reviewers --> Reviewed By: {gaaclarke} <!-- end_reviewers --> <!-- start_revert_body --> This change reverts the following previous change: The change to fix PowerVR barriers regressed Mali (see #165538) We need to tighten the barriers to remove the transfer barrier to get back mali performance. however, this requires us to drop the usage of the blit for onscreen restore. not a huge loss imo. At any rate, all of these changes should be visible in benchmarks. <!-- end_revert_body --> Co-authored-by: auto-submit[bot] <[email protected]>
…it, tighten up graphics on level 3. (flutter/flutter#165584)
…it, tighten up graphics on level 3. (flutter/flutter#165584)
…it, tighten up graphics on level 3. (flutter/flutter#165584)
…it, tighten up graphics on level 3. (flutter/flutter#165584)
…it, tighten up graphics on level 3. (flutter/flutter#165584)
…it, tighten up graphics on level 3. (flutter/flutter#165584)
…it, tighten up graphics on level 3. (flutter/flutter#165584)
…it, tighten up graphics on level 3. (flutter/flutter#165584)
…it, tighten up graphics on level 3. (flutter/flutter#165584)
…it, tighten up graphics on level 3. (flutter/flutter#165584)
…it, tighten up graphics on level 3. (flutter/flutter#165584)
…it, tighten up graphics on level 3. (flutter/flutter#165584)
…it, tighten up graphics on level 3. (flutter/flutter#165584)
…it, tighten up graphics on level 3. (flutter/flutter#165584)
…it, tighten up graphics on level 3. (flutter/flutter#165584)
…it, tighten up graphics on level 3. (flutter/flutter#165584)
…it, tighten up graphics on level 3. (flutter/flutter#165584)
…it, tighten up graphics on level 3. (flutter/flutter#165584)
…it, tighten up graphics on level 3. (flutter/flutter#165584)
…it, tighten up graphics on level 3. (flutter/flutter#165584)
…it, tighten up graphics on level 3. (flutter/flutter#165584)
…it, tighten up graphics on level 3. (flutter/flutter#165584)
…it, tighten up graphics on level 3. (flutter/flutter#165584)
…it, tighten up graphics on level 3. (flutter/flutter#165584)
…it, tighten up graphics on level 3. (flutter/flutter#165584)
…ten up graphics on level 3. (flutter#165584) The change to fix PowerVR barriers regressed Mali (see flutter#165538) We need to tighten the barriers to remove the transfer barrier to get back mali performance. however, this requires us to drop the usage of the blit for onscreen restore. not a huge loss imo. At any rate, all of these changes should be visible in benchmarks.
…lit, tighten up graphics on level 3. (flutter#165584)" (flutter#165898) <!-- start_original_pr_link --> Reverts: flutter#165584 <!-- end_original_pr_link --> <!-- start_initiating_author --> Initiated by: jonahwilliams <!-- end_initiating_author --> <!-- start_revert_reason --> Reason for reverting: render pass compatibility issue. <!-- end_revert_reason --> <!-- start_original_pr_author --> Original PR Author: jonahwilliams <!-- end_original_pr_author --> <!-- start_reviewers --> Reviewed By: {gaaclarke} <!-- end_reviewers --> <!-- start_revert_body --> This change reverts the following previous change: The change to fix PowerVR barriers regressed Mali (see flutter#165538) We need to tighten the barriers to remove the transfer barrier to get back mali performance. however, this requires us to drop the usage of the blit for onscreen restore. not a huge loss imo. At any rate, all of these changes should be visible in benchmarks. <!-- end_revert_body --> Co-authored-by: auto-submit[bot] <[email protected]>
relands flutter#165584 We can't have separate barriers for onscreen because it makes the render pass incompatible.
…ten up graphics on level 3. (flutter#165584) The change to fix PowerVR barriers regressed Mali (see flutter#165538) We need to tighten the barriers to remove the transfer barrier to get back mali performance. however, this requires us to drop the usage of the blit for onscreen restore. not a huge loss imo. At any rate, all of these changes should be visible in benchmarks.
…lit, tighten up graphics on level 3. (flutter#165584)" (flutter#165898) <!-- start_original_pr_link --> Reverts: flutter#165584 <!-- end_original_pr_link --> <!-- start_initiating_author --> Initiated by: jonahwilliams <!-- end_initiating_author --> <!-- start_revert_reason --> Reason for reverting: render pass compatibility issue. <!-- end_revert_reason --> <!-- start_original_pr_author --> Original PR Author: jonahwilliams <!-- end_original_pr_author --> <!-- start_reviewers --> Reviewed By: {gaaclarke} <!-- end_reviewers --> <!-- start_revert_body --> This change reverts the following previous change: The change to fix PowerVR barriers regressed Mali (see flutter#165538) We need to tighten the barriers to remove the transfer barrier to get back mali performance. however, this requires us to drop the usage of the blit for onscreen restore. not a huge loss imo. At any rate, all of these changes should be visible in benchmarks. <!-- end_revert_body --> Co-authored-by: auto-submit[bot] <[email protected]>
relands flutter#165584 We can't have separate barriers for onscreen because it makes the render pass incompatible.
The change to fix PowerVR barriers regressed Mali (see #165538)
We need to tighten the barriers to remove the transfer barrier to get back mali performance. however, this requires us to drop the usage of the blit for onscreen restore. not a huge loss imo.
At any rate, all of these changes should be visible in benchmarks.