summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_stream_buffer.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* general: Convert source file copyright comments over to SPDXMorph2022-04-231-3/+2
| | | | | This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
* gl_stream_buffer/vk_staging_buffer_pool: Fix size checkReinUsesLisp2021-02-131-1/+1
| | | | | | Fix a tragic off-by-one condition that causes Vulkan's stream buffer to think it's always full, using fallback memory. The OpenGL was also affected by this bug to a lesser extent.
* video_core: Reimplement the buffer cacheReinUsesLisp2021-02-131-50/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reimplement the buffer cache using cached bindings and page level granularity for modification tracking. This also drops the usage of shared pointers and virtual functions from the cache. - Bindings are cached, allowing to skip work when the game changes few bits between draws. - OpenGL Assembly shaders no longer copy when a region has been modified from the GPU to emulate constant buffers, instead GL_EXT_memory_object is used to alias sub-buffers within the same allocation. - OpenGL Assembly shaders stream constant buffer data using glProgramBufferParametersIuivNV, from NV_parameter_buffer_object. In theory this should save one hash table resolve inside the driver compared to glBufferSubData. - A new OpenGL stream buffer is implemented based on fences for drivers that are not Nvidia's proprietary, due to their low performance on partial glBufferSubData calls synchronized with 3D rendering (that some games use a lot). - Most optimizations are shared between APIs now, allowing Vulkan to cache more bindings than before, skipping unnecesarry work. This commit adds the necessary infrastructure to use Vulkan object from OpenGL. Overall, it improves performance and fixes some bugs present on the old cache. There are still some edge cases hit by some games that harm performance on some vendors, this are planned to be fixed in later commits.
* video_core: Rewrite the texture cacheReinUsesLisp2020-12-301-21/+11
| | | | | | | | | | | | | | The current texture cache has several points that hurt maintainability and performance. It's easy to break unrelated parts of the cache when doing minor changes. The cache can easily forget valuable information about the cached textures by CPU writes or simply by its normal usage.The current texture cache has several points that hurt maintainability and performance. It's easy to break unrelated parts of the cache when doing minor changes. The cache can easily forget valuable information about the cached textures by CPU writes or simply by its normal usage. This commit aims to address those issues.
* gl_arb_decompiler: Use NV_shader_buffer_{load,store} on assembly shadersReinUsesLisp2020-07-181-1/+1
| | | | | | | | | | | | | | | | NV_shader_buffer_{load,store} is a 2010 extension that allows GL applications to use what in Vulkan is known as physical pointers, this is basically C pointers. On GLASM these is exposed through the LOAD/STORE/ATOM instructions. Up until now, assembly shaders were using NV_shader_storage_buffer_object. These work fine, but have a (probably unintended) limitation that forces us to have the limit of a single stage for all shader stages. In contrast, with NV_shader_buffer_{load,store} we can pass GPU addresses to the shader through local parameters (GLASM equivalent uniform constants, or push constants on Vulkan). Local parameters have the advantage of being per stage, allowing us to generate code without worrying about binding overlaps.
* gl_stream_buffer: Use InvalidateBufferData instead unmap and mapReinUsesLisp2020-06-241-14/+5
| | | | | | | Making the stream buffer resident increases GPU usage significantly on some games. This seems to be addressed invalidating the stream buffer with InvalidateBufferData instead of using a Unmap + Map (with invalidation flags).
* gl_buffer_cache: Mark buffers as residentReinUsesLisp2020-06-241-2/+9
| | | | | | Make stream buffer and cached buffers as resident and query their address. This allows us to use GPU addresses for several proprietary Nvidia extensions.
* gl_stream_buffer: Always use a non-coherent bufferReinUsesLisp2020-06-241-11/+9
|
* gl_stream_buffer: Always use persistent memory mapsReinUsesLisp2020-06-241-27/+13
| | | | yuzu no longer supports platforms without persistent maps.
* buffer_cache: Avoid passing references of shared pointers and misc style changesReinUsesLisp2020-06-091-8/+0
| | | | | | | | | Instead of using as template argument a shared pointer, use the underlying type and manage shared pointers explicitly. This can make removing shared pointers from the cache more easy. While we are at it, make some misc style changes and general improvements (like insert_or_assign instead of operator[] + operator=).
* gl_state: Remove completelyReinUsesLisp2020-02-281-1/+0
|
* video_core: Make ARB_buffer_storage a required extensionReinUsesLisp2019-06-211-2/+3
|
* gl_stream_buffer: Use DSA for buffer managementReinUsesLisp2019-01-061-14/+12
|
* gl_stream_buffer: Profile orphaning of stream buffer.Markus Wick2018-11-061-0/+5
| | | | | This serialize to the driver thread and so it may block for a while. So if it is in the benchmark, we get noticed if it happens too often.
* gl_stream_buffer: Fix use of bitwise OR instead of logical OR in Map()Lioncash2018-09-211-1/+1
| | | | | | | | This was very likely intended to be a logical OR based off the conditioning and testing of inversion in one case. Even if this was intentional, this is the kind of non-obvious thing one should be clarifying with a comment.
* Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi2018-09-151-1/+1
|
* video_core: fixed arithmetic overflow warnings & improved code stylePatrick Elsässer2018-09-091-1/+1
| | | | | | | | - Fixed all warnings, for renderer_opengl items, which were indicating a possible incorrect behavior from integral promotion rules and types larger than those in which arithmetic is typically performed. - Added const for variables where possible and meaningful. - Added constexpr where possible.
* renderer_opengl: Namespace OpenGL codeLioncash2018-08-221-0/+4
| | | | | | | Namespaces all OpenGL code under the OpenGL namespace. Prevents polluting the global namespace and allows clear distinction between other renderers' code in the future.
* Update the stream_buffer helper from Citra.Markus Wick2018-08-121-142/+59
| | | | Please see https://github.com/citra-emu/citra/pull/3666 for more details.
* renderer_gl: Port over gl_stream_buffer module from Citra.bunnei2018-03-201-0/+182