aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader
AgeCommit message (Collapse)Author
2023-04-27Move solution and projects to srcTSR Berry
2023-04-27Fix geometry shader layer passthrough regression (#4735)gdkchan
* Fix geometry shader layer passthrough regression * Shader cache version bump
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-04-24Use vector transform feedback outputs with fragment shaders (#4708)gdkchan
* Use vector transform feedback outputs with fragment shaders * Shader cache version bump * Fix missing outputs when vector transform feedback outputs are used
2023-04-22Shader: Bias textureGather instructions on AMD/Intel (#4703)riperiperi
* Experimental (GLSL, forced) * SPIR-V attempt * Add capability * Fix pCount == 1 on glsl * Fix typo
2023-04-05Use index fragment shader output when dual source blend is enabled (#4404)gdkchan
* Use index fragment shader output when dual source blend is enabled * Shader cache version bump * Actually set DualSourceBlendEnabled to true * Fix XML doc --------- Co-authored-by: Ac_K <Acoustik666@gmail.com>
2023-03-04Minor code formatting (#4498)gdkchan
2023-02-25Move gl_Layer to vertex shader if geometry is not supported (#4368)gdkchan
* Set gl_Layer on vertex shader if it's set on the geometry shader and it does nothing else * Shader cache version bump * PR feedback * Fix typo
2023-02-09Fix SPIR-V when all inputs/outputs are indexed (#4389)gdkchan
2023-02-05Insert bitcast for assignment of fragment integer outputs on GLSL (#4369)gdkchan
* Insert bitcast for assignment of fragment integer outputs on GLSL * Shader cache version bump
2023-01-23SPIR-V: Change BitfieldExtract and BitfieldInsert for SPIRV-Cross (#4336)gdkchan
* SPIR-V: Change BitfieldExtract and BitfieldInsert types to make Metal MSL compiler happy * Shader cache version bump
2023-01-21Implement CSET and CSETP shader instructions (#4318)gdkchan
* Implement CSET and CSETP shader instructions * Shader cache version bump * Fix CC.HI
2023-01-18Optimize string memory usage. Use Spans and StringBuilders where possible ↵Andrey Sukharev
(#3933) * Optimize string memory usage. Use ReadOnlySpan<char> and StringBuilder where possible. * Fix copypaste error * Code generator review fixes * Use if statement instead of switch * Code style fixes Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com> * Another code style fix * Styling fix Co-authored-by: Mary-nyan <thog@protonmail.com> * Styling fix Co-authored-by: gdkchan <gab.dark.100@gmail.com> Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com> Co-authored-by: Mary-nyan <thog@protonmail.com> Co-authored-by: gdkchan <gab.dark.100@gmail.com>
2023-01-13Vulkan: Add workarounds for MoltenVK (#4202)riperiperi
* Add MVK basics. * Use appropriate output attribute types * 4kb vertex alignment, bunch of fixes * Add reduced shader precision mode for mvk. * Disable ASTC on MVK for now * Only request robustnes2 when it is available. * It's just the one feature actually * Add triangle fan conversion * Allow NullDescriptor on MVK for some reason. * Force safe blit on MoltenVK * Use ASTC only when formats are all available. * Disable multilevel 3d texture views * Filter duplicate render targets (on backend) * Add Automatic MoltenVK Configuration * Do not create color attachment views with formats that are not RT compatible * Make sure that the host format matches the vertex shader input types for invalid/unknown guest formats * FIx rebase for Vertex Attrib State * Fix 4b alignment for vertex * Use asynchronous queue submits for MVK * Ensure color clear shader has correct output type * Update MoltenVK config * Always use MoltenVK workarounds on MacOS * Make MVK supersede all vendors * Fix rebase * Various fixes on rebase * Get portability flags from extension * Fix some minor rebasing issues * Style change * Use LibraryImport for MVKConfiguration * Rename MoltenVK vendor to Apple Intel and AMD GPUs on moltenvk report with the those vendors - only apple silicon reports with vendor 0x106B. * Fix features2 rebase conflict * Rename fragment output type * Add missing check for fragment output types Might have caused the crash in MK8 * Only do fragment output specialization on MoltenVK * Avoid copy when passing capabilities * Self feedback * Address feedback Co-authored-by: gdk <gab.dark.100@gmail.com> Co-authored-by: nastys <nastys@users.noreply.github.com>
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-29Use vector outputs for texture operations (#3939)gdkchan
* Change AggregateType to include vector type counts * Replace VariableType uses with AggregateType and delete VariableType * Support new local vector types on SPIR-V and GLSL * Start using vector outputs for texture operations * Use vectors on more texture operations * Use vector output for ImageLoad operations * Replace all uses of single destination texture constructors with multi destination ones * Update textureGatherOffsets replacement to split vector operations * Shader cache version bump Co-authored-by: Ac_K <Acoustik666@gmail.com>
2022-12-14Remove Half Conversion (#4106)Isaac Marovitz
* Remove HalfConversion * Update `CodeGenVersion`
2022-12-10Fix Redundant Qualifer Warnings (#4091)Isaac Marovitz
* Fix Redundant Qualifer Warnings * Remove unnecessary using
2022-12-08Fix shader FSWZADD instruction (#4069)gdkchan
* Fix shader FSWZADD instruction * Shader cache version bump
2022-12-08Shader: Implement PrimitiveID (#4067)gdkchan
* Shader: Implement PrimitiveID * Shader cache version bump
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-06Fix storage buffer access when match fails (#4037)gdkchan
* Fix storage buffer access when match fails * Shader cache version bump
2022-12-06Fix shaders with global memory access from unknown locations (#4029)gdkchan
* Fix shaders with global memory access from unknown locations * Shader cache version bump
2022-12-05Restrict shader storage buffer search when match fails (#4011)gdkchan
* Restrict storage buffer search when match fails * Shader cache version bump
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-12-04Allow SNorm buffer texture formats on Vulkan (#3957)gdkchan
* Allow SNorm buffer texture formats on Vulkan * Shader cache version bump
2022-11-30Remove shader dependency on SPV_KHR_shader_ballot and SPV_KHR_subgroup_vote ↵gdkchan
extensions (#3943) * Remove shader dependency on SPV_KHR_shader_ballot and SPV_KHR_subgroup_vote extensions * 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-18Move gl_Layer from vertex to geometry if GPU does not support it on vertex ↵gdkchan
(#3866) * Move gl_Layer from vertex to geometry if GPU does not support it on vertex * Shader cache version bump * PR feedback
2022-11-18SPIR-V: Fix unscaling helper not being able to find Array textures (#3863)riperiperi
The type in the `texOp` in the textureSize instruction doesn't have the exact type on SPIR-V (for example, it is missing the Array flag). This PR gives it the proper type before giving it to the unscaling helper. This fixes the ground textures being broken on Pokemon Scarlet/Violet when scaling. It wasn't finding the texture, so the descriptor index it provided was -1...
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-11-16Use new LINQ Order() methods (#3851)Berkan Diler
2022-11-16Implement HLE macro for DrawElementsIndirect (#3748)gdkchan
* Implement HLE macro for DrawElementsIndirect * Shader cache version bump * Use GL_ARB_shader_draw_parameters extension on OpenGL * Fix DrawIndexedIndirectCount on Vulkan when extension is not supported * Implement DrawIndex * Alignment * Fix some validation errors * Rename BaseIds to DrawParameters * Fix incorrect index buffer and vertex buffer size in some cases * Add HLE macros for DrawArraysInstanced and DrawElementsInstanced * Perform a regular draw when indirect data is not modified * Use non-indirect draw methods if indirect buffer was not GPU modified * Only check if draw parameters match if the shader actually uses them * Expose Macro HLE setting on GUI * Reset FirstVertex and FirstInstance after draw * Update shader cache version again since some people already tested this * PR feedback Co-authored-by: riperiperi <rhy3756547@hotmail.com>
2022-11-12Use vector transform feedback outputs if possible (#3832)gdkchan
2022-11-11Fix VertexId and InstanceId on Vulkan (#3833)gdkchan
* Fix VertexId and InstanceId on Vulkan * Shader cache version bump
2022-11-09infra: Migrate to .NET 7 (#3795)Mary-nyan
* Update readme to mention .NET 7 * infra: Migrate to .NET 7 .NET 7 is still in preview but this prepare for the release coming up next month. * Use Random.Shared in CreateRandom * Move UInt128Utils.cs to Ryujinx.Common project * Fix inverted parameters in System.UInt128 constructor * Fix Visual Studio complains on Ryujinx.Graphics.Vic * time: Fix missing alignment enforcement in SystemClockContext Fixes at least Smash * time: Fix missing alignment enforcement in SteadyClockContext Fix games (like recent version of Smash) using time shared memory * Switch to .NET 7.0.100 release * Enable Tiered PGO * Ensure CreateId validity requirements are meet when doing random generation Also enforce correct packing layout for other Mii structures. This fix a Mario Kart 8 crashes related to the default Miis.
2022-10-29SPIR-V: Fix tessellation control shader output types (#3807)gdkchan
* SPIR-V: Fix tessellation control shader output types * Shader cache version bump
2022-10-21Vulkan: Fix vertex position Z conversion with geometry shader passthrough ↵gdkchan
(#3781) * Vulkan: Fix vertex position Z conversion with geometry shader passthrough * Shader cache version bump
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-03Fix shader SULD (bindless) instruction using wrong register as handle (#3732)gdkchan
* GLSL: Do not generate scale helpers if we have no textures * Fix shader SULD (bindless) instruction using wrong register as handle
2022-10-01Fix incorrect tessellation inputs/outputs (#3728)gdkchan
* Fix incorrect tessellation inputs/outputs * Shader cache version bump
2022-09-19Allow bindless textures with handles from unbound constant buffer (#3706)gdkchan
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-10Do not output ViewportIndex on SPIR-V if GPU does not support it (#3644)gdkchan
* Do not output ViewportIndex on SPIR-V if GPU does not support it * Bump shader cache version
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-08-20Use RGBA16 vertex format if RGB16 is not supported on Vulkan (#3552)gdkchan
* Use RGBA16 vertex format if RGB16 is not supported on Vulkan * Catch all shader compilation exceptions
2022-08-18Removed unused usings. (#3593)Nicholas Rodine
* Removed unused usings. * Added back using, now that it's used. * Removed extra whitespace.
2022-08-18Fix SpirV parse failure (#3597)Nicholas Rodine
* Added .ToString overrides, to help diagnose and debug SpirV generated code. * Added Spirv to team shared dictionary, so the word will not show up as a warning. * Fixed bug where we were creating invalid constants (bool 0i and float 0i) * Update Ryujinx.Graphics.Shader/CodeGen/Spirv/CodeGenContext.cs Co-authored-by: gdkchan <gab.dark.100@gmail.com> * Update Spv.Generator/Instruction.cs Co-authored-by: gdkchan <gab.dark.100@gmail.com> * Adjusted spacing to match style of the rest of the code. * Added handler for FP64(double) as well, for undefined aggregate types. * Made the operand labels a static dictionary, to avoid re-allocation on each call. Replaced Contains/Get with a TryGetValue, to reduce the number of dictionary lookups. * Added newline between AllOperands and ToString(). Co-authored-by: gdkchan <gab.dark.100@gmail.com>
2022-08-17Removed extra semicolons. (#3594)Nicholas Rodine
2022-08-02Fix geometry shader passthrough fallback being used when feature is ↵gdkchan
supported (#3525) * Fix geometry shader passthrough fallback being used when feature is supported * Shader cache version bump