aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/Translation/Optimizations
AgeCommit message (Collapse)Author
2023-04-27Move solution and projects to srcTSR Berry
2023-04-25Refactor attribute handling on the shader generator (#4565)gdkchan
* Refactor attribute handling on the shader generator * Implement gl_ViewportMask[] * Add back the Intel FrontFacing bug workaround * Fix GLSL transform feedback outputs mistmatch with fragment stage * Shader cache version bump * Fix geometry shader recognition * PR feedback * Delete GetOperandDef and GetOperandUse * Remove replacements that are no longer needed on GLSL compilation on Vulkan * Fix incorrect load for per-patch outputs * Fix build
2023-01-04IPC refactor part 3+4: New server HIPC message processor (#4188)gdkchan
* IPC refactor part 3 + 4: New server HIPC message processor with source generator based serialization * Make types match on calls to AlignUp/AlignDown * Formatting * Address some PR feedback * Move BitfieldExtensions to Ryujinx.Common.Utilities and consolidate implementations * Rename Reader/Writer to SpanReader/SpanWriter and move to Ryujinx.Common.Memory * Implement EventType * Address more PR feedback * Log request processing errors since they are not normal * Rename waitable to multiwait and add missing lock * PR feedback * Ac_K PR feedback
2022-12-14Remove Half Conversion (#4106)Isaac Marovitz
* Remove HalfConversion * Update `CodeGenVersion`
2022-12-06Shader: Add fallback for LDG from "ube" buffer ranges. (#4027)riperiperi
We have a conversion from LDG on the compute shader to a special constant buffer binding that's used to exceed hardware limits on compute, but it was only running if the byte offset could be identified. The fallback that checks all of the bindings at runtime only checks the storage buffers. This PR adds checking ube ranges to the LoadGlobal fallback. This extends the changes in #4011 to only check ube entries which are accessed by the shader. Fixes particles affected by the wind in The Legend of Zelda: Breath of the Wild. May fix other weird issues with compute shaders in some games. Try a bunch of games and drivers to make sure they don't blow up loading constants willynilly from searchable buffers.
2022-12-05Restrict shader storage buffer search when match fails (#4011)gdkchan
* Restrict storage buffer search when match fails * Shader cache version bump
2022-11-25Fix CB0 alignment with addresses used for 8/16-bit LDG/STG (#3897)riperiperi
This replacement is meant to be done with the original identified byteOffset, not the one assigned later on by the below conditionals (that already has the constant offset added, for instance). This fixes videos being pixelated in Xenoblade 3, and other regressions that might have happened since #3847.
2022-11-17GPU: Eliminate CB0 accesses when storage buffer accesses are resolved (#3847)riperiperi
* Eliminate CB0 accesses Still some work to do, decouple from hle? * Forgot the important part somehow * Fix and improve alignment test * Address Feedback * Remove some complexity when checking storage buffer alignment * Update Ryujinx.Graphics.Shader/Translation/Optimizations/GlobalToStorage.cs Co-authored-by: gdkchan <gab.dark.100@gmail.com> Co-authored-by: gdkchan <gab.dark.100@gmail.com>
2022-09-13Fix bindless 1D textures having a buffer type on the shader (#3697)gdkchan
* Fix bindless 1D textures having a buffer type on the shader * Shader cache version bump
2022-09-07Transform shader LDC into constant buffer access if offset is constant (#3672)gdkchan
* Transform shader LDC into constant buffer access if offset is constant * Shader cache version bump
2022-07-23Avoid adding shader buffer descriptors for constant buffers that are not ↵gdkchan
used (#3478) * Avoid adding shader buffer descriptors for constant buffers that are not used * Shader cache version
2022-07-12Propagate Shader phi nodes with the same source value from all blocks (#3457)gdkchan
* Propagate Shader phi nodes with the same source value from all incoming blocks * Shader cache version bump
2022-07-02Bindless elimination for constant sampler handle (#3424)gdkchan
* Bindless elimination for constant sampler handle * Shader cache version bump * Update TextureHandle.ReadPackedId for new bindless elimination
2021-11-08Fix bindless/global memory elimination with inverted predicates (#2826)gdkchan
* Fix bindless/global memory elimination with inverted predicates * Shader cache version bump
2021-10-24Preserve image types for shader bindless surface instructions (.D variants) ↵gdkchan
(#2779) * Preserve image types for SULD/SUST .D variants * Make format unknown for surface atomic if bindless and not sized
2021-10-18Fix shader 8-bit and 16-bit STS/STG (#2741)gdkchan
* Fix 8 and 16-bit STG * Fix 8 and 16-bit STS * Shader cache version bump
2021-10-17Extend bindless elimination to work with masked and shifted handles (#2727)gdkchan
* Extent bindless elimination to work with masked handles * Extend bindless elimination to catch shifted pattern, refactor handle packing/unpacking
2021-09-02Fix TXQ for 3D textures. (#2613)riperiperi
* Fix TXQ for 3D textures. Assumes the texture is 3D if the component mask contains Z. This fixes a bug in UE4 games where parts of the map had garbage pointers to lighting voxels, as the lookup 3D texture was not being initialized. Most notable game is THPS1+2. May need another PR to keep image store data alive and properly flush it in order using the AutoDeleteCache. * Get sampler type for TextureSize from bound textures.
2021-08-31Implement Shader Instructions SUATOM and SURED (#2090)riperiperi
* Initial Implementation * Further improvements (no support for float/64-bit types) * Merge atomic and reduce instructions, add missing format switch * Fix rebase issues. * Not used. * Whoops. Fixed. * Partial implementation of inc/dec, cleanup and TODOs * Remove testing path * Address Feedback
2021-08-11Workaround for Intel FrontFacing built-in variable bug (#2540)gdkchan
2021-06-20Fix separate bindless sampler at offset 0 (#2360)gdkchan
2021-06-09Support bindless textures with separate constant buffers for texture and ↵gdkchan
sampler (#2339)
2021-06-03Fix shaders with mixed PBK and SSY addresses on the stack (#2329)gdkchan
* Fix shaders with mixed PBK and SSY addresses on the stack * Address PR feedback and nits
2021-05-19Move shader resource descriptor creation out of the backend (#2290)gdkchan
* Move shader resource descriptor creation out of the backend * Remove now unused code, and other nits * Shader cache version bump * Nits * Set format for bindless image load/store * Fix buffer write flag
2021-05-19Pass CbufSlot when getting info from the texture descriptor (#2291)riperiperi
* Pass CbufSlot when getting info from the texture descriptor Fixes some issues with bindless textures, when CbufSlot is not equal to the current TextureBufferIndex. Specifically fixes a random chance of full screen colour flickering in Super Mario Party. * Apply suggestions from code review Oops Co-authored-by: gdkchan <gab.dark.100@gmail.com> Co-authored-by: gdkchan <gab.dark.100@gmail.com>
2021-04-18Improve shader global memory to storage pass (#2200)gdkchan
* Improve shader global memory to storage pass * Formatting and more comments * Shader cache version bump
2021-03-09Traverse PhiNodes for Bindless Elimination (#2089)riperiperi
This allows bindless handles to be found for image/texture instructions with predicates, when the assignment of the texture handle is within the same predicate. This seems to cover the remaining bindless handles that compilers seem to be creating due to optimizations. Will affect newer UE4 games, and games by NdCube (Super Mario Party, Clubhouse Games)
2021-02-01Use multiple dest operands for shader call instructions (#1975)gdkchan
* Use multiple dest operands for shader call instructions * Passing opNode is no longer needed
2021-01-28Support multiple destination operands on shader IR and shuffle predicates ↵gdkchan
(#1964) * Support multiple destination operands on shader IR and shuffle predicates * Cache version change
2020-11-09Simplify logic for bindless texture handling (#1667)gdkchan
* Simplify logic for bindless texture handling * Nits
2020-10-25Implement CAL and RET shader instructions (#1618)gdkchan
* Add support for CAL and RET shader instructions * Remove unused stuff * Fix a bug that could cause the wrong values to be passed to a function * Avoid repopulating function id dictionary every time * PR feedback * Fix vertex shader A/B merge
2020-07-04Implement shader LEA instruction and improve bindless image load/store (#1355)gdkchan
2020-05-27Support separate textures and samplers (#1216)gdkchan
* Support separate textures and samplers * Add missing bindless flag, fix SNORM format on buffer textures * Add missing separation * Add comments about the new handles
2020-05-06Refactor shader GPU state and memory access (#1203)gdkchan
* Refactor shader GPU state and memory access * Fix NVDEC project build * Address PR feedback and add missing XML comments
2020-03-03Initial support for double precision shader instructions. (#963)gdkchan
* Implement DADD, DFMA and DMUL shader instructions * Rename FP to FP32 * Correct double immediate * Classic mistake
2020-02-14Update bindless to indexed conversion code pattern match (#938)gdkchan
* Update bindless to indexed conversion code pattern match * Correct index shift
2020-02-11Support compute uniform buffers emulated with global memory (#924)gdkchan
2020-01-09Address PR feedbackgdkchan
Removes a useless null check Aligns some values to improve readability
2020-01-09Support texture rectangle targets (non-normalized coords)gdkchan
2020-01-09Add a pass to turn global memory access into storage access, and do all ↵gdk
storage related transformations on IR
2020-01-09Add ATOMS, LDS, POPC, RED, STS and VOTE shader instructions, start changing ↵gdk
the way how global memory is handled
2020-01-09Remove some unused constants and other codegdk
2020-01-09Add partial support for array of samplers, and add pass to identify them ↵gdk
from bindless texture accesses
2020-01-09Implement BFI, BRK, FLO, FSWZADD, PBK, SHFL and TXD shader instructions, ↵gdk
misc. fixes
2020-01-09Initial workgdk