aboutsummaryrefslogtreecommitdiff
path: root/src/shader_recompiler/environment.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/fix/nx2-storage-buffer-texture-handles' ↵Takoroka2 days1-0/+1
|\ | | | | | | into test/linux-all-prs
| * shader: compute texture handles read from storage buffers for each drawTakoroka3 days1-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+13
|/ | | | | | | | | | | | | | | | | | | | | | | 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.
* Switch 2: Turing macros, native compute, Ampere shader lowering, native tilingTakoroka7 days1-0/+2
| | | | | | | | | | | | | | | | | From changes.patch: the TU104/GA10x MME interpreter (shared macro context for the process's channels, also on the compute class), native compute with QMD 3.0 dependency scheduling, the Ampere-to-Maxwell shader lowering, native vertex stream sizes, and the console's GOB swizzle for textures, DMA copies and the host unswizzle shaders. Switch 2 channels turn all of it on at init. The lowering is widened for title 4 (all 32 of its programs lower): general TEX (any dimension/LOD/mask, operand split 1+1/2+1/2+2/4+n, any but consistent descriptor buffer), cube/array, SULD channel masks, 128-bit STG, indexed IPA, VOTE, SHFL with any immediate or predicate output, R2P/P2R byte select, uniform ULOP3/ULEA/UBREV/UFLO.SH/UISETP signed/UMOV URZ, IMNMX cbuf, IADD3 and FFMA uniform operands, FMUL /4 /8 x8, and BSSY/BSYNC/BREAK/WARPSYNC as no-ops. The capture stops at unmapped memory. EDEN_NX2_SHADER_DUMP dumps every native program; tools in C:\dev\nx2work test the lowering offline.
* [common] Switch to boost::unordered_flat containers (#4326)crueter2026-08-311-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [shader_recompiler/ir] fix potential CBuf collision when count mismatches ↵lizzie2026-07-071-4/+5
| | | | | | | | | | | | | (#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>
* [*] change all std::unordered_map and std::unordered_set into ↵lizzie2026-02-101-4/+4
| | | | | | | | | | | | | | | | | | | 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-0/+59
| | | | | | | | | | | | | (#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>
* Fix "Propietary" typo elsewhereViktor Szépe2024-01-071-3/+3
|
* shader_recompiler: use float image operations on load/store when requiredLiam2023-12-211-0/+2
|
* Fix shader dumps with nvdisasmKelebek12023-08-031-1/+1
| | | | | skip fragment shaders when rasterizer is disabled initialize env_ptrs
* ShaderCompiler: Inline driver specific constants.Fernando Sahmkow2023-01-031-0/+5
|
* MacroHLE: Final cleanup and fixes.Fernando Sahmkow2023-01-011-2/+2
|
* MacroHLE: Add HLE replacement for base vertex and base instance.Fernando Sahmkow2023-01-011-0/+5
|
* video_core: Fix SNORM texture buffer emulating error (#9001)Feng Chen2022-11-041-0/+2
|
* video_core: Generate mipmap texture by drawingFengChen2022-09-201-0/+2
|
* 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.
* ShaderDecompiler: Add a debug option to dump the game's shaders.Fernando Sahmkow2022-01-041-0/+2
|
* general: Add missing copyright noticesameerj2021-12-051-0/+4
|
* shader: Rework varyings and implement passthrough geometry shadersReinUsesLisp2021-07-221-0/+5
| | | | | | Put all varyings into a single std::bitset with helpers to access it. Implement passthrough geometry shaders using host's.
* shader: Implement D3D samplersReinUsesLisp2021-07-221-1/+1
|
* shader: Implement BRXFernandoS272021-07-221-0/+2
|
* shader: Implement LDS, STS, LDL, and STS and use SPIR-V 1.4 when availableReinUsesLisp2021-07-221-0/+4
|
* shader: Implement TXQ and fix FragDepthReinUsesLisp2021-07-221-0/+3
|
* vk_pipeline_cache: Add pipeline cacheReinUsesLisp2021-07-221-3/+8
|
* shader: Add partial rasterizer integrationReinUsesLisp2021-07-221-0/+14
|
* shader: Initial support for textures and TEXReinUsesLisp2021-07-221-0/+2
|
* shader: Primitive Vulkan integrationReinUsesLisp2021-07-221-1/+5
|
* shader: Initial recompiler workReinUsesLisp2021-07-221-0/+14