summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_buffer_cache.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* SMMU: Initial adaptation to video_core.Fernando Sahmkow2024-01-191-4/+3
|
* gl_rasterizer: Implement DrawTransformFeedback macroAmeer J2023-12-201-0/+11
|
* gl_buffer_cache: Reintroduce NV_vertex_buffer_unified_memoryAmeer J2023-12-191-7/+38
| | | | Workaround Nvidia drivers complaining when a buffer is bound as both a vertex buffer and transform feedback buffer
* gl_buffer_cache: Fix tfb binding typoAmeer J2023-12-161-1/+1
|
* Merge pull request #12094 from ameerj/gl-buffer-cache-batch-vtxliamwhite2023-12-031-41/+35
|\ | | | | gl_buffer_cache: Batch vertex/tfb buffer binding
| * gl_buffer_cache: Batch vertex/tfb buffer bindingAmeer J2023-11-191-41/+35
| |
* | Merge pull request #12056 from ameerj/opengl-neglectliamwhite2023-12-011-2/+6
|\ \ | | | | | | OpenGL: Implement async downloads in buffer and texture caches
| * | gl_texture_cache: Enable async downloadsAmeer J2023-08-141-1/+1
| | |
| * | gl_buffer_cache: Enable async downloadsAmeer J2023-08-141-2/+6
| |/
* / renderer_vulkan: Introduce separate cmd buffer for uploadsGPUCode2023-11-121-3/+4
|/
* buffer_cache_base: Specify buffer type in HostBindingsMorph2023-06-131-10/+9
| | | | Avoid reinterpret-casting from void pointer since the type is already known at compile time.
* Combine vertex/transform feedback buffer binding into a single callKelebek12023-06-081-0/+18
|
* Merge pull request #10476 from ameerj/gl-memory-mapsliamwhite2023-06-071-7/+51
|\ | | | | OpenGL: Make use of persistent buffer maps in buffer cache
| * OpenGL: Make use of persistent buffer maps in buffer cache downloadsameerj2023-05-281-7/+51
| | | | | | | | | | | | Persistent buffer maps were already used by the texture cache, this extends their usage for the buffer cache. In my testing, using the memory maps for uploads was slower than the existing "ImmediateUpload" path, so the memory map usage is limited to downloads for the time being.
* | Move buffer bindings to per-channel stateKelebek12023-05-271-1/+1
|/
* video_core: Fix SNORM texture buffer emulating error (#9001)Feng Chen2022-11-041-9/+6
|
* Align index buffe size when vertex_buffer_unified_memory enableFengChen2022-09-101-1/+1
|
* 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.
* GC: Address Feedback.Fernando Sahmkow2022-03-251-9/+5
|
* Garbage Collection: Final tuning.Fernando Sahmkow2022-03-251-1/+1
|
* Buffer Cache: Tune to the levels of the new GC.Fernando Sahmkow2022-03-251-0/+18
|
* shader: Properly scale image reads and add GL SPIR-V supportReinUsesLisp2021-11-161-4/+9
| | | | Thanks for everything!
* buffer_cache: Minor fixesameerj2021-09-201-2/+1
| | | | Loop through the tmp_intervals by reference, rather than by copy, and fix gl clear buffer size calculation.
* Merge pull request #6585 from ameerj/hadesbunnei2021-07-251-13/+71
|\ | | | | Shader Decompiler Rewrite
| * gl_buffer_cache: Use unorm internal formats for snorm texture buffer viewsameerj2021-07-231-1/+24
| | | | | | | | Fixes black textures in UE4 games
| * glasm: Use storage buffers instead of global memory when possibleReinUsesLisp2021-07-231-12/+14
| |
| * shader: Initial OpenGL implementationReinUsesLisp2021-07-231-2/+35
| |
* | gl_buffer_cache: Use glClearNamedBufferSubData:GL_RED instead of GL_RGBAReinUsesLisp2021-07-201-1/+1
|/ | | | Avoids reading out of bounds from the stack.
* DMAEngine: Accelerate BufferClearFernando Sahmkow2021-07-131-0/+6
|
* buffer_cache: Heuristically decide to skip cache on uniform buffersReinUsesLisp2021-03-021-1/+2
| | | | | | | | | Some games benefit from skipping caches (Pokémon Sword), and others don't (Animal Crossing: New Horizons). Add an heuristic to decide this at runtime. The cache hit ratio has to be ~98% or better to not skip the cache. There are 16 frames of buffer.
* renderer_opengl: Remove interopReinUsesLisp2021-02-131-9/+2
| | | | Remove unused interop code from the OpenGL backend.
* gl_buffer_cache: Drop interop based parameter buffer workaroundsReinUsesLisp2021-02-131-53/+33
| | | | | Sacrify runtime performance to avoid generating kernel exceptions on Windows due to our abusive aliasing of interop buffer objects.
* video_core: Reimplement the buffer cacheReinUsesLisp2021-02-131-60/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-4/+3
| | | | | | | | | | | | | | 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.
* video_core: Resolve more variable shadowing scenarios pt.3Lioncash2020-12-051-16/+16
| | | | | Cleans out the rest of the occurrences of variable shadowing and makes any further occurrences of shadowing compiler errors.
* video_core: Remove all Core::System references in rendererReinUsesLisp2020-09-061-2/+3
| | | | | | | | | Now that the GPU is initialized when video backends are initialized, it's no longer needed to query components once the game is running: it can be done when yuzu is booting. This allows us to pass components between constructors and in the process remove all Core::System references in the video backend.
* 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_buffer_cache: Copy to buffers created as STREAM_READ before downloadingReinUsesLisp2020-06-261-5/+12
| | | | | | | | After marking buffers as resident, Nvidia's driver seems to take a slow path. To workaround this issue, copy to a STREAM_READ buffer and then call GetNamedBufferSubData on it. This is a temporary solution until we have asynchronous flushing.
* buffer_cache: Use buffer methods instead of cache virtual methodsReinUsesLisp2020-06-241-20/+18
|
* gl_buffer_cache: Mark buffers as residentReinUsesLisp2020-06-241-8/+16
| | | | | | Make stream buffer and cached buffers as resident and query their address. This allows us to use GPU addresses for several proprietary Nvidia extensions.
* buffer_cache: Avoid passing references of shared pointers and misc style changesReinUsesLisp2020-06-091-13/+8
| | | | | | | | | 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=).
* buffer_cache: Use boost::intrusive::set for cachingReinUsesLisp2020-05-211-0/+1
| | | | | | | | Instead of using boost::icl::interval_map for caching, use boost::intrusive::set. interval_map is intended as a container where the keys can overlap with one another; we don't need this for caching buffers and a std::set-like data structure that allows us to search with lower_bound is enough.
* {maxwell_3d,buffer_cache}: Implement memory barriers using 3D registersReinUsesLisp2020-04-281-4/+0
| | | | | | | | | | | | | Drop MemoryBarrier from the buffer cache and use Maxwell3D's register WaitForIdle. To implement this on OpenGL we just call glMemoryBarrier with the necessary bits. Vulkan lacks this synchronization primitive, so we set an event and immediately wait for it. This is not a pretty solution, but it's what Vulkan can do without submitting the current command buffer to the queue (which ends up being more expensive on the CPU).
* OpenGL: Guarantee writes to Buffers.Fernando Sahmkow2020-04-221-1/+2
|
* buffer_cache: Return handles instead of pointer to handlesReinUsesLisp2020-04-161-10/+8
| | | | | | | | | | | The original idea of returning pointers is that handles can be moved. The problem is that the implementation didn't take that in mind and made everything harder to work with. This commit drops pointer to handles and returns the handles themselves. While it is still true that handles can be invalidated, this way we get an old handle instead of a dangling pointer. This problem can be solved in the future with sparse buffers.
* Buffer Cache: Use vAddr instead of physical memory.Fernando Sahmkow2020-04-061-4/+4
|
* gl_rasterizer: Upload constant buffers with glNamedBufferSubDataReinUsesLisp2019-11-021-4/+27
| | | | | | | | | | | | | | | | Nvidia's OpenGL driver maps gl(Named)BufferSubData with some requirements to a fast. This path has an extra memcpy but updates the buffer without orphaning or waiting for previous calls. It can be seen as a better model for "push constants" that can upload a whole UBO instead of 256 bytes. This path has some requirements established here: http://on-demand.gputechconf.com/gtc/2014/presentations/S4379-opengl-44-scene-rendering-techniques.pdf#page=24 Instead of using the stream buffer, this commits moves constant buffers uploads to calls of glNamedBufferSubData and from my testing it brings a performance improvement. This is disabled when the vendor is not Nvidia since it brings performance regressions.
* gl_buffer_cache: Add missing includeReinUsesLisp2019-08-301-0/+1
| | | | RasterizerInterface was considered an incomplete object by clang.
* Buffer_Cache: Implement flushing.Fernando Sahmkow2019-08-211-0/+4
|
* Video_Core: Implement a new Buffer CacheFernando Sahmkow2019-08-211-19/+28
|
* gl_buffer_cache: Implement with generic buffer cacheReinUsesLisp2019-07-061-162/+27
|
* gl_buffer_cache: Remove global system gettersReinUsesLisp2019-07-061-5/+5
|
* gl_buffer_cache: Implement flushingReinUsesLisp2019-07-061-1/+5
|
* gl_rasterizer: Drop gl_global_cache in favor of gl_buffer_cacheReinUsesLisp2019-07-061-6/+16
|
* gl_buffer_cache: Rework to support internalized buffersReinUsesLisp2019-07-061-46/+121
|
* gl_buffer_cache: Store in CachedBufferEntry the used buffer handleReinUsesLisp2019-07-061-16/+17
|
* gl_buffer_cache: Return used buffer from Upload functionReinUsesLisp2019-07-061-12/+11
|
* rasterizer_cache: Protect inherited caches from submission levelFernando Sahmkow2019-07-011-0/+2
|
* gl_buffer_cache: Remove unused ReserveMemory methodReinUsesLisp2019-05-301-10/+0
|
* video_core/texures/texture: Remove unnecessary includesLioncash2019-04-061-0/+1
| | | | | | Nothing in this header relies on common_funcs or the memory manager. This gets rid of reliance on indirect inclusions in the OpenGL caches.
* video_core/renderer_opengl: Remove unnecessary includesLioncash2019-04-041-1/+0
| | | | | | | Quite a few unused includes have built up over time, particularly on core/memory.h. Removing these includes means the source files including those files will no longer need to be rebuilt if they're changed, making compilation slightly faster in this scenario.
* video_core: Amend constructor initializer list order where applicableLioncash2019-03-271-2/+2
| | | | | | | Specifies the members in the same order that initialization would take place in. This also silences -Wreorder warnings.
* gpu: Move GPUVAddr definition to common_types.bunnei2019-03-211-2/+2
|
* video_core: Refactor to use MemoryManager interface for all memory access.bunnei2019-03-161-5/+3
| | | | | | | | | | | # Conflicts: # src/video_core/engines/kepler_memory.cpp # src/video_core/engines/maxwell_3d.cpp # src/video_core/morton.cpp # src/video_core/morton.h # src/video_core/renderer_opengl/gl_global_cache.cpp # src/video_core/renderer_opengl/gl_global_cache.h # src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
* gpu: Use host address for caching instead of guest address.bunnei2019-03-151-9/+15
|
* video_core: Assert on invalid GPU to CPU address queriesReinUsesLisp2019-02-031-1/+2
|
* gl_stream_buffer: Use DSA for buffer managementReinUsesLisp2019-01-061-1/+1
|
* gl_rasterizer: Skip VB upload if the state is clean.Markus Wick2018-11-171-1/+2
|
* rasterizer_cache: Remove reliance on the System singletonLioncash2018-11-081-1/+3
| | | | | | Rather than have a transparent dependency, we can make it explicit in the interface. This also gets rid of the need to put the core include in a header.
* global: Use std::optional instead of boost::optional (#1578)Frederic L2018-10-301-1/+1
| | | | | | | | | | | | | | | | * get rid of boost::optional * Remove optional references * Use std::reference_wrapper for optional references * Fix clang format * Fix clang format part 2 * Adressed feedback * Fix clang format and MacOS build
* gl_rasterizer: Implement quads topologyReinUsesLisp2018-10-041-3/+14
|
* Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi2018-09-151-7/+8
|
* gl_buffer_cache: Make GetHandle() a const member functionLioncash2018-09-061-1/+1
| | | | | GetHandle() internally calls GetHandle() on the stream_buffer instance, which is a const member function, so this can be made const as well.
* gl_buffer_cache: Remove unnecessary includesLioncash2018-09-061-1/+3
|
* renderer_opengl: Implement a buffer cache.Markus Wick2018-09-051-0/+90
The idea of this cache is to avoid redundant uploads. So we are going to cache the uploaded buffers within the stream_buffer and just reuse the old pointers. The next step is to implement a VBO cache on GPU memory, but for now, I want to check the overhead of the cache management. Fetching the buffer over PCI-E should be quite fast.