summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-11-11Fix regs regression with OpenGL two-sided stencil, and re-add data invalidation regKelebek11-0/+12
2022-11-05video_core: Fix scaling graphical regressions for multiple gamesFengChen1-4/+4
2022-11-04video_core: Fix SNORM texture buffer emulating error (#9001)Feng Chen1-2/+2
2022-10-07Update 3D regsKelebek11-13/+1
2022-10-06Shader Decompiler: Check for shift when deriving composite samplers.Fernando Sahmkow1-2/+3
2022-10-06VideoCore: Fix channels with disk pipeline/shader cache.Fernando Sahmkow1-9/+8
2022-09-20video_core: Generate mipmap texture by drawingFengChen1-4/+20
2022-08-03renderer_vulkan: add format fallbacks for R16G16B16_SFLOAT, R16G16B16_SSCALED, R8G8B8_SSCALEDLiam1-1/+1
2022-06-27video_core: Replace VKUpdateDescriptorQueue with UpdateDescriptorQueuegerman771-1/+1
2022-06-27video_core: Replace VKScheduler with Schedulergerman771-2/+2
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-04-07video_core: Replace lock_guard with scoped_lockMerry1-1/+1
2021-12-18Vulkan: Fix the checks for primitive restart extension.Fernando Sahmkow1-2/+5
2021-12-18Vulkan: implement Logical Operations.Fernando Sahmkow1-2/+2
2021-12-18Vulkan: Implement VK_EXT_primitive_topology_list_restartFernando Sahmkow1-2/+2
2021-11-16vulkan: Fix rescaling push constant usageameerj1-6/+9
2021-11-16emit_spirv: Fix RescalingLayout alignmentameerj1-2/+3
2021-11-16emit_spirv: Fix RescalingLayout alignmentameerj1-1/+1
2021-11-16shader: Properly blacklist and scale image loadsReinUsesLisp1-5/+9
2021-11-16texture_cache: Simplify image view queries and blacklistingReinUsesLisp1-41/+13
2021-11-16Texture Cache: Implement Blacklisting.Fernando Sahmkow1-1/+27
2021-11-16vulkan: Implement rescaling shader patchingReinUsesLisp1-4/+17
2021-11-16vk_graphics_pipeline: Use Shader::NumDescriptors when possibleReinUsesLisp1-18/+6
2021-09-28vk_graphics_pipeline: Force patch list topology when tessellation is usedameerj1-1/+10
Fixes a crash on some drivers when tessellation is used but the IA topology is not patch list.
2021-09-24general: Update style to clang-format-12ameerj1-2/+3
2021-07-28renderer_vulkan: Add setting to log pipeline statisticsReinUsesLisp1-4/+12
Use VK_KHR_pipeline_executable_properties when enabled and available to log statistics about the pipeline cache in a game. For example, this is on Turing GPUs when generating a pipeline cache from Super Smash Bros. Ultimate: Average pipeline statistics ========================================== Code size: 6433.167 Register count: 32.939 More advanced results could be presented, at the moment it's just an average of all 3D and compute pipelines.
2021-07-23renderers: Fix clang formattingameerj1-3/+2
2021-07-23vk_graphics_pipeline: Implement smooth linesReinUsesLisp1-0/+21
2021-07-23vk_graphics_pipeline: Implement line widthReinUsesLisp1-1/+2
2021-07-23shader: Rework varyings and implement passthrough geometry shadersReinUsesLisp1-4/+2
Put all varyings into a single std::bitset with helpers to access it. Implement passthrough geometry shaders using host's.
2021-07-23vk_graphics_pipeline: Implement conservative renderingReinUsesLisp1-9/+24
2021-07-23shader: Unify shader stage typesReinUsesLisp1-1/+1
2021-07-23vk_graphics_pipeline: Use VK_KHR_push_descriptor when availableReinUsesLisp1-10/+18
~51% faster on Nvidia compared to previous method.
2021-07-23vk_graphics_pipeline: Fix path with no VK_EXT_extended_dynamic_stateRodrigo Locatti1-1/+1
2021-07-23vulkan: Add VK_EXT_vertex_input_dynamic_state supportReinUsesLisp1-40/+67
Reduces the number of total pipelines generated on Vulkan. Tested on Super Smash Bros. Ultimate.
2021-07-23vulkan: Use VK_EXT_provoking_vertex when availableReinUsesLisp1-1/+9
2021-07-23vk_pipeline_cache,shader_notify: Add shader notificationsReinUsesLisp1-13/+17
2021-07-23buffer_cache: Reduce uniform buffer size from shader usageReinUsesLisp1-5/+9
Increases performance significantly on certain titles.
2021-07-23vulkan: Enable depth bounds and use it conditionallyReinUsesLisp1-1/+4
Intel devices pre-Xe don't support this.
2021-07-23buffer_cache: Mark uniform buffers as dirty if any enable bit changesReinUsesLisp1-1/+5
2021-07-23shader: Initial OpenGL implementationReinUsesLisp1-10/+12
2021-07-23vk_graphics_pipeline: Fix texture buffer descriptorsReinUsesLisp1-7/+8
2021-07-23vulkan: Defer descriptor set work to the Vulkan threadReinUsesLisp1-21/+19
Move descriptor lookup and update code to a separate thread. Delaying this removes work from the main GPU thread and allows creating descriptor layouts on another thread. This reduces a bit the workload of the main thread when new pipelines are encountered.
2021-07-23vulkan: Rework descriptor allocation algorithmReinUsesLisp1-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.
2021-07-23vk_graphics_pipeline: Generate specialized pipeline config functions and improve codeReinUsesLisp1-29/+210
2021-07-23shader: Accelerate pipeline transitions and use dirty flags for shadersReinUsesLisp1-21/+25
2021-07-23vk_graphics_pipeline: Guard against non-tessellation pipelines using patchesReinUsesLisp1-2/+8
2021-07-23shader: Fix bugs and build issues on GCCRodrigo Locatti1-1/+1
2021-07-23shader: Fix render targets with null attachmentsReinUsesLisp1-5/+13
2021-07-23shader: Implement indexed texturesReinUsesLisp1-25/+38
2021-07-23shader: Implement D3D samplersReinUsesLisp1-7/+18
2021-07-23shader: Implement tessellation shaders, polygon mode and invocation idReinUsesLisp1-1/+2
2021-07-23spirv: Implement image buffersReinUsesLisp1-12/+19
2021-07-23shader: Implement SULD and SUSTReinUsesLisp1-0/+4
2021-07-23shader_recompiler,video_core: Cleanup some GCC and Clang errorslat9nq1-10/+11
Mostly fixing unused *, implicit conversion, braced scalar init, fpermissive, and some others. Some Clang errors likely remain in video_core, and std::ranges is still a pertinent issue in shader_recompiler shader_recompiler: cmake: Force bracket depth to 1024 on Clang Increases the maximum fold expression depth thread_worker: Include condition_variable Don't use list initializers in control flow Co-authored-by: ReinUsesLisp <reinuseslisp@airmail.cc>
2021-07-23shader: Interact texture buffers with buffer cacheReinUsesLisp1-7/+24
2021-07-23shader: Implement texture buffersReinUsesLisp1-5/+9
2021-07-23vk_compute_pass: Fix compute passesReinUsesLisp1-0/+2
2021-07-23shader: Remove atomic flags and use mutex + cond variable for pipelinesReinUsesLisp1-4/+10
2021-07-23shader: Mark SSBOs as written when they areFernandoS271-1/+1
2021-07-23vulkan: Create pipeline layouts in separate threadsReinUsesLisp1-12/+14
2021-07-23vulkan: Build pipelines in parallel at runtimeReinUsesLisp1-28/+44
Wait from the worker thread for a pipeline to build before binding it to the command buffer. This allows queueing pipelines to multiple threads.
2021-07-23shader: Better interpolation and disabled attributes supportReinUsesLisp1-2/+2
2021-07-23shader: Fix rasterizer integration order issuesReinUsesLisp1-2/+5
2021-07-23shader: Implement NDC [-1, 1], attribute types and default varying initializationReinUsesLisp1-0/+3
2021-07-23shader: Add partial rasterizer integrationReinUsesLisp1-0/+445
2021-07-23shader: Remove old shader managementReinUsesLisp1-484/+0
2021-02-13fixed_pipeline_cache: Use dirty flags to lazily update keyReinUsesLisp1-3/+0
Use dirty flags to avoid building pipeline key from scratch on each draw call. This saves a bit of unnecesary work on each draw call.
2021-01-25vk_graphics_pipeline: Fix narrowing conversion on MSVCReinUsesLisp1-2/+2
2021-01-24video_core: Silence -Wmissing-field-initializers warningsReinUsesLisp1-0/+1
2021-01-04renderer_vulkan: Move device abstraction to vulkan_commonReinUsesLisp1-1/+1
2021-01-03renderer_vulkan: Rename VKDevice to DeviceReinUsesLisp1-1/+1
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-23/+41
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-26renderer_vulkan/fixed_pipeline_state: Move enabled bindings to static stateReinUsesLisp1-10/+3
Without using VK_EXT_robustness2, we can't consider the 'enabled' (not null) vertex buffers as dynamic state, as this leads to invalid Vulkan state. Move this to static state that is always hashed and compared in the pipeline key. The bits for enabled vertex buffers are moved into the attribute state bitfield. This is not 'correct' as it's not an attribute state, but that struct has bits to spare, and it's used in an array of 32 elements (the exact same number of vertex buffer bindings).
2020-12-07video_core: Make use of ordered container contains() where applicableLioncash1-1/+1
With C++20, we can use the more concise contains() member function instead of comparing the result of the find() call with the end iterator.
2020-12-05video_core: Resolve more variable shadowing scenarios pt.2Lioncash1-19/+19
Migrates the video core code closer to enabling variable shadowing warnings as errors. This primarily sorts out shadowing occurrences within the Vulkan code.
2020-10-30General: Resolve a few missing initializer warningsLioncash1-0/+2
Resolves a few -Wmissing-initializer warnings.
2020-10-13vk_graphics_pipeline: Manage primitive topology as fixed stateReinUsesLisp1-3/+2
Vulkan has requirements for primitive topologies that don't play nicely with yuzu's. Since it's only 4 bits, we can move it to fixed state without changing the size of the pipeline key. - Fixes a regression on recent Nvidia drivers on Fire Emblem: Three Houses.
2020-09-19renderer_vulkan: Make unconditional use of VK_KHR_timeline_semaphoreReinUsesLisp1-1/+1
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.
2020-08-16Remove unneeded newlines, optional Registry in shader paramsameerj1-4/+3
Addressing feedback from Rodrigo
2020-08-16Address feedback, add shader compile notifier, update setting textameerj1-4/+5
2020-08-16Vk Async pipeline compilationameerj1-3/+2
2020-07-17vk_graphics_pipeline: Resolve narrowing warningsLioncash1-2/+4
For whatever reason, VK_TRUE and VK_FALSE aren't defined as having a VkBool32 type, so we need to cast to it explicitly.
2020-07-14vk_graphics_pipeline: Make use of designated initializers where applicableLioncash1-198/+223
Avoids redundant variable name repetitions.
2020-06-27vk_pipeline_cache: Avoid hashing and comparing dynamic state when possibleReinUsesLisp1-2/+16
With extended dynamic states, some bytes don't have to be collected from the pipeline key, hence we can avoid hashing and comparing them on lookups.
2020-06-27vulkan/fixed_pipeline_state: Move state out of individual structuresReinUsesLisp1-27/+26
2020-06-27vk_rasterizer: Use VK_EXT_extended_dynamic_stateReinUsesLisp1-2/+18
2020-06-27fixed_pipeline_state: Add requirements for VK_EXT_extended_dynamic_stateReinUsesLisp1-6/+6
This moves dynamic state present in VK_EXT_extended_dynamic_state to a separate structure in FixedPipelineState. This is structure is at the bottom allowing us to hash and memcmp only when the extension is not supported.
2020-05-04vk_graphics_pipeline: Implement viewport swizzles with NV_viewport_swizzleReinUsesLisp1-0/+32
2020-05-02vk_graphics_pipeline: Implement rasterizer_enable on VulkanReinUsesLisp1-1/+1
We can simply enable rasterizer discard matching the current pipeline key.
2020-04-29vulkan: Remove unnecessary includesLioncash1-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.
2020-04-28maxwell_3d: Fix depth clamping registerReinUsesLisp1-1/+1
Using deko3d as reference: https://github.com/devkitPro/deko3d/blob/4e47ba0013552e592a86ab7a2510d1e7dadf236a/source/maxwell/gpu_3d_state.cpp#L42 We were using bits 3 and 4 to determine depth clamping, but these are the same both enabled and disabled: state->depthClampEnable ? 0x101A : 0x181D The same happens on Nvidia's OpenGL driver, where they do something like this (default capabilities, GL 4.5 compatibility): (state & DEPTH_CLAMP) != 0 ? 0x201a : 0x281c There's always a difference between the first bits in this register, but bit 11 is consistently disabled on both deko3d/NVN and OpenGL. This commit changes yuzu's behaviour to use bit 11 to determine depth clamping. - Fixes depth issues on Super Mario Odyssey's intro.
2020-04-23vk_renderpass_cache: Pack renderpass cache key to 12 bytesReinUsesLisp1-1/+1
2020-04-19fixed_pipeline_state: Pack blending stateReinUsesLisp1-16/+15
Reduce FixedPipelineState's size to 364 bytes.
2020-04-19fixed_pipeline_state: Pack rasterizer stateReinUsesLisp1-7/+5
Reduce FixedPipelineState's size to 600 bytes.
2020-04-19fixed_pipeline_state: Pack depth stencil stateReinUsesLisp1-10/+10
Reduce FixedPipelineState's size to 632 bytes.
2020-04-19fixed_pipeline_state: Pack attribute stateReinUsesLisp1-11/+17
Reduce FixedPipelineState's size from 1384 to 664 bytes
2020-04-14renderer_vulkan: Integrate Nvidia Nsight Aftermath on WindowsReinUsesLisp1-0/+2
Adds optional support for Nsight Aftermath. It is enabled through ENABLE_NSIGHT_AFTERMATH in cmake. A path to the SDK has to be provided by the environment variable NSIGHT_AFTERMATH_SDK. Nsight Aftermath allows an application to generate "minidumps" of the GPU state when a device loss happens. By analysing these on Nsight we can know what a game was doing and why it triggered a device loss. The dump is generated inside %APPDATA%\yuzu\log\gpucrash and this directory is deleted every time a new instance is initialized with Nsight enabled. To enable it on yuzu there has a to be a driver and device capable of running Nsight Aftermath on Vulkan. That means only Turing based GPUs on the latest stable driver, beta drivers won't work for now. It is manually enabled in Configuration>Debug>Enable Graphics Debugging because when using all debugging capabilities there is a runtime cost.
2020-04-11renderer_vulkan: Drop Vulkan-HppReinUsesLisp1-132/+246
2020-02-24vk_shader_decompiler: Implement indexed texturesReinUsesLisp1-2/+1
Implement accessing textures through an index. It uses the same interface as OpenGL, the main difference is that Vulkan bindings are forced to be arrayed (the binding index doesn't change for stacked textures in SPIR-V).
2020-01-18vk_graphics_pipeline: Set front facing properlyReinUsesLisp1-2/+1
Front face was being forced to a certain value when cull face is disabled. Set a default value on initialization and drop the forcefully set front facing value with culling disabled.
2020-01-07vk_graphics_pipeline: Initial implementationReinUsesLisp1-0/+271
This abstractio represents the state of the 3D engine at a given draw. Instead of changing individual bits of the pipeline how it's done in APIs like D3D11, OpenGL and NVN; on Vulkan we are forced to put everything together into a single, immutable object. It takes advantage of the few dynamic states Vulkan offers.