summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan/vk_buffer_cache.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* SMMU: Initial adaptation to video_core.Fernando Sahmkow2024-01-191-4/+3
|
* renderer_vulkan: don't pass null view when nullDescriptor is not supportedLiam2023-12-191-0/+2
|
* Merge branch 'master' into ssbo-alignAmeer J2023-11-271-1/+20
|\
| * renderer_vulkan: Introduce separate cmd buffer for uploadsGPUCode2023-11-121-1/+20
| |
* | shader_recompiler: Align SSBO offsets to meet host requirementsAmeer J2023-11-011-0/+2
|/ | | | Co-Authored-By: Billy Laws <blaws05@gmail.com>
* renderer_vulkan: Use VMA for buffersGPUCode2023-06-181-2/+0
|
* buffer_cache_base: Specify buffer type in HostBindingsMorph2023-06-131-2/+4
| | | | Avoid reinterpret-casting from void pointer since the type is already known at compile time.
* Combine vertex/transform feedback buffer binding into a single callKelebek12023-06-081-0/+3
|
* Merge pull request #10476 from ameerj/gl-memory-mapsliamwhite2023-06-071-0/+1
|\ | | | | OpenGL: Make use of persistent buffer maps in buffer cache
| * OpenGL: Make use of persistent buffer maps in buffer cache downloadsameerj2023-05-281-0/+1
| | | | | | | | | | | | Persistent buffer maps were already used by the texture cache, this extends their usage for the buffer cache. In my testing, using the memory maps for uploads was slower than the existing "ImmediateUpload" path, so the memory map usage is limited to downloads for the time being.
* | android: video_core: Disable problematic compute shaders.bunnei2023-06-031-1/+1
|/ | | | - Fixes #104.
* renderer_vulkan: separate guest and host compute descriptor queuesLiam2023-05-101-4/+5
|
* Clang: format and ficx compile errors.Fernando Sahmkow2023-04-291-1/+1
|
* Buffer Cache: Fully rework the buffer cache.Fernando Sahmkow2023-04-291-1/+7
|
* Revert "Vulkan, OpenGL: Hook up storage buffer alignment code"Liam2023-01-071-2/+0
| | | | This reverts commit 9e2997c4b6456031622602002924617690e32a13.
* Vulkan, OpenGL: Hook up storage buffer alignment codeBilly Laws2023-01-051-0/+2
|
* video_core: Implement vulkan QuadStrip topologyFengChen2022-12-261-7/+6
|
* video_core: Replace VKUpdateDescriptorQueue with UpdateDescriptorQueuegerman772022-06-271-2/+2
|
* video_core: Replace VKScheduler with Schedulergerman772022-06-271-3/+3
|
* 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/+6
|
* VulkanBufferCache: Avoid adding barriers between multiple copies.Fernando Sahmkow2021-11-161-1/+5
|
* shader: Initial OpenGL implementationReinUsesLisp2021-07-231-1/+1
|
* vulkan: Rework descriptor allocation algorithmReinUsesLisp2021-07-231-2/+2
| | | | | | 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-0/+18
|
* Merge pull request #6629 from FernandoS27/accel-dma-2bunnei2021-07-201-0/+2
|\ | | | | DMAEngine: Accelerate BufferClear [accelerateDMA Part 2]
| * DMAEngine: Accelerate BufferClearFernando Sahmkow2021-07-131-0/+2
| |
* | vk_buffer_cache: Use emulated null buffers for transform feedbackReinUsesLisp2021-07-091-3/+3
|/ | | | | | Vulkan does not support null buffers on transform feedback bindings. Emulate these using the same null buffer we were using for index buffers.
* vk_update_descriptor: Inline and improve code for binding buffersReinUsesLisp2021-02-131-2/+4
| | | | Allow compilers with our settings inline hot code.
* vk_buffer_cache: Add support for null index buffersReinUsesLisp2021-02-131-0/+5
| | | | | | | | | | | 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.
* buffer_cache: Skip cache on small uploads on VulkanReinUsesLisp2021-02-131-0/+7
| | | | | | | | Ports from OpenGL the optimization to skip small 3D uniform buffer uploads. This will take advantage of the previously introduced stream buffer. Fixes instances where the staging buffer offset was being ignored.
* video_core: Reimplement the buffer cacheReinUsesLisp2021-02-131-32/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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_common: Move allocator to the common directoryReinUsesLisp2021-01-151-1/+1
| | | | Allow using the abstraction from the OpenGL backend.
* renderer_vulkan: Rename Vulkan memory manager to memory allocatorReinUsesLisp2021-01-151-4/+3
| | | | | "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-7/+8
| | | | | | | | | 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.
* renderer_vulkan: Rename VKDevice to DeviceReinUsesLisp2021-01-031-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.
* 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-4/+6
| | | | | | | | | | | | | | 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-8/+8
| | | | | 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-5/+2
| | | | | | | | | 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.
* 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-11/+12
|
* gl_buffer_cache: Mark buffers as residentReinUsesLisp2020-06-241-1/+5
| | | | | | Make stream buffer and cached buffers as resident and query their address. This allows us to use GPU addresses for several proprietary Nvidia extensions.
* Merge pull request #4066 from ReinUsesLisp/shared-ptr-bufRodrigo Locatti2020-06-161-10/+6
|\ | | | | buffer_cache: Avoid passing references of shared pointers and misc style changes
| * buffer_cache: Avoid passing references of shared pointers and misc style changesReinUsesLisp2020-06-091-10/+6
| | | | | | | | | | | | | | | | | | 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=).
* | rasterizer_cache: Remove files and includesReinUsesLisp2020-06-071-1/+0
|/ | | | | The rasterizer cache is no longer used. Each cache has its own generic implementation optimized for the cached data.
* Merge pull request #3808 from ReinUsesLisp/wait-for-idlebunnei2020-05-031-2/+0
|\ | | | | {maxwell_3d,buffer_cache}: Implement memory barriers using 3D registers
| * {maxwell_3d,buffer_cache}: Implement memory barriers using 3D registersReinUsesLisp2020-04-281-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Drop MemoryBarrier from the buffer cache and use Maxwell3D's register WaitForIdle. To implement this on OpenGL we just call glMemoryBarrier with the necessary bits. Vulkan lacks this synchronization primitive, so we set an event and immediately wait for it. This is not a pretty solution, but it's what Vulkan can do without submitting the current command buffer to the queue (which ends up being more expensive on the CPU).
* | vulkan: Remove unnecessary includesLioncash2020-04-291-3/+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-5/+5
| | | | | | | | | | | 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-6/+6
|
* Buffer Cache: Use vAddr instead of physical memory.Fernando Sahmkow2020-04-061-2/+2
|
* vk_stream_buffer/vk_buffer_cache: Avoid halting and use generic cacheReinUsesLisp2020-01-061-0/+73
| | | | | | | | | | | | | | | | 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-104/+0
| | | | This is intended for a follow up commit to avoid circular dependencies.
* core: Prepare various classes for memory read/write migrationLioncash2019-11-271-1/+6
| | | | | | | | | | 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-1/+1
| | | | | | | | | | | | | | 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.
* Rasterizer Cache: Use a temporal storage for Surfaces loading/flushing.Fernando Sahmkow2019-04-211-1/+0
| | | | | This PR should heavily reduce memory usage since temporal buffers are no longer stored per Surface but instead managed by the Rasterizer Cache.
* RasterizerCache Redesign: Flush Fernando Sahmkow2019-04-201-2/+4
| | | | | | flushing is now responsability of children caches instead of the cache object. This change will allow the specific cache to pass extra parameters on flushing and will allow more flexibility.
* 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-7/+24
|
* vk_buffer_cache: Fix clang-formatReinUsesLisp2019-03-021-3/+3
|
* vk_buffer_cache: Implement a buffer cacheReinUsesLisp2019-03-011-0/+87
This buffer cache is just like OpenGL's buffer cache with some minor style changes. It uses VKStreamBuffer.