summaryrefslogtreecommitdiffstats
path: root/src/video_core/vulkan_common/vulkan_memory_allocator.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-04-23general: Convert source file copyright comments over to SPDXMorph1-3/+2
This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
2022-03-19video_core: Reduce unused includesameerj1-1/+0
2021-08-07vulkan_memory_allocator: Respect bufferImageGranularityRobin Kertels1-0/+2
2021-06-16vulkan_memory_allocator: Release allocations with no commitsReinUsesLisp1-0/+5
2021-05-27vulkan_memory_allocator: Allow textures to be allocated in host memoryReinUsesLisp1-5/+2
Allow Vulkan's allocator to use host memory when there's no more device local memory. This delays OOM, but it will eventually still happen.
2021-02-13video_core: Reimplement the buffer cacheReinUsesLisp1-1/+1
Reimplement the buffer cache using cached bindings and page level granularity for modification tracking. This also drops the usage of shared pointers and virtual functions from the cache. - Bindings are cached, allowing to skip work when the game changes few bits between draws. - OpenGL Assembly shaders no longer copy when a region has been modified from the GPU to emulate constant buffers, instead GL_EXT_memory_object is used to alias sub-buffers within the same allocation. - OpenGL Assembly shaders stream constant buffer data using glProgramBufferParametersIuivNV, from NV_parameter_buffer_object. In theory this should save one hash table resolve inside the driver compared to glBufferSubData. - A new OpenGL stream buffer is implemented based on fences for drivers that are not Nvidia's proprietary, due to their low performance on partial glBufferSubData calls synchronized with 3D rendering (that some games use a lot). - Most optimizations are shared between APIs now, allowing Vulkan to cache more bindings than before, skipping unnecesarry work. This commit adds the necessary infrastructure to use Vulkan object from OpenGL. Overall, it improves performance and fixes some bugs present on the old cache. There are still some edge cases hit by some games that harm performance on some vendors, this are planned to be fixed in later commits.
2021-02-13vulkan_common: Expose interop and headless devicesReinUsesLisp1-3/+15
2021-01-17video_core: Resolve -Wdocumentation warningsLioncash1-3/+2
Silences some -Wdocumentation warnings on Clang.
2021-01-15vulkan_memory_allocator: Remove unnecesary 'device' memory from commitsReinUsesLisp1-5/+5
2021-01-15vulkan_memory_allocator: Add allocation support for download typesReinUsesLisp1-4/+13
Implements the allocator logic to handle download memory types. This will try to use HOST_CACHED_BIT when available.
2021-01-15vulkan_memory_allocator: Add "download" memory usage hintReinUsesLisp1-5/+19
Allow users of the allocator to hint memory usage for downloads. This removes the non-descriptive boolean passed for "host visible" or not host visible memory commits, and uses an enum to hint device local, upload and download usages.
2021-01-15vulkan_common: Move allocator to the common directoryReinUsesLisp1-0/+0
Allow using the abstraction from the OpenGL backend.
2021-01-15renderer_vulkan: Rename Vulkan memory manager to memory allocatorReinUsesLisp1-5/+5
"Memory manager" collides with the guest GPU memory manager, and a memory allocator sounds closer to what the abstraction aims to be.
2021-01-15vk_memory_manager: Improve memory manager and its APIReinUsesLisp1-88/+51
Fix a bug where the memory allocator could leave gaps between commits. To fix this the allocation algorithm was reworked, although it's still short in number of lines of code. Rework the allocation API to self-contained movable objects instead of naively using an unique_ptr to do the job for us. Remove the VK prefix.
2021-01-03renderer_vulkan: Rename VKDevice to DeviceReinUsesLisp1-5/+5
The "VK" prefix predates the "Vulkan" namespace. It was carried around the codebase for consistency. "VKDevice" currently is a bad alias with "VkDevice" (only an upcase character of difference) that can cause confusion. Rename all instances of it.
2020-12-31vulkan_common: Rename renderer_vulkan/wrapper.h to vulkan_common/vulkan_wrapper.hReinUsesLisp1-1/+1
Allows sharing Vulkan wrapper code between different rendering backends.
2020-12-30video_core: Rewrite the texture cacheReinUsesLisp1-7/+13
The current texture cache has several points that hurt maintainability and performance. It's easy to break unrelated parts of the cache when doing minor changes. The cache can easily forget valuable information about the cached textures by CPU writes or simply by its normal usage.The current texture cache has several points that hurt maintainability and performance. It's easy to break unrelated parts of the cache when doing minor changes. The cache can easily forget valuable information about the cached textures by CPU writes or simply by its normal usage. This commit aims to address those issues.
2020-12-05video_core: Resolve more variable shadowing scenarios pt.2Lioncash1-5/+5
Migrates the video core code closer to enabling variable shadowing warnings as errors. This primarily sorts out shadowing occurrences within the Vulkan code.
2020-04-22vk_memory_manager: Remove unified memory model flagReinUsesLisp1-11/+2
All drivers (even Intel) seem to have a device local memory type that is not host visible. Remove this flag so all devices follow the same path. This fixes a crash when trying to map to host device local memory on integrated devices.
2020-04-16video_core: Amend doxygen comment referencesLioncash1-1/+1
Fixes broken documentation references.
2020-04-11renderer_vulkan: Drop Vulkan-HppReinUsesLisp1-17/+17
2020-01-06vk_memory_manager: Misc changesReinUsesLisp1-12/+60
* Allocate memory in discrete exponentially increasing chunks until the 128 MiB threshold. Allocations larger thant that increase linearly by 256 MiB (depending on the required size). This allows to use small allocations for small resources. * Move memory maps to a RAII abstraction. To optimize for debugging tools (like RenderDoc) users will map/unmap on usage. If this ever becomes a noticeable overhead (from my profiling it doesn't) we can transparently move to persistent memory maps without harming the API, getting optimal performance for both gameplay and debugging. * Improve messages on exceptional situations. * Fix typos "requeriments" -> "requirements". * Small style changes.
2019-02-19vk_memory_manager: Implement memory managerReinUsesLisp1-0/+87
A memory manager object handles the memory allocations for a device. It allocates chunks of Vulkan memory objects and then suballocates.