-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Cache RenderPass/Framebuffer objects on the resolve texture sources. #50142
Changes from 7 commits
6bbae13
b3f4b88
a292db7
ffcefd1
4463ab8
43dd21c
216e185
6873355
2b7e44f
c11a0e2
089b9ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -173,4 +173,22 @@ vk::ImageView TextureVK::GetRenderTargetView() const { | |
| return source_->GetRenderTargetView(); | ||
| } | ||
|
|
||
| void TextureVK::SetFramebuffer( | ||
| const SharedHandleVK<vk::Framebuffer>& framebuffer) { | ||
| framebuffer_ = framebuffer; | ||
| } | ||
|
|
||
| void TextureVK::SetRenderPass( | ||
| const SharedHandleVK<vk::RenderPass>& renderpass) { | ||
| renderpass_ = renderpass; | ||
| } | ||
|
|
||
| SharedHandleVK<vk::Framebuffer> TextureVK::GetFramebuffer() const { | ||
| return framebuffer_; | ||
| } | ||
|
|
||
| SharedHandleVK<vk::RenderPass> TextureVK::GetRenderPass() const { | ||
| return renderpass_; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are inconsistent about wether render pass is 2 words or one. It should be Same for "frame buffer".
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, render pass is two words, framebuffer is one word. |
||
| } | ||
|
|
||
| } // namespace impeller | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,9 +44,20 @@ class TextureVK final : public Texture, public BackendCast<TextureVK, Texture> { | |
|
|
||
| bool IsSwapchainImage() const { return source_->IsSwapchainImage(); } | ||
|
|
||
| // These methods should only be used by render_pass_vk.h | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comments look good 👍 |
||
| void SetFramebuffer(const SharedHandleVK<vk::Framebuffer>& framebuffer); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it make sense to save this on the RenderTarget, not the Texture? This isn't applicable to every Texture, right?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The RenderTarget itself is const/immutable whereas the Texture is stateful.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's not a problem though. We can make the frame buffer and render pass when we create the RenderTarget. We shouldn't ever have a RenderTarget without a render pass and it will never change, right?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately that is all constructed above the backend layer, and there are no metal or gles analogs for these objects. |
||
|
|
||
| void SetRenderPass(const SharedHandleVK<vk::RenderPass>& renderpass); | ||
|
|
||
| SharedHandleVK<vk::Framebuffer> GetFramebuffer() const; | ||
|
|
||
| SharedHandleVK<vk::RenderPass> GetRenderPass() const; | ||
|
gaaclarke marked this conversation as resolved.
|
||
|
|
||
| private: | ||
| std::weak_ptr<Context> context_; | ||
| std::shared_ptr<TextureSourceVK> source_; | ||
| SharedHandleVK<vk::Framebuffer> framebuffer_ = nullptr; | ||
| SharedHandleVK<vk::RenderPass> renderpass_ = nullptr; | ||
|
|
||
| // |Texture| | ||
| void SetLabel(std::string_view label) override; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.