Skip to content

Commit

Permalink
vk: fix stage pool gc logic (#8260)
Browse files Browse the repository at this point in the history
* vk: fix stage pool gc logic

* Update NEW_RELEASE_NOTES.md

---------

Co-authored-by: linkunhai <[email protected]>
  • Loading branch information
1558287830 and linkunhai authored Nov 12, 2024
1 parent 61c4df9 commit 96443fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions NEW_RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ for next branch cut* header.
appropriate header in [RELEASE_NOTES.md](./RELEASE_NOTES.md).

## Release notes for next branch cut
- vk: fix stage pool gc logic
2 changes: 2 additions & 0 deletions filament/backend/src/vulkan/VulkanStagePool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ VulkanStage const* VulkanStagePool::acquireStage(uint32_t numBytes) {
if (iter != mFreeStages.end()) {
auto stage = iter->second;
mFreeStages.erase(iter);
stage->lastAccessed = mCurrentFrame;
mUsedStages.insert(stage);
return stage;
}
Expand Down Expand Up @@ -74,6 +75,7 @@ VulkanStageImage const* VulkanStagePool::acquireImage(PixelDataFormat format, Pi
for (auto image : mFreeImages) {
if (image->format == vkformat && image->width == width && image->height == height) {
mFreeImages.erase(image);
image->lastAccessed = mCurrentFrame;
mUsedImages.insert(image);
return image;
}
Expand Down

0 comments on commit 96443fa

Please sign in to comment.