Remove unnecessary ALIGN macros
This commit is contained in:
@@ -12,29 +12,29 @@ namespace AZ
|
||||
{
|
||||
namespace Simd
|
||||
{
|
||||
static AZ_ALIGN(constexpr float g_sinCoef1[4], 16) = { -0.0001950727f, -0.0001950727f, -0.0001950727f, -0.0001950727f };
|
||||
static AZ_ALIGN(constexpr float g_sinCoef2[4], 16) = { 0.0083320758f, 0.0083320758f, 0.0083320758f, 0.0083320758f };
|
||||
static AZ_ALIGN(constexpr float g_sinCoef3[4], 16) = { -0.1666665247f, -0.1666665247f, -0.1666665247f, -0.1666665247f };
|
||||
static AZ_ALIGN(constexpr float g_cosCoef1[4], 16) = { -0.0013602249f, -0.0013602249f, -0.0013602249f, -0.0013602249f };
|
||||
static AZ_ALIGN(constexpr float g_cosCoef2[4], 16) = { 0.0416566950f, 0.0416566950f, 0.0416566950f, 0.0416566950f };
|
||||
static AZ_ALIGN(constexpr float g_cosCoef3[4], 16) = { -0.4999990225f, -0.4999990225f, -0.4999990225f, -0.4999990225f };
|
||||
static AZ_ALIGN(constexpr float g_acosHiCoef1[4], 16) = { -0.0012624911f, -0.0012624911f, -0.0012624911f, -0.0012624911f };
|
||||
static AZ_ALIGN(constexpr float g_acosHiCoef2[4], 16) = { 0.0066700901f, 0.0066700901f, 0.0066700901f, 0.0066700901f };
|
||||
static AZ_ALIGN(constexpr float g_acosHiCoef3[4], 16) = { -0.0170881256f, -0.0170881256f, -0.0170881256f, -0.0170881256f };
|
||||
static AZ_ALIGN(constexpr float g_acosHiCoef4[4], 16) = { 0.0308918810f, 0.0308918810f, 0.0308918810f, 0.0308918810f };
|
||||
static AZ_ALIGN(constexpr float g_acosLoCoef1[4], 16) = { -0.0501743046f, -0.0501743046f, -0.0501743046f, -0.0501743046f };
|
||||
static AZ_ALIGN(constexpr float g_acosLoCoef2[4], 16) = { 0.0889789874f, 0.0889789874f, 0.0889789874f, 0.0889789874f };
|
||||
static AZ_ALIGN(constexpr float g_acosLoCoef3[4], 16) = { -0.2145988016f, -0.2145988016f, -0.2145988016f, -0.2145988016f };
|
||||
static AZ_ALIGN(constexpr float g_acosLoCoef4[4], 16) = { 1.5707963050f, 1.5707963050f, 1.5707963050f, 1.5707963050f };
|
||||
static AZ_ALIGN(constexpr float g_acosCoef1[4], 16) = { -0.0200752200f, -0.0200752200f, -0.0200752200f, -0.0200752200f };
|
||||
static AZ_ALIGN(constexpr float g_acosCoef2[4], 16) = { 0.0759031500f, 0.0759031500f, 0.0759031500f, 0.0759031500f };
|
||||
static AZ_ALIGN(constexpr float g_acosCoef3[4], 16) = { -0.2126757000f, -0.2126757000f, -0.2126757000f, -0.2126757000f };
|
||||
static AZ_ALIGN(constexpr float g_atanHiRange[4], 16) = { 2.4142135624f, 2.4142135624f, 2.4142135624f, 2.4142135624f };
|
||||
static AZ_ALIGN(constexpr float g_atanLoRange[4], 16) = { 0.4142135624f, 0.4142135624f, 0.4142135624f, 0.4142135624f };
|
||||
static AZ_ALIGN(constexpr float g_atanCoef1[4], 16) = { 8.05374449538e-2f, 8.05374449538e-2f, 8.05374449538e-2f, 8.05374449538e-2f };
|
||||
static AZ_ALIGN(constexpr float g_atanCoef2[4], 16) = { -1.38776856032e-1f, -1.38776856032e-1f, -1.38776856032e-1f, -1.38776856032e-1f };
|
||||
static AZ_ALIGN(constexpr float g_atanCoef3[4], 16) = { 1.99777106478e-1f, 1.99777106478e-1f, 1.99777106478e-1f, 1.99777106478e-1f };
|
||||
static AZ_ALIGN(constexpr float g_atanCoef4[4], 16) = { -3.33329491539e-1f, -3.33329491539e-1f, -3.33329491539e-1f, -3.33329491539e-1f };
|
||||
alignas(16) static constexpr float g_sinCoef1[4] = { -0.0001950727f, -0.0001950727f, -0.0001950727f, -0.0001950727f };
|
||||
alignas(16) static constexpr float g_sinCoef2[4] = { 0.0083320758f, 0.0083320758f, 0.0083320758f, 0.0083320758f };
|
||||
alignas(16) static constexpr float g_sinCoef3[4] = { -0.1666665247f, -0.1666665247f, -0.1666665247f, -0.1666665247f };
|
||||
alignas(16) static constexpr float g_cosCoef1[4] = { -0.0013602249f, -0.0013602249f, -0.0013602249f, -0.0013602249f };
|
||||
alignas(16) static constexpr float g_cosCoef2[4] = { 0.0416566950f, 0.0416566950f, 0.0416566950f, 0.0416566950f };
|
||||
alignas(16) static constexpr float g_cosCoef3[4] = { -0.4999990225f, -0.4999990225f, -0.4999990225f, -0.4999990225f };
|
||||
alignas(16) static constexpr float g_acosHiCoef1[4] = { -0.0012624911f, -0.0012624911f, -0.0012624911f, -0.0012624911f };
|
||||
alignas(16) static constexpr float g_acosHiCoef2[4] = { 0.0066700901f, 0.0066700901f, 0.0066700901f, 0.0066700901f };
|
||||
alignas(16) static constexpr float g_acosHiCoef3[4] = { -0.0170881256f, -0.0170881256f, -0.0170881256f, -0.0170881256f };
|
||||
alignas(16) static constexpr float g_acosHiCoef4[4] = { 0.0308918810f, 0.0308918810f, 0.0308918810f, 0.0308918810f };
|
||||
alignas(16) static constexpr float g_acosLoCoef1[4] = { -0.0501743046f, -0.0501743046f, -0.0501743046f, -0.0501743046f };
|
||||
alignas(16) static constexpr float g_acosLoCoef2[4] = { 0.0889789874f, 0.0889789874f, 0.0889789874f, 0.0889789874f };
|
||||
alignas(16) static constexpr float g_acosLoCoef3[4] = { -0.2145988016f, -0.2145988016f, -0.2145988016f, -0.2145988016f };
|
||||
alignas(16) static constexpr float g_acosLoCoef4[4] = { 1.5707963050f, 1.5707963050f, 1.5707963050f, 1.5707963050f };
|
||||
alignas(16) static constexpr float g_acosCoef1[4] = { -0.0200752200f, -0.0200752200f, -0.0200752200f, -0.0200752200f };
|
||||
alignas(16) static constexpr float g_acosCoef2[4] = { 0.0759031500f, 0.0759031500f, 0.0759031500f, 0.0759031500f };
|
||||
alignas(16) static constexpr float g_acosCoef3[4] = { -0.2126757000f, -0.2126757000f, -0.2126757000f, -0.2126757000f };
|
||||
alignas(16) static constexpr float g_atanHiRange[4] = { 2.4142135624f, 2.4142135624f, 2.4142135624f, 2.4142135624f };
|
||||
alignas(16) static constexpr float g_atanLoRange[4] = { 0.4142135624f, 0.4142135624f, 0.4142135624f, 0.4142135624f };
|
||||
alignas(16) static constexpr float g_atanCoef1[4] = { 8.05374449538e-2f, 8.05374449538e-2f, 8.05374449538e-2f, 8.05374449538e-2f };
|
||||
alignas(16) static constexpr float g_atanCoef2[4] = { -1.38776856032e-1f, -1.38776856032e-1f, -1.38776856032e-1f, -1.38776856032e-1f };
|
||||
alignas(16) static constexpr float g_atanCoef3[4] = { 1.99777106478e-1f, 1.99777106478e-1f, 1.99777106478e-1f, 1.99777106478e-1f };
|
||||
alignas(16) static constexpr float g_atanCoef4[4] = { -3.33329491539e-1f, -3.33329491539e-1f, -3.33329491539e-1f, -3.33329491539e-1f };
|
||||
|
||||
namespace Common
|
||||
{
|
||||
|
||||
@@ -24,24 +24,24 @@ namespace AZ
|
||||
{
|
||||
namespace Simd
|
||||
{
|
||||
static AZ_ALIGN(constexpr float g_vec1111[4], 16) = { 1.0f, 1.0f, 1.0f, 1.0f };
|
||||
static AZ_ALIGN(constexpr float g_vec1000[4], 16) = { 1.0f, 0.0f, 0.0f, 0.0f };
|
||||
static AZ_ALIGN(constexpr float g_vec0100[4], 16) = { 0.0f, 1.0f, 0.0f, 0.0f };
|
||||
static AZ_ALIGN(constexpr float g_vec0010[4], 16) = { 0.0f, 0.0f, 1.0f, 0.0f };
|
||||
static AZ_ALIGN(constexpr float g_vec0001[4], 16) = { 0.0f, 0.0f, 0.0f, 1.0f };
|
||||
static AZ_ALIGN(constexpr float g_Pi[4], 16) = { Constants::Pi, Constants::Pi, Constants::Pi, Constants::Pi };
|
||||
static AZ_ALIGN(constexpr float g_TwoPi[4], 16) = { Constants::TwoPi, Constants::TwoPi, Constants::TwoPi, Constants::TwoPi };
|
||||
static AZ_ALIGN(constexpr float g_HalfPi[4], 16) = { Constants::HalfPi, Constants::HalfPi, Constants::HalfPi, Constants::HalfPi };
|
||||
static AZ_ALIGN(constexpr float g_QuarterPi[4], 16) = { Constants::QuarterPi, Constants::QuarterPi, Constants::QuarterPi, Constants::QuarterPi };
|
||||
static AZ_ALIGN(constexpr float g_TwoOverPi[4], 16) = { Constants::TwoOverPi, Constants::TwoOverPi, Constants::TwoOverPi, Constants::TwoOverPi };
|
||||
static AZ_ALIGN(constexpr int32_t g_absMask[4], 16) = { (int32_t)0x7fffffff, (int32_t)0x7fffffff, (int32_t)0x7fffffff, (int32_t)0x7fffffff };
|
||||
static AZ_ALIGN(constexpr int32_t g_negateMask[4], 16) = { (int32_t)0x80000000, (int32_t)0x80000000, (int32_t)0x80000000, (int32_t)0x80000000 };
|
||||
static AZ_ALIGN(constexpr int32_t g_negateXMask[4], 16) = { (int32_t)0x80000000, (int32_t)0x00000000, (int32_t)0x00000000, (int32_t)0x00000000 };
|
||||
static AZ_ALIGN(constexpr int32_t g_negateYMask[4], 16) = { (int32_t)0x00000000, (int32_t)0x80000000, (int32_t)0x00000000, (int32_t)0x00000000 };
|
||||
static AZ_ALIGN(constexpr int32_t g_negateZMask[4], 16) = { (int32_t)0x00000000, (int32_t)0x00000000, (int32_t)0x80000000, (int32_t)0x00000000 };
|
||||
static AZ_ALIGN(constexpr int32_t g_negateWMask[4], 16) = { (int32_t)0x00000000, (int32_t)0x00000000, (int32_t)0x00000000, (int32_t)0x80000000 };
|
||||
static AZ_ALIGN(constexpr int32_t g_negateXYZMask[4], 16) = { (int32_t)0x80000000, (int32_t)0x80000000, (int32_t)0x80000000, (int32_t)0x00000000 };
|
||||
static AZ_ALIGN(constexpr int32_t g_wMask[4], 16) = { (int32_t)0xffffffff, (int32_t)0xffffffff, (int32_t)0xffffffff, (int32_t)0x00000000 };
|
||||
alignas(16) static constexpr float g_vec1111[4] = { 1.0f, 1.0f, 1.0f, 1.0f };
|
||||
alignas(16) static constexpr float g_vec1000[4] = { 1.0f, 0.0f, 0.0f, 0.0f };
|
||||
alignas(16) static constexpr float g_vec0100[4] = { 0.0f, 1.0f, 0.0f, 0.0f };
|
||||
alignas(16) static constexpr float g_vec0010[4] = { 0.0f, 0.0f, 1.0f, 0.0f };
|
||||
alignas(16) static constexpr float g_vec0001[4] = { 0.0f, 0.0f, 0.0f, 1.0f };
|
||||
alignas(16) static constexpr float g_Pi[4] = { Constants::Pi, Constants::Pi, Constants::Pi, Constants::Pi };
|
||||
alignas(16) static constexpr float g_TwoPi[4] = { Constants::TwoPi, Constants::TwoPi, Constants::TwoPi, Constants::TwoPi };
|
||||
alignas(16) static constexpr float g_HalfPi[4] = { Constants::HalfPi, Constants::HalfPi, Constants::HalfPi, Constants::HalfPi };
|
||||
alignas(16) static constexpr float g_QuarterPi[4] = { Constants::QuarterPi, Constants::QuarterPi, Constants::QuarterPi, Constants::QuarterPi };
|
||||
alignas(16) static constexpr float g_TwoOverPi[4] = { Constants::TwoOverPi, Constants::TwoOverPi, Constants::TwoOverPi, Constants::TwoOverPi };
|
||||
alignas(16) static constexpr int32_t g_absMask[4] = { (int32_t)0x7fffffff, (int32_t)0x7fffffff, (int32_t)0x7fffffff, (int32_t)0x7fffffff };
|
||||
alignas(16) static constexpr int32_t g_negateMask[4] = { (int32_t)0x80000000, (int32_t)0x80000000, (int32_t)0x80000000, (int32_t)0x80000000 };
|
||||
alignas(16) static constexpr int32_t g_negateXMask[4] = { (int32_t)0x80000000, (int32_t)0x00000000, (int32_t)0x00000000, (int32_t)0x00000000 };
|
||||
alignas(16) static constexpr int32_t g_negateYMask[4] = { (int32_t)0x00000000, (int32_t)0x80000000, (int32_t)0x00000000, (int32_t)0x00000000 };
|
||||
alignas(16) static constexpr int32_t g_negateZMask[4] = { (int32_t)0x00000000, (int32_t)0x00000000, (int32_t)0x80000000, (int32_t)0x00000000 };
|
||||
alignas(16) static constexpr int32_t g_negateWMask[4] = { (int32_t)0x00000000, (int32_t)0x00000000, (int32_t)0x00000000, (int32_t)0x80000000 };
|
||||
alignas(16) static constexpr int32_t g_negateXYZMask[4] = { (int32_t)0x80000000, (int32_t)0x80000000, (int32_t)0x80000000, (int32_t)0x00000000 };
|
||||
alignas(16) static constexpr int32_t g_wMask[4] = { (int32_t)0xffffffff, (int32_t)0xffffffff, (int32_t)0xffffffff, (int32_t)0x00000000 };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ namespace AZ
|
||||
}
|
||||
|
||||
// or _m128i and VMX ???
|
||||
AZ_ALIGN(unsigned char data[16], 16);
|
||||
alignas(16) unsigned char data[16];
|
||||
};
|
||||
} // namespace AZ
|
||||
|
||||
|
||||
@@ -88,15 +88,6 @@
|
||||
|
||||
# define AZ_FORCE_INLINE __forceinline
|
||||
|
||||
/// Aligns a declaration.
|
||||
# define AZ_ALIGN(_decl, _alignment) \
|
||||
AZ_PUSH_DISABLE_WARNING(4324, "-Wunknown-warning-option") \
|
||||
__declspec(align(_alignment)) \
|
||||
_decl \
|
||||
AZ_POP_DISABLE_WARNING
|
||||
|
||||
/// Return the alignment of a type. This if for internal use only (use AZStd::alignment_of<>())
|
||||
# define AZ_INTERNAL_ALIGNMENT_OF(_type) __alignof(_type)
|
||||
/// Pointer will be aliased.
|
||||
# define AZ_MAY_ALIAS
|
||||
/// Function signature macro
|
||||
@@ -120,15 +111,7 @@
|
||||
#define AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
|
||||
# define AZ_FORCE_INLINE inline
|
||||
/// Aligns a declaration.
|
||||
# define AZ_ALIGN(_decl, _alignment) \
|
||||
AZ_PUSH_DISABLE_WARNING(4324, "-Wunknown-warning-option") \
|
||||
_decl \
|
||||
__attribute__((aligned(_alignment)))
|
||||
AZ_POP_DISABLE_WARNING
|
||||
|
||||
/// Return the alignment of a type. This if for internal use only (use AZStd::alignment_of<>())
|
||||
# define AZ_INTERNAL_ALIGNMENT_OF(_type) __alignof__(_type)
|
||||
/// Pointer will be aliased.
|
||||
# define AZ_MAY_ALIAS __attribute__((__may_alias__))
|
||||
/// Function signature macro
|
||||
|
||||
@@ -162,7 +162,7 @@ namespace UnitTest
|
||||
struct CreationCounter
|
||||
{
|
||||
AZ_TYPE_INFO(CreationCounter, "{E9E35486-4366-4066-86E5-1A8CEB44198B}");
|
||||
AZ_ALIGN(int test[size / sizeof(int)], alignment);
|
||||
alignas(alignment) int test[size / sizeof(int)];
|
||||
|
||||
static int s_count;
|
||||
static int s_copied;
|
||||
|
||||
@@ -384,7 +384,7 @@ namespace AZStd
|
||||
*/
|
||||
union
|
||||
{
|
||||
AZ_ALIGN(char m_buffer[Internal::ANY_SBO_BUF_SIZE], 32); // Used for objects smaller than SBO_BUF_SIZE
|
||||
alignas(32) char m_buffer[Internal::ANY_SBO_BUF_SIZE]; // Used for objects smaller than SBO_BUF_SIZE
|
||||
void* m_pointer; // Pointer to large objects
|
||||
};
|
||||
type_info m_typeInfo;
|
||||
|
||||
@@ -164,7 +164,7 @@ namespace AZStd
|
||||
//enough.
|
||||
struct Node
|
||||
{
|
||||
AZ_ALIGN(T m_value, 64); //alignment to avoid cache line sharing
|
||||
alignas(64) T m_value; //alignment to avoid cache line sharing
|
||||
thread::id m_threadId;
|
||||
Node* m_next;
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace AZStd
|
||||
template<typename T>
|
||||
struct lock_free_stamped_node_ptr
|
||||
{
|
||||
AZ_ALIGN(struct lock_free_stamped_queue_node<T>* m_node, 8);
|
||||
alignas(8) struct lock_free_stamped_queue_node<T>* m_node;
|
||||
unsigned int m_stamp;
|
||||
};
|
||||
|
||||
|
||||
@@ -1073,7 +1073,7 @@ cleanup:
|
||||
}
|
||||
|
||||
HANDLE hThread = nativeThread;
|
||||
AZ_ALIGN(CONTEXT context, 8); // Without this alignment the function randomly crashes in release.
|
||||
CONTEXT alignas(8) context; // Without this alignment the function randomly crashes in release.
|
||||
context.ContextFlags = CONTEXT_ALL;
|
||||
GetThreadContext(hThread, &context);
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace UnitTestInternal
|
||||
}
|
||||
|
||||
// We use this class on the stack often, so alignment more than 16 bytes will not work on all platforms.
|
||||
AZ_ALIGN(int m_data, 16);
|
||||
alignas(16) int m_data;
|
||||
bool m_isMoved;
|
||||
};
|
||||
|
||||
|
||||
@@ -982,7 +982,7 @@ namespace UnitTest
|
||||
: m_data(data) {}
|
||||
~MyClass() {}
|
||||
|
||||
AZ_ALIGN(int m_data, 32);
|
||||
alignas(32) int m_data;
|
||||
};
|
||||
// Explicitly doesn't have AZ_CLASS_ALLOCATOR
|
||||
class MyDerivedClass
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace UnitTest
|
||||
|
||||
struct Aligned16
|
||||
{
|
||||
AZ_ALIGN(char m_data, 16);
|
||||
alignas(16) char m_data;
|
||||
};
|
||||
|
||||
//! Class that changes a value when it's created and destroyed.
|
||||
|
||||
@@ -109,9 +109,6 @@ typedef unsigned char byte;
|
||||
|
||||
#define INVALID_FILE_ATTRIBUTES (-1)
|
||||
|
||||
#define DEFINE_ALIGNED_DATA(type, name, alignment) \
|
||||
type __attribute__ ((aligned(alignment))) name;
|
||||
|
||||
#include "LinuxSpecific.h"
|
||||
// these functions do not exist int the wchar.h header
|
||||
#undef wscasecomp
|
||||
|
||||
@@ -126,10 +126,6 @@ typedef uint8 byte;
|
||||
#define STDMETHODCALLTYPE
|
||||
#endif
|
||||
|
||||
#define _ALIGN(num) \
|
||||
__attribute__ ((aligned(num))) \
|
||||
AZ_POP_DISABLE_WARNING
|
||||
|
||||
#define _PACK __attribute__ ((packed))
|
||||
|
||||
// Safe memory freeing
|
||||
@@ -265,9 +261,6 @@ typedef union _LARGE_INTEGER
|
||||
|
||||
#define INVALID_FILE_ATTRIBUTES (-1)
|
||||
|
||||
#define DEFINE_ALIGNED_DATA(type, name, alignment) \
|
||||
type __attribute__ ((aligned(alignment))) name;
|
||||
|
||||
#define BST_UNCHECKED 0x0000
|
||||
|
||||
#ifndef HRESULT_VALUES_DEFINED
|
||||
|
||||
@@ -2146,7 +2146,7 @@ inline uint8 CCamera::IsOBBVisible_EH(const Vec3& wpos, const OBB& obb, f32 usca
|
||||
//--- ADDITIONAL-TEST ---
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
extern _MS_ALIGN(64) uint32 BoxSides[];
|
||||
alignas(64) extern uint32 BoxSides[];
|
||||
|
||||
// Description:
|
||||
// A box can easily straddle one of the view-frustum planes far
|
||||
|
||||
@@ -1243,7 +1243,6 @@ struct Matrix33_tpl
|
||||
typedef Matrix33_tpl<f32> Matrix33; //always 32 bit
|
||||
typedef Matrix33_tpl<f64> Matrix33d; //always 64 bit
|
||||
typedef Matrix33_tpl<real> Matrix33r; //variable float precision. depending on the target system it can be between 32, 64 or 80 bit
|
||||
typedef _MS_ALIGN(16) Matrix33_tpl<f32> _ALIGN (16) Matrix33A;
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
@@ -1224,7 +1224,11 @@ struct Matrix34_tpl
|
||||
typedef Matrix34_tpl<f32> Matrix34; //always 32 bit
|
||||
typedef Matrix34_tpl<f64> Matrix34d;//always 64 bit
|
||||
typedef Matrix34_tpl<real> Matrix34r;//variable float precision. depending on the target system it can be between 32, 64 or bit
|
||||
typedef _MS_ALIGN(16) Matrix34_tpl<f32> _ALIGN (16) Matrix34A;
|
||||
#if AZ_COMPILER_MSVC
|
||||
typedef __declspec(align(16)) Matrix34_tpl<f32> Matrix34A;
|
||||
#elif AZ_COMPILER_CLANG
|
||||
typedef Matrix34_tpl<f32> __attribute__((aligned(16))) Matrix34A;
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
@@ -666,7 +666,11 @@ struct Matrix44_tpl
|
||||
typedef Matrix44_tpl<f32> Matrix44; //always 32 bit
|
||||
typedef Matrix44_tpl<f64> Matrix44d; //always 64 bit
|
||||
typedef Matrix44_tpl<real> Matrix44r; //variable float precision. depending on the target system it can be between 32, 64 or 80 bit
|
||||
typedef _MS_ALIGN(16) Matrix44_tpl<f32> _ALIGN (16) Matrix44A;
|
||||
#if AZ_COMPILER_MSVC
|
||||
typedef __declspec(align(16)) Matrix44_tpl<f32> Matrix44A;
|
||||
#elif AZ_COMPILER_CLANG
|
||||
typedef Matrix44_tpl<f32> __attribute__((aligned(16))) Matrix44A;
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
@@ -908,14 +908,6 @@ typedef Quat_tpl<f32> CryQuat;
|
||||
typedef Quat_tpl<f32> quaternionf;
|
||||
typedef Quat_tpl<real> quaternion;
|
||||
|
||||
// alligned versions
|
||||
#ifndef MAX_API_NUM
|
||||
typedef DEFINE_ALIGNED_DATA (Quat, QuatA, 16); // typedef __declspec(align(16)) Quat_tpl<f32> CryQuatA;
|
||||
typedef DEFINE_ALIGNED_DATA (Quatd, QuatrA, 32); // typedef __declspec(align(16)) Quat_tpl<f32> quaternionfA;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
*
|
||||
* The "inner product" or "dot product" operation.
|
||||
@@ -1425,11 +1417,6 @@ typedef QuatT_tpl<f32> QuatT; //always 32 bit
|
||||
typedef QuatT_tpl<f64> QuatTd;//always 64 bit
|
||||
typedef QuatT_tpl<real> QuatTr;//variable float precision. depending on the target system it can be between 32, 64 or bit
|
||||
|
||||
// alligned versions
|
||||
typedef DEFINE_ALIGNED_DATA (QuatT, QuatTA, 32); //wastest 4byte per quatT // typedef __declspec(align(16)) Quat_tpl<f32> QuatTA;
|
||||
typedef DEFINE_ALIGNED_DATA (QuatTd, QuatTrA, 16); // typedef __declspec(align(16)) Quat_tpl<f32> QuatTrA;
|
||||
|
||||
|
||||
/*!
|
||||
*
|
||||
* Implements the multiplication operator: QuatT=Quatpos*Quat
|
||||
@@ -1711,10 +1698,6 @@ typedef QuatTS_tpl<f32> QuatTS; //always 64 bit
|
||||
typedef QuatTS_tpl<f64> QuatTSd;//always 64 bit
|
||||
typedef QuatTS_tpl<real> QuatTSr;//variable float precision. depending on the target system it can be between 32, 64 or 80 bit
|
||||
|
||||
// alligned versions
|
||||
typedef DEFINE_ALIGNED_DATA (QuatTS, QuatTSA, 16); // typedef __declspec(align(16)) Quat_tpl<f32> QuatTSA;
|
||||
typedef DEFINE_ALIGNED_DATA (QuatTSd, QuatTSrA, 64); // typedef __declspec(align(16)) QuatTS_tpl<f32> QuatTSrA;
|
||||
|
||||
template<class F1, class F2>
|
||||
ILINE QuatTS_tpl<F1> operator * (const QuatTS_tpl<F1>& a, const Quat_tpl<F2>& b)
|
||||
{
|
||||
@@ -1972,11 +1955,6 @@ typedef QuatTNS_tpl<f32> QuatTNS;
|
||||
typedef QuatTNS_tpl<f64> QuatTNSr;
|
||||
typedef QuatTNS_tpl<f64> QuatTNS_f64;
|
||||
|
||||
// alligned versions
|
||||
typedef DEFINE_ALIGNED_DATA (QuatTNS, QuatTNSA, 16);
|
||||
typedef DEFINE_ALIGNED_DATA (QuatTNSr, QuatTNSrA, 64);
|
||||
typedef DEFINE_ALIGNED_DATA (QuatTNS_f64, QuatTNS_f64A, 64);
|
||||
|
||||
template<class F1, class F2>
|
||||
ILINE QuatTNS_tpl<F1> operator * (const QuatTNS_tpl<F1>& a, const Quat_tpl<F2>& b)
|
||||
{
|
||||
|
||||
@@ -753,7 +753,7 @@ struct SBending
|
||||
// Description:
|
||||
// Interface for the skinnable objects (renderer calls its functions to get the skinning data).
|
||||
// should only created by EF_CreateSkinningData
|
||||
_MS_ALIGN(16) struct SSkinningData
|
||||
struct alignas(16) SSkinningData
|
||||
{
|
||||
uint32 nNumBones;
|
||||
uint32 nHWSkinningFlags;
|
||||
@@ -768,9 +768,10 @@ _MS_ALIGN(16) struct SSkinningData
|
||||
// members below are for Software Skinning
|
||||
void* pCustomData; // client specific data, used for example for sw-skinning on animation side
|
||||
SSkinningData* pNextSkinningData; // List to the next element which needs SW-Skinning
|
||||
} _ALIGN(16);
|
||||
[[maybe_unused]] int m_padding[2]; // padding to avoid MSVC warning 4324
|
||||
};
|
||||
|
||||
struct SRenderObjData
|
||||
struct alignas(16) SRenderObjData
|
||||
{
|
||||
uintptr_t m_uniqueObjectId;
|
||||
|
||||
@@ -837,7 +838,7 @@ struct SRenderObjData
|
||||
{
|
||||
AZ_UNUSED(pSizer);
|
||||
}
|
||||
} _ALIGN(16);
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Objects using in shader pipeline
|
||||
@@ -856,7 +857,7 @@ struct ShadowMapFrustum;
|
||||
/// It can be compiled into the platform specific efficient rendering compiled object.
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
_MS_ALIGN(16) class CRenderObject
|
||||
class alignas(16) CRenderObject
|
||||
{
|
||||
public:
|
||||
AZ_CLASS_ALLOCATOR(CRenderObject, AZ::LegacyAllocator, 0);
|
||||
@@ -929,6 +930,8 @@ public:
|
||||
|
||||
PerInstanceConstantBufferKey m_PerInstanceConstantBufferKey;
|
||||
|
||||
[[maybe_unused]] int m_padding[1]; // padding to avoid MSVC warning 4324
|
||||
|
||||
//! Embedded SRenderObjData, optional data carried by CRenderObject
|
||||
SRenderObjData m_data;
|
||||
|
||||
@@ -1007,7 +1010,7 @@ protected:
|
||||
}
|
||||
|
||||
friend class CRenderer;
|
||||
} _ALIGN(16);
|
||||
};
|
||||
|
||||
enum EResClassName
|
||||
{
|
||||
@@ -1200,8 +1203,8 @@ struct SEfTexModificator
|
||||
return false;
|
||||
}
|
||||
|
||||
_MS_ALIGN(16) Matrix44 m_TexGenMatrix _ALIGN(16);
|
||||
_MS_ALIGN(16) Matrix44 m_TexMatrix _ALIGN(16);
|
||||
alignas(16) Matrix44 m_TexGenMatrix;
|
||||
alignas(16) Matrix44 m_TexMatrix;
|
||||
|
||||
float m_Tiling[3];
|
||||
float m_Offs[3];
|
||||
|
||||
@@ -91,9 +91,6 @@ typedef unsigned char byte;
|
||||
|
||||
#define INVALID_FILE_ATTRIBUTES (-1)
|
||||
|
||||
#define DEFINE_ALIGNED_DATA(type, name, alignment) \
|
||||
type __attribute__ ((aligned(alignment))) name;
|
||||
|
||||
#include "LinuxSpecific.h"
|
||||
|
||||
#define TARGET_DEFAULT_ALIGN (0x4U)
|
||||
|
||||
@@ -97,9 +97,6 @@ typedef uint8 byte;
|
||||
|
||||
#define INVALID_FILE_ATTRIBUTES (-1)
|
||||
|
||||
#define DEFINE_ALIGNED_DATA(type, name, alignment) \
|
||||
type __attribute__ ((aligned(alignment))) name;
|
||||
|
||||
#include "LinuxSpecific.h"
|
||||
|
||||
#define TARGET_DEFAULT_ALIGN (0x8U)
|
||||
|
||||
@@ -83,10 +83,6 @@ typedef float FLOAT;
|
||||
#define STDMETHODCALLTYPE
|
||||
#endif
|
||||
|
||||
#define _ALIGN(num) \
|
||||
__attribute__ ((aligned(num))) \
|
||||
AZ_POP_DISABLE_WARNING
|
||||
|
||||
#define _PACK __attribute__ ((packed))
|
||||
|
||||
// Safe memory freeing
|
||||
|
||||
@@ -101,12 +101,6 @@ int64 CryGetTicksPerSec();
|
||||
}
|
||||
#endif
|
||||
|
||||
#define _MS_ALIGN(num) \
|
||||
AZ_PUSH_DISABLE_WARNING(4324, "-Wunknown-warning-option") \
|
||||
__declspec(align(num))
|
||||
|
||||
#define DEFINE_ALIGNED_DATA(type, name, alignment) _declspec(align(alignment)) type name;
|
||||
|
||||
#ifndef FILE_ATTRIBUTE_NORMAL
|
||||
#define FILE_ATTRIBUTE_NORMAL 0x00000080
|
||||
#endif
|
||||
|
||||
@@ -84,12 +84,6 @@ int64 CryGetTicksPerSec();
|
||||
}
|
||||
#endif
|
||||
|
||||
#define _MS_ALIGN(num) \
|
||||
AZ_PUSH_DISABLE_WARNING(4324, "-Wunknown-warning-option") \
|
||||
__declspec(align(num))
|
||||
|
||||
#define DEFINE_ALIGNED_DATA(type, name, alignment) _declspec(align(alignment)) type name;
|
||||
|
||||
#ifndef FILE_ATTRIBUTE_NORMAL
|
||||
#define FILE_ATTRIBUTE_NORMAL 0x00000080
|
||||
#endif
|
||||
|
||||
@@ -372,16 +372,6 @@ threadID CryGetCurrentThreadId();
|
||||
#define __PACKED
|
||||
#endif
|
||||
|
||||
// Fallback for Alignment macro of GCC/CLANG (must be after the class definition)
|
||||
#if !defined(_ALIGN)
|
||||
#define _ALIGN(num) AZ_POP_DISABLE_WARNING
|
||||
#endif
|
||||
|
||||
// Fallback for Alignment macro of MSVC (must be before the class definition)
|
||||
#if !defined(_MS_ALIGN)
|
||||
#define _MS_ALIGN(num) AZ_PUSH_DISABLE_WARNING(4324, "-Wunknown-warning-option")
|
||||
#endif
|
||||
|
||||
#if defined(AZ_RESTRICTED_PLATFORM)
|
||||
#define AZ_RESTRICTED_SECTION PLATFORM_H_SECTION_13
|
||||
#include AZ_RESTRICTED_FILE(platform_h)
|
||||
|
||||
@@ -339,7 +339,7 @@ inline void CryDebugStr([[maybe_unused]] const char* format, ...)
|
||||
*/
|
||||
}
|
||||
|
||||
_MS_ALIGN(64) uint32 BoxSides[0x40 * 8] = {
|
||||
alignas(64) uint32 BoxSides[0x40 * 8] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, //00
|
||||
0, 4, 6, 2, 0, 0, 0, 4, //01
|
||||
7, 5, 1, 3, 0, 0, 0, 4, //02
|
||||
|
||||
Reference in New Issue
Block a user