mirror of https://github.com/PCSX2/pcsx2.git
gsdx: Use alignas instead of __aligned
__aligned is defined in FreeBSD headers and will cause compile errors.
This commit is contained in:
parent
6362b9c9b2
commit
da2046e90e
|
@ -1022,7 +1022,7 @@ const GSVector4i GPUDrawScanlineCodeGenerator::m_test[8] =
|
|||
GSVector4i::zero(),
|
||||
};
|
||||
|
||||
__aligned(const uint16, 32) GPUDrawScanlineCodeGenerator::m_dither[4][16] =
|
||||
alignas(32) const uint16_t GPUDrawScanlineCodeGenerator::m_dither[4][16] =
|
||||
{
|
||||
{7, 0, 6, 1, 7, 0, 6, 1, 7, 0, 6, 1, 7, 0, 6, 1},
|
||||
{2, 5, 3, 4, 2, 5, 3, 4, 2, 5, 3, 4, 2, 5, 3, 4},
|
||||
|
|
|
@ -56,5 +56,5 @@ public:
|
|||
GPUDrawScanlineCodeGenerator(void* param, uint32 key, void* code, size_t maxsize);
|
||||
|
||||
static const GSVector4i m_test[8];
|
||||
static __aligned(const uint16, 32) m_dither[4][16];
|
||||
};
|
||||
alignas(32) static const uint16 m_dither[4][16];
|
||||
};
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include "GPU.h"
|
||||
|
||||
__aligned(class, 32) GPUDrawingEnvironment
|
||||
class alignas(32) GPUDrawingEnvironment
|
||||
{
|
||||
public:
|
||||
GPURegSTATUS STATUS;
|
||||
|
|
|
@ -56,7 +56,7 @@ union GPUScanlineSelector
|
|||
operator uint32() const {return key;}
|
||||
};
|
||||
|
||||
__aligned(struct, 32) GPUScanlineGlobalData
|
||||
struct alignas(32) GPUScanlineGlobalData
|
||||
{
|
||||
GPUScanlineSelector sel;
|
||||
|
||||
|
@ -66,7 +66,7 @@ __aligned(struct, 32) GPUScanlineGlobalData
|
|||
GSVector4i twin; // TWW, TWH, TWX, TWY
|
||||
};
|
||||
|
||||
__aligned(struct, 32) GPUScanlineLocalData
|
||||
struct alignas(32) GPUScanlineLocalData
|
||||
{
|
||||
const GPUScanlineGlobalData* gd;
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
__aligned(struct, 32) GPUVertex
|
||||
struct alignas(32) GPUVertex
|
||||
{
|
||||
union
|
||||
{
|
||||
|
|
|
@ -1101,7 +1101,7 @@ REG128_SET(GIFPackedReg)
|
|||
GIFPackedNOP NOP;
|
||||
REG_SET_END
|
||||
|
||||
__aligned(struct, 32) GIFPath
|
||||
struct alignas(32) GIFPath
|
||||
{
|
||||
GIFTag tag;
|
||||
uint32 nloop;
|
||||
|
|
|
@ -1917,7 +1917,7 @@ public:
|
|||
|
||||
#else
|
||||
|
||||
__aligned(uint16, 32) block[16 * 8];
|
||||
alignas(32) uint16 block[16 * 8];
|
||||
|
||||
ReadBlock16(src, (uint8*)block, sizeof(block) / 8);
|
||||
|
||||
|
@ -1976,7 +1976,7 @@ public:
|
|||
|
||||
#else
|
||||
|
||||
__aligned(uint8, 32) block[16 * 16];
|
||||
alignas(32) uint8 block[16 * 16];
|
||||
|
||||
ReadBlock8(src, (uint8*)block, sizeof(block) / 16);
|
||||
|
||||
|
@ -2053,7 +2053,7 @@ public:
|
|||
|
||||
#else
|
||||
|
||||
__aligned(uint8, 32) block[(32 / 2) * 16];
|
||||
alignas(32) uint8 block[(32 / 2) * 16];
|
||||
|
||||
ReadBlock4(src, (uint8*)block, sizeof(block) / 16);
|
||||
|
||||
|
@ -2096,7 +2096,7 @@ public:
|
|||
|
||||
#else
|
||||
|
||||
__aligned(uint32, 32) block[8 * 8];
|
||||
alignas(32) uint32 block[8 * 8];
|
||||
|
||||
ReadBlock32(src, (uint8*)block, sizeof(block) / 8);
|
||||
|
||||
|
@ -2139,7 +2139,7 @@ public:
|
|||
|
||||
#else
|
||||
|
||||
__aligned(uint32, 32) block[8 * 8];
|
||||
alignas(32) uint32 block[8 * 8];
|
||||
|
||||
ReadBlock32(src, (uint8*)block, sizeof(block) / 8);
|
||||
|
||||
|
@ -2182,7 +2182,7 @@ public:
|
|||
|
||||
#else
|
||||
|
||||
__aligned(uint32, 32) block[8 * 8];
|
||||
alignas(32) uint32 block[8 * 8];
|
||||
|
||||
ReadBlock32(src, (uint8*)block, sizeof(block) / 8);
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
class GSLocalMemory;
|
||||
|
||||
__aligned(class, 32) GSClut : public GSAlignedClass<32>
|
||||
class alignas(32) GSClut : public GSAlignedClass<32>
|
||||
{
|
||||
GSLocalMemory* m_mem;
|
||||
|
||||
|
@ -37,7 +37,7 @@ __aligned(class, 32) GSClut : public GSAlignedClass<32>
|
|||
uint32* m_buff32;
|
||||
uint64* m_buff64;
|
||||
|
||||
__aligned(struct, 32) WriteState
|
||||
struct alignas(32) WriteState
|
||||
{
|
||||
GIFRegTEX0 TEX0;
|
||||
GIFRegTEXCLUT TEXCLUT;
|
||||
|
@ -45,7 +45,7 @@ __aligned(class, 32) GSClut : public GSAlignedClass<32>
|
|||
bool IsDirty(const GIFRegTEX0& TEX0, const GIFRegTEXCLUT& TEXCLUT);
|
||||
} m_write;
|
||||
|
||||
__aligned(struct, 32) ReadState
|
||||
struct alignas(32) ReadState
|
||||
{
|
||||
GIFRegTEX0 TEX0;
|
||||
GIFRegTEXA TEXA;
|
||||
|
|
|
@ -30,7 +30,7 @@ class GSDeviceDX : public GSDevice
|
|||
public:
|
||||
#pragma pack(push, 1)
|
||||
|
||||
__aligned(struct, 32) VSConstantBuffer
|
||||
struct alignas(32) VSConstantBuffer
|
||||
{
|
||||
GSVector4 VertexScale;
|
||||
GSVector4 VertexOffset;
|
||||
|
@ -86,7 +86,7 @@ public:
|
|||
VSSelector() : key(0) {}
|
||||
};
|
||||
|
||||
__aligned(struct, 32) PSConstantBuffer
|
||||
struct alignas(32) PSConstantBuffer
|
||||
{
|
||||
GSVector4 FogColor_AREF;
|
||||
GSVector4 HalfTexel;
|
||||
|
|
|
@ -116,8 +116,8 @@ public:
|
|||
|
||||
class GSDeviceOGL final : public GSDevice
|
||||
{
|
||||
public:
|
||||
__aligned(struct, 32) VSConstantBuffer
|
||||
public:
|
||||
struct alignas(32) VSConstantBuffer
|
||||
{
|
||||
GSVector4 Vertex_Scale_Offset;
|
||||
GSVector4 TextureScale;
|
||||
|
@ -187,7 +187,7 @@ class GSDeviceOGL final : public GSDevice
|
|||
GSSelector(uint32 k) : key(k) {}
|
||||
};
|
||||
|
||||
__aligned(struct, 32) PSConstantBuffer
|
||||
struct alignas(32) PSConstantBuffer
|
||||
{
|
||||
GSVector4 FogColor_AREF;
|
||||
GSVector4 WH;
|
||||
|
|
|
@ -186,7 +186,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
__aligned(class, 16) ShaderFactorBlend : public ShaderBase
|
||||
class alignas(16) ShaderFactorBlend : public ShaderBase
|
||||
{
|
||||
GSVector4i m_f;
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#if _M_SSE >= 0x501
|
||||
|
||||
__aligned(const uint8, 8) GSDrawScanlineCodeGenerator::m_test[16][8] =
|
||||
alignas(8) const uint8 GSDrawScanlineCodeGenerator::m_test[16][8] =
|
||||
{
|
||||
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
{0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
|
|
|
@ -135,7 +135,7 @@ public:
|
|||
GSDrawScanlineCodeGenerator(void* param, uint64 key, void* code, size_t maxsize);
|
||||
|
||||
#if _M_SSE >= 0x501
|
||||
static __aligned(const uint8, 8) m_test[16][8];
|
||||
alignas(8) static const uint8 m_test[16][8];
|
||||
static const GSVector8 m_log2_coef[4];
|
||||
#else
|
||||
static const GSVector4i m_test[8];
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include "GS.h"
|
||||
#include "GSLocalMemory.h"
|
||||
|
||||
__aligned(class, 32) GSDrawingContext
|
||||
class alignas(32) GSDrawingContext
|
||||
{
|
||||
public:
|
||||
GIFRegXYOFFSET XYOFFSET;
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include "GS.h"
|
||||
|
||||
__aligned(class, 32) GSDrawingEnvironment
|
||||
class alignas(32) GSDrawingEnvironment
|
||||
{
|
||||
public:
|
||||
GIFRegPRIM PRIM;
|
||||
|
|
|
@ -770,7 +770,7 @@ void GSLocalMemory::WriteImageLeftRight(int l, int r, int y, int h, const uint8*
|
|||
template<int psm, int bsx, int bsy, int trbpp>
|
||||
void GSLocalMemory::WriteImageTopBottom(int l, int r, int y, int h, const uint8* src, int srcpitch, const GIFRegBITBLTBUF& BITBLTBUF)
|
||||
{
|
||||
__aligned(uint8, 32) buff[64]; // merge buffer for one column
|
||||
alignas(32) uint8 buff[64]; // merge buffer for one column
|
||||
|
||||
uint32 bp = BITBLTBUF.DBP;
|
||||
uint32 bw = BITBLTBUF.DBW;
|
||||
|
@ -2055,7 +2055,7 @@ uint32* GSOffset::GetPages(const GSVector4i& rect, uint32* pages, GSVector4i* bb
|
|||
pages = new uint32[limit];
|
||||
}
|
||||
|
||||
__aligned(uint32, 16) tmp[16];
|
||||
alignas(16) uint32 tmp[16];
|
||||
|
||||
((GSVector4i*)tmp)[0] = GSVector4i::zero();
|
||||
((GSVector4i*)tmp)[1] = GSVector4i::zero();
|
||||
|
|
|
@ -30,13 +30,13 @@
|
|||
class GSOffset : public GSAlignedClass<32>
|
||||
{
|
||||
public:
|
||||
__aligned(struct, 32) Block
|
||||
struct alignas(32) Block
|
||||
{
|
||||
short row[256]; // yn (n = 0 8 16 ...)
|
||||
short* col; // blockOffset*
|
||||
};
|
||||
|
||||
__aligned(struct, 32) Pixel
|
||||
struct alignas(32) Pixel
|
||||
{
|
||||
int row[4096]; // yn (n = 0 1 2 ...) NOTE: this wraps around above 2048, only transfers should address the upper half (dark cloud 2 inventing)
|
||||
int* col[8]; // rowOffset*
|
||||
|
@ -95,7 +95,7 @@ public:
|
|||
typedef void (GSLocalMemory::*readTexture)(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA);
|
||||
typedef void (GSLocalMemory::*readTextureBlock)(uint32 bp, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) const;
|
||||
|
||||
__aligned(struct, 128) psm_t
|
||||
struct alignas(128) psm_t
|
||||
{
|
||||
pixelAddress pa, bn;
|
||||
readPixel rp;
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "GSPerfMon.h"
|
||||
#include "GSThread_CXX11.h"
|
||||
|
||||
__aligned(class, 32) GSRasterizerData : public GSAlignedClass<32>
|
||||
class alignas(32) GSRasterizerData : public GSAlignedClass<32>
|
||||
{
|
||||
static int s_counter;
|
||||
|
||||
|
@ -122,7 +122,7 @@ public:
|
|||
virtual void PrintStats() = 0;
|
||||
};
|
||||
|
||||
__aligned(class, 32) GSRasterizer : public IRasterizer
|
||||
class alignas(32) GSRasterizer : public IRasterizer
|
||||
{
|
||||
protected:
|
||||
GSPerfMon* m_perfmon;
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#ifdef ENABLE_OPENCL
|
||||
|
||||
__aligned(struct, 32) GSVertexCL
|
||||
struct alignas(32) GSVertexCL
|
||||
{
|
||||
GSVector4 p, t;
|
||||
};
|
||||
|
@ -145,7 +145,7 @@ class GSRendererCL : public GSRenderer
|
|||
}
|
||||
};
|
||||
|
||||
__aligned(struct, 32) TFXParameter
|
||||
struct alignas(32) TFXParameter
|
||||
{
|
||||
GSVector4i scissor;
|
||||
GSVector4i dimx; // 4x4 signed char
|
||||
|
|
|
@ -44,7 +44,7 @@ class GSRendererCS : public GSRenderer
|
|||
VSSelector() : key(0) {}
|
||||
};
|
||||
|
||||
__aligned(struct, 32) VSConstantBuffer
|
||||
struct alignas(32) VSConstantBuffer
|
||||
{
|
||||
GSVector4 VertexScale;
|
||||
GSVector4 VertexOffset;
|
||||
|
@ -86,7 +86,7 @@ class GSRendererCS : public GSRenderer
|
|||
PSSelector() : key(0) {}
|
||||
};
|
||||
|
||||
__aligned(struct, 32) PSConstantBuffer
|
||||
struct alignas(32) PSConstantBuffer
|
||||
{
|
||||
uint32 fm;
|
||||
uint32 zm;
|
||||
|
|
|
@ -29,7 +29,7 @@ class GSRendererSW : public GSRenderer
|
|||
{
|
||||
class SharedData : public GSDrawScanline::SharedData
|
||||
{
|
||||
__aligned(struct, 16) TextureLevel
|
||||
struct alignas(16) TextureLevel
|
||||
{
|
||||
GSVector4i r;
|
||||
GSTextureCacheSW::Texture* t;
|
||||
|
|
|
@ -105,7 +105,7 @@ union GSScanlineSelector
|
|||
}
|
||||
};
|
||||
|
||||
__aligned(struct, 32) GSScanlineGlobalData // per batch variables, this is like a pixel shader constant buffer
|
||||
struct alignas(32) GSScanlineGlobalData // per batch variables, this is like a pixel shader constant buffer
|
||||
{
|
||||
GSScanlineSelector sel;
|
||||
|
||||
|
@ -150,7 +150,7 @@ __aligned(struct, 32) GSScanlineGlobalData // per batch variables, this is like
|
|||
#endif
|
||||
};
|
||||
|
||||
__aligned(struct, 32) GSScanlineLocalData // per prim variables, each thread has its own
|
||||
struct alignas(32) GSScanlineLocalData // per prim variables, each thread has its own
|
||||
{
|
||||
#if _M_SSE >= 0x501
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ class GSVector8i;
|
|||
|
||||
#endif
|
||||
|
||||
__aligned(class, 16) GSVector4i
|
||||
class alignas(16) GSVector4i
|
||||
{
|
||||
static const GSVector4i m_xff[17];
|
||||
static const GSVector4i m_x0f[17];
|
||||
|
@ -2421,7 +2421,7 @@ public:
|
|||
__forceinline static GSVector4i x0f(int n) {return m_x0f[n];}
|
||||
};
|
||||
|
||||
__aligned(class, 16) GSVector4
|
||||
class alignas(16) GSVector4
|
||||
{
|
||||
public:
|
||||
union
|
||||
|
@ -3341,7 +3341,7 @@ GSVector.h:2973:15: error: shadows template parm 'int i'
|
|||
|
||||
#if _M_SSE >= 0x501
|
||||
|
||||
__aligned(class, 32) GSVector8i
|
||||
class alignas(32) GSVector8i
|
||||
{
|
||||
static const GSVector8i m_xff[33];
|
||||
static const GSVector8i m_x0f[33];
|
||||
|
@ -5133,7 +5133,7 @@ public:
|
|||
|
||||
#if _M_SSE >= 0x500
|
||||
|
||||
__aligned(class, 32) GSVector8
|
||||
class alignas(32) GSVector8
|
||||
{
|
||||
public:
|
||||
union
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
__aligned(struct, 32) GSVertex
|
||||
struct alignas(32) GSVertex
|
||||
{
|
||||
union
|
||||
{
|
||||
|
@ -52,7 +52,7 @@ struct GSVertexP
|
|||
GSVector4 p;
|
||||
};
|
||||
|
||||
__aligned(struct, 32) GSVertexPT1
|
||||
struct alignas(32) GSVertexPT1
|
||||
{
|
||||
GSVector4 p;
|
||||
GSVector2 t;
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
__aligned(struct, 32) GSVertexHW9
|
||||
struct alignas(32) GSVertexHW9
|
||||
{
|
||||
GSVector4 t;
|
||||
GSVector4 p;
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include "GSVector.h"
|
||||
|
||||
__aligned(struct, 32) GSVertexSW
|
||||
struct alignas(32) GSVertexSW
|
||||
{
|
||||
GSVector4 p, _pad, t, c;
|
||||
|
||||
|
@ -237,7 +237,7 @@ __aligned(struct, 32) GSVertexSW
|
|||
|
||||
#if _M_SSE >= 0x501
|
||||
|
||||
__aligned(struct, 32) GSVertexSW2
|
||||
struct alignas(32) GSVertexSW2
|
||||
{
|
||||
GSVector4 p, _pad;
|
||||
GSVector8 tc;
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
class GSState;
|
||||
|
||||
__aligned(class, 32) GSVertexTrace : public GSAlignedClass<32>
|
||||
class alignas(32) GSVertexTrace : public GSAlignedClass<32>
|
||||
{
|
||||
public:
|
||||
struct Vertex {GSVector4i c; GSVector4 p, t;};
|
||||
|
|
|
@ -197,17 +197,17 @@ using namespace stdext;
|
|||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
#define __aligned(t, n) __declspec(align(n)) t
|
||||
#if _MSC_VER < 1900
|
||||
#define alignas(n) __declspec(align(n))
|
||||
#endif
|
||||
|
||||
#define EXPORT_C_(type) extern "C" __declspec(dllexport) type __stdcall
|
||||
#define EXPORT_C EXPORT_C_(void)
|
||||
|
||||
#define ALIGN_STACK(n) __aligned(int, n) __dummy;
|
||||
#define ALIGN_STACK(n) alignas(n) int dummy__;
|
||||
|
||||
#else
|
||||
|
||||
#define __aligned(t, n) t __attribute__((aligned(n)))
|
||||
#define __fastcall __attribute__((fastcall))
|
||||
|
||||
#define EXPORT_C_(type) extern "C" __attribute__((stdcall,externally_visible,visibility("default"))) type
|
||||
|
@ -227,7 +227,7 @@ using namespace stdext;
|
|||
#else
|
||||
|
||||
// TODO Check clang behavior
|
||||
#define ALIGN_STACK(n) __aligned(int, n) __dummy;
|
||||
#define ALIGN_STACK(n) alignas(n) int dummy__;
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue