Skip to content

Conversation

@show50726
Copy link
Contributor

The refactoring contains two parts: FenceManager and reallocation logic

FenceManager

This refactor extracts fence management logic from UboManager into a separate FenceManager class for better testability/readability. But the downside of this approach is that whenever we add a new synchronous backend API, we will need to add a corresponding MOCK_FUNCTION in MockDriver.h file. Otherwise, the compilation fails.

Reallocation Logic

Additionally, this refactors the UboManager allocation logic into two separate functions: allocateOnDemand and allocateAllInstances.
The allocateOnDemand function now implements a two-pass strategy:

  1. First, it allocates slots for new material instances (those that have never been allocated).
  2. Second, it allocates slots for existing instances that need to orphan their current allocation.

This specific order allows for a more accurate calculation of the required UBO size, which helps prevent multiple, cascading reallocations.

introduce FenceManager

remove debug log

update
@show50726 show50726 added the internal Issue/PR does not affect clients label Nov 7, 2025
Copy link
Collaborator

@pixelflinger pixelflinger left a comment

Choose a reason for hiding this comment

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

my only comment here is that FenceManager is not really a generic, reusable class right? It's very much part of UboManager. Maybe you can make it an internal class of UboManager?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Issue/PR does not affect clients

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants