summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan/vk_buffer_cache.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* video_core: Replace VKUpdateDescriptorQueue with UpdateDescriptorQueuegerman772022-06-271-1/+1
|
* video_core: Replace VKScheduler with Schedulergerman772022-06-271-1/+1
|
* common: Change semantics of UNREACHABLE to unconditionally crashLiam2022-06-141-2/+2
|
* general: Convert source file copyright comments over to SPDXMorph2022-04-231-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.
* Buffer Cache: Tune to the levels of the new GC.Fernando Sahmkow2022-03-251-0/+12
|
* VulkanBufferCache: Avoid adding barriers between multiple copies.Fernando Sahmkow2021-11-161-3/+35
|
* vk_buffer_cache: Add transform feedback usage to null bufferReinUsesLisp2021-07-261-3/+7
| | | | Fixes bad API usages on Vulkan.
* vk_buffer_cache: Handle null texture buffersReinUsesLisp2021-07-231-0/+4
| | | | Fixes a crash on Age of Calamity cutscenes.
* vk_buffer_cache: Add transform feedback usage to buffersReinUsesLisp2021-07-231-15/+22
|
* vulkan: Rework descriptor allocation algorithmReinUsesLisp2021-07-231-1/+1
| | | | | | Create multiple descriptor pools on demand. There are some degrees of freedom what is considered a compatible pool to avoid wasting large pools on small descriptors.
* shader: Interact texture buffers with buffer cacheReinUsesLisp2021-07-231-16/+41
|
* Merge pull request #6629 from FernandoS27/accel-dma-2bunnei2021-07-201-0/+24
|\ | | | | DMAEngine: Accelerate BufferClear [accelerateDMA Part 2]
| * DMAEngine: Accelerate BufferClearFernando Sahmkow2021-07-131-0/+24
| |
* | vk_buffer_cache: Fix quad index array with 0 vertices (#6627)Fernando S2021-07-201-0/+7
| |
* | vk_buffer_cache: Use emulated null buffers for transform feedbackReinUsesLisp2021-07-091-8/+16
|/ | | | | | Vulkan does not support null buffers on transform feedback bindings. Emulate these using the same null buffer we were using for index buffers.
* vk_buffer_cache: Silence implicit cast warningsReinUsesLisp2021-06-261-2/+3
|
* vk_buffer_cache: Fix offset for NULL vertex buffersJoshua Ashton2021-04-111-1/+1
| | | | | | | The Vulkan spec states: If an element of pBuffers is VK_NULL_HANDLE, then the corresponding element of pOffsets must be zero. https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdBindVertexBuffers2EXT.html#VUID-vkCmdBindVertexBuffers2EXT-pBuffers-04112
* vk_update_descriptor: Inline and improve code for binding buffersReinUsesLisp2021-02-131-4/+0
| | | | Allow compilers with our settings inline hot code.
* vk_buffer_cache: Add support for null index buffersReinUsesLisp2021-02-131-4/+35
| | | | | | | | | | | Games can bind a null index buffer (size=0) where all indices are evaluated as zero. VK_EXT_robustness2 doesn't support this and all drivers segfault when a null index buffer is passed to vkCmdBindIndexBuffer. Workaround this by creating a 4 byte buffer and filling it with zeroes. If it's read out of bounds, robustness takes care of returning zeroes as indices.
* vk_staging_buffer_pool: Add stream buffer for small uploadsReinUsesLisp2021-02-131-11/+12
| | | | | | | | This uses a ring buffer similar to OpenGL's stream buffer for small uploads. This stops us from allocating several small buffers, reducing memory fragmentation and cache locality. It uses dedicated allocations when possible.
* video_core: Reimplement the buffer cacheReinUsesLisp2021-02-131-139/+227
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* vulkan_memory_allocator: Add "download" memory usage hintReinUsesLisp2021-01-151-4/+4
| | | | | | | 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.
* renderer_vulkan: Rename Vulkan memory manager to memory allocatorReinUsesLisp2021-01-151-6/+6
| | | | | "Memory manager" collides with the guest GPU memory manager, and a memory allocator sounds closer to what the abstraction aims to be.
* vk_memory_manager: Improve memory manager and its APIReinUsesLisp2021-01-151-16/+14
| | | | | | | | | 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.
* vk_buffer_cache: Remove unused functionReinUsesLisp2021-01-151-4/+0
|
* renderer_vulkan: Move device abstraction to vulkan_commonReinUsesLisp2021-01-041-1/+1
|
* renderer_vulkan: Rename VKDevice to DeviceReinUsesLisp2021-01-031-3/+3
| | | | | | | 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.
* vulkan_common: Rename renderer_vulkan/wrapper.h to vulkan_common/vulkan_wrapper.hReinUsesLisp2020-12-311-1/+1
| | | | Allows sharing Vulkan wrapper code between different rendering backends.
* video_core: Rewrite the texture cacheReinUsesLisp2020-12-301-23/+44
| | | | | | | | | | | | | | 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.
* video_core: Resolve more variable shadowing scenarios pt.3Lioncash2020-12-051-55/+55
| | | | | Cleans out the rest of the occurrences of variable shadowing and makes any further occurrences of shadowing compiler errors.
* video_core: Remove all Core::System references in rendererReinUsesLisp2020-09-061-8/+9
| | | | | | | | | Now that the GPU is initialized when video backends are initialized, it's no longer needed to query components once the game is running: it can be done when yuzu is booting. This allows us to pass components between constructors and in the process remove all Core::System references in the video backend.
* vk_buffer_cache: Make use of designated initializers where applicableLioncash2020-07-161-30/+33
| | | | | Note: An array within CopyFrom() cannot be converted over yet, as it ICEs MSVC when converted over.
* gl_buffer_cache: Copy to buffers created as STREAM_READ before downloadingReinUsesLisp2020-06-261-3/+3
| | | | | | | | After marking buffers as resident, Nvidia's driver seems to take a slow path. To workaround this issue, copy to a STREAM_READ buffer and then call GetNamedBufferSubData on it. This is a temporary solution until we have asynchronous flushing.
* buffer_cache: Use buffer methods instead of cache virtual methodsReinUsesLisp2020-06-241-43/+46
|
* gl_buffer_cache: Mark buffers as residentReinUsesLisp2020-06-241-2/+2
| | | | | | Make stream buffer and cached buffers as resident and query their address. This allows us to use GPU addresses for several proprietary Nvidia extensions.
* buffer_cache: Avoid passing references of shared pointers and misc style changesReinUsesLisp2020-06-091-13/+9
| | | | | | | | | Instead of using as template argument a shared pointer, use the underlying type and manage shared pointers explicitly. This can make removing shared pointers from the cache more easy. While we are at it, make some misc style changes and general improvements (like insert_or_assign instead of operator[] + operator=).
* buffer_cache: Use boost::intrusive::set for cachingReinUsesLisp2020-05-211-0/+1
| | | | | | | | Instead of using boost::icl::interval_map for caching, use boost::intrusive::set. interval_map is intended as a container where the keys can overlap with one another; we don't need this for caching buffers and a std::set-like data structure that allows us to search with lower_bound is enough.
* vulkan: Remove unnecessary includesLioncash2020-04-291-4/+0
| | | | | | | Reduces some header churn and reduces rebuilds when some header internals change. While we're at it we can also resolve a missing include in buffer_cache.
* buffer_cache: Return handles instead of pointer to handlesReinUsesLisp2020-04-161-6/+6
| | | | | | | | | | | The original idea of returning pointers is that handles can be moved. The problem is that the implementation didn't take that in mind and made everything harder to work with. This commit drops pointer to handles and returns the handles themselves. While it is still true that handles can be invalidated, this way we get an old handle instead of a dangling pointer. This problem can be solved in the future with sparse buffers.
* renderer_vulkan: Drop Vulkan-HppReinUsesLisp2020-04-111-60/+89
|
* Buffer Cache: Use vAddr instead of physical memory.Fernando Sahmkow2020-04-061-4/+4
|
* vk_stream_buffer/vk_buffer_cache: Avoid halting and use generic cacheReinUsesLisp2020-01-061-0/+143
| | | | | | | | | | | | | | | | The stream buffer before this commit once it was full (no more bytes to write before looping) waiting for all previous operations to finish. This was a temporary solution and had a noticeable performance penalty in performance (from what a profiler showed). To avoid this mark with fences usages of the stream buffer and once it loops wait for them to be signaled. On average this will never wait. Each fence knows where its usage finishes, resulting in a non-paged stream buffer. On the other side, the buffer cache is reimplemented using the generic buffer cache. It makes use of the staging buffer pool and the new stream buffer.
* vk_buffer_cache: Temporarily remove buffer cacheReinUsesLisp2020-01-061-122/+0
| | | | This is intended for a follow up commit to avoid circular dependencies.
* core/memory: Migrate over GetPointer()Lioncash2019-11-271-3/+3
| | | | | With all of the interfaces ready for migration, it's trivial to migrate over GetPointer().
* core: Prepare various classes for memory read/write migrationLioncash2019-11-271-1/+3
| | | | | | | | | | Amends a few interfaces to be able to handle the migration over to the new Memory class by passing the class by reference as a function parameter where necessary. Notably, within the filesystem services, this eliminates two ReadBlock() calls by using the helper functions of HLERequestContext to do that for us.
* vk_scheduler: Drop execution context in favor of viewsReinUsesLisp2019-07-071-2/+2
| | | | | | | | | | | | | | Instead of passing by copy an execution context through out the whole Vulkan call hierarchy, use a command buffer view and fence view approach. This internally dereferences the command buffer or fence forcing the user to be unable to use an outdated version of it on normal usage. It is still possible to keep store an outdated if it is casted to VKFence& or vk::CommandBuffer. While changing this file, add an extra parameter for Flush and Finish to allow releasing the fence from this calls.
* video_core/engines: Remove unnecessary inclusions where applicableLioncash2019-04-061-0/+1
| | | | | | Replaces header inclusions with forward declarations where applicable and also removes unused headers within the cpp file. This reduces a few more dependencies on core/memory.h
* video_core: Amend constructor initializer list order where applicableLioncash2019-03-271-2/+2
| | | | | | | Specifies the members in the same order that initialization would take place in. This also silences -Wreorder warnings.
* gpu: Move GPUVAddr definition to common_types.bunnei2019-03-211-2/+1
|
* gpu: Use host address for caching instead of guest address.bunnei2019-03-151-10/+17
|
* video_core/engines: Remove unnecessary includesLioncash2019-03-061-1/+1
| | | | | | | | | Removes a few unnecessary dependencies on core-related machinery, such as the core.h and memory.h, which reduces the amount of rebuilding necessary if those files change. This also uncovered some indirect dependencies within other source files. This also fixes those.
* vk_buffer_cache: Implement a buffer cacheReinUsesLisp2019-03-011-0/+116
This buffer cache is just like OpenGL's buffer cache with some minor style changes. It uses VKStreamBuffer.