aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/vulkan_common/vulkan_wrapper.h
Commit message (Collapse)AuthorAgeFilesLines
* texture_cache: collect images in the emptiest device memory blocks firstTakoroka3 days1-0/+9
| | | | | | | | | | | | Deleting by age alone left every block partly used: the collector deletes thousands of images a minute and new ones land in the holes, so blocks seldom empty (title 1: ~0.8 GB of holes in ~190 32 MiB blocks after ten minutes, counted by the driver as used). Among the oldest candidates, 8 per image a pass may delete, those in the emptiest blocks go first, so blocks drain and VMA returns them; placement already prefers the fullest blocks. (cherry picked from commit 2f8f0716fafd874cfbb3cc9086141aea61aff2df)
* video_core: draw Switch 2 task/mesh pipelines with VK_EXT_mesh_shaderTakoroka3 days1-0/+5
| | | | | | | | | | | | | While SET_MESH_CONTROL is on, a native draw binds a task program in the vertex slot, its mesh program in the tessellation slot and a header-only pass-through geometry program naming the per-primitive outputs. Translate the first two as task and mesh programs with the mesh registers (SET_MESH_SHADER_A/B, SET_MESH_INIT_SHADER) and that header, key their pipelines by them, and build pipelines with task/mesh stages and no vertex input, input assembly or tessellation state. The draw's vertex count is the number of task workgroups: record vkCmdDrawMeshTasksEXT. Enable VK_EXT_mesh_shader (task and mesh only) when the host has it; draws are skipped without it, as they were before.
* vulkan: bind memory to sparse terrain arrays layer by layerTakoroka5 days1-0/+4
| | | | | | | | | | | | | | | | | | | | | | | The written part of Mario Kart World's sparse terrain arrays is small: 13-26% of their blocks. The two 1.45 GB ASTC arrays were backed in full on the host, and the two 5.8 GB BC6H arrays, too large to back, stayed unbacked, so what the game streamed into them never showed. A color array of 32 MiB or more lying in one sparse region, in a format uploaded layer by layer (huge ASTC arrays decoded on the GPU, or formats sampled as they are), is now a sparse resident image (SparseLayers). When it is refreshed, the layers written since (or, for a new image, the layers any of whose blocks was written) get device memory bound with vkQueueBindSparse (under the submit lock, waited on, as the multi-range buffer cache does) and only those layers are uploaded. Unwritten layers read zero. One image binds at most 768 MiB (384 MiB on GPUs with less than 7 GiB); rendering into one binds all its layers. Mario Kart World, 180 s: the ASTC arrays hold 1.4 MiB per written layer, four BC6H layers (341 MiB) now have their data, device memory in use 4.8-5.0 GB instead of 6.0-7.1 GB with the texture cache below its collection threshold, 16.8-17.2 ms average frames, peak working set 13.4 GB.
* Vulkan: unbacked sparse images for textures too large to backTakoroka7 days1-0/+5
| | | | | | | | | Title 1 samples an 8192x8192, 12-level, 68-layer array (a sparse virtual texture, ~23 GB): vkCreateImage failed and Eden aborted, or VMA put it in system memory and staged a full upload (34 GB private). Images over 2^28 texels are now created sparse-resident with no memory bound; the texture cache neither uploads nor downloads them. Images merely over the VRAM budget are allocated without the budget limit instead of failing.
* [shader_recompiler, vulkan] Virtual buffer pages with multi-range + sparse ↵CamilleLaVey2026-09-081-3/+22
| | | | | | | | | | | | buffers binding (#4362) Storage buffers can span GPU pages that aren't contiguous in host memory, but the buffer cache assumed one contiguous buffer per binding, so anything crossing a mapping boundary read the wrong bytes. Multi-range binding resolves the real segments and presents them to the shader as one buffer, aliasing their memory into a sparse VkBuffer or gathering them into a copy, all of this was mostly fixed by making a path to use sparse on buffers (the same way as texture cache has it) and retrieve properly the mapping ranges to the virtual pages, including the actual structure on the use of binding sparse. Meanwhile this fixes Monster Hunter Sunbreak z-fighting, bad performance and mostly vertex explosions (coming from the contiguous buffer read from the shader's game) it's only the basis for a further investigation towards how are we gonna treat phi calculations, optimized them and mostly eradicate the currently excess of exposure on the textures where the lightning trace should not being reflected. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4362 Reviewed-by: lizzie <lizzie@eden-emu.dev> Reviewed-by: Maufeat <sahyno1996@gmail.com>
* [vulkan] Adjustments on MSAA and BlitHelpers (#4287)crueter2026-08-231-0/+3
| | | | | | | | | | | | | | | PR/Commit Owner: CamilleLaVey This PR contains changes complementary to the MSAA refactor from some weeks ago, adds proper shader convert to depth, stencil for msaa and non msaa convertions; removes redundant helpers and unify paths on the resolve functions, just to make the readability and maintainability better; includes fixes for the blit operations on Nvidia, Intel/Windows (previously banned) and ensures Linux retain the fix without extra burden; fixes the QCOM driver bug on resolution upscaling on any games above x1 (includes turnip on A8xx series) and fixes crashes/ resolution upscaled bugs on certain games that used to have wrong viewporting effect on screen or directly device loss on Vulkan. Adds fixes for regressions caused by previous MSAA refactor on games as Fire Emblem: Engage. Special Thanks 1.- Big Smolio (@Gidoly) Co-authored-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4287 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: Samuel <lizzie@eden-emu.dev>
* [vulkan] Initial implementation on Bindless Buffer/Descriptors (#4251)CamilleLaVey2026-08-051-0/+51
| | | | | | | | | | Adds a VK_EXT_descriptor_buffer, VK_KHR_device_buffer_address path alongside push descriptors and descriptor sets. The ring is chunked and sized from the device limits, so drivers with a small sampler range (QCOM reports 128 KiB) get more, chunks per frame instead of losing the feature. A pipeline uses one path or the other, never both, since some drivers do not support bufferless push descriptors. The chunk binding is only re-emitted when it changes, and a draw that repeats the previous payload reuses its allocation instead of rewriting it. This whole change will help to reduce the constant use of descriptors on the slower path, improves the "slow implementation" on QCOM drivers (A7xx and older) for push descriptors, improves latency when compiling pipelines. The implementation on indexing descriptors was also refined. _Special Thanks_ 1.- Meowly The Bindless Smol (@Gidoly) Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4251
* [vulkan, android] Mediacodec implementation + Vulkan fixes (#4191)CamilleLaVey2026-07-091-0/+3
| | | | | | | | | | | | | | | | | | | This is the first step into the conversion on full GPU video decoding for Android; currently due to the VIC structure, I couldn't set it on surface mode to prevent the latency when sending video decoded (which is processed by GPU now), because currently we convert YUV420 into the Nvidia's format each frame constantly on CPU, aside the requirements from other extensions to work + VIC rewrite, which is a work currently not planned to happen on this PR; the actual configuration for video decoding is ByteBuffer, using GPU to decode NVDEC data (all codecs supported, h264, vp8 and vp9) and send it to CPU for display purposes, which is more faster than relying purely on CPU for any drawing task, saving devices resources/ heating, the downside on this will be the slight latency when a new frame is displayed, which is gonna be a black frame for less than a second, nothing major to harm the experience rather than actually trying our best to take advantage on hardware accelerated. Aside this, I also added a bunch of minor Vulkan fixes to grant drivers less thinkering when receiving spir-v instructions, meaning this has new bans for extensions on QCOM (following reported issues on other projects working around Adreno driver behavior), this more than providing performance aims to enhance the stability on the driver, performance it's gonna likely to be hit based on the UBO's (StorageBufferAccess) operations and SSBO (uniformStorageBufferAccess), there was an already existing path for the emulation which forces to wide them into 32bit packed operations. I also included some smaller changes/ bugs + VUID's fixes from earlier changes on my work. Special Thanks: -> Mr. Smoly Gidolard (@gidoly) Sources: 1.- https://github.com/microsoft/DirectXShaderCompiler/issues/2842 2.- https://github.com/mlc-ai/web-llm/issues/836 3.- https://github.com/ggml-org/llama.cpp/issues/5186 4.- https://github.com/encounter/aurora/pull/202 Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4191
* [vulkan] 3rd Vulkan Global Maintenance (#4189)CamilleLaVey2026-07-091-0/+85
| | | | | | | | | | Following the philosophy on the previous Vulkan maintenance PR's, this one is reviewing the video_core to resolve VUID's related to the missing handling/ safechecks (UBO's case on missing StorageBufferAccess 8/16 bits on QCOM drivers, resulting on bad compute pipeline compiled), wiring topology representative to EDS2 configuration (following #4117), refactored the sampled image access via new memeber function for type "typeless" which adds a handling on the integer mistmatch (uint to sint, float to uint) + fixing bugs on current texture sampling (int) including the depth/stencil path resolve, maintenance to previous changes on query cache (resolving bugs from #3853), reduced the amount of binding BindVertexBufferEXT2 when a new tick/ frame is presented (with this being a reason for performance reduction on games where vertex polutes the stage, like BOTW/TOTK where grass is draw with vertex); implemented color border swizzle and color write enable for future improvements on EDS3, added initial implementation on Synchronization2 starting a path to ensure an access to VK 1.3 features safely and other smaller fixes along the road. Special Thanks: -> Mr. Smolio Gidolard (@gidoly) Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4189
* [common] rework BitField and BitUtil, use concepts whenever possible (#4076)lizzie2026-07-091-4/+3
| | | | | | | | | | test no regressions especially on Liiinux Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4076 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
* [*] basic in-house cpp linting (#4039)lizzie2026-06-041-2/+2
| | | | | | | | | | | | - add `#pragma once` to remainder files - "correcter" defines (ANDROID), see https://groups.google.com/g/android-ndk/c/cf9_f1SLXls - extra miscelly fixups Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4039 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: crueter <crueter@eden-emu.dev>
* [vulkan] Fix regressions found in last stable release (#3953)CamilleLaVey2026-06-021-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | This PR aims to fix some regressions found in the latest release 0.2.0, which were a bunch of constant crashes/ random on certain Android devices with issues with the PiP configuration, addressing some problems founds for AMD after the maintenance of 2nd Global Vulkan Maintenance. -> Fixes Final Fantasy Tactics on AMD (no longer requires of generic bits to work "all commands bit") -> Fixes some performance regressions on android due to the Tomodachi fix applied globally as common behavior (#3898, #3900) -> Fixes blittering of screen found on ARM Windows devices and QCOM stock drivers (Android and ARM Windows) related to Mario Kart 8 Deluxe strange blittering in races, caused by a strange race condition with the ResetQueryPool and mostly the workaround for presync -> Fixes issues on Luigi's Mansion 3 issue where the pause screen became black on AMD due to the early reset of queries. -> Fixes crashes on Mario Party Jamboree for AMD/ Nvidia. -> Keeps previous fixes related to crashes on AMD with other games such as Astral Chain, Fire Emblem Three Houses and Xenoblade 3 based on the lack of access to vertex fragment replaced with generic flags. -> Fixes TOTK RADV skybox lighting. -------- Credits: @melod-y @Gidoly @MaranBr @AlexWolff @Lizzie And all the people who contributed into the reporting issues/ helping with the bisect. Co-authored-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3953 Reviewed-by: Lizzie <lizzie@eden-emu.dev> Reviewed-by: crueter <crueter@eden-emu.dev>
* [vulkan] 2nd Vulkan Global Maintenance (#3853)CamilleLaVey2026-04-241-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This pr is a sequel to the one merged some days ago (#3839); which aims to improve stability, graphical accuracy and better Vulkan implementation and coherency among all platforms, contains the next changes: -> Removal of VK_EXT_unified_image_layouts: The removal of this ext was for cleaning purposes since the only part of this extension implemented was the activator; meanwhile a proper structure of use for this extension was not implemented, currently it's not viable to keep following an idea of a proper implementation due to complexity of this feature and the state of buffer cache and texture cache, which it's task that we must do near in the future, when this happens a better oportunity will arise to properly set layouts along a proper implementation of VK_EXT_descriptors_indexing, practically this feature was dead code. -> Adjustment of VK_EXT_custom_border_color: The implementation of this feature was handled poorly and worsened during the first tries of making ExtendedDynamicState stable, by gating it's use to the slider of EDS (dyna_state) if the counter was at least in 1, even tho this entered in a bug with the RemoveUnsuitableExtension, when is not a requirement for enabling in Vulkan's documentation and was my mistake, some time later in ExtendedDynamicState refactor (#3074) I tried to make the implementation more robust in comparison the Yuzu's implementation which had bans on vendor drivers, the new handling was requesting if extension was available and what kind of support feature it had, enabling what it was available and wiring an adequate path for said available feature; which leads us to today's change, after reading carefully how certain paths weren't triggered or caused mostly issues on how extension should work I did the next changes: - I removed the forced disabling with ExtendedDynamicState setting - Resolved the bug with RemoveUnsuitableExtension + dyna_state - Removed comments of explanation + log_debug warning - Set extension to be disabled if customBorderColorWithoutFormat is not available - Helps to solidify the removal of bans in vendor drivers This changes fixes the VUID 04015 for the handling with undefined format and made the usage of the extension more near to what Vulkan specification expects, yet there is still cases where we can't emulate properly samplers and some translucid black boxes will still appear, yet, now alleviated by allowing extension choose the proper custom available in Vulkan or degrade into a fallaback of solid colors. -> Adjustment of VK_EXT/KHR_robustness2: This feature was introduced in ExtendedDynamicState refactor (#3074), as safety measure for descriptors during the Write of buffers, providing robustness with an upgraded access to image, buffers and proper discard of null data in descriptors, however, despite the configuration the logs during debug sessions never stopped to bring the next VUID-VkWriteDescriptorSet-descriptorType-00324 and VUID-VkWriteDescriptorSet-descriptorType-00325, being the first one, the most constant issue plaguing logs; the approach was not only ensuring device can access between each of the version of this feature, whether is an EXT or KHR (drivers can report one of them or both, yet, if we call the one of them and it's not the version supported, driver would not load the feature, there's a priority to the KHR version) with a simplified configuration of the extension to use only nullDescritor to deflect properly buffers and other trash data outside of descriptors bound; ensuring to wire the path when it's and not available and also with BindVertexBuffers2EXT when it's or not available; fixing both VUID's. This changes helps to save some CPU resources and memory on binding routes. - Fixes VUID-VkWriteDescriptorSet-descriptorType-00324 - Fixes VUID-VkWriteDescriptorSet-descriptorType-00325 - Fixes VUID-vkCmdBindVertexBuffers-pBuffers-00621 (alongisde a latter adjustment for pStrides) -> Adjustment VK_EXT_image_robustness: As other features, this was implemented during the ExtendedDynamicState refactor (#3074), currently this change it's just to ensure more drivers are accessing this feature by changing the modality from extension to an explicit feature, some other redundant code was cleaned within this change. -> Restored gating flush operation on removed gpu accuracy: An issue report from an user called CaptFaraday in https://github.com/eden-emulator/Issue-Reports/issues/425, posted a behavior appearing after the rework of gpu accuracy levels (#3129), which broke the rendering in Paper Mario - The-Thousand-Year Door where some graphical issues such as black flash and missing rendering from many animations through the game thanks to the removal of the flush inside FlushAndInvalidateRegion gated with IsGPULevelExtreme and suggested a possible fix with resting the missing gating and flush; which I did and properly restoring the complete behavior of this functionality + wiring to the new IsGPULevelHigh for a better semantic correctness, the change was tested and didn't affected Yoshi's Crafted World graphical problems and main reason behind the deletion of this function, fixed in fcfcee7247. - Solves https://github.com/eden-emulator/Issue-Reports/issues/266 - Solves https://github.com/eden-emulator/Issue-Reports/issues/425 - Fixes Paper Mario - The-Thousand-Year Door - Keeps Yoshi's Crafted World issue still fixed -> Adjustment VK_EXT_conditional_rendering: Yuzu inherited us in their Vulkan backend multiple flaws which got worsened with the time as game and drivers changed, aside that, with the time studying this source code and especially the Vulkan-side of Eden, I started to learn and recognize some extensions that required a wide and robust modification to ensure the logic of the extension works as intended; currently ConditionalRendering had a lot of minimal modification: - Reordering the functions from "_NotifySegment_" to avoid a masive ram leak coming from query_cache (@weakboson) (#131) - Removing a function "_NotifySegment_" from rasterizer to ensure Metroid Prime 4 stopped crashing due to serious ram leaks in query_cache (@Maufeat) (#3142) And other intents to make ConditionalRendering fully working, such as happened in ExtendedDynamicState refactor (#3074) but only patched an horrible situation with how the extension was truly working, after spending more than 3 months studying how this and other sub-sequential and essential extensions touched in this PR worked in Vulkan, I dived once again to make it work properly; one of the first changes was to fix an invalid reference lookup of queries, which fixed the removal of "NotifySegment" inside rasterizer and start to adjusting other parts of the implementation of ConditionalRendering minimally and switching with heavy tests to ensure not a single game gets broken among the changes; yet the initial benefits from fixing the indirection in the lookups to query cache, was to reduce the amount of time of GPU was spending in the constant state of queries, which proved to reduce flickering in Pokémon ZA among others, with also an small increase of performance but more noticeable stability, starting to reduce stutering bit by bit. This advances allowed me to fix one of the the functions of IsGPULevelHigh, where existed a bypass to accelerate conditional rendering without the proper checks if the extension was truly supported, freeing QCOM from the flag of a fixated presync workaround; which also improved the usage of QCOM driver for 8 Elite devices and Unreal Engine 4 - 5 games, such as Dragon Ball Z - Sparking Zero; but that's not the only benefit from the current tries to make ConditionalRendering implementation more robust and accurate to specifications, but also started to show key points of where VK_EXT_transform_feedback was also failing to work properly. -> Adjustment VK_EXT_transform_feedback: Like many other features in this PR, this one was also adjusted minimally in ExtendedDynamicState refactor (#3074), with the ConditionalRendering refactor going on, the solutions for the usage of this extensions started by ensuring each key function is properly gated by a getter which would only be enabled if the extension was already being loaded in the virtual device, if wasn't the case I was making sure to wire the fallback correctly, which wasn't in place and didn't had a robust handling since ever, this way games started to not only improve graphical accuracy, like some games such as Zelda - Echoes Of Wisdom where the lightning and dark border moves/ reacts dynamically. Besides that, this change brought the possibility to finally get rid of the indirection of the buffers synchronization which often take a non-synchornization path to ensure a faster reply but with higher possibilities to cause graphical issues in among several games; aside that, also helped to ensure "_query_cache.CounterEnable(VideoCommon::QueryType::StreamingByteCount, false)_;" function is properly allocated and reset in a different place than where this was placed. - Maintain Metroid Prime 4 fixes even after returning the lines that caused the game to be unplayable, whether was an instant crash or crash after some minutes of gameplay, fixes that were introduced in other work (#3142). Within the first step in the refactor of this extension, this work was reviewed by @wildcard which made me notice of an issue of handling inside buffers, there existed a mismatch on the tracking of feedback buffers and since we're treating them as buffer_slot, counterstream was still tracking and consuming stream_buffers and not where data was really passing through; derivating the counter selection of counterBufferCount by stream indexes and not by slot, which could cause cases of _Stream =! slot_, a solution proposed for me was to add stream mapper function where the stream slot were located + updating UpdateBuffers() to calculate buffer counts per slot and not stream, allowing to fully map the map funtion of stream mapper; along other changes on the WriteBuffers + ProduceBufferCounter to avoid any misaligment. -> Other minimal adjustments: Alongside these important adjustment, others were also made to ensure logical coherency to this recent changes, such as ensuring FullSynchronization of buffers path, since GPU has mostly a syncing issue with certain type of textures and vertex calculations, the original behavior of jumping into a non-synchronize path of buffers let GPU ran without proper awareness of the textures being loaded, ensuring more performance if all the textures reached properly inside GPU, but with no safety provided for buffers, even we added a cases were dummies and mostly buffer trash data gets discarded by nullDescriptors, this won't ensure graphical artifacts or a bad calculation on the range of lightning/ gfx could appear. I dare to think this was thought to be implemented due to the original heavy costs on Yuzu's time, this along the removal of QCOM's drivers from Query's Presync funtions. A small adjustment to the mutable functions inside the CreateImageView structure to add the extended usage: "Because Switch's GPU creates incompatible views (sRGB and UNORM) on the same image. A sRGB image can't be used as storage but it is in a UNORM view. Which is exactly the use case of these flags." - @weakboson During all of this changes inside queries, we started to get in some devices "Device Loss" warning from Vulkan along 2 specific warnings: - [ 102.384895] Render.Vulkan <Critical> video_core/vulkan_common/vulkan_debug_callback.cpp:69:DebugUtilCallback: vkDeviceWaitIdle(): THREADING ERROR : object of type VkQueue is simultaneously used in current thread 517024609280 and thread 517864567808 - [ 114.003530] Render.Vulkan <Critical> video_core/vulkan_common/vulkan_debug_callback.cpp:69:DebugUtilCallback: vkCmdBeginQuery(): VkQueryPool 0x15e400000015e4 and query 172: query not reset. After query pool creation, each query must be reset (with vkCmdResetQueryPool or vkResetQueryPool) before it is used. Queries must also be reset between uses. Since before all of this adjustments, original GPU thread often take it's time to stop and look for a moment to synchronize with CPU (non-TimelineSemaphore), the whole flow data was improved that we were producing more data stale than we could really take due to the lack of a Reset to avoid pools being filled with old data, in order to get rid of this, another try to implement ResetQueryPool's appeared which was intented to be implemented some months ago and got removed in #3270, this time aligning the vkDeviceWaitIdle + ResetQueryPool was proved to be effective than first implementation and didn't caused major issues, now GPU can Vulkan can reset staling data, which can catalogued as old once they were used and displayed in frame, keeping a more fluid exchance and discard of data. - Fixes VUID-vkCmdBeginQuery-None-00807 - Fixes multithreading error with vkDeviceWaitIdle and data allocation We have some other changes to the coherency of ExtendedDynamicState2 and the feature of restart primitives, which now patches topologies once are processed if they pass through ExtendedDynamicState2 enabled and get reset before every draw to prevent another topology VUID; also I ensured refresh, reset, clamp and overall improve the math inside the Viewport/ Scissor feature operations inside DynamicState and later upgrades. --------------------------- UPDATE (23/04/2026): After passing a heavy testing phase, an issue was encountered with AMD drivers on Windows which based on the commit: c07dfa6fb4, Super Mario Odissey started to show vertex glitches on the the waterfall + water fog being rendered incorrectly, if VertexInputDynamicState was disabled caused black screen on ExtendedDynamicState (1 - 3) and hard crash if ExtendedDynamicState it was disabled; this situation was caused to the vertex input dynamic tied to ExtendedDynamicState1, AMD driver didn't allowed fast access to BindVertexBuffers2EXT without binding strides first, which caused a syncing problem between the binded vertex and the missing buffer in the same chain, this got fixed by removing the conditions for vertex input dynamic. Aside that; another pair of issues were addressed in the meantime of refining this PR, one of them was to solve the failing BGR565 formats to swizzle into RGBA5 which allows to swap between red and blue; solving the inverse situation of blue icons on Mario Kart 8 Deluxe for older QCOM drivers and SoC's, such as Snapdragon 855 - 870; which will also help some Exynos processors to render properly. This solution was converted into a toggle/hack because it's use it's very conditional on older hardware; newer SoC's such as 8 Elite won't longer require this handling to convert properly BGR565 texture even if the support for the format is not available. --------------------------- Here an small preview of what this pr has been fixed so far, but our testing range may be more limited than what this can actually do: - Allow to display new effect on games 1. Jump Force: New particle on stages and main menu. 2. The Legend Of Zelda - Echoes of Wisdom: darkness post processing effect on screen filter such as game intro and smokes on houses (8 Elite). 3. Reduce texture flickering on games such as EoW, Monster Hunter Rise. 4. Improved performance stability on various games with Android. 5. Improved Xenoblade games rendering with QCOM stock drivers by improve viewpoint handling (8 Elite). 6. Fixes vertex explosion on Xenoblade 3 with AMD GPU with extended dynamic state enabled. 7. Fixed Mario Kart 8 Deluxe rendering with VK_EXT_vertex_input_dynamic_state enabled. 8. Fixes certain angle of Pokemon Legend Z-A would look mono color with vertex input dynamic state. 9. Fixed graphical issue with VK_EXT_vertex_input_dynamic_state on mobile drivers. 10. Fixed vertex explosion with Turnip (8 Elite) on The Legend Of Zelda- Breath Of The Wild during loading screen. 11. Fixed issue of vertex on Pokémon Legends ZA with VK_EXT_vertex_input_dynamic_state enabled. 12. Improved rendering and stability of Inmortal Fenyx Rising, including QCOM drivers being able to reach into gameplay. 13. Fixes Paper Mario - The-Thousand-Year Door missing rendering on animations through the whole game. 14. Fixed Mario Kart 8 Deluxe blue tint icon on Snapdragon 855 - 870 (by enabling Emulated BGR565 hack toggle). 15. Fixed Naruto Ultimate Ninja Storm issue rendering on characters like Naruto being blue on older QCOM SoC's and Exynos (by enabling Emulated BGR565 hack toggle) 16. Fixed Dangaronpa Killing Harmony v3 issue rendering on characters with blue tint on older QCOM SoC's. --------------------------- _**Special Thanks - Credits**_ -> @Gidoly for being able to keep track of the intensive testing phase this pr required and the will to keep helping in development, you're a good friend and very useful. -> @CaptFaraday for the suggestion of the fix for Paper Mario. -> @wildcard for the review during the refactor of VK_EXT_transform_feedback, without this comment I would probably ran into many untrackable issues. -> @weakboson for the suggestion into the solution for sRGB's and UNORM's in the incompatible views. Co-authored-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3853 Reviewed-by: crueter <crueter@eden-emu.dev>
* [vulkan] 1st Vulkan Global Maintenance (#3839)CamilleLaVey2026-04-081-15/+0
| | | | | | | | | | | | | | | | | | This pr aims to make a first step into giving Eden's Vulkan backend maintenance with better formatting, understanding and reduce the redundancy between some wrong implementations: -> ProvokingVertex: Has been reworked completely, now the wiring to ExtendedDynamicState3 (ProvokingVertexMode) it works safe, the gating of the extension no longer requires user enabling on UI, it will be enabled automatically based on what features of the extension are available on driver, depending if first or last mode are available and also will be properly set under TrasformFeedback operations; this way we're gonna ensure all drivers, including Android stock drivers on QCOM, Mali and other mobile vendors drivers access correctly to the extension, fixing some graphical issues (flickering textures or wrong sccisors on vertex that required first mode) generated by the missing first mode handling or the proper clearing on pipeline state. This change will increase/ decrease slightly the performance on some games that changes dynamically between first and last modes, but will also ensure a clear path to GPU to use resources smartly, reducing VRAM consumption in PC and MEM/GPU percentage of use on Android (marginal to 5 - 8% approx). -> Removal VK_EXT_multi_draw: It has passed some months since the first try to implement this feature, but wasn't completed so functionality was null to negative, taking space in source and using small CPU cicles for initialization during device creation that reduced CPU effectiveness by 2 - 5%, aside that, after reviewing the situation of formally introducing handling for multidraws to reduce the floods of constants draw calls into 1 per batch, seems to not pay the overhead when the multidraw capacity is less or equal to 1, aside that, for the time being batching multidraws will introduce indirections on each batch of command draws, that graphical issues will appear and reducing performance can happen, something it was gonna solve. For the time being it's discarded, but, may be analyzed the chance to introduce it properly in a later date. -> Removal VK_EXT_indexing_descriptor: Currently the implementation of this feature was partial, with not proper handling on layouts; just the initial checks on device creation and chained up to the pNext feature, currently this extension will require a buffer cache and texture cache rework to set layouts and reduce the amount of use of descriptor into making it a less expensive cost effective, aside that to generate a path for the Bindless Texture and Bindless Buffer, allowing to track state of textures in runtime and ensuring the state of some compiled shaders doesn't change if it's no needed, among other benefits, besides that, enabling this feature was only generating innecessary checks on GPU, so consumption would be higher than it should be. -> Removal of VK_EXT_swapchain_maintenance1: The use of this feature was really conditional to certain support on newer drivers and cards, which wasn't available for all platforms, I concluded that if the support for this instance wasn't really there, the cost effective between the try to initialize it and running it, won't be good as when it didn't exist on our Vulkan device, with also the constant factor of not being completely implemented, right now I'm aiming to reduce the complexity on Vulkan side to keep it as simple as it could for a future video_core rework, which may start somewhere these weeks. -> Refined the Maintenance features: Meawhile this features are usually inherent to Vulkan core functionality, sometimes drivers doesn't expose them well, which leads to Eden run Vulkan without really noticing the existence of maintenance features on driver to improve stability, so we're tied to declare them and load them when a device creation starts by asking if driver supports and which, currently 1 - 5 are core maintenance features, meanwhile the 7 - 9 are more experimental and not being available everywhere, so right now to help drivers give attention to this features we not only load them, but also calculate with features bits which features inside Maintenance5 are available to use, that was the initial purpose, but we weren't using the full potential of the extension; I made cleaned part of the unneeded log code for the initialization of this Maintenance5 and it's feature flags, but also making an operation to sanitize depth/ stencil when One is not available in swizzle operations, making it easier to draw it; it's also needed to mention that Maintenance9 was removed from source code until we can have better handling on Arrays2D, aside that, the use of the extension was really conditional to certain drivers being capable of use it, so I remove it. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3839 Co-authored-by: CamilleLaVey <camillelavey99@gmail.com> Co-committed-by: CamilleLaVey <camillelavey99@gmail.com>
* [vk] unify VkSurfaceKHR with Android and the rest of platforms; remove ↵lizzie2026-03-051-22/+22
| | | | | | | | | | | | | | | | technically incorrect nullptr() ctor for handles (#2971) Removes some odd #ifdef-ing that just can use a shrimple opaque type. Also removes nullptr() ctor'ing for vulkan handles and such; it's not incorrect per se like how `void *p = 0;` isn't incorrect, just that, y'know, any static analyzer will go "woah". Also there isn't any guarantee that handles `sizeof(Handle) == sizeof(void*)` so may as well :) Signed-off-by: lizzie lizzie@eden-emu.dev Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2971 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [desktop] Show basic driver info on GPU selector box (#3636)crueter2026-02-261-1/+5
| | | | | | | | | | | Shows a short driver identification string in the Graphics Device combo box (desktop only, Android doesn't need this at all) Largely meant for debugging, especially macOS. Maybe Windows in the future once MESA begins working on FOSS drivers over there. Linux on ARM platforms too maybe? And Nvidia Signed-off-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3636 Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
* [vk] Remove UniformRing and vkCmdResetQueryPool (#3270)Caio Oliveira2026-01-071-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Fixes perfomance regression on Xenoblade Chronicles DE and Pokemon Scarlet (among other games) It should be investigated the reason why such perfomance loss (more than ~10% in some case) At core it partially reverted the following commits: Reverts "[vk] Introduce Ring Buffers for Uniform Buffer (#2698)" This reverts commit 776958c79d. Revert "[vk] Bring Vulkan closer to Spec (#180)" This reverts commit c8d6f23129. Revert "[VK] PR 180 extension (#257)" This reverts commit 444b9f361e. Revert "[vk] Fixes regression of PR #180 vk_scheduler.cpp for AMD GPU and Windows OS (#3071)" This reverts commit be218cc020. Signed-off-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3270 Reviewed-by: Lizzie <lizzie@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Co-committed-by: Caio Oliveira <caiooliveirafarias0@gmail.com>
* [refactor, vk] DynamicState, ExtendedDynamicState and ↵CamilleLaVey2026-01-071-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VertexInputDynamicState (#3074) This PR rewrites the DynamicState, ExtendedDynamicState and VertexInputDynamicState logic: - Adds proper handling on how features should be loaded based on driver available features for ExtendedDynamicState/ VertexInputDynamicState. - Fixes some old regressions with emulated formats for Android. - Adds better formatting for tiling format features. - Adds better formatting for format features. - Adds NonWritable buffers handling for Spir-v. - Updates Maintenance features calling. - Adds new features: Multidraw, Robustness2, Image Robustness. - Removes dead code/ duplicated on Vulkan device related to ExtendedDynamicState handling. - Adjusts and conditions with better handling for some features callings: SwapchainMaintenance1, ConditionalRendering, ShaderExtencilExport, CustomBorderColor, TransformFeedback, VertexInputDynamicState. - Removes some older feature ban logic. - Adds hardware resolve path for MSAA Image Blits on Nvidia cards. - Adds flat decorations for input interfaces on Spir-v. - Reduces flushwork within drawcalls. - Clamps render limits on out-of-area for rasterizer. Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-authored-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Co-authored-by: DraVee <dravee@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3074 Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: Lizzie <lizzie@eden-emu.dev> Co-authored-by: CamilleLaVey <camillelavey99@gmail.com> Co-committed-by: CamilleLaVey <camillelavey99@gmail.com>
* [vk] Unify RAII in Vulkan (#2679)Ribbit2025-10-081-32/+34
| | | | | | | | | | | This PR consolidates Vulkan RAII on video_core/vulkan_common/vulkan_wrapper.h’s vk::Handle and remove the unused duplicate src/video_core/vulkan_common/vulkan_raii.h, reducing confusion and maintenance. Swapchain now uses RAII‑managed per‑image semaphores and clears them in Destroy(), providing correct present synchronization and automatic cleanup. Expected result: simpler lifetimes, fewer leak risks, and more stable presentation with negligible overhead. Co-authored-by: Ribbit <ribbit@placeholder.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2679 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: Ribbit <ribbit@eden-emu.dev> Co-committed-by: Ribbit <ribbit@eden-emu.dev>
* [cmake] enable clang-cl and WoA builds (#348)lizzie2025-09-091-2/+2
| | | | | | | | | | | | | | Compilation and CMake fixes for both Windows on ARM and clang-cl, meaning Windows can now be built on both MSVC and clang on both amd64 and aarch64. Compiling on clang is *dramatically* faster so this should be useful for CI. Co-authored-by: crueter <crueter@eden-emu.dev> Co-authored-by: crueter <crueter@crueter.xyz> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/348 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [vk] Bring Vulkan closer to Spec (#180)Shinmegumi2025-08-131-1/+4
| | | | | | | | | | The changes noted below bring Vulkan closer to 1.3 spec and get rid of validation errors and enable us to properly use one or two more functions. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/180 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: Maufeat <sahyno1996@gmail.com> Co-authored-by: Shinmegumi <shinmegumi@eden-emu.dev> Co-committed-by: Shinmegumi <shinmegumi@eden-emu.dev>
* [vk] Enable line stipple and depth bound reg transfer (#59)Aleksandr Popovich2025-07-221-0/+6
| | | | | | | | | | | It should improve line stipple accuracy and the depth stencilling as part of the ExtendedDynamicState improvements. Co-authored-by: crueter <crueter@eden-emu.dev> Signed-off-by: Aleksandr Popovich <popovich@eden-emu.dev> Co-authored-by: crueter <crueter@crueter.xyz> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/59 Co-authored-by: Aleksandr Popovich <popovich@eden-emu.dev> Co-committed-by: Aleksandr Popovich <popovich@eden-emu.dev>
* [vk] Add some dynamic handling in the pipeline (#142)Aleksandr Popovich2025-06-161-0/+21
| | | | | | | Co-authored-by: crueter <swurl@swurl.xyz> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/142 Co-authored-by: Aleksandr Popovich <alekpopo@pm.me> Co-committed-by: Aleksandr Popovich <alekpopo@pm.me>
* fix a large variety of issues (#101)swurl2025-05-111-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - GLASM/SPIR-V mixup on Android - potential greenscreen fix (thx suyu) - save memory layout and add 10gb/12gb options - potential samsung gaming hub fix - fix layout of controller UI - fix default settings to sensible defaults. - note to TotK that you should increase memory layout - Error checking for Windows linking - fix an IDE error - improved migration system w/threading and busy indicator - disabled citron migration for now - replaced some user-facing legacy strings with eden - Added 10GB and 12GB DRAM layouts - Fix Android black screen issues - add discord link & update FAQ/Quickstart - update links in about page - add back rich presence - add Don't show again for desktop pre alpha banner - add citron warning to android and polaris to desktop Signed-off-by: swurl <swurl@swurl.xyz> Co-authored-by: Pavel Barabanov <pavelbarabanov94@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/101 Co-authored-by: swurl <swurl@swurl.xyz> Co-committed-by: swurl <swurl@swurl.xyz>
* renderer_vulkan: Use raw surface handles and improve release logic (#75)Briar2025-05-021-0/+18
| | | | | | | | | Should fix or at least lessen the crashes when leaving runtime emulation on both Android / PC Also, may have improved the time required to leave the game Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/75 Co-authored-by: Briar <205427297+icy-briar@users.noreply.github.com> Co-committed-by: Briar <205427297+icy-briar@users.noreply.github.com>
* Vulkan validation error fix.darktux2025-04-041-5/+12
| | | | | Different image usage flags between image creation and image view creation.
* Simplify VkResult lookupMike Lothian2024-01-221-3/+0
|
* renderer_vulkan: Introduce separate cmd buffer for uploadsGPUCode2023-11-121-0/+4
|
* vk_present_manager: recreate surface on any surface lossLiam2023-10-021-0/+3
|
* Merge pull request #11402 from FernandoS27/depth-bias-controlliamwhite2023-09-281-0/+13
|\ | | | | Vulkan: Implement Depth Bias Control
| * Vulkan: Implement Depth Bias ControlFernando Sahmkow2023-09-161-0/+13
| |
* | Macro HLE: Add DrawIndirectByteCountFernando Sahmkow2023-09-231-0/+8
| |
* | Query Cachge: Fully rework Vulkan's query cacheFernando Sahmkow2023-09-231-0/+19
|/
* VideoCore: Implement DispatchIndirectFernando Sahmkow2023-08-271-0/+5
|
* vulkan: centralize configAlexandre Bouvier2023-08-021-8/+0
|
* vma: enable options everywhereAlexandre Bouvier2023-07-311-9/+2
|
* vulkan: Use newer VK_EXT_metal_surface to create surface for MoltenVK.Steveice102023-06-301-0/+2
|
* renderer_vulkan: Add suport for debug report callbackGPUCode2023-06-271-0/+9
|
* renderer_vulkan: Use VMA for buffersGPUCode2023-06-181-13/+78
|
* renderer_vulkan: Use VMA for imagesGPUCode2023-06-181-13/+57
|
* general: fix spelling mistakesLiam2023-03-121-7/+7
|
* vulkan_common: fix indirect draw with countLiam2023-01-101-6/+6
|
* video_core/vulkan: Added `VkPipelineCache` to store Vulkan pipelinesWollnashorn2023-01-051-2/+22
| | | | | | As an optional feature which can be enabled in the advanced graphics configuration, all pipelines that get built at the initial shader loading are stored in a VkPipelineCache object and are dumped to the disk. These vendor specific pipeline cache files are located at `/shader/GAME_ID/vulkan_pipelines.bin`. This feature was mainly added because of an issue with the AMD driver (see yuzu-emu#8507) causing invalidation of the cache files the driver builds automatically.
* MacroHLE: Final cleanup and fixes.Fernando Sahmkow2023-01-011-1/+2
|
* Vulkan: Implement Dynamic State 3Fernando Sahmkow2023-01-011-0/+25
|
* Vulkan Implement Dynamic State 2 LogicOp and PatchVerticesFernando Sahmkow2023-01-011-0/+10
|
* Vulkan: Implement Dynamic States 2Fernando Sahmkow2023-01-011-0/+15
|
* MacroHLE: Implement DrawIndexedIndirect & DrawArraysIndirect.Fernando Sahmkow2023-01-011-6/+18
|
* MacroHLE: Add MultidrawIndirect HLE Macro.Fernando Sahmkow2023-01-011-0/+15
|
* video_core: Integrate SMAALiam2022-12-081-0/+6
| | | | | Co-authored-by: goldenx86 <goldenx86@users.noreply.github.com> Co-authored-by: BreadFish64 <breadfish64@users.noreply.github.com>