1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-11-10 21:26:39 +00:00
Ryujinx/Ryujinx.Graphics.OpenGL
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
..
Helper Miria: The Death of OpenTK 3 (#2194) 2021-04-14 12:28:43 +02:00
Image Return mapped buffer pointer directly for flush, WriteableRegion for textures (#2494) 2021-07-19 19:10:54 -03:00
Queries End empty gl queries before returning them to the pool. (#1806) 2020-12-12 10:31:39 +11:00
BackgroundContextWorker.cs Assign _backgroundContext before starting its worker thread. (#2299) 2021-05-20 15:29:10 +02:00
Buffer.cs Return mapped buffer pointer directly for flush, WriteableRegion for textures (#2494) 2021-07-19 19:10:54 -03:00
Constants.cs Fix transform feedback errors caused by host pause/resume and multiple uses (#1634) 2020-10-25 17:23:42 -03:00
Debugger.cs Rename DebugLevel Performance to Slowdowns (#1450) 2020-08-07 15:30:06 +02:00
EnumConversion.cs Fix incorrect GPU GL blend func values (#1612) 2020-10-13 14:45:41 +11:00
FormatInfo.cs Add basic error logging to the GPU 2020-01-09 02:13:00 +01:00
FormatTable.cs Implement ETC2 (RGB) texture format (#2000) 2021-02-08 10:23:56 +11:00
Framebuffer.cs Use copy dependencies for the Intel/AMD view format workaround (#2144) 2021-05-16 20:43:27 +02:00
Handle.cs Spanify Graphics Abstraction Layer (#1226) 2020-05-23 11:46:09 +02:00
HwCapabilities.cs Only use persistent buffers to flush on NVIDIA and Windows+AMD (#2489) 2021-07-18 11:45:50 -03:00
IOpenGLContext.cs Miria: The Death of OpenTK 3 (#2194) 2021-04-14 12:28:43 +02:00
PersistentBuffers.cs Return mapped buffer pointer directly for flush, WriteableRegion for textures (#2494) 2021-07-19 19:10:54 -03:00
Pipeline.cs Add support for custom line widths (#2406) 2021-06-25 20:11:54 -03:00
Program.cs Implement parallel host shader cache compilation. 2021-04-18 17:33:58 +01:00
Renderer.cs Return mapped buffer pointer directly for flush, WriteableRegion for textures (#2494) 2021-07-19 19:10:54 -03:00
ResourcePool.cs Texture/Buffer Memory Management Improvements (#1408) 2020-09-10 16:44:04 -03:00
Ryujinx.Graphics.OpenGL.csproj Miria: The Death of OpenTK 3 (#2194) 2021-04-14 12:28:43 +02:00
Shader.cs Use explicit buffer and texture bindings on shaders (#1666) 2020-11-08 12:10:00 +01:00
Sync.cs Only flush commands when creating sync on Intel/AMD (windows) (#2165) 2021-04-03 11:10:37 +11:00
VertexArray.cs Fix value of constant vertex attributes (#2307) 2021-05-24 17:38:38 +10:00
VertexBuffer.cs Initial work 2020-01-09 02:13:00 +01:00
Window.cs Add Screenshot Feature (#2354) 2021-06-28 22:09:43 +02:00