diff options
| author | flacs <tilkax@gmail.com> | 2015-09-11 17:00:13 +0000 |
|---|---|---|
| committer | flacs <tilkax@gmail.com> | 2015-09-11 17:00:13 +0000 |
| commit | c5685ba53a6866cce5c32bf0c3bbbd7aa52dbf6c (patch) | |
| tree | 7886e61f016f7835a7aadf2bb670c82787b94064 /Source/Core/VideoCommon | |
| parent | d7acf065059ae84eda86e3feb27e0d5c2283be0b (diff) | |
| parent | 8ce04f9a65612b7553015428e617ba7c53913175 (diff) | |
Merge pull request #2972 from lioncash/align
General: Replace GC_ALIGN macros with alignas
Diffstat (limited to 'Source/Core/VideoCommon')
| -rw-r--r-- | Source/Core/VideoCommon/TextureCacheBase.cpp | 4 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/TextureCacheBase.h | 2 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/TextureDecoder.h | 2 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/TextureDecoder_Common.cpp | 6 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/TextureDecoder_x64.cpp | 12 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/VertexLoaderARM64.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/VertexShaderManager.cpp | 2 |
7 files changed, 16 insertions, 14 deletions
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp index 85a1726817..53d91f21aa 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/TextureCacheBase.cpp @@ -26,9 +26,9 @@ static const int TEXTURE_KILL_THRESHOLD = 60; static const int TEXTURE_POOL_KILL_THRESHOLD = 3; static const int FRAMECOUNT_INVALID = 0; -TextureCache *g_texture_cache; +TextureCache* g_texture_cache; -GC_ALIGNED16(u8 *TextureCache::temp) = nullptr; +alignas(16) u8* TextureCache::temp = nullptr; size_t TextureCache::temp_size; TextureCache::TexCache TextureCache::textures_by_address; diff --git a/Source/Core/VideoCommon/TextureCacheBase.h b/Source/Core/VideoCommon/TextureCacheBase.h index 56e1f0b1e2..29f04e6777 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.h +++ b/Source/Core/VideoCommon/TextureCacheBase.h @@ -142,7 +142,7 @@ public: protected: TextureCache(); - static GC_ALIGNED16(u8 *temp); + alignas(16) static u8* temp; static size_t temp_size; private: diff --git a/Source/Core/VideoCommon/TextureDecoder.h b/Source/Core/VideoCommon/TextureDecoder.h index be0c8f44e0..249024fa3a 100644 --- a/Source/Core/VideoCommon/TextureDecoder.h +++ b/Source/Core/VideoCommon/TextureDecoder.h @@ -12,7 +12,7 @@ enum TMEM_SIZE = 1024 * 1024, TMEM_LINE_SIZE = 32, }; -extern GC_ALIGNED16(u8 texMem[TMEM_SIZE]); +alignas(16) extern u8 texMem[TMEM_SIZE]; enum TextureFormat { diff --git a/Source/Core/VideoCommon/TextureDecoder_Common.cpp b/Source/Core/VideoCommon/TextureDecoder_Common.cpp index 8fc1631b93..a1c7bff0c2 100644 --- a/Source/Core/VideoCommon/TextureDecoder_Common.cpp +++ b/Source/Core/VideoCommon/TextureDecoder_Common.cpp @@ -5,7 +5,9 @@ #include <algorithm> #include <cmath> -#include "Common/Common.h" +#include "Common/CommonFuncs.h" +#include "Common/CommonTypes.h" +#include "Common/Logging/Log.h" #include "VideoCommon/LookUpTables.h" #include "VideoCommon/sfont.inc" @@ -16,7 +18,7 @@ static bool TexFmt_Overlay_Center = false; // TRAM // STATE_TO_SAVE -GC_ALIGNED16(u8 texMem[TMEM_SIZE]); +alignas(16) u8 texMem[TMEM_SIZE]; int TexDecoder_GetTexelSizeInNibbles(int format) { diff --git a/Source/Core/VideoCommon/TextureDecoder_x64.cpp b/Source/Core/VideoCommon/TextureDecoder_x64.cpp index f68d35f842..3064b0f3c1 100644 --- a/Source/Core/VideoCommon/TextureDecoder_x64.cpp +++ b/Source/Core/VideoCommon/TextureDecoder_x64.cpp @@ -1065,8 +1065,8 @@ void _TexDecoder_DecodeImpl(u32 * dst, const u8 * src, int width, int height, in const __m128i dxt = _mm_loadu_si128((__m128i *)(src + sizeof(struct DXTBlock) * 2 * xStep)); // Copy the 2-bit indices from each DXT block: - GC_ALIGNED16( u32 dxttmp[4] ); - _mm_store_si128((__m128i *)dxttmp, dxt); + alignas(16) u32 dxttmp[4]; + _mm_store_si128((__m128i*)dxttmp, dxt); u32 dxt0sel = dxttmp[1]; u32 dxt1sel = dxttmp[3]; @@ -1204,10 +1204,10 @@ void _TexDecoder_DecodeImpl(u32 * dst, const u8 * src, int width, int height, in u32 *dst32 = ( dst + (y + z*4) * width + x ); // Copy the colors here: - GC_ALIGNED16( u32 colors0[4] ); - GC_ALIGNED16( u32 colors1[4] ); - _mm_store_si128((__m128i *)colors0, mmcolors0); - _mm_store_si128((__m128i *)colors1, mmcolors1); + alignas(16) u32 colors0[4]; + alignas(16) u32 colors1[4]; + _mm_store_si128((__m128i*)colors0, mmcolors0); + _mm_store_si128((__m128i*)colors1, mmcolors1); // Row 0: dst32[(width * 0) + 0] = colors0[(dxt0sel >> ((0*8)+6)) & 3]; diff --git a/Source/Core/VideoCommon/VertexLoaderARM64.cpp b/Source/Core/VideoCommon/VertexLoaderARM64.cpp index ebd0026237..4251acaaa0 100644 --- a/Source/Core/VideoCommon/VertexLoaderARM64.cpp +++ b/Source/Core/VideoCommon/VertexLoaderARM64.cpp @@ -21,7 +21,7 @@ ARM64Reg stride_reg = X11; ARM64Reg arraybase_reg = X10; ARM64Reg scale_reg = X9; -static const float GC_ALIGNED16(scale_factors[]) = +alignas(16) static const float scale_factors[] = { 1.0 / (1ULL << 0), 1.0 / (1ULL << 1), 1.0 / (1ULL << 2), 1.0 / (1ULL << 3), 1.0 / (1ULL << 4), 1.0 / (1ULL << 5), 1.0 / (1ULL << 6), 1.0 / (1ULL << 7), diff --git a/Source/Core/VideoCommon/VertexShaderManager.cpp b/Source/Core/VideoCommon/VertexShaderManager.cpp index 603fc2efb8..93d248938b 100644 --- a/Source/Core/VideoCommon/VertexShaderManager.cpp +++ b/Source/Core/VideoCommon/VertexShaderManager.cpp @@ -22,7 +22,7 @@ #include "VideoCommon/VideoConfig.h" #include "VideoCommon/XFMemory.h" -static float GC_ALIGNED16(g_fProjectionMatrix[16]); +alignas(16) static float g_fProjectionMatrix[16]; // track changes static bool bTexMatricesChanged[2], bPosNormalMatrixChanged, bProjectionChanged, bViewportChanged; |
