aboutsummaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [vulkan] 4th Vulkan Global Maintenance (#4212)CamilleLaVey2026-07-161-13/+84
| | | | | | | | | | 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-091-18/+45
| | | | | | | | | | 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
* [*] basic in-house cpp linting (#4039)lizzie2026-06-041-1/+1
| | | | | | | | | | | | - 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>
* [vk] fix LM3 and TL:LTD multiple NonUniform annotations (#3997)lizzie2026-05-291-41/+17
| | | | | | | | | | 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>
* [spirv] mark sampled image descriptor indices non-uniform (#3900)ryana2026-05-041-5/+46
| | | | | | | | | | | fixes incorrect texture selection on vk when shaders use per-pixel descriptor indices, in line with #3898 so dynamic descs are no longer treated as uniform also fixes TD;LTD spotty grass issue on SD not addressed by above pr you can test out all the fixes here: https://git.eden-emu.dev/may/eden/src/branch/may/integrate-texture-descriptor-fixes Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3900 Reviewed-by: crueter <crueter@eden-emu.dev>
* [shader_recompiler] Fix IsScaled dynamic indexing reading wrong bit source ↵MaranBr2026-04-061-1/+6
| | | | | | | | | | | | (#3789) The non-immediate path in IsScaled was incorrectly using index_value as the source for OpBitFieldUExtract, instead of loading the corresponding word from the push constant bitmask. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3789 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: MaranBr <maranbr@outlook.com> Co-committed-by: MaranBr <maranbr@outlook.com>
* [vulkan] Fix incorrect offset application for Array2D textures (#3696)wildcard2026-03-081-2/+2
| | | | | | | | | | Earlier we were taking the coords and adding them to coords instead of actually taking offsets and adding it to coord Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3696 Reviewed-by: MaranBr <maranbr@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>
* [shader_recompiler] Implement indirect image/texture array indexing (#3608)JPikachu2026-02-231-8/+16
| | | | | | | | | | | | | Fixes missing textures in Luigi's Mansion 3 (Invisible Mice lol) and potentially other titles by implementing OpAccessChain indexing into descriptor arrays instead of throwing NotImplementedException. Co-authored-by: JPikachu <fakemail@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3608 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: JPikachu <jpikachu@eden-emu.dev> Co-committed-by: JPikachu <jpikachu@eden-emu.dev>
* [vk] change UInt32->Int32 being used as texture gather offsets (#3404)lizzie2026-01-291-8/+5
| | | | | | | | | | | | | "So, found another macOS crash while testing Luigi's mansion 2. It looks like Metal is pretty picky about types and was crashing because the texture gather offsets were being passed as unsigned integers instead of signed ones. I made a small tweak to the shader recompiler to force them to be signed, and the game boots fine now. Most other drivers usually handle signed offsets anyway, so it should be a safe fix for everyone." - rayman Authored-by: rayman Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3404 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>
* [android, feat] add "Fix Bloom Effects" toggle (#3359)PavelBARABANOV2026-01-261-3/+14
| | | | | | | | | | | | | - Toggle partially removes blur in Link's Awakening (LA) and Echoes of Wisdom (EOW) for turnip and stock drivers from A7XX and below. - Burnout screen blur fix is now controlled by this toggle Co-authored-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3359 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: PavelBARABANOV <pavelbarabanov94@gmail.com> Co-committed-by: PavelBARABANOV <pavelbarabanov94@gmail.com>
* shader_recompiler: fix non-const offset for arrayed image typesLiam2024-02-151-4/+10
|
* Revert "shader_recompiler: use only ConstOffset for OpImageFetch"Liam2024-02-151-5/+36
| | | | This reverts commit d69e462d13294086063cea93a91da1cfd991184f.
* shader_recompiler: use only ConstOffset for OpImageFetchLiam2024-02-051-36/+5
|
* shader_recompiler: fix Offset operand usage for non-OpImage*GatherLiam2024-01-111-22/+54
|
* shader_recompiler: use float image operations on load/store when requiredLiam2023-12-211-6/+16
|
* shader_recompiler: Fix spelling of "derivate" (#12067)Ameer J2023-11-181-28/+28
|
* shader_recompiler: skip sampler for buffer textures (#11435)liamwhite2023-09-141-3/+1
|
* shader_recompiler: fix emulation of 3D textureGradLiam2023-09-011-2/+33
|
* shader_recompiler: Use vector arithmetic rather than component-wise in ↵Wollnashorn2023-04-081-18/+9
| | | | | | ImageGatherSubpixelOffset Should be more efficient and better readable
* shader_recompiler: Add subpixel offset for correct rounding at `ImageGather`Wollnashorn2023-04-081-0/+39
| | | | | | | On AMD a subpixel offset of 1/512 of the texel size is applied to the texture coordinates at a ImageGather call to ensure the rounding at the texel centers is done the same way as in Maxwell or other Nvidia architectures. See https://www.reedbeta.com/blog/texture-gathers-and-coordinate-precision/ for more details why this might be necessary. This should fix shadow artifacts at object edges in Zelda: Breath of the Wild (#9957, #6956).
* spirv: Fix TXQ with MSAA texturesameerj2023-01-291-8/+17
|
* shader_recompiler: TXQ: Skip QueryLevels when possibleameerj2023-01-281-2/+4
|
* spirv: fix multisampled image fetchLiam2023-01-231-0/+4
|
* video_code: support rectangle textureFengChen2022-08-251-0/+1
|
* general: Convert source file copyright comments over to SPDXMorph2022-04-231-3/+2
| | | | | This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
* emit_spirv: Reduce emit_spirv.h include overheadameerj2021-12-051-0/+1
| | | | emit_spirv.h is included in video_core, which was propagating further includes that video_core did not depend on.
* shader, video_core: Fix GCC build errorsameerj2021-11-161-4/+0
|
* shader: Properly scale image reads and add GL SPIR-V supportReinUsesLisp2021-11-161-21/+53
| | | | Thanks for everything!
* spirv: Implement rescaling patchingReinUsesLisp2021-11-161-2/+24
|
* shader: Add IsTextureScaled opcodeReinUsesLisp2021-11-161-0/+4
|
* emit_spirv_image: Fix depth image implicit lod sample in computeameerj2021-10-171-5/+16
| | | | Ensures all drivers behave the same way in this case.
* shader_recompiler, video_core: Resolve clang errorslat9nq2021-07-221-5/+10
| | | | | | | | | | Silences the following warnings-turned-errors: -Wsign-conversion -Wunused-private-field -Wbraced-scalar-init -Wunused-variable And some other errors
* shader: Add loggingReinUsesLisp2021-07-221-2/+2
|
* spirv: Fix image and image buffer descriptor index usageReinUsesLisp2021-07-221-5/+7
|
* glasm: Implement TEX and TEXS instructionsReinUsesLisp2021-07-221-4/+4
| | | | | Remove lod clamp from texture instructions with lod, as this is not needed (nor supported).
* Move SPIR-V emission functions to their own headerReinUsesLisp2021-07-221-0/+1
|
* spirv: Only add image operands mask when neededReinUsesLisp2021-07-221-5/+9
|
* spirv: Workaround image unsigned offset bugReinUsesLisp2021-07-221-5/+5
| | | | | Workaround bug on Nvidia's OpenGL SPIR-V compiler when using unsigned texture offsets.
* shader: Implement indexed texturesReinUsesLisp2021-07-221-24/+34
|
* spirv: Replace Constant/ConstantComposite with Const helperameerj2021-07-221-14/+9
|
* spirv: Fix implicit lod typeReinUsesLisp2021-07-221-1/+1
|
* spirv: Use explicit lods outside of fragment shadersReinUsesLisp2021-07-221-5/+16
|
* spirv: Use ConstOffset instead of Offset when possibleReinUsesLisp2021-07-221-17/+46
|
* spirv: Implement image buffersReinUsesLisp2021-07-221-1/+2
|
* spirv: Guard against typeless image reads on unsupported devicesReinUsesLisp2021-07-221-0/+4
|
* shader: Implement SULD and SUSTReinUsesLisp2021-07-221-7/+39
|
* shader: Address feedback + clang formatlat9nq2021-07-221-4/+0
|
* shader_recompiler,video_core: Cleanup some GCC and Clang errorslat9nq2021-07-221-4/+7
| | | | | | | | | | | | | | | | | Mostly fixing unused *, implicit conversion, braced scalar init, fpermissive, and some others. Some Clang errors likely remain in video_core, and std::ranges is still a pertinent issue in shader_recompiler shader_recompiler: cmake: Force bracket depth to 1024 on Clang Increases the maximum fold expression depth thread_worker: Include condition_variable Don't use list initializers in control flow Co-authored-by: ReinUsesLisp <reinuseslisp@airmail.cc>
* shader: Fix TextureGradReinUsesLisp2021-07-221-1/+1
|
* shader: Implement texture buffersReinUsesLisp2021-07-221-5/+19
|