aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Gpu
AgeCommit message (Collapse)Author
2024-09-19Shader: Assume the only remaining source is the right one when all others ↵gdkchan
are undefined (#7331) * Shader: Assume the only remaining source is the right one when all other are undefined * Shader cache version bump * Improve comment
2024-09-19Add support for sampler sRGB disable (#7312)gdkchan
2024-09-18Replace passing by IMemoryOwner<byte> with passing by concrete ↵jhorv
MemoryOwner<byte> (#7171) * refactor(perf): pass MemoryOwner<byte> around as itself rather than IMemoryOwner<byte> * fix(perf): get span via MemoryOwner<byte>.Span property instead of through Memory property * fix: incorrect comment change
2024-09-18Implement support for shader ATOM.EXCH instruction (#7320)gdkchan
* Implement support for shader ATOM.EXCH instruction * Shader cache version bump * Check type
2024-09-17Change image format view handling to allow view incompatible formats (#7311)gdkchan
* Allow creating texture aliases on texture pool * Delete old image format override code * New format incompatible alias * Missing bounds check * GetForBinding now takes FormatInfo * Make FormatInfo struct more compact
2024-09-15Implement fast DMA texture to texture copy (#7299)gdkchan
* Implement fast DMA texture to texture copy * PR feedback
2024-09-01Fix incorrect depth texture 3D flag (#7262)gdkchan
2024-08-31Make HLE project AOT friendly (#7085)Emmanuel Hansen
* add hle service generator remove usage of reflection in device state * remove rd.xml generation * make applet manager reflection free * fix typos * fix encoding * fix style report * remove rogue generator reference * remove double assignment
2024-08-21Fix NRE when using buffer image array (#7159)gdkchan
2024-08-12Clamp amount of mipmap levels to max allowed for all backends (#7197)gdkchan
* Clamp amount of mipmap levels to max allowed for all backends * XML docs * Remove using
2024-08-03replace ByteMemoryPool usage in Ryujinx.Graphics (#7129)jhorv
* chore: replace `ByteMemoryPool` usage with `MemoryOwner<byte>` * refactor: `PixelConverter.ConvertR4G4ToR4G4B4A4()` - rename old `outputSpan` to `outputSpanUInt16`, reuse same output `Span<byte>` as newly-freed name `outputSpan` * eliminate temporary buffer allocations * chore, perf: use MemoryOwner<byte> instead of IMemoryOwner<byte>
2024-07-30Fix shader RegisterUsage pass only taking first operation dest into account ↵gdkchan
(#7131) * Fix shader RegisterUsage pass only taking first operation dest into account * Shader cache version bump
2024-07-17Vulkan: Defer guest barriers, and improve image barrier timings (#7012)riperiperi
* More guarantees for buffer correct placement, defer guest requested buffers * Split RP on indirect barrier rn * Better handling for feedback loops. * Qualcomm barriers suck too * Fix condition * Remove unused field * Allow render pass barriers on turnip for now
2024-06-16Extend bindless elimination to catch a few more specific cases (#6921)gdkchan
* Catch more cases on bindless elimination * Match blocks with the same comparison condition * Shader cache version bump
2024-06-02Vulkan separate descriptor set fixes (#6895)gdkchan
* Ensure descriptor sets are only re-used when all command buffers using it have completed * Fix some SPIR-V capabilities * Set update after bind flag if we exceed limits * Simpler fix for Intel * Format whitespace * Make struct readonly * Add barriers for extra set arrays too
2024-06-02Avoid inexact read with 'Stream.Read' (#6847)Marco Carvalho
2024-05-26Vulkan: Extend full bindless to cover cases with phi nodes (#6853)gdkchan
* Key textures using set and binding (rather than just binding) * Extend full bindless to cover cases with phi nodes * Log error on bindless access failure * Shader cache version bump * Remove constant buffer match to reduce the chances of full bindless triggering * Re-enable it for constant buffers, paper mario does actually need it * Format whitespace
2024-05-26misc: Change disk shader cache compression algorithm to `Brotli` (RFC 7932) ↵MutantAura
(#6841) * Prefer `Brotli` compression for disk shader cache. * Final default case for decompression switch. * Prefer fastest compression.
2024-05-26Allow texture arrays to use separate descriptor sets on Vulkan (#6870)gdkchan
* Report base and extra sets from the backend * Pass texture set index everywhere * Key textures using set and binding (rather than just binding) * Start using extra sets for array textures * Shader cache version bump * Separate new commands, some PR feedback * Introduce new manual descriptor set reservation method that prevents it from being used by something else while owned by an array * Move bind extra sets logic to new method * Should only use separate array is MaximumExtraSets is not zero * Format whitespace
2024-05-19GPU: Migrate buffers on GPU project, pre-emptively flush device local ↵riperiperi
mappings (#6794) * GPU: Migrate buffers on GPU project, pre-emptively flush device local mappings Essentially retreading #4540, but it's on the GPU project now instead of the backend. This allows us to have a lot more control + knowledge of where the buffer backing has been changed and allows us to pre-emptively flush pages to host memory for quicker readback. It will allow us to do other stuff in the future, but we'll get there when we get there. Performance greatly improved in Hyrule Warriors: Age of Calamity. Performance notably improved in TOTK (average). Performance for BOTW restored to how it was before #4911, perhaps a bit better. - Rewrites a bunch of buffer migration stuff. Might want to tighten up how dispose stuff works. - Fixed an issue where the copy for texture pre-flush would happen _after_ the syncpoint. TODO: remove a page from pre-flush if it isn't flushed after a certain number of copies. * Add copy deactivation * Fix dependent virtual buffers * Remove logging * Fix format issues (maybe) * Vulkan: Remove backing swap * Add explicit memory access types for most buffers * Fix typo * Add device local force expiry, change buffer inheritance behaviour * General cleanup, OGL fix * BufferPreFlush comments * BufferBackingState comments * Add an extra precaution to BufferMigration This is very unlikely, but it's important to cover loose ends like this. * Address some feedback * Docs
2024-05-16Change Deflate compression level to `Fastest`. (#6812)MutantAura
2024-05-14Add missing lock on texture cache UpdateMapping method (#6657)gdkchan
2024-05-14Make TextureGroup.ClearModified thread safe (#6686)gdkchan
2024-05-14Add support for bindless textures from storage buffer on Vulkan (#6721)gdkchan
* Halve primitive ID when converting quads to triangles * Shader cache version bump * Add support for bindless textures from storage buffer on Vulkan
2024-05-08Replace "List.ForEach" for "foreach" (#6783)Marco Carvalho
* Replace "List.ForEach" for "foreach" * dotnet format * Update Ptc.cs * Update GpuContext.cs
2024-04-22Add support for bindless textures from shader input (vertex buffer) on ↵gdkchan
Vulkan (#6577) * Add support for bindless textures from shader input (vertex buffer) * Shader cache version bump * Format whitespace * Remove cache entries on pool removal, disable for OpenGL * PR feedback
2024-04-20End render target lifetime on syncpoint increment (#6687)gdkchan
2024-04-18Fix unmapped address check when reading texture handles (#6679)gdkchan
2024-04-14Texture loading: reduce memory allocations (#6623)jhorv
* rebase * add methods Ryyjinx.Common EmbeddedResources and SteamUtils * GAL changes - change SetData() methods and ThreadedTexture commands to use IMemoryOwner<byte> instead of SpanOrArray<byte> * Ryujinx.Graphics.Texture: change texture conversion methods to return IMemoryOwner<byte> and allocate from ByteMemoryPool * Ryujinx.Graphics.OpenGL: update ITexture and Texture-like types with SetData() methods to take IMemoryOwner<byte> instead of SpanOrArray<byte> * Ryujinx.Graphics.Vulkan: update ITexture and Texture-like types with SetData() methods to take IMemoryOwner<byte> instead of SpanOrArray<byte> * Ryujinx.Graphics.Gpu: update ITexture and Texture-like types with SetData() methods to take IMemoryOwner<byte> instead of SpanOrArray<byte> * Remove now-unused SpanOrArray<T> * post-rebase cleanup * PixelConverter: remove unsafe modifier on safe methods, and remove one unnecessary cast * use ByteMemoryPool.Rent() in GetWritableRegion() impls * fix formatting, rename `ReadRentedMemory()` to `ReadFileToRentedMemory()`` * Texture.ConvertToHostCompatibleFormat(): dispose of `result` in Astc decode branch
2024-04-09Use ResScaleUnsupported flag for texture arrays (#6626)gdkchan
2024-04-09Fast D32S8 2D depth texture copy (#6636)gdkchan
2024-04-07Add support for large sampler arrays on Vulkan (#6489)gdkchan
* Add support for large sampler arrays on Vulkan * Shader cache version bump * Format whitespace * Move DescriptorSetManager to PipelineLayoutCacheEntry to allow different pool sizes per layout * Handle array textures with different types on the same buffer * Somewhat better caching system * Avoid useless buffer data modification checks * Move redundant bindings update checking to the backend * Fix an issue where texture arrays would get the same bindings across stages on Vulkan * Backport some fixes from part 2 * Fix typo * PR feedback * Format whitespace * Add some missing XML docs
2024-04-03Stop clearing Modified flag on DiscardData (#6591)gdkchan
2024-03-26Implement host tracked memory manager mode (#6356)gdkchan
* Add host tracked memory manager mode * Skipping flush is no longer needed * Formatting + revert unrelated change * LightningJit: Ensure that dest register is saved for load ops that do partial updates * avoid allocations when doing address space lookup Add missing improvement * IsRmwMemory -> IsPartialRegisterUpdateMemory * Ensure we iterate all private allocations in range * PR feedback and potential fixes * Simplified bridges a lot * Skip calling SignalMappingChanged if Guest is true * Late map bridge too * Force address masking for prefetch instructions * Reprotection for bridges * Move partition list validation to separate debug method * Move host tracked related classes to HostTracked folder * New HostTracked namespace * Move host tracked modes to the end of enum to avoid PPTC invalidation --------- Co-authored-by: riperiperi <rhy3756547@hotmail.com>
2024-03-16chore: remove repetitive words (#6500)standstaff
Signed-off-by: standstaff <zhengxingru@yeah.net>
2024-03-14GPU: Rebind RTs if scale changes when binding textures (#6493)riperiperi
This fixes a longstanding issue with resolution scale that could result in flickering graphics, typically the first frame something is drawn, or on camera cuts in cutscenes. The root cause of the issue is that texture scale can be changed when binding textures or images. This typically happens because a texture becomes a view of a larger texture, such as a 400x225 texture becoming a view of a 800x450 texture with two levels. If the 400x225 texture is bound as a render target and has state [1x Undesired], but the storage texture is [2x Scaled], the render target texture's scale is changed to [2x Scaled] to match its new storage. This means the scale changed after the render target state was processed... This can cause a number of issues. When render target state is processed, texture scales are examined and potentially changed so that they are all the same value. If one texture is scaled, all textures must be. If one texture is blacklisted from scaling, all of them must be. This results in a single resolution scale value being assigned to the TextureManager, which also scales the scissor and viewport values. If the scale is chosen as 1x, and a later texture binding changes one of the textures to be 2x, the scale in TextureManager no longer matches all of the bound textures. What's worse, the scales in these textures could mismatch entirely. This typically results in the support buffer scale, viewport and scissor being wrong for at least one of the bound render targets. This PR fixes the issue by re-evaluating render target state if any scale mismatches the expected scale after texture bindings happen. This can actually cause scale to change again, so it must loop back to perform texture bindings again. This can happen as many times as it needs to, but I don't expect it to happen more than once. Problematic bindings will just result in a blacklist, which will propagate to other bound targets.
2024-03-14Separate guest/host tracking + unaligned protection (#6486)riperiperi
* WIP: Separate guest/host tracking + unaligned protection Allow memory manager to define support for single byte guest tracking * Formatting * Improve docs * Properly handle cases where the address space bits are too low * Address feedback
2024-03-13Update AutoDeleteCache.cs (#6471)Keaton
Increase the texture cache limit from 512 MB to 1 GB.
2024-03-13Fix geometry shader passthrough issue (#6462)Nicolas Abram
* Fix geometry shader passthrough issue (Diagnosed by gdkchan) * Fix whitespace formatting * Fix whitespace formatting * Bump shader cache version * Don't apply PassthroughNV decorations to output geometry shader variables
2024-03-10Fix lost copy and swap problem on shader SSA deconstruction (#6455)gdkchan
* Fix lost copy on shader SSA deconstruction * Shader cache version bump
2024-02-24Change packed aliasing formats to UInt (#6358)gdkchan
2024-02-22Implement virtual buffer dependencies (#6190)gdkchan
* Implement virtual buffer copies * Introduce TranslateAndCreateMultiBuffersPhysicalOnly, use it for copy and clear * Rename VirtualBufferCache to VirtualRangeCache * Fix potential issue where virtual range could exist in the cache, without a physical buffer * Fix bug that could cause copy with negative size on CopyToDependantVirtualBuffer * Remove virtual copy back for SyncAction * GetData XML docs * Make field readonly * Fix virtual buffer modification tracking * Remove CopyFromDependantVirtualBuffers from ExternalFlush * Move things around a little to avoid perf impact - Inline null check for CopyFromDependantVirtualBuffers - Remove extra method call for SynchronizeMemoryWithVirtualCopyBack, prefer calling CopyFromDependantVirtualBuffers separately * Fix up XML doc --------- Co-authored-by: riperiperi <rhy3756547@hotmail.com>
2024-02-17Vulkan: Improve texture barrier usage, timing and batching (#6240)riperiperi
* WIP barrier batch * Add store op to image usage barrier * Dispose the barrier batch * Fix encoding? * Handle read and write on the load op barrier. Load op consumes read accesses but does not add one, as the only other operation that can read is another load. * Simplify null check * Insert barriers on program change in case stale bindings are reintroduced * Not sure how I messed this one up * Improve location of bindings barrier update This is also important for emergency deferred clear * Update src/Ryujinx.Graphics.Vulkan/BarrierBatch.cs Co-authored-by: Mary Guillemard <thog@protonmail.com> --------- Co-authored-by: Mary Guillemard <thog@protonmail.com>
2024-02-15Implement X8Z24 texture format (#6315)gdkchan
2024-02-10Force CPU copy for non-identity DMA remap (#6293)gdkchan
2024-02-08Implement BGR10A2 render target format (#6273)gdkchan
2024-02-08Clamp vertex buffer size to mapped size if too high (#6272)gdkchan
* Clamp vertex buffer size to mapped size if too high * Update comment
2024-02-04Revert change to skip flush when range size is 0 (#6254)gdkchan
2024-02-04Fix depth compare value for TLD4S shader instruction with offset (#6253)gdkchan
* Fix depth compare value for TLD4S shader instruction with offset * Shader cache version bump
2024-01-22Fix missing data for new copy dependency textures with mismatching size (#6161)gdkchan