Skip to content
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

Implement image heap suballocation #1984

Merged
merged 5 commits into from
May 7, 2024
Merged

Conversation

HansKristian-Work
Copy link
Owner

Until now, we would never attempt to suballocate small image heaps.
Some games, at least Nixxes ports, tend to create lots of smaller heaps.
The intent seems to be that the game can use fine-grained residency
priority. On implementations without EXT_pageable (e.g. RADV currently),
we assume a naive allocation model that cannot take advantage of
priorities, so there is no need to consider priority set by
applications. In future, should RADV get support for this EXT,
we may want to revisit these assumptions.

To make image suballocation work better, normalize heap type in allocations.

Fixes a potential problem where two different CUSTOM heaps
can end up allocating from each other. Normalize the CUSTOM heap type
to a standard type and compare those.

Ensure that all suballocated heaps have a GLOBAL buffer, but just
change the explicit usage. This way we don't have to check the heap
flags and RTV heaps and resource heaps can share chunks as long as
their memory types match.

@HansKristian-Work HansKristian-Work force-pushed the image-heap-suballocate branch from 261af6e to 1689d35 Compare May 6, 2024 14:37
@HansKristian-Work HansKristian-Work marked this pull request as ready for review May 6, 2024 14:42
Until now, we would never attempt to suballocate small image heaps.
Some games, at least Nixxes ports, tend to create lots of smaller heaps.
The intent seems to be that the game can use fine-grained residency
priority. On implementations without EXT_pageable (e.g. RADV currently),
we assume a naive allocation model that cannot take advantage of
priorities, so there is no need to consider priority set by
applications. In future, should RADV get support for this EXT,
we may want to revisit these assumptions.

To make image suballocation work better, normalize heap type in allocations.

Fixes a potential problem where two different CUSTOM heaps
can end up allocating from each other. Normalize the CUSTOM heap type
to a standard type and compare those.

Ensure that all suballocated heaps have a GLOBAL buffer, but just
change the explicit usage. This way we don't have to check the heap
flags and RTV heaps and resource heaps can share chunks as long as
their memory types match.

Signed-off-by: Hans-Kristian Arntzen <[email protected]>
These are typically used for resource heaps and don't need to be
cleared in most cases.
For RTV cases, they have to be initialized with a clear or discard,
and usually that will clear the memory anyway, so this flag is a softer
and safer variant of the full "skip clear" flag.

Signed-off-by: Hans-Kristian Arntzen <[email protected]>
@HansKristian-Work HansKristian-Work force-pushed the image-heap-suballocate branch from 1689d35 to 6130821 Compare May 7, 2024 11:08
@HansKristian-Work HansKristian-Work merged commit 985cce8 into master May 7, 2024
6 checks passed
@HansKristian-Work HansKristian-Work deleted the image-heap-suballocate branch May 7, 2024 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants