diff options
| author | 2019-11-03 18:54:03 -0500 | |
|---|---|---|
| committer | 2019-11-03 22:22:41 -0500 | |
| commit | 1bdae0fe29f87daa81d2aba052a10a709b87485a (patch) | |
| tree | 16d0f4aa4c4a11222c6950b3ad60e7d1d9905036 /src | |
| parent | Merge pull request #3059 from FearlessTobi/stub-am-commands (diff) | |
| download | yuzu-1bdae0fe29f87daa81d2aba052a10a709b87485a.tar.gz yuzu-1bdae0fe29f87daa81d2aba052a10a709b87485a.tar.xz yuzu-1bdae0fe29f87daa81d2aba052a10a709b87485a.zip | |
common_func: Use std::array for INSERT_PADDING_* macros.
- Zero initialization here is useful for determinism.
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/bit_field.h | 7 | ||||
| -rw-r--r-- | src/common/common_funcs.h | 22 | ||||
| -rw-r--r-- | src/core/file_sys/content_archive.cpp | 39 | ||||
| -rw-r--r-- | src/core/file_sys/romfs.h | 19 | ||||
| -rw-r--r-- | src/core/hle/ipc.h | 6 | ||||
| -rw-r--r-- | src/core/hle/service/am/applets/error.cpp | 11 | ||||
| -rw-r--r-- | src/core/hle/service/vi/vi.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/engines/fermi_2d.h | 12 | ||||
| -rw-r--r-- | src/video_core/engines/kepler_compute.h | 18 | ||||
| -rw-r--r-- | src/video_core/engines/kepler_memory.h | 4 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 116 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_dma.h | 10 | ||||
| -rw-r--r-- | src/video_core/engines/shader_header.h | 50 | ||||
| -rw-r--r-- | src/video_core/gpu.h | 8 |
14 files changed, 166 insertions, 158 deletions
diff --git a/src/common/bit_field.h b/src/common/bit_field.h index 8131d1f95..fd2bbbd99 100644 --- a/src/common/bit_field.h +++ b/src/common/bit_field.h | |||
| @@ -36,6 +36,13 @@ | |||
| 36 | #include "common/common_funcs.h" | 36 | #include "common/common_funcs.h" |
| 37 | #include "common/swap.h" | 37 | #include "common/swap.h" |
| 38 | 38 | ||
| 39 | // Inlining | ||
| 40 | #ifdef _WIN32 | ||
| 41 | #define FORCE_INLINE __forceinline | ||
| 42 | #else | ||
| 43 | #define FORCE_INLINE inline __attribute__((always_inline)) | ||
| 44 | #endif | ||
| 45 | |||
| 39 | /* | 46 | /* |
| 40 | * Abstract bitfield class | 47 | * Abstract bitfield class |
| 41 | * | 48 | * |
diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h index 04ecac959..c029dc7b3 100644 --- a/src/common/common_funcs.h +++ b/src/common/common_funcs.h | |||
| @@ -1,10 +1,11 @@ | |||
| 1 | // Copyright 2013 Dolphin Emulator Project / 2014 Citra Emulator Project | 1 | // Copyright 2019 yuzu emulator team |
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <algorithm> | 7 | #include <algorithm> |
| 8 | #include <array> | ||
| 8 | #include <string> | 9 | #include <string> |
| 9 | 10 | ||
| 10 | #if !defined(ARCHITECTURE_x86_64) | 11 | #if !defined(ARCHITECTURE_x86_64) |
| @@ -16,18 +17,15 @@ | |||
| 16 | #define CONCAT2(x, y) DO_CONCAT2(x, y) | 17 | #define CONCAT2(x, y) DO_CONCAT2(x, y) |
| 17 | #define DO_CONCAT2(x, y) x##y | 18 | #define DO_CONCAT2(x, y) x##y |
| 18 | 19 | ||
| 19 | // helper macro to properly align structure members. | 20 | /// Helper macros to insert unused bytes or words to properly align structs. These values will be |
| 20 | // Calling INSERT_PADDING_BYTES will add a new member variable with a name like "pad121", | 21 | /// zero-initialized. |
| 21 | // depending on the current source line to make sure variable names are unique. | 22 | #define INSERT_PADDING_BYTES(num_bytes) std::array<u8, num_bytes> CONCAT2(pad, __LINE__){}; |
| 22 | #define INSERT_PADDING_BYTES(num_bytes) u8 CONCAT2(pad, __LINE__)[(num_bytes)] | 23 | #define INSERT_PADDING_WORDS(num_words) std::array<u32, num_words> CONCAT2(pad, __LINE__){}; |
| 23 | #define INSERT_PADDING_WORDS(num_words) u32 CONCAT2(pad, __LINE__)[(num_words)] | ||
| 24 | 24 | ||
| 25 | // Inlining | 25 | /// These are similar to the INSERT_PADDING_* macros, but are needed for padding unions. This is |
| 26 | #ifdef _WIN32 | 26 | /// because unions can only be initialized by one member. |
| 27 | #define FORCE_INLINE __forceinline | 27 | #define INSERT_UNION_PADDING_BYTES(num_bytes) std::array<u8, num_bytes> CONCAT2(pad, __LINE__); |
| 28 | #else | 28 | #define INSERT_UNION_PADDING_WORDS(num_words) std::array<u32, num_words> CONCAT2(pad, __LINE__); |
| 29 | #define FORCE_INLINE inline __attribute__((always_inline)) | ||
| 30 | #endif | ||
| 31 | 29 | ||
| 32 | #ifndef _MSC_VER | 30 | #ifndef _MSC_VER |
| 33 | 31 | ||
diff --git a/src/core/file_sys/content_archive.cpp b/src/core/file_sys/content_archive.cpp index ea5c92f61..b8bbdd1ef 100644 --- a/src/core/file_sys/content_archive.cpp +++ b/src/core/file_sys/content_archive.cpp | |||
| @@ -32,11 +32,28 @@ enum class NCASectionFilesystemType : u8 { | |||
| 32 | ROMFS = 0x3, | 32 | ROMFS = 0x3, |
| 33 | }; | 33 | }; |
| 34 | 34 | ||
| 35 | struct IVFCLevel { | ||
| 36 | u64_le offset; | ||
| 37 | u64_le size; | ||
| 38 | u32_le block_size; | ||
| 39 | u32_le reserved; | ||
| 40 | }; | ||
| 41 | static_assert(sizeof(IVFCLevel) == 0x18, "IVFCLevel has incorrect size."); | ||
| 42 | |||
| 43 | struct IVFCHeader { | ||
| 44 | u32_le magic; | ||
| 45 | u32_le magic_number; | ||
| 46 | INSERT_UNION_PADDING_BYTES(8); | ||
| 47 | std::array<IVFCLevel, 6> levels; | ||
| 48 | INSERT_UNION_PADDING_BYTES(64); | ||
| 49 | }; | ||
| 50 | static_assert(sizeof(IVFCHeader) == 0xE0, "IVFCHeader has incorrect size."); | ||
| 51 | |||
| 35 | struct NCASectionHeaderBlock { | 52 | struct NCASectionHeaderBlock { |
| 36 | INSERT_PADDING_BYTES(3); | 53 | INSERT_UNION_PADDING_BYTES(3); |
| 37 | NCASectionFilesystemType filesystem_type; | 54 | NCASectionFilesystemType filesystem_type; |
| 38 | NCASectionCryptoType crypto_type; | 55 | NCASectionCryptoType crypto_type; |
| 39 | INSERT_PADDING_BYTES(3); | 56 | INSERT_UNION_PADDING_BYTES(3); |
| 40 | }; | 57 | }; |
| 41 | static_assert(sizeof(NCASectionHeaderBlock) == 0x8, "NCASectionHeaderBlock has incorrect size."); | 58 | static_assert(sizeof(NCASectionHeaderBlock) == 0x8, "NCASectionHeaderBlock has incorrect size."); |
| 42 | 59 | ||
| @@ -44,7 +61,7 @@ struct NCASectionRaw { | |||
| 44 | NCASectionHeaderBlock header; | 61 | NCASectionHeaderBlock header; |
| 45 | std::array<u8, 0x138> block_data; | 62 | std::array<u8, 0x138> block_data; |
| 46 | std::array<u8, 0x8> section_ctr; | 63 | std::array<u8, 0x8> section_ctr; |
| 47 | INSERT_PADDING_BYTES(0xB8); | 64 | INSERT_UNION_PADDING_BYTES(0xB8); |
| 48 | }; | 65 | }; |
| 49 | static_assert(sizeof(NCASectionRaw) == 0x200, "NCASectionRaw has incorrect size."); | 66 | static_assert(sizeof(NCASectionRaw) == 0x200, "NCASectionRaw has incorrect size."); |
| 50 | 67 | ||
| @@ -52,19 +69,19 @@ struct PFS0Superblock { | |||
| 52 | NCASectionHeaderBlock header_block; | 69 | NCASectionHeaderBlock header_block; |
| 53 | std::array<u8, 0x20> hash; | 70 | std::array<u8, 0x20> hash; |
| 54 | u32_le size; | 71 | u32_le size; |
| 55 | INSERT_PADDING_BYTES(4); | 72 | INSERT_UNION_PADDING_BYTES(4); |
| 56 | u64_le hash_table_offset; | 73 | u64_le hash_table_offset; |
| 57 | u64_le hash_table_size; | 74 | u64_le hash_table_size; |
| 58 | u64_le pfs0_header_offset; | 75 | u64_le pfs0_header_offset; |
| 59 | u64_le pfs0_size; | 76 | u64_le pfs0_size; |
| 60 | INSERT_PADDING_BYTES(0x1B0); | 77 | INSERT_UNION_PADDING_BYTES(0x1B0); |
| 61 | }; | 78 | }; |
| 62 | static_assert(sizeof(PFS0Superblock) == 0x200, "PFS0Superblock has incorrect size."); | 79 | static_assert(sizeof(PFS0Superblock) == 0x200, "PFS0Superblock has incorrect size."); |
| 63 | 80 | ||
| 64 | struct RomFSSuperblock { | 81 | struct RomFSSuperblock { |
| 65 | NCASectionHeaderBlock header_block; | 82 | NCASectionHeaderBlock header_block; |
| 66 | IVFCHeader ivfc; | 83 | IVFCHeader ivfc; |
| 67 | INSERT_PADDING_BYTES(0x118); | 84 | INSERT_UNION_PADDING_BYTES(0x118); |
| 68 | }; | 85 | }; |
| 69 | static_assert(sizeof(RomFSSuperblock) == 0x200, "RomFSSuperblock has incorrect size."); | 86 | static_assert(sizeof(RomFSSuperblock) == 0x200, "RomFSSuperblock has incorrect size."); |
| 70 | 87 | ||
| @@ -72,24 +89,24 @@ struct BKTRHeader { | |||
| 72 | u64_le offset; | 89 | u64_le offset; |
| 73 | u64_le size; | 90 | u64_le size; |
| 74 | u32_le magic; | 91 | u32_le magic; |
| 75 | INSERT_PADDING_BYTES(0x4); | 92 | INSERT_UNION_PADDING_BYTES(0x4); |
| 76 | u32_le number_entries; | 93 | u32_le number_entries; |
| 77 | INSERT_PADDING_BYTES(0x4); | 94 | INSERT_UNION_PADDING_BYTES(0x4); |
| 78 | }; | 95 | }; |
| 79 | static_assert(sizeof(BKTRHeader) == 0x20, "BKTRHeader has incorrect size."); | 96 | static_assert(sizeof(BKTRHeader) == 0x20, "BKTRHeader has incorrect size."); |
| 80 | 97 | ||
| 81 | struct BKTRSuperblock { | 98 | struct BKTRSuperblock { |
| 82 | NCASectionHeaderBlock header_block; | 99 | NCASectionHeaderBlock header_block; |
| 83 | IVFCHeader ivfc; | 100 | IVFCHeader ivfc; |
| 84 | INSERT_PADDING_BYTES(0x18); | 101 | INSERT_UNION_PADDING_BYTES(0x18); |
| 85 | BKTRHeader relocation; | 102 | BKTRHeader relocation; |
| 86 | BKTRHeader subsection; | 103 | BKTRHeader subsection; |
| 87 | INSERT_PADDING_BYTES(0xC0); | 104 | INSERT_UNION_PADDING_BYTES(0xC0); |
| 88 | }; | 105 | }; |
| 89 | static_assert(sizeof(BKTRSuperblock) == 0x200, "BKTRSuperblock has incorrect size."); | 106 | static_assert(sizeof(BKTRSuperblock) == 0x200, "BKTRSuperblock has incorrect size."); |
| 90 | 107 | ||
| 91 | union NCASectionHeader { | 108 | union NCASectionHeader { |
| 92 | NCASectionRaw raw; | 109 | NCASectionRaw raw{}; |
| 93 | PFS0Superblock pfs0; | 110 | PFS0Superblock pfs0; |
| 94 | RomFSSuperblock romfs; | 111 | RomFSSuperblock romfs; |
| 95 | BKTRSuperblock bktr; | 112 | BKTRSuperblock bktr; |
diff --git a/src/core/file_sys/romfs.h b/src/core/file_sys/romfs.h index 0f35639bc..1c89be8a4 100644 --- a/src/core/file_sys/romfs.h +++ b/src/core/file_sys/romfs.h | |||
| @@ -13,25 +13,6 @@ | |||
| 13 | 13 | ||
| 14 | namespace FileSys { | 14 | namespace FileSys { |
| 15 | 15 | ||
| 16 | struct RomFSHeader; | ||
| 17 | |||
| 18 | struct IVFCLevel { | ||
| 19 | u64_le offset; | ||
| 20 | u64_le size; | ||
| 21 | u32_le block_size; | ||
| 22 | u32_le reserved; | ||
| 23 | }; | ||
| 24 | static_assert(sizeof(IVFCLevel) == 0x18, "IVFCLevel has incorrect size."); | ||
| 25 | |||
| 26 | struct IVFCHeader { | ||
| 27 | u32_le magic; | ||
| 28 | u32_le magic_number; | ||
| 29 | INSERT_PADDING_BYTES(8); | ||
| 30 | std::array<IVFCLevel, 6> levels; | ||
| 31 | INSERT_PADDING_BYTES(64); | ||
| 32 | }; | ||
| 33 | static_assert(sizeof(IVFCHeader) == 0xE0, "IVFCHeader has incorrect size."); | ||
| 34 | |||
| 35 | enum class RomFSExtractionType { | 16 | enum class RomFSExtractionType { |
| 36 | Full, // Includes data directory | 17 | Full, // Includes data directory |
| 37 | Truncated, // Traverses into data directory | 18 | Truncated, // Traverses into data directory |
diff --git a/src/core/hle/ipc.h b/src/core/hle/ipc.h index fae54bcc7..7ce313190 100644 --- a/src/core/hle/ipc.h +++ b/src/core/hle/ipc.h | |||
| @@ -160,7 +160,7 @@ struct DomainMessageHeader { | |||
| 160 | // Used when responding to an IPC request, Server -> Client. | 160 | // Used when responding to an IPC request, Server -> Client. |
| 161 | struct { | 161 | struct { |
| 162 | u32_le num_objects; | 162 | u32_le num_objects; |
| 163 | INSERT_PADDING_WORDS(3); | 163 | INSERT_UNION_PADDING_WORDS(3); |
| 164 | }; | 164 | }; |
| 165 | 165 | ||
| 166 | // Used when performing an IPC request, Client -> Server. | 166 | // Used when performing an IPC request, Client -> Server. |
| @@ -171,8 +171,10 @@ struct DomainMessageHeader { | |||
| 171 | BitField<16, 16, u32> size; | 171 | BitField<16, 16, u32> size; |
| 172 | }; | 172 | }; |
| 173 | u32_le object_id; | 173 | u32_le object_id; |
| 174 | INSERT_PADDING_WORDS(2); | 174 | INSERT_UNION_PADDING_WORDS(2); |
| 175 | }; | 175 | }; |
| 176 | |||
| 177 | std::array<u32, 4> raw{}; | ||
| 176 | }; | 178 | }; |
| 177 | }; | 179 | }; |
| 178 | static_assert(sizeof(DomainMessageHeader) == 16, "DomainMessageHeader size is incorrect"); | 180 | static_assert(sizeof(DomainMessageHeader) == 16, "DomainMessageHeader size is incorrect"); |
diff --git a/src/core/hle/service/am/applets/error.cpp b/src/core/hle/service/am/applets/error.cpp index a7db26725..eab0d42c9 100644 --- a/src/core/hle/service/am/applets/error.cpp +++ b/src/core/hle/service/am/applets/error.cpp | |||
| @@ -20,9 +20,9 @@ namespace Service::AM::Applets { | |||
| 20 | struct ShowError { | 20 | struct ShowError { |
| 21 | u8 mode; | 21 | u8 mode; |
| 22 | bool jump; | 22 | bool jump; |
| 23 | INSERT_PADDING_BYTES(4); | 23 | INSERT_UNION_PADDING_BYTES(4); |
| 24 | bool use_64bit_error_code; | 24 | bool use_64bit_error_code; |
| 25 | INSERT_PADDING_BYTES(1); | 25 | INSERT_UNION_PADDING_BYTES(1); |
| 26 | u64 error_code_64; | 26 | u64 error_code_64; |
| 27 | u32 error_code_32; | 27 | u32 error_code_32; |
| 28 | }; | 28 | }; |
| @@ -32,7 +32,7 @@ static_assert(sizeof(ShowError) == 0x14, "ShowError has incorrect size."); | |||
| 32 | struct ShowErrorRecord { | 32 | struct ShowErrorRecord { |
| 33 | u8 mode; | 33 | u8 mode; |
| 34 | bool jump; | 34 | bool jump; |
| 35 | INSERT_PADDING_BYTES(6); | 35 | INSERT_UNION_PADDING_BYTES(6); |
| 36 | u64 error_code_64; | 36 | u64 error_code_64; |
| 37 | u64 posix_time; | 37 | u64 posix_time; |
| 38 | }; | 38 | }; |
| @@ -41,7 +41,7 @@ static_assert(sizeof(ShowErrorRecord) == 0x18, "ShowErrorRecord has incorrect si | |||
| 41 | struct SystemErrorArg { | 41 | struct SystemErrorArg { |
| 42 | u8 mode; | 42 | u8 mode; |
| 43 | bool jump; | 43 | bool jump; |
| 44 | INSERT_PADDING_BYTES(6); | 44 | INSERT_UNION_PADDING_BYTES(6); |
| 45 | u64 error_code_64; | 45 | u64 error_code_64; |
| 46 | std::array<char, 8> language_code; | 46 | std::array<char, 8> language_code; |
| 47 | std::array<char, 0x800> main_text; | 47 | std::array<char, 0x800> main_text; |
| @@ -52,7 +52,7 @@ static_assert(sizeof(SystemErrorArg) == 0x1018, "SystemErrorArg has incorrect si | |||
| 52 | struct ApplicationErrorArg { | 52 | struct ApplicationErrorArg { |
| 53 | u8 mode; | 53 | u8 mode; |
| 54 | bool jump; | 54 | bool jump; |
| 55 | INSERT_PADDING_BYTES(6); | 55 | INSERT_UNION_PADDING_BYTES(6); |
| 56 | u32 error_code; | 56 | u32 error_code; |
| 57 | std::array<char, 8> language_code; | 57 | std::array<char, 8> language_code; |
| 58 | std::array<char, 0x800> main_text; | 58 | std::array<char, 0x800> main_text; |
| @@ -65,6 +65,7 @@ union Error::ErrorArguments { | |||
| 65 | ShowErrorRecord error_record; | 65 | ShowErrorRecord error_record; |
| 66 | SystemErrorArg system_error; | 66 | SystemErrorArg system_error; |
| 67 | ApplicationErrorArg application_error; | 67 | ApplicationErrorArg application_error; |
| 68 | std::array<u8, 0x1018> raw{}; | ||
| 68 | }; | 69 | }; |
| 69 | 70 | ||
| 70 | namespace { | 71 | namespace { |
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index 199b30635..611cecc20 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp | |||
| @@ -45,7 +45,7 @@ struct DisplayInfo { | |||
| 45 | 45 | ||
| 46 | /// Whether or not the display has a limited number of layers. | 46 | /// Whether or not the display has a limited number of layers. |
| 47 | u8 has_limited_layers{1}; | 47 | u8 has_limited_layers{1}; |
| 48 | INSERT_PADDING_BYTES(7){}; | 48 | INSERT_PADDING_BYTES(7); |
| 49 | 49 | ||
| 50 | /// Indicates the total amount of layers supported by the display. | 50 | /// Indicates the total amount of layers supported by the display. |
| 51 | /// @note This is only valid if has_limited_layers is set. | 51 | /// @note This is only valid if has_limited_layers is set. |
diff --git a/src/video_core/engines/fermi_2d.h b/src/video_core/engines/fermi_2d.h index 0901cf2fa..dba342c70 100644 --- a/src/video_core/engines/fermi_2d.h +++ b/src/video_core/engines/fermi_2d.h | |||
| @@ -99,19 +99,19 @@ public: | |||
| 99 | 99 | ||
| 100 | union { | 100 | union { |
| 101 | struct { | 101 | struct { |
| 102 | INSERT_PADDING_WORDS(0x80); | 102 | INSERT_UNION_PADDING_WORDS(0x80); |
| 103 | 103 | ||
| 104 | Surface dst; | 104 | Surface dst; |
| 105 | 105 | ||
| 106 | INSERT_PADDING_WORDS(2); | 106 | INSERT_UNION_PADDING_WORDS(2); |
| 107 | 107 | ||
| 108 | Surface src; | 108 | Surface src; |
| 109 | 109 | ||
| 110 | INSERT_PADDING_WORDS(0x15); | 110 | INSERT_UNION_PADDING_WORDS(0x15); |
| 111 | 111 | ||
| 112 | Operation operation; | 112 | Operation operation; |
| 113 | 113 | ||
| 114 | INSERT_PADDING_WORDS(0x177); | 114 | INSERT_UNION_PADDING_WORDS(0x177); |
| 115 | 115 | ||
| 116 | union { | 116 | union { |
| 117 | u32 raw; | 117 | u32 raw; |
| @@ -119,7 +119,7 @@ public: | |||
| 119 | BitField<4, 1, Filter> filter; | 119 | BitField<4, 1, Filter> filter; |
| 120 | } blit_control; | 120 | } blit_control; |
| 121 | 121 | ||
| 122 | INSERT_PADDING_WORDS(0x8); | 122 | INSERT_UNION_PADDING_WORDS(0x8); |
| 123 | 123 | ||
| 124 | u32 blit_dst_x; | 124 | u32 blit_dst_x; |
| 125 | u32 blit_dst_y; | 125 | u32 blit_dst_y; |
| @@ -130,7 +130,7 @@ public: | |||
| 130 | u64 blit_src_x; | 130 | u64 blit_src_x; |
| 131 | u64 blit_src_y; | 131 | u64 blit_src_y; |
| 132 | 132 | ||
| 133 | INSERT_PADDING_WORDS(0x21); | 133 | INSERT_UNION_PADDING_WORDS(0x21); |
| 134 | }; | 134 | }; |
| 135 | std::array<u32, NUM_REGS> reg_array; | 135 | std::array<u32, NUM_REGS> reg_array; |
| 136 | }; | 136 | }; |
diff --git a/src/video_core/engines/kepler_compute.h b/src/video_core/engines/kepler_compute.h index b185c98c7..5259d92bd 100644 --- a/src/video_core/engines/kepler_compute.h +++ b/src/video_core/engines/kepler_compute.h | |||
| @@ -51,7 +51,7 @@ public: | |||
| 51 | 51 | ||
| 52 | union { | 52 | union { |
| 53 | struct { | 53 | struct { |
| 54 | INSERT_PADDING_WORDS(0x60); | 54 | INSERT_UNION_PADDING_WORDS(0x60); |
| 55 | 55 | ||
| 56 | Upload::Registers upload; | 56 | Upload::Registers upload; |
| 57 | 57 | ||
| @@ -63,7 +63,7 @@ public: | |||
| 63 | 63 | ||
| 64 | u32 data_upload; | 64 | u32 data_upload; |
| 65 | 65 | ||
| 66 | INSERT_PADDING_WORDS(0x3F); | 66 | INSERT_UNION_PADDING_WORDS(0x3F); |
| 67 | 67 | ||
| 68 | struct { | 68 | struct { |
| 69 | u32 address; | 69 | u32 address; |
| @@ -72,11 +72,11 @@ public: | |||
| 72 | } | 72 | } |
| 73 | } launch_desc_loc; | 73 | } launch_desc_loc; |
| 74 | 74 | ||
| 75 | INSERT_PADDING_WORDS(0x1); | 75 | INSERT_UNION_PADDING_WORDS(0x1); |
| 76 | 76 | ||
| 77 | u32 launch; | 77 | u32 launch; |
| 78 | 78 | ||
| 79 | INSERT_PADDING_WORDS(0x4A7); | 79 | INSERT_UNION_PADDING_WORDS(0x4A7); |
| 80 | 80 | ||
| 81 | struct { | 81 | struct { |
| 82 | u32 address_high; | 82 | u32 address_high; |
| @@ -88,7 +88,7 @@ public: | |||
| 88 | } | 88 | } |
| 89 | } tsc; | 89 | } tsc; |
| 90 | 90 | ||
| 91 | INSERT_PADDING_WORDS(0x3); | 91 | INSERT_UNION_PADDING_WORDS(0x3); |
| 92 | 92 | ||
| 93 | struct { | 93 | struct { |
| 94 | u32 address_high; | 94 | u32 address_high; |
| @@ -100,7 +100,7 @@ public: | |||
| 100 | } | 100 | } |
| 101 | } tic; | 101 | } tic; |
| 102 | 102 | ||
| 103 | INSERT_PADDING_WORDS(0x22); | 103 | INSERT_UNION_PADDING_WORDS(0x22); |
| 104 | 104 | ||
| 105 | struct { | 105 | struct { |
| 106 | u32 address_high; | 106 | u32 address_high; |
| @@ -111,11 +111,11 @@ public: | |||
| 111 | } | 111 | } |
| 112 | } code_loc; | 112 | } code_loc; |
| 113 | 113 | ||
| 114 | INSERT_PADDING_WORDS(0x3FE); | 114 | INSERT_UNION_PADDING_WORDS(0x3FE); |
| 115 | 115 | ||
| 116 | u32 tex_cb_index; | 116 | u32 tex_cb_index; |
| 117 | 117 | ||
| 118 | INSERT_PADDING_WORDS(0x374); | 118 | INSERT_UNION_PADDING_WORDS(0x374); |
| 119 | }; | 119 | }; |
| 120 | std::array<u32, NUM_REGS> reg_array; | 120 | std::array<u32, NUM_REGS> reg_array; |
| 121 | }; | 121 | }; |
| @@ -179,7 +179,7 @@ public: | |||
| 179 | }; | 179 | }; |
| 180 | 180 | ||
| 181 | INSERT_PADDING_WORDS(0x11); | 181 | INSERT_PADDING_WORDS(0x11); |
| 182 | } launch_description; | 182 | } launch_description{}; |
| 183 | 183 | ||
| 184 | struct { | 184 | struct { |
| 185 | u32 write_offset = 0; | 185 | u32 write_offset = 0; |
diff --git a/src/video_core/engines/kepler_memory.h b/src/video_core/engines/kepler_memory.h index e0e25c321..396fb6e86 100644 --- a/src/video_core/engines/kepler_memory.h +++ b/src/video_core/engines/kepler_memory.h | |||
| @@ -45,7 +45,7 @@ public: | |||
| 45 | 45 | ||
| 46 | union { | 46 | union { |
| 47 | struct { | 47 | struct { |
| 48 | INSERT_PADDING_WORDS(0x60); | 48 | INSERT_UNION_PADDING_WORDS(0x60); |
| 49 | 49 | ||
| 50 | Upload::Registers upload; | 50 | Upload::Registers upload; |
| 51 | 51 | ||
| @@ -57,7 +57,7 @@ public: | |||
| 57 | 57 | ||
| 58 | u32 data; | 58 | u32 data; |
| 59 | 59 | ||
| 60 | INSERT_PADDING_WORDS(0x11); | 60 | INSERT_UNION_PADDING_WORDS(0x11); |
| 61 | }; | 61 | }; |
| 62 | std::array<u32, NUM_REGS> reg_array; | 62 | std::array<u32, NUM_REGS> reg_array; |
| 63 | }; | 63 | }; |
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 8cc842684..1aa7c274f 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -496,7 +496,7 @@ public: | |||
| 496 | Equation equation_a; | 496 | Equation equation_a; |
| 497 | Factor factor_source_a; | 497 | Factor factor_source_a; |
| 498 | Factor factor_dest_a; | 498 | Factor factor_dest_a; |
| 499 | INSERT_PADDING_WORDS(1); | 499 | INSERT_UNION_PADDING_WORDS(1); |
| 500 | }; | 500 | }; |
| 501 | 501 | ||
| 502 | struct RenderTargetConfig { | 502 | struct RenderTargetConfig { |
| @@ -517,7 +517,7 @@ public: | |||
| 517 | }; | 517 | }; |
| 518 | u32 layer_stride; | 518 | u32 layer_stride; |
| 519 | u32 base_layer; | 519 | u32 base_layer; |
| 520 | INSERT_PADDING_WORDS(7); | 520 | INSERT_UNION_PADDING_WORDS(7); |
| 521 | 521 | ||
| 522 | GPUVAddr Address() const { | 522 | GPUVAddr Address() const { |
| 523 | return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) | | 523 | return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) | |
| @@ -542,7 +542,7 @@ public: | |||
| 542 | f32 translate_x; | 542 | f32 translate_x; |
| 543 | f32 translate_y; | 543 | f32 translate_y; |
| 544 | f32 translate_z; | 544 | f32 translate_z; |
| 545 | INSERT_PADDING_WORDS(2); | 545 | INSERT_UNION_PADDING_WORDS(2); |
| 546 | 546 | ||
| 547 | Common::Rectangle<s32> GetRect() const { | 547 | Common::Rectangle<s32> GetRect() const { |
| 548 | return { | 548 | return { |
| @@ -606,7 +606,7 @@ public: | |||
| 606 | 606 | ||
| 607 | union { | 607 | union { |
| 608 | struct { | 608 | struct { |
| 609 | INSERT_PADDING_WORDS(0x45); | 609 | INSERT_UNION_PADDING_WORDS(0x45); |
| 610 | 610 | ||
| 611 | struct { | 611 | struct { |
| 612 | u32 upload_address; | 612 | u32 upload_address; |
| @@ -615,7 +615,7 @@ public: | |||
| 615 | u32 bind; | 615 | u32 bind; |
| 616 | } macros; | 616 | } macros; |
| 617 | 617 | ||
| 618 | INSERT_PADDING_WORDS(0x17); | 618 | INSERT_UNION_PADDING_WORDS(0x17); |
| 619 | 619 | ||
| 620 | Upload::Registers upload; | 620 | Upload::Registers upload; |
| 621 | struct { | 621 | struct { |
| @@ -626,7 +626,7 @@ public: | |||
| 626 | 626 | ||
| 627 | u32 data_upload; | 627 | u32 data_upload; |
| 628 | 628 | ||
| 629 | INSERT_PADDING_WORDS(0x44); | 629 | INSERT_UNION_PADDING_WORDS(0x44); |
| 630 | 630 | ||
| 631 | struct { | 631 | struct { |
| 632 | union { | 632 | union { |
| @@ -636,11 +636,11 @@ public: | |||
| 636 | }; | 636 | }; |
| 637 | } sync_info; | 637 | } sync_info; |
| 638 | 638 | ||
| 639 | INSERT_PADDING_WORDS(0x11E); | 639 | INSERT_UNION_PADDING_WORDS(0x11E); |
| 640 | 640 | ||
| 641 | u32 tfb_enabled; | 641 | u32 tfb_enabled; |
| 642 | 642 | ||
| 643 | INSERT_PADDING_WORDS(0x2E); | 643 | INSERT_UNION_PADDING_WORDS(0x2E); |
| 644 | 644 | ||
| 645 | std::array<RenderTargetConfig, NumRenderTargets> rt; | 645 | std::array<RenderTargetConfig, NumRenderTargets> rt; |
| 646 | 646 | ||
| @@ -648,49 +648,49 @@ public: | |||
| 648 | 648 | ||
| 649 | std::array<ViewPort, NumViewports> viewports; | 649 | std::array<ViewPort, NumViewports> viewports; |
| 650 | 650 | ||
| 651 | INSERT_PADDING_WORDS(0x1D); | 651 | INSERT_UNION_PADDING_WORDS(0x1D); |
| 652 | 652 | ||
| 653 | struct { | 653 | struct { |
| 654 | u32 first; | 654 | u32 first; |
| 655 | u32 count; | 655 | u32 count; |
| 656 | } vertex_buffer; | 656 | } vertex_buffer; |
| 657 | 657 | ||
| 658 | INSERT_PADDING_WORDS(1); | 658 | INSERT_UNION_PADDING_WORDS(1); |
| 659 | 659 | ||
| 660 | float clear_color[4]; | 660 | float clear_color[4]; |
| 661 | float clear_depth; | 661 | float clear_depth; |
| 662 | 662 | ||
| 663 | INSERT_PADDING_WORDS(0x3); | 663 | INSERT_UNION_PADDING_WORDS(0x3); |
| 664 | 664 | ||
| 665 | s32 clear_stencil; | 665 | s32 clear_stencil; |
| 666 | 666 | ||
| 667 | INSERT_PADDING_WORDS(0x7); | 667 | INSERT_UNION_PADDING_WORDS(0x7); |
| 668 | 668 | ||
| 669 | u32 polygon_offset_point_enable; | 669 | u32 polygon_offset_point_enable; |
| 670 | u32 polygon_offset_line_enable; | 670 | u32 polygon_offset_line_enable; |
| 671 | u32 polygon_offset_fill_enable; | 671 | u32 polygon_offset_fill_enable; |
| 672 | 672 | ||
| 673 | INSERT_PADDING_WORDS(0xD); | 673 | INSERT_UNION_PADDING_WORDS(0xD); |
| 674 | 674 | ||
| 675 | std::array<ScissorTest, NumViewports> scissor_test; | 675 | std::array<ScissorTest, NumViewports> scissor_test; |
| 676 | 676 | ||
| 677 | INSERT_PADDING_WORDS(0x15); | 677 | INSERT_UNION_PADDING_WORDS(0x15); |
| 678 | 678 | ||
| 679 | s32 stencil_back_func_ref; | 679 | s32 stencil_back_func_ref; |
| 680 | u32 stencil_back_mask; | 680 | u32 stencil_back_mask; |
| 681 | u32 stencil_back_func_mask; | 681 | u32 stencil_back_func_mask; |
| 682 | 682 | ||
| 683 | INSERT_PADDING_WORDS(0xC); | 683 | INSERT_UNION_PADDING_WORDS(0xC); |
| 684 | 684 | ||
| 685 | u32 color_mask_common; | 685 | u32 color_mask_common; |
| 686 | 686 | ||
| 687 | INSERT_PADDING_WORDS(0x6); | 687 | INSERT_UNION_PADDING_WORDS(0x6); |
| 688 | 688 | ||
| 689 | u32 rt_separate_frag_data; | 689 | u32 rt_separate_frag_data; |
| 690 | 690 | ||
| 691 | f32 depth_bounds[2]; | 691 | f32 depth_bounds[2]; |
| 692 | 692 | ||
| 693 | INSERT_PADDING_WORDS(0xA); | 693 | INSERT_UNION_PADDING_WORDS(0xA); |
| 694 | 694 | ||
| 695 | struct { | 695 | struct { |
| 696 | u32 address_high; | 696 | u32 address_high; |
| @@ -710,7 +710,7 @@ public: | |||
| 710 | } | 710 | } |
| 711 | } zeta; | 711 | } zeta; |
| 712 | 712 | ||
| 713 | INSERT_PADDING_WORDS(0x41); | 713 | INSERT_UNION_PADDING_WORDS(0x41); |
| 714 | 714 | ||
| 715 | union { | 715 | union { |
| 716 | BitField<0, 4, u32> stencil; | 716 | BitField<0, 4, u32> stencil; |
| @@ -719,11 +719,11 @@ public: | |||
| 719 | BitField<12, 4, u32> viewport; | 719 | BitField<12, 4, u32> viewport; |
| 720 | } clear_flags; | 720 | } clear_flags; |
| 721 | 721 | ||
| 722 | INSERT_PADDING_WORDS(0x19); | 722 | INSERT_UNION_PADDING_WORDS(0x19); |
| 723 | 723 | ||
| 724 | std::array<VertexAttribute, NumVertexAttributes> vertex_attrib_format; | 724 | std::array<VertexAttribute, NumVertexAttributes> vertex_attrib_format; |
| 725 | 725 | ||
| 726 | INSERT_PADDING_WORDS(0xF); | 726 | INSERT_UNION_PADDING_WORDS(0xF); |
| 727 | 727 | ||
| 728 | struct { | 728 | struct { |
| 729 | union { | 729 | union { |
| @@ -746,16 +746,16 @@ public: | |||
| 746 | } | 746 | } |
| 747 | } rt_control; | 747 | } rt_control; |
| 748 | 748 | ||
| 749 | INSERT_PADDING_WORDS(0x2); | 749 | INSERT_UNION_PADDING_WORDS(0x2); |
| 750 | 750 | ||
| 751 | u32 zeta_width; | 751 | u32 zeta_width; |
| 752 | u32 zeta_height; | 752 | u32 zeta_height; |
| 753 | 753 | ||
| 754 | INSERT_PADDING_WORDS(0x27); | 754 | INSERT_UNION_PADDING_WORDS(0x27); |
| 755 | 755 | ||
| 756 | u32 depth_test_enable; | 756 | u32 depth_test_enable; |
| 757 | 757 | ||
| 758 | INSERT_PADDING_WORDS(0x5); | 758 | INSERT_UNION_PADDING_WORDS(0x5); |
| 759 | 759 | ||
| 760 | u32 independent_blend_enable; | 760 | u32 independent_blend_enable; |
| 761 | 761 | ||
| @@ -763,7 +763,7 @@ public: | |||
| 763 | 763 | ||
| 764 | u32 alpha_test_enabled; | 764 | u32 alpha_test_enabled; |
| 765 | 765 | ||
| 766 | INSERT_PADDING_WORDS(0x6); | 766 | INSERT_UNION_PADDING_WORDS(0x6); |
| 767 | 767 | ||
| 768 | u32 d3d_cull_mode; | 768 | u32 d3d_cull_mode; |
| 769 | 769 | ||
| @@ -777,7 +777,7 @@ public: | |||
| 777 | float b; | 777 | float b; |
| 778 | float a; | 778 | float a; |
| 779 | } blend_color; | 779 | } blend_color; |
| 780 | INSERT_PADDING_WORDS(0x4); | 780 | INSERT_UNION_PADDING_WORDS(0x4); |
| 781 | 781 | ||
| 782 | struct { | 782 | struct { |
| 783 | u32 separate_alpha; | 783 | u32 separate_alpha; |
| @@ -786,7 +786,7 @@ public: | |||
| 786 | Blend::Factor factor_dest_rgb; | 786 | Blend::Factor factor_dest_rgb; |
| 787 | Blend::Equation equation_a; | 787 | Blend::Equation equation_a; |
| 788 | Blend::Factor factor_source_a; | 788 | Blend::Factor factor_source_a; |
| 789 | INSERT_PADDING_WORDS(1); | 789 | INSERT_UNION_PADDING_WORDS(1); |
| 790 | Blend::Factor factor_dest_a; | 790 | Blend::Factor factor_dest_a; |
| 791 | 791 | ||
| 792 | u32 enable_common; | 792 | u32 enable_common; |
| @@ -802,7 +802,7 @@ public: | |||
| 802 | u32 stencil_front_func_mask; | 802 | u32 stencil_front_func_mask; |
| 803 | u32 stencil_front_mask; | 803 | u32 stencil_front_mask; |
| 804 | 804 | ||
| 805 | INSERT_PADDING_WORDS(0x2); | 805 | INSERT_UNION_PADDING_WORDS(0x2); |
| 806 | 806 | ||
| 807 | u32 frag_color_clamp; | 807 | u32 frag_color_clamp; |
| 808 | 808 | ||
| @@ -811,12 +811,12 @@ public: | |||
| 811 | BitField<4, 1, u32> triangle_rast_flip; | 811 | BitField<4, 1, u32> triangle_rast_flip; |
| 812 | } screen_y_control; | 812 | } screen_y_control; |
| 813 | 813 | ||
| 814 | INSERT_PADDING_WORDS(0x21); | 814 | INSERT_UNION_PADDING_WORDS(0x21); |
| 815 | 815 | ||
| 816 | u32 vb_element_base; | 816 | u32 vb_element_base; |
| 817 | u32 vb_base_instance; | 817 | u32 vb_base_instance; |
| 818 | 818 | ||
| 819 | INSERT_PADDING_WORDS(0x35); | 819 | INSERT_UNION_PADDING_WORDS(0x35); |
| 820 | 820 | ||
| 821 | union { | 821 | union { |
| 822 | BitField<0, 1, u32> c0; | 822 | BitField<0, 1, u32> c0; |
| @@ -829,11 +829,11 @@ public: | |||
| 829 | BitField<7, 1, u32> c7; | 829 | BitField<7, 1, u32> c7; |
| 830 | } clip_distance_enabled; | 830 | } clip_distance_enabled; |
| 831 | 831 | ||
| 832 | INSERT_PADDING_WORDS(0x1); | 832 | INSERT_UNION_PADDING_WORDS(0x1); |
| 833 | 833 | ||
| 834 | float point_size; | 834 | float point_size; |
| 835 | 835 | ||
| 836 | INSERT_PADDING_WORDS(0x7); | 836 | INSERT_UNION_PADDING_WORDS(0x7); |
| 837 | 837 | ||
| 838 | u32 zeta_enable; | 838 | u32 zeta_enable; |
| 839 | 839 | ||
| @@ -842,7 +842,7 @@ public: | |||
| 842 | BitField<4, 1, u32> alpha_to_one; | 842 | BitField<4, 1, u32> alpha_to_one; |
| 843 | } multisample_control; | 843 | } multisample_control; |
| 844 | 844 | ||
| 845 | INSERT_PADDING_WORDS(0x4); | 845 | INSERT_UNION_PADDING_WORDS(0x4); |
| 846 | 846 | ||
| 847 | struct { | 847 | struct { |
| 848 | u32 address_high; | 848 | u32 address_high; |
| @@ -866,11 +866,11 @@ public: | |||
| 866 | } | 866 | } |
| 867 | } tsc; | 867 | } tsc; |
| 868 | 868 | ||
| 869 | INSERT_PADDING_WORDS(0x1); | 869 | INSERT_UNION_PADDING_WORDS(0x1); |
| 870 | 870 | ||
| 871 | float polygon_offset_factor; | 871 | float polygon_offset_factor; |
| 872 | 872 | ||
| 873 | INSERT_PADDING_WORDS(0x1); | 873 | INSERT_UNION_PADDING_WORDS(0x1); |
| 874 | 874 | ||
| 875 | struct { | 875 | struct { |
| 876 | u32 tic_address_high; | 876 | u32 tic_address_high; |
| @@ -883,7 +883,7 @@ public: | |||
| 883 | } | 883 | } |
| 884 | } tic; | 884 | } tic; |
| 885 | 885 | ||
| 886 | INSERT_PADDING_WORDS(0x5); | 886 | INSERT_UNION_PADDING_WORDS(0x5); |
| 887 | 887 | ||
| 888 | u32 stencil_two_side_enable; | 888 | u32 stencil_two_side_enable; |
| 889 | StencilOp stencil_back_op_fail; | 889 | StencilOp stencil_back_op_fail; |
| @@ -891,13 +891,13 @@ public: | |||
| 891 | StencilOp stencil_back_op_zpass; | 891 | StencilOp stencil_back_op_zpass; |
| 892 | ComparisonOp stencil_back_func_func; | 892 | ComparisonOp stencil_back_func_func; |
| 893 | 893 | ||
| 894 | INSERT_PADDING_WORDS(0x4); | 894 | INSERT_UNION_PADDING_WORDS(0x4); |
| 895 | 895 | ||
| 896 | u32 framebuffer_srgb; | 896 | u32 framebuffer_srgb; |
| 897 | 897 | ||
| 898 | float polygon_offset_units; | 898 | float polygon_offset_units; |
| 899 | 899 | ||
| 900 | INSERT_PADDING_WORDS(0x11); | 900 | INSERT_UNION_PADDING_WORDS(0x11); |
| 901 | 901 | ||
| 902 | union { | 902 | union { |
| 903 | BitField<2, 1, u32> coord_origin; | 903 | BitField<2, 1, u32> coord_origin; |
| @@ -913,7 +913,7 @@ public: | |||
| 913 | (static_cast<GPUVAddr>(code_address_high) << 32) | code_address_low); | 913 | (static_cast<GPUVAddr>(code_address_high) << 32) | code_address_low); |
| 914 | } | 914 | } |
| 915 | } code_address; | 915 | } code_address; |
| 916 | INSERT_PADDING_WORDS(1); | 916 | INSERT_UNION_PADDING_WORDS(1); |
| 917 | 917 | ||
| 918 | struct { | 918 | struct { |
| 919 | u32 vertex_end_gl; | 919 | u32 vertex_end_gl; |
| @@ -925,14 +925,14 @@ public: | |||
| 925 | }; | 925 | }; |
| 926 | } draw; | 926 | } draw; |
| 927 | 927 | ||
| 928 | INSERT_PADDING_WORDS(0xA); | 928 | INSERT_UNION_PADDING_WORDS(0xA); |
| 929 | 929 | ||
| 930 | struct { | 930 | struct { |
| 931 | u32 enabled; | 931 | u32 enabled; |
| 932 | u32 index; | 932 | u32 index; |
| 933 | } primitive_restart; | 933 | } primitive_restart; |
| 934 | 934 | ||
| 935 | INSERT_PADDING_WORDS(0x5F); | 935 | INSERT_UNION_PADDING_WORDS(0x5F); |
| 936 | 936 | ||
| 937 | struct { | 937 | struct { |
| 938 | u32 start_addr_high; | 938 | u32 start_addr_high; |
| @@ -973,9 +973,9 @@ public: | |||
| 973 | } | 973 | } |
| 974 | } index_array; | 974 | } index_array; |
| 975 | 975 | ||
| 976 | INSERT_PADDING_WORDS(0x7); | 976 | INSERT_UNION_PADDING_WORDS(0x7); |
| 977 | 977 | ||
| 978 | INSERT_PADDING_WORDS(0x1F); | 978 | INSERT_UNION_PADDING_WORDS(0x1F); |
| 979 | 979 | ||
| 980 | float polygon_offset_clamp; | 980 | float polygon_offset_clamp; |
| 981 | 981 | ||
| @@ -989,17 +989,17 @@ public: | |||
| 989 | } | 989 | } |
| 990 | } instanced_arrays; | 990 | } instanced_arrays; |
| 991 | 991 | ||
| 992 | INSERT_PADDING_WORDS(0x6); | 992 | INSERT_UNION_PADDING_WORDS(0x6); |
| 993 | 993 | ||
| 994 | Cull cull; | 994 | Cull cull; |
| 995 | 995 | ||
| 996 | u32 pixel_center_integer; | 996 | u32 pixel_center_integer; |
| 997 | 997 | ||
| 998 | INSERT_PADDING_WORDS(0x1); | 998 | INSERT_UNION_PADDING_WORDS(0x1); |
| 999 | 999 | ||
| 1000 | u32 viewport_transform_enabled; | 1000 | u32 viewport_transform_enabled; |
| 1001 | 1001 | ||
| 1002 | INSERT_PADDING_WORDS(0x3); | 1002 | INSERT_UNION_PADDING_WORDS(0x3); |
| 1003 | 1003 | ||
| 1004 | union { | 1004 | union { |
| 1005 | BitField<0, 1, u32> depth_range_0_1; | 1005 | BitField<0, 1, u32> depth_range_0_1; |
| @@ -1007,13 +1007,13 @@ public: | |||
| 1007 | BitField<4, 1, u32> depth_clamp_far; | 1007 | BitField<4, 1, u32> depth_clamp_far; |
| 1008 | } view_volume_clip_control; | 1008 | } view_volume_clip_control; |
| 1009 | 1009 | ||
| 1010 | INSERT_PADDING_WORDS(0x21); | 1010 | INSERT_UNION_PADDING_WORDS(0x21); |
| 1011 | struct { | 1011 | struct { |
| 1012 | u32 enable; | 1012 | u32 enable; |
| 1013 | LogicOperation operation; | 1013 | LogicOperation operation; |
| 1014 | } logic_op; | 1014 | } logic_op; |
| 1015 | 1015 | ||
| 1016 | INSERT_PADDING_WORDS(0x1); | 1016 | INSERT_UNION_PADDING_WORDS(0x1); |
| 1017 | 1017 | ||
| 1018 | union { | 1018 | union { |
| 1019 | u32 raw; | 1019 | u32 raw; |
| @@ -1026,9 +1026,9 @@ public: | |||
| 1026 | BitField<6, 4, u32> RT; | 1026 | BitField<6, 4, u32> RT; |
| 1027 | BitField<10, 11, u32> layer; | 1027 | BitField<10, 11, u32> layer; |
| 1028 | } clear_buffers; | 1028 | } clear_buffers; |
| 1029 | INSERT_PADDING_WORDS(0xB); | 1029 | INSERT_UNION_PADDING_WORDS(0xB); |
| 1030 | std::array<ColorMask, NumRenderTargets> color_mask; | 1030 | std::array<ColorMask, NumRenderTargets> color_mask; |
| 1031 | INSERT_PADDING_WORDS(0x38); | 1031 | INSERT_UNION_PADDING_WORDS(0x38); |
| 1032 | 1032 | ||
| 1033 | struct { | 1033 | struct { |
| 1034 | u32 query_address_high; | 1034 | u32 query_address_high; |
| @@ -1050,7 +1050,7 @@ public: | |||
| 1050 | } | 1050 | } |
| 1051 | } query; | 1051 | } query; |
| 1052 | 1052 | ||
| 1053 | INSERT_PADDING_WORDS(0x3C); | 1053 | INSERT_UNION_PADDING_WORDS(0x3C); |
| 1054 | 1054 | ||
| 1055 | struct { | 1055 | struct { |
| 1056 | union { | 1056 | union { |
| @@ -1090,10 +1090,10 @@ public: | |||
| 1090 | BitField<4, 4, ShaderProgram> program; | 1090 | BitField<4, 4, ShaderProgram> program; |
| 1091 | }; | 1091 | }; |
| 1092 | u32 offset; | 1092 | u32 offset; |
| 1093 | INSERT_PADDING_WORDS(14); | 1093 | INSERT_UNION_PADDING_WORDS(14); |
| 1094 | } shader_config[MaxShaderProgram]; | 1094 | } shader_config[MaxShaderProgram]; |
| 1095 | 1095 | ||
| 1096 | INSERT_PADDING_WORDS(0x60); | 1096 | INSERT_UNION_PADDING_WORDS(0x60); |
| 1097 | 1097 | ||
| 1098 | u32 firmware[0x20]; | 1098 | u32 firmware[0x20]; |
| 1099 | 1099 | ||
| @@ -1110,7 +1110,7 @@ public: | |||
| 1110 | } | 1110 | } |
| 1111 | } const_buffer; | 1111 | } const_buffer; |
| 1112 | 1112 | ||
| 1113 | INSERT_PADDING_WORDS(0x10); | 1113 | INSERT_UNION_PADDING_WORDS(0x10); |
| 1114 | 1114 | ||
| 1115 | struct { | 1115 | struct { |
| 1116 | union { | 1116 | union { |
| @@ -1118,14 +1118,14 @@ public: | |||
| 1118 | BitField<0, 1, u32> valid; | 1118 | BitField<0, 1, u32> valid; |
| 1119 | BitField<4, 5, u32> index; | 1119 | BitField<4, 5, u32> index; |
| 1120 | }; | 1120 | }; |
| 1121 | INSERT_PADDING_WORDS(7); | 1121 | INSERT_UNION_PADDING_WORDS(7); |
| 1122 | } cb_bind[MaxShaderStage]; | 1122 | } cb_bind[MaxShaderStage]; |
| 1123 | 1123 | ||
| 1124 | INSERT_PADDING_WORDS(0x56); | 1124 | INSERT_UNION_PADDING_WORDS(0x56); |
| 1125 | 1125 | ||
| 1126 | u32 tex_cb_index; | 1126 | u32 tex_cb_index; |
| 1127 | 1127 | ||
| 1128 | INSERT_PADDING_WORDS(0x395); | 1128 | INSERT_UNION_PADDING_WORDS(0x395); |
| 1129 | 1129 | ||
| 1130 | struct { | 1130 | struct { |
| 1131 | /// Compressed address of a buffer that holds information about bound SSBOs. | 1131 | /// Compressed address of a buffer that holds information about bound SSBOs. |
| @@ -1137,14 +1137,14 @@ public: | |||
| 1137 | } | 1137 | } |
| 1138 | } ssbo_info; | 1138 | } ssbo_info; |
| 1139 | 1139 | ||
| 1140 | INSERT_PADDING_WORDS(0x11); | 1140 | INSERT_UNION_PADDING_WORDS(0x11); |
| 1141 | 1141 | ||
| 1142 | struct { | 1142 | struct { |
| 1143 | u32 address[MaxShaderStage]; | 1143 | u32 address[MaxShaderStage]; |
| 1144 | u32 size[MaxShaderStage]; | 1144 | u32 size[MaxShaderStage]; |
| 1145 | } tex_info_buffers; | 1145 | } tex_info_buffers; |
| 1146 | 1146 | ||
| 1147 | INSERT_PADDING_WORDS(0xCC); | 1147 | INSERT_UNION_PADDING_WORDS(0xCC); |
| 1148 | }; | 1148 | }; |
| 1149 | std::array<u32, NUM_REGS> reg_array; | 1149 | std::array<u32, NUM_REGS> reg_array; |
| 1150 | }; | 1150 | }; |
diff --git a/src/video_core/engines/maxwell_dma.h b/src/video_core/engines/maxwell_dma.h index 93808a9bb..4f40d1d1f 100644 --- a/src/video_core/engines/maxwell_dma.h +++ b/src/video_core/engines/maxwell_dma.h | |||
| @@ -94,7 +94,7 @@ public: | |||
| 94 | 94 | ||
| 95 | union { | 95 | union { |
| 96 | struct { | 96 | struct { |
| 97 | INSERT_PADDING_WORDS(0xC0); | 97 | INSERT_UNION_PADDING_WORDS(0xC0); |
| 98 | 98 | ||
| 99 | struct { | 99 | struct { |
| 100 | union { | 100 | union { |
| @@ -112,7 +112,7 @@ public: | |||
| 112 | }; | 112 | }; |
| 113 | } exec; | 113 | } exec; |
| 114 | 114 | ||
| 115 | INSERT_PADDING_WORDS(0x3F); | 115 | INSERT_UNION_PADDING_WORDS(0x3F); |
| 116 | 116 | ||
| 117 | struct { | 117 | struct { |
| 118 | u32 address_high; | 118 | u32 address_high; |
| @@ -139,7 +139,7 @@ public: | |||
| 139 | u32 x_count; | 139 | u32 x_count; |
| 140 | u32 y_count; | 140 | u32 y_count; |
| 141 | 141 | ||
| 142 | INSERT_PADDING_WORDS(0xB8); | 142 | INSERT_UNION_PADDING_WORDS(0xB8); |
| 143 | 143 | ||
| 144 | u32 const0; | 144 | u32 const0; |
| 145 | u32 const1; | 145 | u32 const1; |
| @@ -162,11 +162,11 @@ public: | |||
| 162 | 162 | ||
| 163 | Parameters dst_params; | 163 | Parameters dst_params; |
| 164 | 164 | ||
| 165 | INSERT_PADDING_WORDS(1); | 165 | INSERT_UNION_PADDING_WORDS(1); |
| 166 | 166 | ||
| 167 | Parameters src_params; | 167 | Parameters src_params; |
| 168 | 168 | ||
| 169 | INSERT_PADDING_WORDS(0x13); | 169 | INSERT_UNION_PADDING_WORDS(0x13); |
| 170 | }; | 170 | }; |
| 171 | std::array<u32, NUM_REGS> reg_array; | 171 | std::array<u32, NUM_REGS> reg_array; |
| 172 | }; | 172 | }; |
diff --git a/src/video_core/engines/shader_header.h b/src/video_core/engines/shader_header.h index e86a7f04a..bc80661d8 100644 --- a/src/video_core/engines/shader_header.h +++ b/src/video_core/engines/shader_header.h | |||
| @@ -38,37 +38,37 @@ struct Header { | |||
| 38 | BitField<26, 1, u32> does_load_or_store; | 38 | BitField<26, 1, u32> does_load_or_store; |
| 39 | BitField<27, 1, u32> does_fp64; | 39 | BitField<27, 1, u32> does_fp64; |
| 40 | BitField<28, 4, u32> stream_out_mask; | 40 | BitField<28, 4, u32> stream_out_mask; |
| 41 | } common0; | 41 | } common0{}; |
| 42 | 42 | ||
| 43 | union { | 43 | union { |
| 44 | BitField<0, 24, u32> shader_local_memory_low_size; | 44 | BitField<0, 24, u32> shader_local_memory_low_size; |
| 45 | BitField<24, 8, u32> per_patch_attribute_count; | 45 | BitField<24, 8, u32> per_patch_attribute_count; |
| 46 | } common1; | 46 | } common1{}; |
| 47 | 47 | ||
| 48 | union { | 48 | union { |
| 49 | BitField<0, 24, u32> shader_local_memory_high_size; | 49 | BitField<0, 24, u32> shader_local_memory_high_size; |
| 50 | BitField<24, 8, u32> threads_per_input_primitive; | 50 | BitField<24, 8, u32> threads_per_input_primitive; |
| 51 | } common2; | 51 | } common2{}; |
| 52 | 52 | ||
| 53 | union { | 53 | union { |
| 54 | BitField<0, 24, u32> shader_local_memory_crs_size; | 54 | BitField<0, 24, u32> shader_local_memory_crs_size; |
| 55 | BitField<24, 4, OutputTopology> output_topology; | 55 | BitField<24, 4, OutputTopology> output_topology; |
| 56 | BitField<28, 4, u32> reserved; | 56 | BitField<28, 4, u32> reserved; |
| 57 | } common3; | 57 | } common3{}; |
| 58 | 58 | ||
| 59 | union { | 59 | union { |
| 60 | BitField<0, 12, u32> max_output_vertices; | 60 | BitField<0, 12, u32> max_output_vertices; |
| 61 | BitField<12, 8, u32> store_req_start; // NOTE: not used by geometry shaders. | 61 | BitField<12, 8, u32> store_req_start; // NOTE: not used by geometry shaders. |
| 62 | BitField<24, 4, u32> reserved; | 62 | BitField<24, 4, u32> reserved; |
| 63 | BitField<12, 8, u32> store_req_end; // NOTE: not used by geometry shaders. | 63 | BitField<12, 8, u32> store_req_end; // NOTE: not used by geometry shaders. |
| 64 | } common4; | 64 | } common4{}; |
| 65 | 65 | ||
| 66 | union { | 66 | union { |
| 67 | struct { | 67 | struct { |
| 68 | INSERT_PADDING_BYTES(3); // ImapSystemValuesA | 68 | INSERT_UNION_PADDING_BYTES(3); // ImapSystemValuesA |
| 69 | INSERT_PADDING_BYTES(1); // ImapSystemValuesB | 69 | INSERT_UNION_PADDING_BYTES(1); // ImapSystemValuesB |
| 70 | INSERT_PADDING_BYTES(16); // ImapGenericVector[32] | 70 | INSERT_UNION_PADDING_BYTES(16); // ImapGenericVector[32] |
| 71 | INSERT_PADDING_BYTES(2); // ImapColor | 71 | INSERT_UNION_PADDING_BYTES(2); // ImapColor |
| 72 | union { | 72 | union { |
| 73 | BitField<0, 8, u16> clip_distances; | 73 | BitField<0, 8, u16> clip_distances; |
| 74 | BitField<8, 1, u16> point_sprite_s; | 74 | BitField<8, 1, u16> point_sprite_s; |
| @@ -79,20 +79,20 @@ struct Header { | |||
| 79 | BitField<14, 1, u16> instance_id; | 79 | BitField<14, 1, u16> instance_id; |
| 80 | BitField<15, 1, u16> vertex_id; | 80 | BitField<15, 1, u16> vertex_id; |
| 81 | }; | 81 | }; |
| 82 | INSERT_PADDING_BYTES(5); // ImapFixedFncTexture[10] | 82 | INSERT_UNION_PADDING_BYTES(5); // ImapFixedFncTexture[10] |
| 83 | INSERT_PADDING_BYTES(1); // ImapReserved | 83 | INSERT_UNION_PADDING_BYTES(1); // ImapReserved |
| 84 | INSERT_PADDING_BYTES(3); // OmapSystemValuesA | 84 | INSERT_UNION_PADDING_BYTES(3); // OmapSystemValuesA |
| 85 | INSERT_PADDING_BYTES(1); // OmapSystemValuesB | 85 | INSERT_UNION_PADDING_BYTES(1); // OmapSystemValuesB |
| 86 | INSERT_PADDING_BYTES(16); // OmapGenericVector[32] | 86 | INSERT_UNION_PADDING_BYTES(16); // OmapGenericVector[32] |
| 87 | INSERT_PADDING_BYTES(2); // OmapColor | 87 | INSERT_UNION_PADDING_BYTES(2); // OmapColor |
| 88 | INSERT_PADDING_BYTES(2); // OmapSystemValuesC | 88 | INSERT_UNION_PADDING_BYTES(2); // OmapSystemValuesC |
| 89 | INSERT_PADDING_BYTES(5); // OmapFixedFncTexture[10] | 89 | INSERT_UNION_PADDING_BYTES(5); // OmapFixedFncTexture[10] |
| 90 | INSERT_PADDING_BYTES(1); // OmapReserved | 90 | INSERT_UNION_PADDING_BYTES(1); // OmapReserved |
| 91 | } vtg; | 91 | } vtg; |
| 92 | 92 | ||
| 93 | struct { | 93 | struct { |
| 94 | INSERT_PADDING_BYTES(3); // ImapSystemValuesA | 94 | INSERT_UNION_PADDING_BYTES(3); // ImapSystemValuesA |
| 95 | INSERT_PADDING_BYTES(1); // ImapSystemValuesB | 95 | INSERT_UNION_PADDING_BYTES(1); // ImapSystemValuesB |
| 96 | union { | 96 | union { |
| 97 | BitField<0, 2, AttributeUse> x; | 97 | BitField<0, 2, AttributeUse> x; |
| 98 | BitField<2, 2, AttributeUse> y; | 98 | BitField<2, 2, AttributeUse> y; |
| @@ -100,10 +100,10 @@ struct Header { | |||
| 100 | BitField<6, 2, AttributeUse> z; | 100 | BitField<6, 2, AttributeUse> z; |
| 101 | u8 raw; | 101 | u8 raw; |
| 102 | } imap_generic_vector[32]; | 102 | } imap_generic_vector[32]; |
| 103 | INSERT_PADDING_BYTES(2); // ImapColor | 103 | INSERT_UNION_PADDING_BYTES(2); // ImapColor |
| 104 | INSERT_PADDING_BYTES(2); // ImapSystemValuesC | 104 | INSERT_UNION_PADDING_BYTES(2); // ImapSystemValuesC |
| 105 | INSERT_PADDING_BYTES(10); // ImapFixedFncTexture[10] | 105 | INSERT_UNION_PADDING_BYTES(10); // ImapFixedFncTexture[10] |
| 106 | INSERT_PADDING_BYTES(2); // ImapReserved | 106 | INSERT_UNION_PADDING_BYTES(2); // ImapReserved |
| 107 | struct { | 107 | struct { |
| 108 | u32 target; | 108 | u32 target; |
| 109 | union { | 109 | union { |
| @@ -139,6 +139,8 @@ struct Header { | |||
| 139 | return result; | 139 | return result; |
| 140 | } | 140 | } |
| 141 | } ps; | 141 | } ps; |
| 142 | |||
| 143 | std::array<u32, 0xF> raw{}; | ||
| 142 | }; | 144 | }; |
| 143 | 145 | ||
| 144 | u64 GetLocalMemorySize() const { | 146 | u64 GetLocalMemorySize() const { |
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h index dbca19f35..ecc338ae9 100644 --- a/src/video_core/gpu.h +++ b/src/video_core/gpu.h | |||
| @@ -207,7 +207,7 @@ public: | |||
| 207 | 207 | ||
| 208 | union { | 208 | union { |
| 209 | struct { | 209 | struct { |
| 210 | INSERT_PADDING_WORDS(0x4); | 210 | INSERT_UNION_PADDING_WORDS(0x4); |
| 211 | struct { | 211 | struct { |
| 212 | u32 address_high; | 212 | u32 address_high; |
| 213 | u32 address_low; | 213 | u32 address_low; |
| @@ -220,12 +220,12 @@ public: | |||
| 220 | 220 | ||
| 221 | u32 semaphore_sequence; | 221 | u32 semaphore_sequence; |
| 222 | u32 semaphore_trigger; | 222 | u32 semaphore_trigger; |
| 223 | INSERT_PADDING_WORDS(0xC); | 223 | INSERT_UNION_PADDING_WORDS(0xC); |
| 224 | 224 | ||
| 225 | // The puser and the puller share the reference counter, the pusher only has read | 225 | // The puser and the puller share the reference counter, the pusher only has read |
| 226 | // access | 226 | // access |
| 227 | u32 reference_count; | 227 | u32 reference_count; |
| 228 | INSERT_PADDING_WORDS(0x5); | 228 | INSERT_UNION_PADDING_WORDS(0x5); |
| 229 | 229 | ||
| 230 | u32 semaphore_acquire; | 230 | u32 semaphore_acquire; |
| 231 | u32 semaphore_release; | 231 | u32 semaphore_release; |
| @@ -234,7 +234,7 @@ public: | |||
| 234 | BitField<4, 4, u32> operation; | 234 | BitField<4, 4, u32> operation; |
| 235 | BitField<8, 8, u32> id; | 235 | BitField<8, 8, u32> id; |
| 236 | } fence_action; | 236 | } fence_action; |
| 237 | INSERT_PADDING_WORDS(0xE2); | 237 | INSERT_UNION_PADDING_WORDS(0xE2); |
| 238 | 238 | ||
| 239 | // Puller state | 239 | // Puller state |
| 240 | u32 acquire_mode; | 240 | u32 acquire_mode; |