Commit Graph

88 Commits

Author SHA1 Message Date
bunnei 616e83dd94 DMA & InlineToMemory Engines Rework. 2022-10-06 21:00:53 +02:00
Fernando Sahmkow a1b6ba1602 Memory Manager: ensure safety of GPU to CPU address. 2022-10-06 21:00:53 +02:00
Fernando Sahmkow 6a3eca65ea MemoryManager: Fix errors popping out. 2022-10-06 21:00:53 +02:00
Fernando Sahmkow 8f0981702a MemoryManager: Finish up the initial implementation. 2022-10-06 21:00:52 +02:00
Fernando Sahmkow 67bb131e37 MemoryManager: initial multi paging system implementation. 2022-10-06 21:00:52 +02:00
Fernando Sahmkow bc66debfdc Texture cache: Fix the remaining issues with memory mnagement and unmapping. 2022-10-06 21:00:52 +02:00
Fernando Sahmkow 0925f2386a Refactor VideoCore to use AS sepparate from Channel. 2022-10-06 21:00:52 +02:00
Fernando Sahmkow 19d8ea6bd6 NVDRV: Remake ASGPU 2022-10-06 21:00:52 +02:00
Fernando Sahmkow 80a4737010 MemoryManager: Temporary Fix for NVDEC. 2022-10-06 21:00:52 +02:00
Fernando Sahmkow a4346d16ed VideoCore: Update MemoryManager 2022-10-06 21:00:51 +02:00
Fernando Sahmkow 8847b6645c VideoCore: implement channels on gpu caches. 2022-10-06 21:00:51 +02:00
Kyle Kienapfel ea00332a67 code: dodge PAGE_SIZE #define
Some header files, specifically for OSX and Musl libc define PAGE_SIZE to be a number
This is great except in yuzu we're using PAGE_SIZE as a variable

Specific example
`static constexpr u64 PAGE_SIZE = u64(1) << PAGE_BITS;`

PAGE_SIZE PAGE_BITS PAGE_MASK are all similar variables.
Simply deleted the underscores, and then added YUZU_ prefix

Might be worth noting that there are multiple uses in different classes/namespaces
This list may not be exhaustive

Core::Memory   12 bits (4096)
QueryCacheBase 12 bits
ShaderCache    14 bits (16384)
TextureCache   20 bits (1048576, or 1MB)

Fixes #8779
2022-08-19 16:08:40 -07:00
Liam c1771c98f3 common: Change semantics of UNREACHABLE to unconditionally crash 2022-06-13 20:09:00 -04:00
Morph 2b87305d31 general: Convert source file copyright comments over to SPDX
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.
2022-04-23 05:55:32 -04:00
ameerj b837219423 video_core: Reduce unused includes 2022-03-19 15:01:31 -04:00
ameerj 4c10c0a514 video_core/memory_manager: Fixes for sparse memory management 2021-12-31 17:04:02 -05:00
ameerj 5c644fe97b video_core/memory_manager: Deduplicate Read/WriteBlock 2021-12-31 02:08:22 -05:00
Morph 421ff5ea79 video_core/memory_manager: Add missing <algorithm> include 2021-09-11 17:19:15 -04:00
Fernando Sahmkow c01e168072 GPU_MemoryManger: Fix GetSubmappedRange. 2021-08-19 22:57:22 +02:00
FernandoS27 7d40446b99 shader: Address feedback 2021-07-22 21:51:25 -04:00
FernandoS27 8232c10ed1 shader: Implement TLD 2021-07-22 21:51:25 -04:00
Fernando Sahmkow 73d501ed4b Texture Cache: Address feedback. 2021-07-04 22:32:35 +02:00
Fernando Sahmkow 083e0527fd Texture Cache: Improve accuracy of sparse texture detection. 2021-07-04 22:32:35 +02:00
Fernando Sahmkow 5854ca4ff0 Texture Cache: Initial Implementation of Sparse Textures. 2021-07-04 22:32:03 +02:00
ameerj 2a0dbf9b79 buffer_cache: Simplify uniform disabling logic 2021-06-01 13:26:58 -04:00
bunnei ad048de3d6 hle: kernel: Rename Process to KProcess. 2021-05-05 16:40:52 -07:00
bunnei 5dbcaa2970 hle: kernel: Migrate PageHeap/PageTable to KPageHeap/KPageTable. 2021-02-18 16:16:25 -08:00
ReinUsesLisp 70b3c29534 gpu: Report renderer errors with exceptions
Instead of using a two step initialization to report errors, initialize
the GPU renderer and rasterizer on the constructor and report errors
through std::runtime_error.
2021-02-13 02:16:19 -03:00
bunnei 15108fcea7 Merge pull request #5795 from ReinUsesLisp/bytes-to-map-end
video_core/memory_manager: Add BytesToMapEnd
2021-01-29 22:56:29 -08:00
ReinUsesLisp 0e885adf4a video_core/memory_manager: Add BytesToMapEnd
Track map address sizes in a flat ordered map and add a method to query
the number of bytes until the end of a map in a given address.
2021-01-22 18:31:12 -03:00
ReinUsesLisp 220ba5933c video_core/memory_manager: Remove unused CopyBlockUnsafe
This function was not being used.
2021-01-21 19:16:06 -03:00
ReinUsesLisp 85390839b0 video_core/memory_manager: Flush destination buffer on CopyBlock
When we copy into a buffer, it might contain data modified from the GPU
on the same pages. Because of this, we have to flush the contents before
writing new data.

An alternative approach would be to write the data in place, but games
can also write data in other ways, invalidating our contents.

Fixes geometry in Zombie Panic in Wonderland DX.
2021-01-21 19:16:06 -03:00
ReinUsesLisp 5c2fdf4e60 video_core/memory_manager: Add GPU address based flush method
Allow flushing rasterizer contents based on a GPU address.
2021-01-21 19:16:05 -03:00
ReinUsesLisp d25b097e84 video_core: Rewrite the texture cache
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.
2020-12-30 03:38:50 -03:00
ameerj 9ef5c53e52 video_core: NVDEC Implementation
This commit aims to implement the NVDEC (Nvidia Decoder) functionality, with video frame decoding being handled by the FFmpeg library.

The process begins with Ioctl commands being sent to the NVDEC and VIC (Video Image Composer) emulated devices. These allocate the necessary GPU buffers for the frame data, along with providing information on the incoming video data. A Submit command then signals the GPU to process and decode the frame data.

To decode the frame, the respective codec's header must be manually composed from the information provided by NVDEC, then sent with the raw frame data to the ffmpeg library.

Currently, H264 and VP9 are supported, with VP9 having some minor artifacting issues related mainly to the reference frame composition in its uncompressed header.

Async GPU is not properly implemented at the moment.

Co-Authored-By: David <25727384+ogniK5377@users.noreply.github.com>
2020-10-26 23:07:36 -04:00
Lioncash e457001dce General: Make use of std::nullopt where applicable
Allows some implementations to avoid completely zeroing out the internal
buffer of the optional, and instead only set the validity byte within
the structure.

This also makes it consistent how we return empty optionals.
2020-09-22 17:32:33 -04:00
bunnei 6d9165c252 Merge pull request #4574 from lioncash/const-fn
memory_manager: Mark IsGranularRange() as a const member function
2020-08-25 11:24:13 -04:00
Lioncash 9a974b8cb9 memory_manager: Mark IsGranularRange() as a const member function
This doesn't modify internal member state, so it can be marked as const.
2020-08-24 00:37:57 -04:00
ReinUsesLisp 1c61cf29b6 video_core: Initialize renderer with a GPU
Add an extra step in GPU initialization to be able to initialize render
backends with a valid GPU instance.
2020-08-22 01:51:45 -03:00
bunnei 991aca142e hle: nvdrv: Rewrite of GPU memory management. 2020-07-26 00:49:43 -04:00
Lioncash 693ec509d7 memory_manager: Eliminate variable shadowing
Renames some variables to prevent ones in inner scopes from shadowing
outer-scoped variables.

The Copy* functions have no shadowing, but we rename them anyways to
remain consistent with the other functions.
2020-06-19 22:02:58 -04:00
bunnei da893629a0 kernel: memory: Improve implementation of device shared memory. (#3707)
* kernel: memory: Improve implementation of device shared memory.

* fixup! kernel: memory: Improve implementation of device shared memory.

* fixup! kernel: memory: Improve implementation of device shared memory.
2020-04-23 11:37:12 -04:00
bunnei 5a461a7482 video_core: memory_manager: Updates for Common::PageTable changes. 2020-04-17 00:59:34 -04:00
Fernando Sahmkow 99e0ffe21b Memory: Correct GCC errors. 2020-04-08 18:09:16 -04:00
Fernando Sahmkow 3e7aecbd3c GPUMemoryManager: Improve safety of memory reads. 2020-04-08 12:08:06 -04:00
Fernando Sahmkow 5cc292ac3c GPU: Setup Flush/Invalidate to use VAddr instead of CacheAddr 2020-04-06 09:21:46 -04:00
bunnei 638252e316 video_core: memory_manager: Flush/invalidate asynchronously on Unmap.
- Minor perf improvement.
2020-02-19 20:03:52 -05:00
bunnei f382179d47 Revert "video_core: memory_manager: Use GPU interface for cache functions." 2020-02-15 17:47:15 -05:00
bunnei f28ab9626e video_core: memory_manager: Use GPU interface for cache functions. 2020-02-07 22:59:35 -05:00
Lioncash 7110e6a128 core/memory: Migrate over GetPointer()
With all of the interfaces ready for migration, it's trivial to migrate
over GetPointer().
2019-11-26 21:55:38 -05:00