Commit Graph

14 Commits

Author SHA1 Message Date
bunnei 94e00fbb3f common: alignment: Add a helper function for generic alignment checking. 2020-04-17 00:59:28 -04:00
Lioncash 18a54d5b01 alignment: Resolve allocator construction issues on debug
This was related to the source allocator being passed into the
constructor potentially having a different type than allocator being
constructed.

We simply need to provide a constructor to handle this case.

This resolves issues related to the allocator causing debug builds on
MSVC to fail.
2019-10-06 18:49:49 -04:00
Lioncash a8ad9b2141 alignment: Specify trait definitions within the allocator
Allows containers and other data structures to consider optimizations
based off of them. We satisfy all of these requirements anyways.
2019-10-06 18:48:05 -04:00
Fernando Sahmkow 5f6d1644c4 Common/Alignment: Add noexcept where required. 2019-07-19 21:49:54 -04:00
Fernando Sahmkow 5581a0d296 Kernel: Address Feedback 2019-07-19 11:28:57 -04:00
Fernando Sahmkow f478fa3a7f Common: Correct alignment allocator to work on C++14 or higher. 2019-07-19 11:11:42 -04:00
Fernando Sahmkow 5bce8f62ac VM_Manager: Align allocated memory to 256bytes
This commit ensures that all backing memory allocated for the Guest CPU
is aligned to 256 bytes. This due to how gpu memory works and the heavy
constraints it has in the alignment of physical memory.
2019-07-19 10:06:08 -04:00
ReinUsesLisp 84878d07a9 common/alignment: Address feedback 2019-06-24 01:47:09 -03:00
ReinUsesLisp 1d10810d2b video_core: Use un-shifted block sizes to avoid integer divisions
Instead of storing all block width, height and depths in their shifted
form:

block_width = 1U << block_shift;

Store them like they are provided by the emulated hardware (their
block_shift form). This way we can avoid doing the costly
Common::AlignUp operation to align texture sizes and drop CPU integer
divisions with bitwise logic (defined in Common::AlignBits).
2019-06-20 21:36:12 -03:00
Lioncash da8827def6 common: Add function for checking word alignment to alignment.h
This will be used in a following change to svcArbitrateLock() and
svcArbitrateUnlock()
2018-10-18 12:58:27 -04:00
Lioncash 7784a1ca44 common: Move Is4KBAligned() to alignment.h
Aligning on 4KB pages isn't a Switch-specific thing, so this can be
moved to common so it can be used with other things as well.
2018-10-18 12:57:02 -04:00
fearlessTobi 1190ea6ddb Port #4182 from Citra: "Prefix all size_t with std::" 2018-09-15 15:21:06 +02:00
Lioncash 6b1e9244c0 common: Convert type traits templates over to variable template versions where applicable
Uses the C++17 inline variable variants
2018-08-07 19:34:47 -04:00
Jannik Vogel 5cf2de5ecf PICA: Align vertex attributes 2016-03-13 04:54:23 +01:00