ryujinx/Ryujinx.Graphics.GAL
riperiperi 4b60371e64
Return mapped buffer pointer directly for flush, WriteableRegion for textures (#2494)
* Return mapped buffer pointer directly for flush, WriteableRegion for textures

A few changes here to generally improve performance, even for platforms not using the persistent buffer flush.

- Texture and buffer flush now return a ReadOnlySpan<byte>. It's guaranteed that this span is pinned in memory, but it will be overwritten on the next flush from that thread, so it is expected that the data is used before calling again.
- As a result, persistent mappings no longer copy to a new array - rather the persistent map is returned directly as a Span<>. A similar host array is used for the glGet flushes instead of allocating new arrays each time.
- Texture flushes now do their layout conversion into a WriteableRegion when the texture is not MultiRange, which allows the flush to happen directly into guest memory rather than into a temporary span, then copied over. This avoids another copy when doing layout conversion.

Overall, this saves 1 data copy for buffer flush, 1 copy for linear textures with matching source/target stride, and 2 copies for block textures or linear textures with mismatching strides.

* Fix tests

* Fix array pointer for Mesa/Intel path

* Address some feedback

* Update method for getting array pointer.
2021-07-19 19:10:54 -03:00
..
AddressMode.cs Some code cleanup 2020-01-09 02:13:00 +01:00
BlendDescriptor.cs Implement Constant Color blends (#1119) 2020-04-25 23:00:43 +10:00
BlendFactor.cs Some code cleanup 2020-01-09 02:13:00 +01:00
BlendOp.cs Fix incorrect GPU GL blend func values (#1612) 2020-10-13 14:45:41 +11:00
BufferHandle.cs Spanify Graphics Abstraction Layer (#1226) 2020-05-23 11:46:09 +02:00
BufferRange.cs Fix transform feedback errors caused by host pause/resume and multiple uses (#1634) 2020-10-25 17:23:42 -03:00
Capabilities.cs Fix texture sampling with depth compare and LOD level or bias (#2404) 2021-06-25 00:54:50 +02:00
ColorF.cs Implement Constant Color blends (#1119) 2020-04-25 23:00:43 +10:00
CompareMode.cs Some code cleanup 2020-01-09 02:13:00 +01:00
CompareOp.cs Initial support for the guest OpenGL driver (NVIDIA and Nouveau) 2020-01-09 02:13:00 +01:00
CounterType.cs Initial work 2020-01-09 02:13:00 +01:00
DepthMode.cs Support depth clip mode and disable shader fast math optimization on NVIDIA as a workaround for compiler bugs (?) 2020-01-09 02:13:00 +01:00
DepthStencilMode.cs Some code cleanup 2020-01-09 02:13:00 +01:00
DepthStencilState.cs Some code cleanup 2020-01-09 02:13:00 +01:00
DepthTestDescriptor.cs Some code cleanup 2020-01-09 02:13:00 +01:00
Extents2D.cs Allow copy destination to have a different scale from source (#1711) 2020-11-20 17:14:45 -03:00
Face.cs Initial work 2020-01-09 02:13:00 +01:00
Format.cs Implement ETC2 (RGB) texture format (#2000) 2021-02-08 10:23:56 +11:00
FrontFace.cs Initial work 2020-01-09 02:13:00 +01:00
ICounterEvent.cs Implement Counter Queue and Partial Host Conditional Rendering (#1167) 2020-05-04 12:24:59 +10:00
ImageCrop.cs gui/gpu: Implement setting and toggle for Aspect Ratio (#1777) 2020-12-15 23:19:07 -03:00
IndexType.cs Initial work 2020-01-09 02:13:00 +01:00
IPipeline.cs Add support for custom line widths (#2406) 2021-06-25 20:11:54 -03:00
IProgram.cs Implement parallel host shader cache compilation. 2021-04-18 17:33:58 +01:00
IRenderer.cs Return mapped buffer pointer directly for flush, WriteableRegion for textures (#2494) 2021-07-19 19:10:54 -03:00
ISampler.cs Initial work 2020-01-09 02:13:00 +01:00
IShader.cs Initial work 2020-01-09 02:13:00 +01:00
ITexture.cs Return mapped buffer pointer directly for flush, WriteableRegion for textures (#2494) 2021-07-19 19:10:54 -03:00
IWindow.cs Improved and simplified window texture presentation 2020-01-09 02:13:00 +01:00
LogicalOp.cs Implement Logical Operation registers and functionality (#1380) 2020-07-10 14:23:15 -03:00
MagFilter.cs Some code cleanup 2020-01-09 02:13:00 +01:00
MinFilter.cs Some code cleanup 2020-01-09 02:13:00 +01:00
Origin.cs Fix wrong face culling once and for all (#1277) 2020-05-28 09:03:07 +10:00
PolygonModeMask.cs Initial work 2020-01-09 02:13:00 +01:00
PrimitiveTopology.cs Initial work 2020-01-09 02:13:00 +01:00
ProgramLinkStatus.cs Implement parallel host shader cache compilation. 2021-04-18 17:33:58 +01:00
RectangleF.cs Initial work 2020-01-09 02:13:00 +01:00
Ryujinx.Graphics.GAL.csproj infra: Migrate to .NET 5 (#1694) 2020-11-15 19:27:15 +01:00
SamplerCreateInfo.cs Add seamless cubemap flag in sampler parameters. (#1658) 2020-11-02 17:03:06 -03:00
ScreenCaptureImageInfo.cs Add Screenshot Feature (#2354) 2021-06-28 22:09:43 +02:00
StencilOp.cs Some code cleanup 2020-01-09 02:13:00 +01:00
StencilTestDescriptor.cs Some code cleanup 2020-01-09 02:13:00 +01:00
SwizzleComponent.cs Some code cleanup 2020-01-09 02:13:00 +01:00
Target.cs Some code cleanup 2020-01-09 02:13:00 +01:00
TextureCreateInfo.cs Texture/Buffer Memory Management Improvements (#1408) 2020-09-10 16:44:04 -03:00
TextureReleaseCallback.cs Initial work 2020-01-09 02:13:00 +01:00
TransformFeedbackDescriptor.cs Initial transform feedback support (#1370) 2020-07-15 13:01:10 +10:00
VertexAttribDescriptor.cs Avoid some redundant GL calls (#1958) 2021-01-27 08:44:07 +11:00
VertexBufferDescriptor.cs Some code cleanup 2020-01-09 02:13:00 +01:00
Viewport.cs Initial work 2020-01-09 02:13:00 +01:00
ViewportSwizzle.cs Fix wrong face culling once and for all (#1277) 2020-05-28 09:03:07 +10:00