summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan/vk_scheduler.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* renderer_vulkan: Introduce separate cmd buffer for uploadsGPUCode2023-11-121-5/+16
|
* Query Cache: address issuesFernando Sahmkow2023-09-231-3/+9
|
* Query Cachge: Fully rework Vulkan's query cacheFernando Sahmkow2023-09-231-1/+1
|
* renderer_vulkan: Async presentationGPUCode2023-05-011-2/+4
|
* vk_scheduler: split work queue waits and execution waitsLiam2023-03-121-3/+3
|
* renderer_vulkan: pause turbo submissions on inactive queueLiam2023-01-071-0/+7
|
* general: fix compile for Apple ClangLiam2022-11-231-0/+1
|
* vk_scheduler: Remove recorded_countsRobin Kertels2022-10-281-3/+1
|
* video_core: Replace VKQueryCache with QueryCachegerman772022-06-271-3/+3
|
* 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.
* video_core: Reduce unused includesameerj2022-03-191-1/+0
|
* Vulkan: Fix Scheduler Chunks when their FuncType is 0.Fernando Sahmkow2022-01-311-1/+3
|
* vulkan: Implement rescaling shader patchingReinUsesLisp2021-11-161-0/+5
|
* video_core: Fix jthread related hangs when stopping emulationameerj2021-09-241-1/+1
| | | | jthread on some compilers is more picky when it comes to the order in which objects are destroyed.
* vk_scheduler: Use std::jthreadameerj2021-09-161-4/+3
|
* renderer_vulkan: Wait on present semaphore at queue submitameerj2021-09-021-3/+3
| | | | | | | | | | The present semaphore is being signalled by the call to acquire the swapchain image. This semaphore is meant to be waited on when rendering to the swapchain image. Currently it is waited on when presenting, but moving its usage to be waited on in the command buffer submission allows for proper usage of this semaphore. Fixes the device lost when launching titles on the Intel Linux Mesa driver.
* video_core,shader: Clang-format fixesReinUsesLisp2021-07-231-1/+1
|
* vk_scheduler: Use locks instead of SPSC a queueReinUsesLisp2021-07-231-7/+9
| | | | This tries to fix a data race where we'd wait forever for the GPU.
* vk_scheduler: Allow command submission on worker threadReinUsesLisp2021-07-231-0/+15
| | | | | | | | | | | | This changes how Scheduler::Flush works. It queues the current command buffer to be sent to the GPU but does not do it immediately. The Vulkan worker thread takes care of that. Users will have to use Scheduler::Flush + Scheduler::WaitWorker to get the previous behavior. Scheduler::Finish is unchanged. To avoid waiting on work never queued, Scheduler::Wait sends the current command buffer if that's what the caller wants to wait.
* vulkan: Build pipelines in parallel at runtimeReinUsesLisp2021-07-231-3/+4
| | | | | Wait from the worker thread for a pipeline to build before binding it to the command buffer. This allows queueing pipelines to multiple threads.
* video_core: Reimplement the buffer cacheReinUsesLisp2021-02-131-10/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* vk_scheduler: Fix unaligned placement new expressionsReinUsesLisp2021-01-281-6/+6
| | | | | We were accidentaly creating an object in an unaligned memory address. Fix this by manually aligning the offset.
* 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-4/+10
| | | | | | | | | | | | | | 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.2Lioncash2020-12-051-1/+1
| | | | | | | Migrates the video core code closer to enabling variable shadowing warnings as errors. This primarily sorts out shadowing occurrences within the Vulkan code.
* renderer_vulkan: Make unconditional use of VK_KHR_timeline_semaphoreReinUsesLisp2020-09-191-42/+28
| | | | | | | | | | | | | | | | | | | | | | | This reworks how host<->device synchronization works on the Vulkan backend. Instead of "protecting" resources with a fence and signalling these as free when the fence is known to be signalled by the host GPU, use timeline semaphores. Vulkan timeline semaphores allow use to work on a subset of D3D12 fences. As far as we are concerned, timeline semaphores are a value set by the host or the device that can be waited by either of them. Taking advantange of this, we can have a monolithically increasing atomic value for each submission to the graphics queue. Instead of protecting resources with a fence, we simply store the current logical tick (the atomic value stored in CPU memory). When we want to know if a resource is free, it can be compared to the current GPU tick. This greatly simplifies resource management code and the free status of resources should have less false negatives. To workaround bugs in validation layers, when these are attached there's a thread waiting for timeline semaphores.
* vulkan: Remove unnecessary includesLioncash2020-04-291-1/+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.
* renderer_vulkan: Drop Vulkan-HppReinUsesLisp2020-04-111-14/+15
|
* vk_state_tracker: Initial implementationReinUsesLisp2020-02-281-37/+5
| | | | Add support for render targets and viewports.
* vk_query_cache: Implement generic query cache on VulkanReinUsesLisp2020-02-141-0/+15
|
* vk_scheduler: Delegate commands to a worker thread and state trackReinUsesLisp2019-12-131-25/+173
| | | | | | | | | | | | Introduce a worker thread approach for delegating Vulkan work derived from dxvk's approach. https://github.com/doitsujin/dxvk Now that the scheduler is what handles all Vulkan work related to command streaming, store state tracking in itself. This way we can know when to reupload Vulkan dynamic state to the queue (since this one is invalidated between command buffers unlike NVN). We can also store the renderpass state and graphics pipeline bound to avoid redundant binds and renderpass begins/ends.
* vk_scheduler: Drop execution context in favor of viewsReinUsesLisp2019-07-071-31/+47
| | | | | | | | | | | | | | 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.
* vk_scheduler: Implement a schedulerReinUsesLisp2019-02-221-0/+69
The scheduler abstracts command buffer and fence management with an interface that's able to do OpenGL-like operations on Vulkan command buffers. It returns by value a command buffer and fence that have to be used for subsequent operations until Flush or Finish is executed, after that the current execution context (the pair of command buffers and fences) gets invalidated a new one must be fetched. Thankfully validation layers will quickly detect if this is skipped throwing an error due to modifications to a sent command buffer.