Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[impeller] [vulkan] Support textures backed by vk::Images #35163

Merged
merged 1 commit into from
Aug 5, 2022

Conversation

iskakaushik
Copy link
Contributor

No description provided.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

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.

Copy link
Member

@chinmaygarde chinmaygarde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nits but we should land this and keep working on it later patches as this backend is under construction.


TextureVK::~TextureVK() {
if (image_) {
vmaDestroyImage(allocator_, image_, allocation_);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO (in a later patch is fine) we should create RAII wrappers for VMA handles.


// |Texture|
~TextureVK() override;

private:
ContextVK& context_;
const VmaAllocator& allocator_;
VkImage image_;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't these be unique images?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, zero out these variable explicitly in case we add more ctors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the image was just a "holder" to the vma managed allocation, and in the dtor i clean it up. Should we still have a UniqueImage?

return image_;
}

ISize TextureVK::GetSize() const {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder where this isn't true. Perhaps we should just move this to the base class?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, I think during creation we ensure that the size is the same as the descriptor size.

// allocations, but setting them to be host visible for now.
alloc_create_info.flags =
VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT |
VMA_ALLOCATION_CREATE_MAPPED_BIT;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we should manage memory mappings explicitly. Thats more efficient and the API already allows for that. All you need is the VMA map-unmap calls later before and after the memcpy.

@iskakaushik iskakaushik merged commit 1cf7023 into flutter:main Aug 5, 2022
@iskakaushik
Copy link
Contributor Author

will address the follow-ups in future PRs.

engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 5, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 5, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 5, 2022
zanderso pushed a commit to flutter/flutter that referenced this pull request Aug 5, 2022
* 7a536ee Roll Dart SDK from 0ab07c889f74 to 16cbbc9d5e4b (1 revision) (flutter/engine#35177)

* e1e4a28 [Impeller] Enforce shader resource limits in impellerc (flutter/engine#35120)

* d6931cc Roll Fuchsia Mac SDK from CUZLMQ1lB... to b8WQvI4f0... (flutter/engine#35179)

* c1bb5d7 Roll Dart SDK from 16cbbc9d5e4b to aada0a67f81e (1 revision) (flutter/engine#35180)

* d45c4c4 ColorFilterLayer change SkColorFilter to DLColorFilter (flutter/engine#34744)

* 1a678d2 Roll Fuchsia Linux SDK from BRTz21cLl... to kURZcohuz... (flutter/engine#35182)

* cdccc60 Roll Dart SDK from aada0a67f81e to 344a7d12b413 (1 revision) (flutter/engine#35181)

* 2c7b4f6 Update setAssetDirectory service extension to fail if provided path is invalid (flutter/engine#35178)

* ce3397f fix analysis error (flutter/engine#35187)

* eaeae8e Make it possible to obtain `FontWeight` integer value (flutter/engine#35183)

* 1f9d87d Analyze all dart code on CI (flutter/engine#35147)

* 1cf7023 [impeller] [vulkan] Support textures backed by `vk::Image`s (flutter/engine#35163)

* 57f43bd Roll Skia from 098c234c05f7 to f1245dcd35f8 (23 revisions) (flutter/engine#35189)
camsim99 pushed a commit to camsim99/flutter that referenced this pull request Aug 10, 2022
…09063)

* 7a536ee Roll Dart SDK from 0ab07c889f74 to 16cbbc9d5e4b (1 revision) (flutter/engine#35177)

* e1e4a28 [Impeller] Enforce shader resource limits in impellerc (flutter/engine#35120)

* d6931cc Roll Fuchsia Mac SDK from CUZLMQ1lB... to b8WQvI4f0... (flutter/engine#35179)

* c1bb5d7 Roll Dart SDK from 16cbbc9d5e4b to aada0a67f81e (1 revision) (flutter/engine#35180)

* d45c4c4 ColorFilterLayer change SkColorFilter to DLColorFilter (flutter/engine#34744)

* 1a678d2 Roll Fuchsia Linux SDK from BRTz21cLl... to kURZcohuz... (flutter/engine#35182)

* cdccc60 Roll Dart SDK from aada0a67f81e to 344a7d12b413 (1 revision) (flutter/engine#35181)

* 2c7b4f6 Update setAssetDirectory service extension to fail if provided path is invalid (flutter/engine#35178)

* ce3397f fix analysis error (flutter/engine#35187)

* eaeae8e Make it possible to obtain `FontWeight` integer value (flutter/engine#35183)

* 1f9d87d Analyze all dart code on CI (flutter/engine#35147)

* 1cf7023 [impeller] [vulkan] Support textures backed by `vk::Image`s (flutter/engine#35163)

* 57f43bd Roll Skia from 098c234c05f7 to f1245dcd35f8 (23 revisions) (flutter/engine#35189)
emilyabest pushed a commit to emilyabest/engine that referenced this pull request Aug 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants