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
5a461a7482
video_core: memory_manager: Updates for Common::PageTable changes.
2020-04-17 00:59:34 -04:00
Fernando Sahmkow
f00f6bbdb6
Memory: Address Feedback.
2020-04-08 13:40:46 -04:00
Fernando Sahmkow
3e7aecbd3c
GPUMemoryManager: Improve safety of memory reads.
2020-04-08 12:08:06 -04:00
Fernando Sahmkow
3728c7160f
Buffer Cache: Use vAddr instead of physical memory.
2020-04-06 09:23:06 -04:00
Fernando Sahmkow
34be867080
PageTable: move backing addresses to a children class as the CPU page table does not need them.
...
This PR aims to reduce the memory usage in the CPU page table by moving
GPU specific parameters into a child class. This saves 1Gb of Memory for
most games.
2020-03-14 09:43:57 -04: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
Michael Scire
ab4a2b5699
prefer system reference over global accessor
2019-07-09 08:11:35 -07:00
Fernando Sahmkow
ab3bb046a8
GPUVM: Correct GPU VM virtual address space
2019-06-09 17:47:15 -04:00
Lioncash
542ab1b1b9
video_core/memory_manager: Mark IsBlockContinuous() as a const member function
...
Corrects the typo in its name and marks the function as a const member
function, given it doesn't actually modify memory manager state.
2019-05-09 19:14:36 -04:00
Lioncash
24e9c43cf1
video_core/memory_manager: Mark the constructor as explicit
...
Prevents implicit converting constructions of the memory manager.
2019-05-09 19:10:26 -04:00
Lioncash
cb867f250a
video_core/memory_manager: Default the destructor within the cpp file
...
Makes the class less surprising when it comes to forward declaring the
type, and also prevents inlining the destruction code of the class,
given it contains non-trivial types.
2019-05-09 19:10:13 -04:00
Lioncash
cf685d3e43
video_core/memory_manager: Amend doxygen comments
...
Corrects references to non-existent parameters and corrects typos.
2019-05-09 19:09:19 -04:00
Lioncash
57744806c3
video_core/memory_manager: Remove superfluous const from function declarations
...
These are able to be omitted from the declaration of functions, since
they don't do anything at the type system level. The definitions of the
functions can retain the use of const though, since they make the
variables immutable in the implementation of the function where they're
used.
2019-05-09 18:59:49 -04:00
Fernando Sahmkow
ad686a3c0d
Implement IsBlockContinous
...
This detects when a GPU Memory Block is not continous within host cpu
memory.
2019-04-16 18:49:35 -04:00
Fernando Sahmkow
994393bd02
Use ReadBlockUnsafe for fetyching DMA CommandLists
2019-04-16 11:22:34 -04:00
Fernando Sahmkow
86d3cb5fa7
Document unsafe versions and add BlockCopyUnsafe
2019-04-16 10:11:35 -04:00
Fernando Sahmkow
57051db434
GPU MemoryManager: Implement ReadBlockUnsafe and WriteBlockUnsafe
2019-04-15 23:01:35 -04:00
bunnei
2a4a454793
memory_manager: Improved implementation of read/write/copy block.
...
- Fixes graphical issues with Chocobo's Mystery Dungeon EVERY BUDDY!
- Fixes a crash with Mario Tennis Aces
2019-04-05 23:43:34 -04:00
Lioncash
69846b1557
video_core/memory_manager: Make Read() a const qualified member function
...
Given this doesn't actually alter internal state, this can be made a
const member function.
2019-04-05 20:30:48 -04:00
Lioncash
e36500c07f
video_core/memory_manager: Make ReadBlock() a const qualifier member function
...
Now, since we have a const qualified variant of GetPointer(), we can put
it to use in ReadBlock() to retrieve the source pointer that is passed
into memcpy.
Now block reading may be done from a const context.
2019-04-05 20:28:44 -04:00
Lioncash
514351af96
video_core/memory_manager: Add a const qualified variant of GetPointer()
...
Allows retrieving read-only pointers from a const context externally.
2019-04-05 20:25:28 -04:00
Lioncash
72e8ac8e4e
video_core/memory_manager: Make FindFreeRegion() a const member function
...
This doesn't modify internal state, so it can be made a const member
function.
2019-04-05 20:22:55 -04:00
Lioncash
ad244b004b
video_core/memory_manager: Make GpuToCpuAddress() a const member function
...
This doesn't modify any internal state, so it can be made a const member
function to allow its use in const contexts.
2019-04-05 20:18:29 -04:00
bunnei
51cdb0df88
memory_manager: Cleanup FindFreeRegion.
2019-03-20 23:12:28 -04:00
bunnei
7521cd30d1
memory_manager: Bug fixes and further cleanup.
2019-03-20 22:36:03 -04:00
bunnei
bb6e007a63
memory_manager: Add protections for invalid GPU addresses.
...
- Avoid a crash in Xenoblade Chronicles 2.
2019-03-20 22:36:03 -04:00
bunnei
fa405371ee
gpu: Rewrite virtual memory manager using PageTable.
2019-03-20 22:36:02 -04:00
bunnei
6f872bd580
gpu: Move GPUVAddr definition to common_types.
2019-03-20 22:36:02 -04:00
bunnei
d3f26c1546
video_core: Refactor to use MemoryManager interface for all memory access.
...
# 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
2019-03-16 00:38:48 -04:00
bunnei
ae72f4154e
memory_manager: Do not allow 0 to be a valid GPUVAddr.
...
- Fixes a bug with Undertale using 0 for a render target.
2018-11-23 12:58:55 -05:00
bunnei
938dd94181
memory_manager: Do not MapBufferEx over already in use memory.
...
- This fixes rendering when changing areas in Super Mario Odyssey.
2018-11-01 18:57:59 -04:00
Frederic L
c76f4b6aec
global: Use std::optional instead of boost::optional ( #1578 )
...
* 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
2018-10-30 00:03:25 -04:00
bunnei
ac8ab8f305
memory_manager: Add a method for querying the end of a mapped GPU region.
2018-10-16 11:31:00 -04:00
Subv
9abfc3df7b
GPU: Implemented nvhost-as-gpu's UnmapBuffer ioctl.
...
It removes a mapping previously created with the MapBufferEx ioctl.
2018-05-20 14:25:56 -05:00
bunnei
31748079de
gl_rasterizer_cache: Update to be based on GPU addresses, not CPU addresses.
2018-04-24 22:31:45 -04:00
bunnei
995cbfc15f
memory_manager: Add implement CpuToGpuAddress.
2018-04-24 17:49:20 -04:00
bunnei
b6bed8fd74
memory_manager: Make GpuToCpuAddress return an optional.
2018-04-24 17:49:19 -04:00
bunnei
ebef12f037
memory_manager: Use GPUVAdddr, not PAddr, for GPU addresses.
2018-04-24 17:40:43 -04:00
Subv
fbc480d611
GPU: Make the GPU virtual memory manager use 16 page bits and 10 page table bits.
...
Also removed some dead code and added memory map consistency asserts.
2018-04-23 10:57:12 -05:00
Subv
0088b3128b
Make a GPU class in VideoCore to contain the GPU state.
...
Also moved the GPU MemoryManager class to video_core since it makes more sense for it to be there.
2018-02-11 23:44:12 -05:00