aboutsummaryrefslogtreecommitdiff
path: root/src/shader_recompiler/ir_opt
Commit message (Collapse)AuthorAgeFilesLines
* shader: drop the slots of a failed handle subtree with its codeSssnowyyy31 hours1-4/+13
| | | | | | | | | | | | | | | | When BuildHandleProgram failed on a subtree it truncated the code back to where the subtree started, which removed the Tee ops of the values the subtree had kept, but their entries stayed in g_handle_slots. A Phi tries its other inputs after the first one fails; if one of them reused a value from the dropped subtree, it emitted a Load of a slot that nothing wrote, so the handle read 0. Number slots with a counter instead of counting map entries, and on failure erase the entries numbered from the subtree's first slot on and rewind the counter, so such a value is built again. Follow-up to 561f87abec. Assisted-by: Claude Sonnet 5.5 (implementation and commit message)
* shader: restore the handle build depth when a build throwsSssnowyyy31 hours1-4/+7
| | | | | | | | | | | | | BuildHandleProgram incremented g_handle_depth and decremented it at the end, so a NotImplementedException from BuildHandleNode left the thread-local depth above zero. That thread never cleared g_handle_slots again, and stale IR::Inst* keys from an earlier program could match instructions of a later one (a freed instruction's address can be reused). Do the decrement and the outermost clear in SCOPE_EXIT. Follow-up to e23b0f2fab. Assisted-by: Claude Sonnet 5.5 (implementation and commit message)
* shader: evaluate handle programs for image and texture buffer descriptorsSssnowyyy31 hours1-5/+29
| | | | | | | | | | | | | | | | | | | | 561f87abec only gave TextureDescriptor a handle_program. Image load/store/atomics and texture/image buffers whose handle comes from a storage buffer still got the placeholder constant buffer address (index 0, offset 0), so the pipelines read cbuf 0 word 0 as the handle (and asserted if cbuf 0 was unbound). Add handle_program to TextureBufferDescriptor, ImageBufferDescriptor and ImageDescriptor, compare it when merging, and let all four pipelines evaluate it for every descriptor kind instead of only TextureDescriptor. ImageQueryDimensions on such a handle was always declared Color2D, so array, cube and 3D views got a 2D declaration. The instruction carries no type, so take it from another instruction using the same handle program, falling back to Color2D when there is none. Follow-up to 561f87abec. The OpenGL pipeline edits are the same change as the Vulkan ones but were not compiled here. Assisted-by: Claude Sonnet 5.5 (implementation and commit message)
* shader: tell handle-program textures apart when adding descriptorsSssnowyyy31 hours1-1/+6
| | | | | | | | | | | | | | | | Every texture whose handle is computed per draw gets the same placeholder constant buffer address (index 0, offset 0), and Descriptors::Add did not compare handle_program. Two such textures of the same type and depth in one shader therefore shared a descriptor, so the second sampled the first, and one could also merge with a real texture bound at constant buffer 0 offset 0. Compare handle_program too. The pixel-format-integer lookup cached its last answer by (index, offset), which has the same problem for handle programs; skip that cache for them. Follow-up to 561f87abec. Assisted-by: Claude Sonnet 5.5 (implementation and commit message)
* Merge nx2 into nx2-experimentalkraibse37 hours1-0/+31
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolved by area: - audio feature_support.h: nx2's native revision handling. - fiber.cpp: ours, which also drops the unused rewind stack. - host_memory.cpp: ours granule bitmap and HintCold, plus nx2's fallocate hole punching per whole dirty granule on Linux. - texture_cache.h: nx2's old-age eviction pass, then our Collect(). - kepler_compute.cpp: shared upscale slots, then Fortune's Weave's, then the Kirby Air Riders scan. - nx2_gsv.h: ours, plus nx2's GetBufferMaxResolution and graphics device ids (1-based). - nvhost_ctrl_gpu.cpp: engine support flag bits 40-44. - lower_to_maxwell.h: ours as the base, with nx2's seven lowering commits applied one at a time. Second texture descriptor buffers are read bindless in TEX, TLD.SCR (level zero) and SUST; FSEL keeps its operand modifiers; TXD takes any channel mask. lower_to_maxwell.h lowers 837 Fortune's Weave and 1183 Mario Kart World shader dumps with the same rejects as nx2 and ours (12 and 0). Assisted-by: Claude Sonnet 5.5 (conflict analysis and drafting)
| * shader: keep root table reads the blit constants would zeroDuck9122 days1-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | Fire Emblem: Fortune's Weave's enemy health gauges read only offset 0x40 of root table 0, which is inside the blit parameter block (title 4's zero dither bias). The pass replaced it with zero and the gauges drew black. A shader that reads only words the block leaves zero now keeps its reads: an unbound bank reads zero anyway, and a bound root table keeps its values. Assisted-by: Claude Opus 5.5 (debugging, implementation and drafting) Signed-off-by: Duck912 <350528965+Duck912@users.noreply.github.com>
| * video_core: keep root tables and bind table 0 as constant bank 17Duck9122 days1-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 3D methods 0x504/0x508 write eight 256-byte root tables, which shaders read as constant banks 24-31; NVN2 keeps push constants in table 0 (bank 17 after the Ampere lowering). Fire Emblem: Fortune's Weave keeps its material constants there and never binds bank 17, and the blit constants pass replaced those reads with render-target sizes, flooding its 3D scenes red. Maxwell3D now keeps the tables, the buffer cache streams table 0 as bank 17 when the game has not bound one, and the blit constants pass leaves shaders that read bank 17 outside its parameter block alone. Assisted-by: Claude Opus 5.5 (debugging, implementation and drafting) Signed-off-by: Duck912 <350528965+Duck912@users.noreply.github.com>
* | Merge commit 'e23b0f2fab9014225486beebd82fab8dbc0fe14c' into ↵Takoroka2 days1-12/+14
|\ \ | | | | | | | | | test/linux-all-prs-plus
| * | shader: keep the handle slot map thread-local instead of a pointer to itTakoroka2 days1-12/+14
| | | | | | | | | | | | | | | | | | | | | BuildHandleProgram stored the address of its outermost call's local map in a thread_local pointer for the nested calls, which GCC 15 rejects with -Werror=dangling-pointer. The map itself is thread_local now, and a depth counter tells the outermost call to clear it.
* | | Merge remote-tracking branch 'origin/fix/nx2-storage-buffer-texture-handles' ↵Takoroka2 days1-6/+426
|\| | | | | | | | | | | into test/linux-all-prs
| * | shader: compute texture handles read from storage buffers for each drawTakoroka3 days1-6/+426
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch 2 shaders can read a texture handle from a storage buffer (Switch Sports' scenery: a per-object entry of a table whose pointer is in the driver constant buffer). The bindless handle search looked through the load into its address and returned the table pointer's constant buffer word as the handle, which named an arbitrary descriptor; the game repoints that one at transient render targets every few seconds, so the island and menu lighting flipped between correct, dark and red. The search no longer looks into memory loads. A handle it cannot trace is now built into a small program over constant buffer words, storage buffer words and integer operations (Shader::Info::handle_programs), which the pipelines evaluate when they bind the texture. Handles a single evaluation cannot give (one that changes in a loop) keep the previous search.
* / shader_recompiler: translate Switch 2 task and mesh programsTakoroka2 days1-0/+7
|/ | | | | | | | | | | | | | | | | | | | | | | Mario Kart World draws some of its geometry with NVN task and mesh programs (the task program culls and writes the mesh workgroup count and a payload to its stage buffer; each mesh workgroup reads it back and writes vertices and primitives). Add Task and Mesh stages and translate them for VK_EXT_mesh_shader: - the ISBE pseudo instruction from the lowering becomes reads and writes of an emulated stage buffer: the task's output region is the task payload, the mesh output regions live in workgroup memory - every EXIT of these stages jumps to one final return, so all invocations reach the epilogue: a barrier, then OpEmitMeshTasksEXT, or OpSetMeshOutputsEXT and a copy of the 32-element vertex and primitive groups (lines named by the mesh header's and the pass-through geometry header's output maps) to arrayed and per-primitive outputs - Sirit lacks the two mesh instructions: they are emitted as OpStore markers and replaced after assembly - fragment inputs a mesh program writes per primitive get PerPrimitiveEXT The captured task and mesh programs of the title translate to SPIR-V that spirv-val accepts.
* refactor: move MaskValues to a header file and cleaningMeow4 days2-75/+120
| | | | this issue may appear more than just once, as it is an NVIDIA compiling driver issue
* shader_recompiler: fold max(x, -x) of merged predicate masksvibecodekun4 days1-17/+85
| | | | | | | | | | | | | | Selecting the Special Cup in Mario Kart World lost the Vulkan device on NVIDIA (RTX 3060, driver 621.01). One of its particle vertex shaders takes the abs of a predicate mask as max(x, -x), where the mask was merged from predicated moves: Phi(1 - s, -s) with s = Select(c, 0, 1). FoldSMax32 only folded selects of two constants, so this max reached the driver, and the draw faulted on an invalid instruction pointer. Track the values a mask can take through selects, negations, +/-1 and phis, and fold max(x, -x) to x & 1 when they are only -1, 0 and 1. Assisted-by: Claude Opus 5.5 (debugging, implementation, message draft)
* nx2: log per-call and periodic diagnostic lines at debug levelTakoroka5 days1-1/+1
| | | | | | | | | | | A 9-minute Mario Kart World session wrote 36k log lines at the default level, most of them one per GPU call: nx2:syncpt 201/202 (12k), gpu submit jobs (7k), memory registrations (7k), "Lowered native shader" (1.6k), and 4.7k "Storage buffer tracked without bias" warnings, which every Switch 2 shader hits. These, the texture cache's per-image and per-format detail lines, the 3D image shapes and the per-type VMA lines are now debug level. The once-a-report summary lines (texture cache memory, images created/deleted, VMA heap budget) stay at info.
* Fix MK World crash on initial loading screen for some users (AI-assisted)yumerkiru5 days1-0/+32
|
* shader_recompiler: linear-time breadth-first search; cache storage buffer ↵Takoroka6 days1-2/+20
| | | | | | | | | | | | | | | tracking Translating title 1's 28,102-instruction compute shader took 3.4 s on the GPU thread (a freeze the first time it runs), three quarters of it in GlobalMemoryToStorageBufferPass: - BreadthFirstSearch checked "visited" with a linear scan per argument, quadratic once a search walks thousands of instructions; past 64 it now uses a hash set (same visit order, same result). - The pass searched again for every global memory access; accesses through the same address now share the result (the IR does not change while storage buffers are collected). That shader now takes 0.85 s; other new pipelines also cost less.
* nx2: title 4's cutscene scene renders; blit constants for fragment shadersTakoroka7 days1-2/+5
| | | | | | | | | | | | | - Render area falls back to colour target 0 when the surface clip is unset (Switch 2 titles may never program it); it feeds the synthesized blit block. - BlitConstantsPass also covers fragment shaders: UV clamp rectangle 0..1 (0x30-0x3c) and zero dither bias. - Debug: EDEN_NX2_SKIP_VS=<addr,...>, EDEN_NX2_TRACE_VS=<addr>, EDEN_NX2_UPSCALE_SOURCE[_FORMAT], EDEN_NX2_TRACE_AFTER_UPSCALE, EDEN_NX2_SAMPLE_AT, skipped-draw reasons, clear tracing. Showing the raw HDR scene colour through the upscale fallback gives the correct lit cockpit scene; the game's tonemap pass still outputs black.
* nx2: stand in for title 4's tensor-core upscaler and its blit constantsTakoroka7 days2-0/+64
| | | | | | | | | | | | | | | | - When a compute program is rejected for tensor-core math, blit its input image (handle at cbuf0+0x90) to its output (cbuf0+0xa0) with bilinear filtering. Title 4 renders at 2560x1440 and upscales to 3840x2160 with a DLSS-style network; this keeps the 4K output fed. EDEN_NX2_TENSOR=stub keeps the program with HMMA as D = C (for experiments). - BlitConstantsPass: vertex shaders reading bank 24 (lowered to 17) get the console-provided blit block synthesized from the render area (texel size, size, UV scale 1, rectangle 0..W-1,H-1). - Debug: EDEN_NX2_CB24_TRACE, upscaler resource description and render target sampling at the fallback. The scene behind the intro dialogue is still black: the tonemap output that feeds the upscaler has no colour although earlier targets do.
* [ir] resolve conditional Phi inputs when tracking bindless texture handles ↵xbzk8 days1-16/+71
| | | | | | | | | | | | | | | | | | | | | | (#4551) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md). - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Aimed to fix Ender Magnolia missing shader textures. Main example is Yolvan character bullets. By using windows version of the game, dxvk lib to make it vulkan, and renderdoc, it was possible to capture bullets, and by tracking backward composition and comparing with a similar scene from eden with missing bullets, it was possible to unveil the missing functionality: conditional Phi inputs resolve for bindless handles. By ignoring the boolean predicate register in the shader, handles for these shaders were resolving to some old value instead of proper live conditional ones. TESTS: -Compare Yolvan bullets -Usual roam on main titles for regression check. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4551 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: Shinmegumi <shinmegumi@eden-emu.dev>
* [shader_recompiler, vulkan, qcom, tu] Provide handling to missing shader ↵CamilleLaVey2026-10-143-13/+165
| | | | | | | | | | | | | | | | subgroups on QCOM (#4508) This works provides better emulation on certain GS missing for shader invocation data + geometry pass fallback in qcom/turnip drivers, some of those were provided as community patch by @a.kamaltdinov; which was refined to address the requirements on forced gpu reads; which used to kill some performance on low end devices; now, the stability with some of the graphical problems have been addressed and balanced. Shuffle shaders (SHFFL) are not actually provided on QCOM and turnip drivers, so any game that previously required this stage draw, will now avoid being ignored and tax some performance based on the complexity of the stage draw from now on. This will also address partially some tessellation problems as well. _Special Thanks:_ 1.- @a.kamaltdinov (for the initial patch "early fix for nier" provided for #4325) 2.- @PavelBARABANOV (because the making the cherry-pick easier for a new PR) Co-authored-by: PavelBARABANOV <pavelbarabanov94@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4508 Reviewed-by: lizzie <lizzie@eden-emu.dev> Reviewed-by: crueter <crueter@eden-emu.dev>
* [video_core] Skip fragment shaders with known issues on non-NVIDIA drivers ↵MaranBr2026-10-083-12/+52
| | | | | | | | | | | | | | | (#4503) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Skip fragment shaders using a pattern that is not supported by non-NVIDIA drivers. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4503 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
* [cmake] Fix some macOS compilation errors (#4350)lizzie2026-09-051-11/+0
| | | | | | | | | | | | | | | | | | | | Don't compile GLSL/GLASM backends without OpenGL enabled. These codepaths are unused on non-OpenGL platforms. Fixes other miscellaneous errors that pop up on Clang 23 as well. Signed-off-by: Lizzie lizzie@eden-emu.dev Signed-off-by: crueter crueter@eden-emu.dev - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Co-authored-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4350 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
* [common] Switch to boost::unordered_flat containers (#4326)crueter2026-08-312-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaces all instances of ankerl's unordered map/set with boost's `unordered_flat_*` classes. This uses std::hash since boost::hash is actually a lot slower. Also adds an abstraction layer in `Common` so future changes are quicker and easier. Other implementation details: - ankerl provided hash specializations for tuple and pair, so those were ported here - std::erase_if doesn't work on boost, so just used the ADL'd erase_if This should be about equal or superior performance as unordered_dense for everything except iteration. Signed-off-by: crueter <crueter@eden-emu.dev> - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4326 Reviewed-by: Lizzie and Samuel <lizzie@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
* [vulkan] Implementation for VK_EXT_shader_quad_control (#4168)CamilleLaVey2026-08-281-0/+4
| | | | | | | | An experimental approach to introduce an smarter way to use and access QUAD's capabilities on shaders, suggested by @gidoly some months ago, finally came into something usable; current implementation checks GLASM, GLSL and Vulkan on their own way, stablishes proper emitters and receivers for Quads inside our recompiler, which are the introductions for future changes; checks for support and actual feature bit, OpCodes and mask were added within this PR. Meanwhile the expected behavior was to reduce graphical issues (on games with Quad shaders reliant), we encountered a very slight performance increase depending on what game and shader are actually compiled. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4168 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: Samuel <lizzie@eden-emu.dev>
* [vulkan] 4th Vulkan Global Maintenance (#4212)CamilleLaVey2026-07-162-0/+128
| | | | | | | | | | The approach on this PR moves around refactoring/ updating residual work; main issue was the whole logic behind msaa upload/download images with the constant image copy per pass required; which was gated via shaderStorageImageMultisample, which is not available on all the platforms supported including Android, making them to rely into a more heavier approach to convert msaa image copy into a non msaa image copy, not only losing precision in the conversion, but also creating bugs around the resolve of the image itself, if the supported path had to copy 2 times the same image to be actually presentable, when the fallback was enabled 3 copies were performed, not only decreasing the performance but also increasing race conditions due to the certain capabilities processed in this chain (storage_views). In order to resolve them more naturally, the constant copies were removed from the now "common" path along establishing a proper color resolve for Android and actually making them more direct. Yet this opened a new pack of outdated handling on our current backend; since we now pass msaa images more directly (whenever a game request a msaa type of image/ which seems to be not common + each fragment resolves images on how it's actually required, adding missing depth/stencil), how we often load and store them becomes a critical issue, since our current configuration renderpass/framebuffer forces to always load and load clear whenever a new attachment it's passing through the renderpass, making this really heavier on memory bandwidth limited devices as SteamDeck and others that doesn't rely on the inmediate rendering mode (Tilers vs iGPU); to prevent over allocating data, I had to re-structure part of the current renderpass and framebuffer to actually reuse part of the data/ attachments called, with flags as DON'T_CARE, simplifying partially on how we actually call attachments including their barriers and conditions (occlusion, etc), the DON'T_CARE it's specifically useful to not only prevent calling new loads (which is a flush and heavier on tiler devices) and not only reusing the actual data store, which works on the future time, this saves memory bandwidth and gives space to actually avoid the constant pressure on SYSMEM/GMEM shader resolver path. This maintenance also improved the current removal features logic on QCOM drivers, closing gaps between implementations on descriptors (VK_EXT_indexing_descriptor), adjusting the whole WMEL to avoid being so stricter if certain capabilities are missing to actually use this feature, leading to test and play more on how QCOM drivers are actually behaving; meanwhile the main objective is to open path for a robust and bigger implementation in the future, the changes made here also contains small bug fixes on SPIR-V logic, adding missing cases to resolve shaders (FP64 -> FP16), adding more robustness on how narrow features are actually being used and how to wired them whenever they're not available, meanwhile there are still some issues in regards on how Tegra vs Adreno can preserve unorms at FP32 and FP16, leaving better understanding on base for what VK_EXT_shader_float_controls is actually doing most of the times (flushes NaN's and Denorms equally). Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4212
* [vulkan] 3rd Vulkan Global Maintenance (#4189)CamilleLaVey2026-07-092-3/+30
| | | | | | | | | | 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
* [shader_recompiler/ir] fix potential CBuf collision when count mismatches ↵lizzie2026-07-071-8/+12
| | | | | | | | | | | | | (#4097) this should make disjoint counts be handled as different cbufs for the cbuf cache this fixes TIC asserts on PKZA Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4097 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
* [vk] Clamp dynamic descriptors based on device limits (#4115)lizzie2026-06-302-73/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Should fix this specific crash ``` * thread #82, name = 'GPU', stop reason = Exception 0xc0000005 encountered at address 0x7ff7e5193e89: Access violation reading location 0x00000098 * frame #0: 0x00007ff7e5193e89 eden.exe`std::unique_ptr<Vulkan::Scheduler::CommandChunk,std::default_delete<Vulkan::Scheduler::CommandChunk> >::operator->(this=<unavailable>) at memory:3453 [inlined] frame #1: 0x00007ff7e5193e81 eden.exe`void Vulkan::Scheduler::DispatchWork(this=0x0000000000000000) at vk_scheduler.cpp:146 frame #2: 0x00007ff7e5193d8f eden.exe`void Vulkan::Scheduler::WaitWorker(this=<unavailable>) at vk_scheduler.cpp:133 frame #3: 0x00007ff7e54f472e eden.exe`void Vulkan::UpdateDescriptorQueue::Acquire(this=0x0000026c77cfb4b8) at vk_update_descriptor.cpp:41 frame #4: 0x00007ff7e5537a43 eden.exe`void Vulkan::ASTCDecoderPass::Assemble(this=0x0000026c794fba10, image=0x0000026cfb794850, map=0x00000025e28fcb30, swizzles=<unavailable>) at vk_compute_pass.cpp:603 frame #5: 0x00007ff7e55043e1 eden.exe`void Vulkan::TextureCacheRuntime::AccelerateImageUpload(this=<unavailable>, image=0x0000026cfb794850, map=0x00000025e28fcb30, swizzles=size=10, z_start=0, z_count=0) at vk_texture_cache.cpp:2482 frame #6: 0x00007ff7e5516592 eden.exe`void VideoCommon::TextureCache<struct Vulkan::TextureCacheParams>::UploadImageContents<struct Vulkan::StagingBufferRef>(this=<unavailable>, image=0x0000026cfb794850, staging=0x00000025e28fcb30) at texture_cache.h:1147 frame #7: 0x00007ff7e551523d eden.exe`void VideoCommon::TextureCache<struct Vulkan::TextureCacheParams>::RefreshContents(this=0x0000026c794fd800, image=0x0000026cfb794850, image_id=(index = 3801072224)) at texture_cache.h:1133 frame #8: 0x00007ff7e5517b50 eden.exe`struct Common::SlotId VideoCommon::TextureCache<struct Vulkan::TextureCacheParams>::JoinImages(this=0x0000026c794fd800, info=<unavailable>, gpu_addr=25374426112, cpu_addr=2254181376) at texture_cache.h:1644 frame #9: 0x00007ff7e5516ff6 eden.exe`struct Common::SlotId VideoCommon::TextureCache<struct Vulkan::TextureCacheParams>::InsertImage(this=0x0000026c794fd800, info=0x00000025e28fd270, gpu_addr=25374426112, options=0x0) at texture_cache.h:1513 frame #10: 0x00007ff7e5516a60 eden.exe`struct Common::SlotId VideoCommon::TextureCache<struct Vulkan::TextureCacheParams>::FindOrInsertImage(this=0x0000026c794fd800, info=0x00000025e28fd270, gpu_addr=25374426112, options=0x0) at texture_cache.h:1194 frame #11: 0x00007ff7e5515a13 eden.exe`struct Common::SlotId VideoCommon::TextureCache<struct Vulkan::TextureCacheParams>::CreateImageView(this=0x0000026c794fd800, config=0x00000025e28fd370) at texture_cache.h:1173 frame #12: 0x00007ff7e550cd64 eden.exe`struct Common::SlotId VideoCommon::TextureCache<struct Vulkan::TextureCacheParams>::VisitImageView(this=0x0000026c794fd800, index=4586, compute=<unavailable>) at texture_cache.h:554 frame #13: 0x00007ff7e550d181 eden.exe`void VideoCommon::TextureCache<struct Vulkan::TextureCacheParams>::FillImageViews(this=0x0000026c794fd800, views=size=5, compute=<unavailable>, blacklist=<unavailable>) at texture_cache.h:227 frame #14: 0x00007ff7e58896e4 eden.exe`Vulkan::GraphicsPipeline::ConfigureImpl<Vulkan::(anonymous namespace)::SimpleStorageSpec>(this=0x0000026f865c1a60, is_indexed=<unavailable>) at vk_graphics_pipeline.cpp:415 frame #15: 0x00007ff7e5889479 eden.exe`<lambda_1>::operator(pl=<unavailable>, is_indexed=<unavailable>) at vk_graphics_pipeline.h:123 [inlined] frame #16: 0x00007ff7e5889474 eden.exe`<lambda_1>::__invoke(pl=<unavailable>, is_indexed=<unavailable>) at vk_graphics_pipeline.h:123 frame #17: 0x00007ff7e519d2a8 eden.exe`Vulkan::GraphicsPipeline::Configure(this=0x0000026f865c1a60, is_indexed=<unavailable>) at vk_graphics_pipeline.h:105 [inlined] frame #18: 0x00007ff7e519d29d eden.exe`Vulkan::RasterizerVulkan::PrepareDraw<`lambda at D:\a\g\g\eden-source\src\video_core\renderer_vulkan\vk_rasterizer.cpp:256:29'>(this=0x0000026c764f9368, is_indexed=<unavailable>, draw_func=0x00000025e28fdb80) at vk_rasterizer.cpp:244 frame #19: 0x00007ff7e519d1db eden.exe`void Vulkan::RasterizerVulkan::Draw(this=<unavailable>, is_indexed=<unavailable>, instance_count=<unavailable>) at vk_rasterizer.cpp:256 frame #20: 0x00007ff7e50d9025 eden.exe`void Tegra::HLE_DrawIndexedIndirect::Fallback(this=0x0000026f2af85118, maxwell3d=0x0000026ccbf9eb00, parameters=size=6) at macro.cpp:178 frame #21: 0x00007ff7e50d8f21 eden.exe`void Tegra::HLE_DrawIndexedIndirect::Execute(this=0x0000026f2af85118, maxwell3d=0x0000026ccbf9eb00, parameters=size=6) at macro.cpp:129 frame #22: 0x00007ff7e50db607 eden.exe`Tegra::MacroEngine::Execute::<lambda_0>::operator(this=0x00000025e28fde70, acm= Active Type = Tegra::HLE_DrawIndexedIndirect ) at macro.cpp:1362 frame #23: 0x00007ff7e50dada0 eden.exe`void Tegra::MacroEngine::Execute(this=0x0000026ccbfaa020, maxwell3d=0x0000026ccbf9eb00, method=418, parameters=<unavailable>) at macro.cpp:1392 frame #24: 0x00007ff7e4ef062b eden.exe`void Tegra::Engines::Maxwell3D::CallMacroMethod(this=0x0000026ccbf9eb00, method=<unavailable>, parameters=<unavailable>) at maxwell_3d.cpp:390 frame #25: 0x00007ff7e4ef04be eden.exe`void Tegra::Engines::Maxwell3D::ProcessMacro(this=0x0000026ccbf9eb00, method=<unavailable>, base_start=<unavailable>, amount=5, is_last_call=<unavailable>) at maxwell_3d.cpp:223 frame #26: 0x00007ff7e4ef1673 eden.exe`void Tegra::Engines::Maxwell3D::CallMultiMethod(this=<unavailable>, method=<unavailable>, base_start=0x000001ea398e22f4, amount=<unavailable>, methods_pending=5) at maxwell_3d.cpp:419 frame #27: 0x00007ff7e4ef535a eden.exe`void Tegra::DmaPusher::CallMultiMethod(this=<unavailable>, base_start=0x000001ea398e22f4, num_methods=<unavailable>) const at dma_pusher.cpp:201 frame #28: 0x00007ff7e4ef5023 eden.exe`void Tegra::DmaPusher::ProcessCommands(this=0x0000026ccbfba698, commands=size=36) at dma_pusher.cpp:120 frame #29: 0x00007ff7e4ef4ced eden.exe`bool Tegra::DmaPusher::Step(this=0x0000026ccbfba698) at dma_pusher.cpp:88 frame #30: 0x00007ff7e4ef49f8 eden.exe`void Tegra::DmaPusher::DispatchCalls(this=0x0000026ccbfba698) at dma_pusher.cpp:40 frame #31: 0x00007ff7e4ede797 eden.exe`void Tegra::Control::Scheduler::Push(this=<unavailable>, channel=-493895072, entries=0x00000025e28fe2e0) at scheduler.cpp:31 frame #32: 0x00007ff7e4eedc7b eden.exe`VideoCommon::GPUThread::ThreadManager::StartThread::<lambda_0>::operator(this=<unavailable>, stop_token=stop_token @ 0x00000025e28ffb40) at gpu_thread.cpp:42 [inlined] frame #33: 0x00007ff7e4eedae8 eden.exe`std::invoke(_Obj=<unavailable>, _Arg1=0x0000026ccb3edef0) at type_traits:1680 [inlined] frame #34: 0x00007ff7e4eedac1 eden.exe`std::thread::_Invoke<std::tuple<`lambda at D:\a\g\g\eden-source\src\video_core\gpu_thread.cpp:29:27',std::stop_token>,0,1>(_RawVals=0x0000026ccb3edef0) at thread:60 frame #35: 0x00007ff8e87a37b0 ucrtbase.dll`wcsrchr + 336 ``` Signed-off-by: lizzie <lizzie@eden-emu.dev> Co-authored-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4115 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
* [vulkan] Fix regressions found in last stable release (#3953)CamilleLaVey2026-06-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [vk] fix LM3 and TL:LTD multiple NonUniform annotations (#3997)lizzie2026-05-291-3/+2
| | | | | | | | | | should fix AMD Signed-off-by: lizzie lizzie@eden-emu.dev Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3997 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
* [shader_recompiler] handle dynamic texture descriptor strides (#3898)ryana2026-05-041-12/+117
| | | | | | | | | | | | | | | | this fixes dynamic texture descriptors that are not laid out as simple 8-byte entries tested on steam deck/amd notes - DynamicDescriptorSizeShift called twice because i moved it away from the struct but doing it this way keeps the patch just in this single file than adding a new derived field in the shared struct (i also think its just a cheap recomputation anyways) - removed cbuf scanning because i figured out how to do a bounds check statically credits: - Mythrax <mythrax@mytrax-rs.org> (identified the 1024 descriptor cap fix in #3897) Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3898 Reviewed-by: crueter <crueter@eden-emu.dev>
* [Settings] Add "Enable Legacy Rescale Pass" Toggle (#3582)John2026-02-261-5/+12
| | | | | | | | | | | This PR introduces an optional Legacy Rescale Compatibility Mode that restores the previous rescale‑pass behavior for titles that rely on its quirks. While the new rescale logic is generally more correct, some games exhibit visual issues that the legacy behavior incidentally avoids. Enabling this mode can mitigate line artifacts on AMD GPUs and reduce grey‑texture flickering on Nvidia GPUs in Luigi’s Mansion 3. This is a compatibility workaround rather than a full fix, and should only be used for titles affected by these rare edge‑case rendering problems. Original Logic from MaranBR Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3582 Co-authored-by: John <john@eden-emu.dev> Co-committed-by: John <john@eden-emu.dev>
* [shader_recompiler] Fix Shuffle handling for Position attributes (#3406)MaranBr2026-02-121-3/+7
| | | | | | | | | | This fixes the rescaling path to properly convert to F32, matching native 1x behavior for any resolution. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3406 Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: MaranBr <maranbr@outlook.com> Co-committed-by: MaranBr <maranbr@outlook.com>
* [*] change all std::unordered_map and std::unordered_set into ↵lizzie2026-02-102-5/+11
| | | | | | | | | | | | | | | | | | | ankerl::unordered_dense::map/set variants (#3442) mainly doing this to reduce memory footprint; we all know how nice ankerl::unordered_dense is in theory 4x faster - in practice these maps arent that "hot" anyways so not likely to have much perf gained i just want to reduce mem fragmentation to ease my porting process, plus it helps other platforms as well (ahem weak Mediatek devices) :) Signed-off-by: lizzie <lizzie@eden-emu.dev> Co-authored-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3442 Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [vk] properly handle multithreading with global constants without using TLS ↵lizzie2026-01-221-95/+44
| | | | | | | | | | | | | (#3368) TL;DR basically multiple threads writing to the same memory, now they dont, everyone happy Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3368 Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [texture_pass] Re-Add caching optimization for Texture_Pass (#3356)wildcard2026-01-211-24/+114
| | | | | | | | | | | | | | Caching optimization for Texture_Pass (#481) Add Caching per texture_pass and optimize sorting to single pass. Use Logical shift instead of arithmetic shift. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3356 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: Maufeat <sahyno1996@gmail.com> Co-authored-by: wildcard <nubieluv@gmail.com> Co-committed-by: wildcard <nubieluv@gmail.com>
* [vk, ogl/IR, dynarmic/IR] friendlier IR identity pointer chasing, inline AA ↵lizzie2026-01-201-13/+19
| | | | | | | | | | | | | | passes (#3250) Only merge once we find out wth is causing the crashes [we know it's fsr] This reverts commit 82f9d489e7916318b56dac59fc52efc46fe0df7e. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3250 Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* revert old mocking for bindless textures (#3331)xbzk2026-01-181-16/+1
| | | | | | | | | | | | | | this revert is intended to bring back the original behavior (throw exception) for untracked bindless textures. reason: this was a mock intended to extend ender magnolia's mean time to crash. by reverting it we will be able to identify more games which rely on bindless textures, and avoid to obfuscate visual issues investigation on them. this is super safe to merge. if any game that was benefitting of it gets visual regression, we will know immediately via the throw message in logs. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3331 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: Maufeat <sahyno1996@gmail.com> Co-authored-by: xbzk <xbzk@eden-emu.dev> Co-committed-by: xbzk <xbzk@eden-emu.dev>
* Revert "[vk, ogl/IR, dynarmic/IR] friendlier IR identity pointer chasing, ↵lizzie2026-01-011-19/+13
| | | | | | | | | | | | | | inline AA passes (#2565)" (#3249) FUCK. Fixes crash on Linux and SteamDeck . This reverts commit 46b32b76886b5cd0cfc8dfee1a02c3e83fb1e7d7. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3249 Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [vk, ogl/IR, dynarmic/IR] friendlier IR identity pointer chasing, inline AA ↵lizzie2025-12-311-13/+19
| | | | | | | | | | | | | | | | passes (#2565) - use std::optional instead of std::unique_ptr for the Antialias (FXAA, etc) passes to avoid the extra deref - use a pattern for deferencing the IR pointer chasing loop as suggested on the intel optimization manual - this also removes std::vector<> overhead by using boost::container::small_vector<> (not a silver bullet but in the case of this function reduces access times) Signed-off-by: lizzie <lizzie@eden-emu.dev> Co-authored-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2565 Reviewed-by: Maufeat <sahyno1996@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>
* Revert "[Shader Recompiler] Caching optimization for Texture_Pass (#481)" ↵Ribbit2025-10-281-114/+23
| | | | | | | | | | | | | | (#2859) This commit has some bugs that causes FPS drops, and crashes after playing for more than 1hr+. Needs to be reworked and further tested. Co-authored-by: Ribbit <ribbit@placeholder.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2859 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: Ribbit <ribbit@eden-emu.dev> Co-committed-by: Ribbit <ribbit@eden-emu.dev>
* [common] replace Common::BitCast with libc++ provided one (#2774)lizzie2025-10-221-6/+6
| | | | | | | | | Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2774 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [meta] fix license headers (#2547)lizzie2025-09-212-0/+6
| | | | | | | Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2547 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [Shader Recompiler] Caching optimization for Texture_Pass (#481)wildcard2025-09-171-23/+114
| | | | | | | | | | | Add Caching per texture_pass and optimize sorting to single pass. Use Logical shift instead of arithmetic shift. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/481 Reviewed-by: Shinmegumi <shinmegumi@eden-emu.dev> Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: wildcard <wildcard@eden-emu.dev> Co-committed-by: wildcard <wildcard@eden-emu.dev>
* [cmake] enable clang-cl and WoA builds (#348)lizzie2025-09-093-4/+4
| | | | | | | | | | | | | | 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>
* revert Align and bias memory strongerCamilleLaVey2025-07-111-11/+5
| | | | | | | | | | | revert [ir] Align and bias memory stronger Signed-off-by: Aleksandr Popovich <alekpopo@pm.me> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/229 Co-authored-by: Aleksandr Popovich <alekpopo@pm.me> Co-committed-by: Aleksandr Popovich <alekpopo@pm.me> Reverted as showed up issues with buffers on games that weren't expected, it's going to be refined and implemented again with better params.
* [ir] Align and bias memory strongerAleksandr Popovich2025-07-041-5/+11
| | | | | | | Signed-off-by: Aleksandr Popovich <alekpopo@pm.me> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/229 Co-authored-by: Aleksandr Popovich <alekpopo@pm.me> Co-committed-by: Aleksandr Popovich <alekpopo@pm.me>
* [VK] Rework SPIRV Shader Optimization (#238)Gamer642025-07-031-0/+3
| | | | | | | | The actual SPIRV Shader Optimization option doesn't seem to do anything as long as it isn't vinculed, so let's rework it to make it work Co-authored-by: Gamer64 <76565986+Gamer64ytb@users.noreply.github.com> Co-authored-by: echosys <echosys@noreply.localhost> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/238
* revert 91a662431cfe419bd46b6ca4ed298a4ba70d7820 (#240)CamilleLaVey2025-06-301-2/+18
| | | | | | | | | | | | | | | | | | revert [Texture_cache] Better memory handling for devices with lower memory allocations (#233) Means games like Minecraft Dungeons, Sea of Stars, Luigi Mansion 2, Astroneer, Alan Wake, etc are now playable. It also cleans up the recent abi.cpp and bindless texture commits a bit. Everything is in #ifdef ANDROID - The biggest change is CACHING_PAGEBITS = 12. Without that the way the buffercache grows and joins buffers can cause Android to run out of memory (as you end up with just one big buffer that needs to be copied every time it grows) Also patches up ffmpeg issues. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/233 Co-authored-by: JPikachu <jpikachu.eden@gmail.com> Co-committed-by: JPikachu <jpikachu.eden@gmail.com> Had showed some regressions on devices with higher specifications, will be refined to return as a toggle in a later commit. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/240