aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/Decoders/Decoder.cs
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
2022-12-05Make structs readonly when applicable (#4002)Andrey Sukharev
* Make all structs readonly when applicable. It should reduce amount of needless defensive copies * Make structs with trivial boilerplate equality code record structs * Remove unnecessary readonly modifiers from TextureCreateInfo * Make BitMap structs readonly too
2022-10-15Improve shader BRX instruction code generation (#3759)gdkchan
* Improve shader BRX instruction code generation * Shader cache version bump, add some comments and asserts
2022-10-01Fix incorrect tessellation inputs/outputs (#3728)gdkchan
* Fix incorrect tessellation inputs/outputs * Shader cache version bump
2022-07-23Fix decoding of block after shader BRA.CC instructions without predicate (#3472)gdkchan
* Fix decoding of block after BRA.CC instructions without predicate * Shader cache version bump
2022-04-10New shader cache implementation (#3194)gdkchan
* New shader cache implementation * Remove some debug code * Take transform feedback varying count into account * Create shader cache directory if it does not exist + fragment output map related fixes * Remove debug code * Only check texture descriptors if the constant buffer is bound * Also check CPU VA on GetSpanMapped * Remove more unused code and move cache related code * XML docs + remove more unused methods * Better codegen for TransformFeedbackDescriptor.AsSpan * Support migration from old cache format, remove more unused code Shader cache rebuild now also rewrites the shared toc and data files * Fix migration error with BRX shaders * Add a limit to the async translation queue Avoid async translation threads not being able to keep up and the queue growing very large * Re-create specialization state on recompile This might be required if a new version of the shader translator requires more or less state, or if there is a bug related to the GPU state access * Make shader cache more error resilient * Add some missing XML docs and move GpuAccessor docs to the interface/use inheritdoc * Address early PR feedback * Fix rebase * Remove IRenderer.CompileShader and IShader interface, replace with new ShaderSource struct passed to CreateProgram directly * Handle some missing exceptions * Make shader cache purge delete both old and new shader caches * Register textures on new specialization state * Translate and compile shaders in forward order (eliminates diffs due to different binding numbers) * Limit in-flight shader compilation to the maximum number of compilation threads * Replace ParallelDiskCacheLoader state changed event with a callback function * Better handling for invalid constant buffer 1 data length * Do not create the old cache directory structure if the old cache does not exist * Constant buffer use should be per-stage. This change will invalidate existing new caches (file format version was incremented) * Replace rectangle texture with just coordinate normalization * Skip incompatible shaders that are missing texture information, instead of crashing This is required if we, for example, support new texture instruction to the shader translator, and then they allow access to textures that were not accessed before. In this scenario, the old cache entry is no longer usable * Fix coordinates normalization on cubemap textures * Check if title ID is null before combining shader cache path * More robust constant buffer address validation on spec state * More robust constant buffer address validation on spec state (2) * Regenerate shader cache with one stream, rather than one per shader. * Only create shader cache directory during initialization * Logging improvements * Proper shader program disposal * PR feedback, and add a comment on serialized structs * XML docs for RegisterTexture Co-authored-by: riperiperi <rhy3756547@hotmail.com>
2022-03-06Only initialize shader outputs that are actually used on the next stage (#3054)gdkchan
* Only initialize shader outputs that are actually used on the next stage * Shader cache version bump
2022-01-10Implement IMUL, PCNT and CONT shader instructions, fix FFMA32I and HFMA32I ↵gdkchan
(#2972) * Implement IMUL shader instruction * Implement PCNT/CONT instruction and fix FFMA32I * Add HFMA232I to the table * Shader cache version bump * No Rc on Ffma32i
2021-11-08Support shader gl_Color, gl_SecondaryColor and gl_TexCoord built-ins (#2817)gdkchan
* Support shader gl_Color, gl_SecondaryColor and gl_TexCoord built-ins * Shader cache version bump * Fix back color value on fragment shader * Disable IPA multiplication for fixed function attributes and back color selection
2021-10-28Add support for fragment shader interlock (#2768)gdkchan
* Support coherent images * Add support for fragment shader interlock * Change to tree based match approach * Refactor + check for branch targets and external registers * Make detection more robust * Use Intel fragment shader ordering if interlock is not available, use nothing if both are not available * Remove unused field
2021-10-18Initial tessellation shader support (#2534)gdkchan
* Initial tessellation shader support * Nits * Re-arrange built-in table * This is not needed anymore * PR feedback
2021-10-12Rewrite shader decoding stage (#2698)gdkchan
* Rewrite shader decoding stage * Fix P2R constant buffer encoding * Fix PSET/PSETP * PR feedback * Log unimplemented shader instructions * Implement NOP * Remove using * PR feedback
2021-08-27Initial support for shader attribute indexing (#2546)gdkchan
* Initial support for shader attribute indexing * Support output indexing too, other improvements * Fix order * Address feedback
2021-08-11Make sure attributes used on subsequent shader stages are initialized (#2538)gdkchan
2021-08-11Use a new approach for shader BRX targets (#2532)gdkchan
* Use a new approach for shader BRX targets * Make shader cache actually work * Improve the shader pattern matching a bit * Extend LDC search to predecessor blocks, catches more cases * Nit * Only save the amount of constant buffer data actually used. Avoids crashes on partially mapped buffers * Ignore Rd on predicate instructions, as they do not have a Rd register (catches more cases)
2021-06-15End shader decoding when reaching a block that starts with an infinite loop ↵riperiperi
(after BRX) (#2367) * End shader decoding when reaching an infinite loop The NV shader compiler puts these at the end of shaders. * Update shader cache version
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-03-27Shader Cache: Move bindless checking from translation to decode (#2145)mageven
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-10-21Get rid of Reflection.Emit dependency on CPU and Shader projects (#1626)gdkchan
* Get rid of Reflection.Emit dependency on CPU and Shader projects * Remove useless private sets * Missed those due to the alignment
2020-10-03Improve BRX target detection heuristics (#1591)gdkchan
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-29Move the OpActivator to OpCodeTable class for improve performance (#1001)Chenj168
* Move the OpActivator to OpCodeTable class, for reduce the use of ConcurrentDictionary * Modify code style.
2020-03-06Fix branch with CC and predicate, and a case of SYNC propagation (#967)jduncanator
2020-01-13Add a GetSpan method to the memory manager and use it on GPU (#877)gdkchan
2020-01-09Address PR feedbackgdkchan
Removes a useless null check Aligns some values to improve readability
2020-01-09Make the shader translator more error resilientgdk
2020-01-09Add missing check for BRX, do not add a out of bounds block to the queuegdk
2020-01-09Add partial support for the BRX shader instructiongdk
2020-01-09Implement BFI, BRK, FLO, FSWZADD, PBK, SHFL and TXD shader instructions, ↵gdk
misc. fixes
2020-01-09Initial workgdk