aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Vulkan
AgeCommit message (Collapse)Author
2023-07-01[Ryujinx.Graphics.Vulkan] Address dotnet-format issues (#5378)TSRBerry
* dotnet format style --severity info Some changes were manually reverted. * dotnet format analyzers --serverity info Some changes have been minimally adapted. * Restore a few unused methods and variables * Silence dotnet format IDE0060 warnings * Silence dotnet format IDE0059 warnings * Address dotnet format CA1816 warnings * Fix new dotnet-format issues after rebase * Address most dotnet format whitespace warnings * Apply dotnet format whitespace formatting A few of them have been manually reverted and the corresponding warning was silenced * Format if-blocks correctly * Another rebase, another dotnet format run * Run dotnet format whitespace after rebase * Run dotnet format style after rebase * Run dotnet format analyzers after rebase * Run dotnet format style after rebase * Run dotnet format after rebase and remove unused usings - analyzers - style - whitespace * Disable 'prefer switch expression' rule * Add comments to disabled warnings * Simplify properties and array initialization, Use const when possible, Remove trailing commas * Run dotnet format after rebase * Address IDE0251 warnings * Address a few disabled IDE0060 warnings * Silence IDE0060 in .editorconfig * Revert "Simplify properties and array initialization, Use const when possible, Remove trailing commas" This reverts commit 9462e4136c0a2100dc28b20cf9542e06790aa67e. * dotnet format whitespace after rebase * First dotnet format pass * Fix naming rule violations * Remove redundant code * Rename generics * Address review feedback * Remove SetOrigin
2023-06-28Apply new naming rule to all projects except Vp9 (#5407)TSRBerry
2023-06-23"Exists" method should be used instead of the "Any" extension (#5345)Marco Carvalho
2023-06-15Inheritance list should not be redundant (#5230)Marco Carvalho
2023-06-15Blocks should be synchronized on read-only fields (#5212)Marco Carvalho
* Blocks should be synchronized on read-only fields * more readonlys * fix alignment * more * Update ISelfController.cs * simplify new * simplify new
2023-06-10Implement transform feedback emulation for hardware without native support ↵gdkchan
(#5080) * Implement transform feedback emulation for hardware without native support * Stop doing some useless buffer updates and account for non-zero base instance * Reduce redundant updates even more * Update descriptor init logic to account for ResourceLayout * Fix transform feedback and storage buffers not being updated in some cases * Shader cache version bump * PR feedback * SetInstancedDrawVertexCount must be always called after UpdateState * Minor typo
2023-06-09Removing shift by 0 (#5249)Marco Carvalho
* Integral numbers should not be shifted by zero or more than their number of bits-1 * more
2023-06-08Vulkan: Use aspect flags for identity views for bindings (#5267)riperiperi
2023-06-08Remove barrier on Intel if control flow is potentially divergent (#5044)gdkchan
* Remove barrier on Intel if control flow is potentially divergent * Shader cache version bump
2023-06-08Implement soft float64 conversion on shaders when host has no support (#5159)gdkchan
* Implement soft float64 conversion on shaders when host has no support * Shader cache version bump * Fix rebase error
2023-06-03Implement shader storage buffer operations using new Load/Store instructions ↵gdkchan
(#4993) * Implement storage buffer operations using new Load/Store instruction * Extend GenerateMultiTargetStorageOp to also match access with constant offset, and log and comments * Remove now unused code * Catch more complex cases of global memory usage * Shader cache version bump * Extend global access elimination to work with more shared memory cases * Change alignment requirement from 16 bytes to 8 bytes, handle cases where we need more than 16 storage buffers * Tweak preferencing to catch more cases * Enable CB0 elimination even when host storage buffer alignment is > 16 (for Intel) * Fix storage buffer bindings * Simplify some code * Shader cache version bump * Fix typo * Extend global memory elimination to handle shared memory with multiple possible offsets and local memory
2023-06-03Allow BGRA images on Vulkan (#5203)gdkchan
2023-06-01Vulkan: Include DepthMode in ProgramPipelineState (#5185)riperiperi
2023-05-31Skip draws with zero vertex count (#5149)gdkchan
2023-05-29Make sure blend is disabled if render target has integer format (#5122)gdkchan
* Make sure blend is disabled if render target has integer format * Change approach to avoid permanently mutating state
2023-05-29Workaround for MoltenVK barrier issues (#5118)gdkchan
2023-05-29Fix incorrect vertex attribute format change (#5112)gdkchan
* Fix incorrect vertex attribute format change * Only change vertex format if the host supports the new format
2023-05-28Add support for VK_EXT_depth_clip_control. (#5027)cstamford
* Add support for VK_EXT_depth_clip_control. * Code review feedback Minor formatting Co-authored-by: gdkchan <gab.dark.100@gmail.com> * Check .DepthClipControl to make sure the host actually supports the feature. * Review feedback: remove Vulkan platform switch, relying on QueryHostSupportsDepthClipControl to drive the behaviour - OpenGL returns true, and any future platforms that don't support the [-1, 1] depth mode can return false for the transformation. --------- Co-authored-by: gdkchan <gab.dark.100@gmail.com>
2023-05-25Truncate vertex attribute format if it exceeds stride on MoltenVK (#5094)gdkchan
* Truncate vertex attribute format if it exceeds stride on MoltenVK * Fix BGR format * Move vertex attribute check to pipeline creation to avoid costs * No need for this to be public
2023-05-23Vulkan: Do not set storage flag for multisample textures if not supported ↵gdkchan
(#5060)
2023-05-21Fix crash in SettingsViewModel when Vulkan isn't available (#4985)jhorv
* fix crash when Vulkan isn't available * add VulkanRenderer.GetPhysicalDevices() overload that provides its own Vk API object and logs on failure * adjustments per AcK77
2023-05-21Replace ShaderBindings with new ResourceLayout structure for Vulkan (#5025)gdkchan
* Introduce ResourceLayout * Part 1: Use new ResourceSegments array on UpdateAndBind * Part 2: Use ResourceLayout to build PipelineLayout * Delete old code * XML docs * Fix shader cache load NRE * Fix typo
2023-05-20Limit compute storage buffer size (#5028)gdkchan
2023-05-18Fix Vulkan blit-like operations swizzle (#5003)gdkchan
2023-05-13Vulkan: Device map buffers written more than flushed (#4911)riperiperi
2023-05-11Vulkan: Partially workaround MoltenVK InvalidResource error (#4880)riperiperi
* Add MVK stage flags workaround * Actually do the workaround * Remove GS on VS stuff * Address feedback
2023-05-10fix(mvk): resumeLostDevice (#4800)Aaron O'Mullan
Command buffer errors currently trigger an exception "DeviceLost" crashing the process. Looking at [MKV's code](https://github.com/KhronosGroup/MoltenVK/blob/53a4eb26f2fbd7322eb087eb4af263fe466543b0/MoltenVK/MoltenVK/GPUObjects/MVKQueue.mm#L392-L408) we observe that: - It hard fails if error is: ``` MTLCommandBufferErrorBlacklisted || MTLCommandBufferErrorNotPermitted || MTLCommandBufferErrorDeviceRemoved ``` - Otherwise fails conditionally if `config.resumeLostDevice == false` (current default) For Ryujinx's use-case it's more graceful to resume on those errors rather than crashing the app, the error isn't totally silenced since `mvk` still logs it Fixes #4704, #4575
2023-05-08vulkan: Pass Vk instance to VulkanRenderer (#4859)Mary
This will allow possible multiple driver selection without any need of LD preload. (useful when testing custom version of mesa for example)
2023-05-08vulkan: Avoid hardcoding features in CreateDevice (#4858)Mary
Those shouldn't have been hardcoded.
2023-05-08Vulkan: Simplify MultiFenceHolder and managing them (#4845)riperiperi
* Vulkan: Simplify waitable add/remove Removal of unnecessary hashset and dictionary * Thread safety for GetBufferData in PersistentFlushBuffer * Fix WaitForFencesImpl thread safety * Proper methods for risky reference increments * Wrong type of CB. * Address feedback
2023-05-08Vulkan: Batch vertex buffer updates (#4843)riperiperi
* Vulkan: Batch vertex buffer updates Some games can bind a large number of vertex buffers for draws. This PR allows for vertex buffers to be updated with one call rather than one per buffer. This mostly affects the AMD Mesa driver, the testing platform was Steam Deck with Super Mario Odyssey. It was taking about 12% before, should be greatly reduced now. A small optimization has been added to avoid looking up the same buffer multiple times, as a common pattern is for the same buffer to be bound many times in a row with different ranges. * Only rebind vertex buffers if they have changed * Address feedback
2023-05-03Vulkan: Record modifications after changing the framebuffer (#4775)riperiperi
Our Vulkan backend inserts image barriers when a texture is sampled after it is rendered. This is done via a "modification flag" which is set when a render target is unbound (presuming that a texture has finished drawing to it). Imagine the following scenario: - Game sets render target to texture A - Game renders to texture A - (render pass ends) - Game binds texture A to a sampler - Game sets render target to texture B - Renders to texture B using texture A (barrier required) Because of the previous behaviour, the check to add a barrier for sampling a texture actually happens before it is registered as modified, meaning no barrier was added at all. This isn't always the case, but it was definitely causing issues in Xenoblade 2. This doesn't fix any more complicated issues where a texture is repeatedly sampled while it is currently being rendered. Fixes visual glitches at lower resolutions in Xenoblade 2. May fix other cases.
2023-05-01GPU: Pre-emptively flush textures that are flushed often (to imported memory ↵riperiperi
when available) (#4711) * WIP texture pre-flush Improve performance of TextureView GetData to buffer Fix copy/sync ordering Fix minor bug Make this actually work WIP host mapping stuff * Fix usage flags * message * Cleanup 1 * Fix rebase * Fix * Improve pre-flush rules * Fix pre-flush * A lot of cleanup * Use the host memory bits * Select the correct memory type * Cleanup TextureGroupHandle * Missing comment * Remove debugging logs * Revert BufferHandle _value access modifier * One interrupt action at a time. * Support D32S8 to D24S8 conversion, safeguards * Interrupt cannot happen in sync handle's lock Waitable needs to be checked twice now, but this should stop it from deadlocking. * Remove unused using * Address some feedback * Address feedback * Address more feedback * Address more feedback * Improve sync rules Should allow for faster sync in some cases.
2023-04-27Move solution and projects to srcTSR Berry