summaryrefslogtreecommitdiffstats
path: root/src/video_core/buffer_cache (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #4066 from ReinUsesLisp/shared-ptr-bufRodrigo Locatti2020-06-162-114/+112
|\ | | | | buffer_cache: Avoid passing references of shared pointers and misc style changes
| * buffer_cache: Avoid passing references of shared pointers and misc style changesReinUsesLisp2020-06-092-114/+112
| | | | | | | | | | | | | | | | | | 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: Return stream buffer invalidation in Map instead of UnmapReinUsesLisp2020-06-091-7/+9
|/ | | | | We have to invalidate whatever cache is being used before uploading the data, hence it makes more sense to return this on Map instead of Unmap.
* buffer_cache: Avoid copying twice on certain casesReinUsesLisp2020-05-281-17/+23
| | | | | | Avoid copying to a staging buffer on non-granular memory addresses. Add a callable argument to StreamBufferUpload to be able to copy to the staging buffer directly from ReadBlockUnsafe.
* buffer_cache: Remove unused boost headersReinUsesLisp2020-05-211-2/+0
|
* map_interval: Add interval allocator and drop hackReinUsesLisp2020-05-213-3/+78
| | | | | | | | | | Drop the std::list hack to allocate memory indefinitely. Instead use a custom allocator that keeps references valid until destruction. This allocates fixed chunks of memory and puts pointers in a free list. When an allocation is no longer used put it back to the free list, this doesn't heap allocate because std::vector doesn't change the capacity. If the free list is empty, allocate a new chunk.
* buffer_cache: Use boost::container::small_vector for maps in rangeReinUsesLisp2020-05-211-13/+15
| | | | | | Most overlaps in the buffer cache only contain one mapped address. We can avoid close to all heap allocations once the buffer cache is warmed up by using a small_vector with a stack size of one.
* buffer_cache: Use boost::intrusive::set for cachingReinUsesLisp2020-05-212-30/+44
| | | | | | | | 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.
* buffer_cache: Remove shared pointersReinUsesLisp2020-05-212-70/+72
| | | | | Removing shared pointers is a first step to be able to use intrusive objects and keep allocations close to one another in memory.
* buffer_cache: Minor style changesReinUsesLisp2020-05-212-129/+65
| | | | | Minor style changes. Mostly done so I avoid editing it while doing other changes.
* Merge pull request #3808 from ReinUsesLisp/wait-for-idlebunnei2020-05-031-6/+0
|\ | | | | {maxwell_3d,buffer_cache}: Implement memory barriers using 3D registers
| * {maxwell_3d,buffer_cache}: Implement memory barriers using 3D registersReinUsesLisp2020-04-281-6/+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).
* | vulkan: Remove unnecessary includesLioncash2020-04-291-1/+0
|/ | | | | | | Reduces some header churn and reduces rebuilds when some header internals change. While we're at it we can also resolve a missing include in buffer_cache.
* Address Feedback.Fernando Sahmkow2020-04-221-9/+6
|
* Address Feedback.Fernando Sahmkow2020-04-221-33/+23
|
* vk_fence_manager: Initial implementationReinUsesLisp2020-04-221-0/+1
|
* FenceManager: Manage syncpoints and rename fences to semaphores.Fernando Sahmkow2020-04-221-0/+7
|
* BufferCache: Refactor async managing.Fernando Sahmkow2020-04-221-7/+24
|
* FenceManager: Implement async buffer cache flushes on High settingsFernando Sahmkow2020-04-221-0/+50
|
* ThreadManager: Sync async reads on accurate gpu.Fernando Sahmkow2020-04-221-0/+12
|
* BufferCache: Implement OnCPUWrite and SyncGuestHostFernando Sahmkow2020-04-222-2/+61
|
* buffer_cache: Return handles instead of pointer to handlesReinUsesLisp2020-04-161-25/+22
| | | | | | | | | | | 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.
* Memory: Correct GCC errors.Fernando Sahmkow2020-04-091-0/+1
|
* GPUMemoryManager: Improve safety of memory reads.Fernando Sahmkow2020-04-081-3/+3
|
* Buffer Cache: Use vAddr instead of physical memory.Fernando Sahmkow2020-04-063-90/+108
|
* buffer_cache: Delay buffer destructionsReinUsesLisp2020-01-291-1/+4
| | | | | | Delay buffer destruction some extra frames to avoid destroying buffers that are still being used from older frames. This happens on Nvidia's driver with mailbox.
* buffer_cache: Remove brace initialized for objects with default constructorReinUsesLisp2019-11-201-10/+10
|
* buffer_cache: Add missing includes (#3079)Morph2019-11-071-0/+4
| | | | `boost::make_iterator_range` is available when `boost/range/iterator_range.hpp` is included. Also include `boost/icl/interval_map.hpp` and `boost/icl/interval_set.hpp`.
* gl_rasterizer: Upload constant buffers with glNamedBufferSubDataReinUsesLisp2019-11-021-3/+11
| | | | | | | | | | | | | | | | 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.
* video_core: Silent miscellaneous warnings (#2820)Rodrigo Locatti2019-08-302-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | * texture_cache/surface_params: Remove unused local variable * rasterizer_interface: Add missing documentation commentary * maxwell_dma: Remove unused rasterizer reference * video_core/gpu: Sort member declaration order to silent -Wreorder warning * fermi_2d: Remove unused MemoryManager reference * video_core: Silent unused variable warnings * buffer_cache: Silent -Wreorder warnings * kepler_memory: Remove unused MemoryManager reference * gl_texture_cache: Add missing override * buffer_cache: Add missing include * shader/decode: Remove unused variables
* Buffer Cache: Adress Feedback.Fernando Sahmkow2019-08-211-4/+3
|
* Buffer_Cache: Implement flushing.Fernando Sahmkow2019-08-211-1/+26
|
* Buffer_Cache: Implement barriers.Fernando Sahmkow2019-08-211-0/+4
|
* Buffer_Cache: Optimize and track written areas.Fernando Sahmkow2019-08-212-12/+104
|
* BufferCache: Rework mapping caching.Fernando Sahmkow2019-08-212-49/+76
|
* Buffer_Cache: Fixes and optimizations.Fernando Sahmkow2019-08-212-68/+38
|
* Video_Core: Implement a new Buffer CacheFernando Sahmkow2019-08-213-0/+498