Skip to content

Commit

Permalink
RC2
Browse files Browse the repository at this point in the history
fixed compilation
  • Loading branch information
azhirnov committed Oct 1, 2024
1 parent bfbdf50 commit 6c8bf4f
Show file tree
Hide file tree
Showing 16 changed files with 164 additions and 54 deletions.
3 changes: 2 additions & 1 deletion AE/engine/src/base/Algorithms/Parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ namespace AE::Base

ND_ static bool IsNumberBegin (char c) __NE___;
ND_ static bool IsNumber (char c) __NE___;
} CPP;

} CPP = {};
};


Expand Down
36 changes: 17 additions & 19 deletions AE/engine/src/base/Defines/Attribs.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,22 @@


// function prefix attribs
#define __Cx__ constexpr
#define __CxIn constexpr inline
#define __CxIF constexpr forceinline
#define __CxIA constexpr AE_FLATTEN_FN forceinline
#define __Cx__ constexpr
#define __CxIn inline constexpr
#define __CxIF forceinline constexpr
#define __CxIA AE_FLATTEN_FN forceinline constexpr
#define ____In inline
#define ____IF forceinline
#define ____IA AE_FLATTEN_FN forceinline
#define NdCx__ ND_ constexpr
#define NdCxIn ND_ constexpr inline
#define NdCxIF ND_ constexpr forceinline
#define NdCxIA ND_ constexpr AE_FLATTEN_FN forceinline
#define ____IA AE_FLATTEN_FN forceinline
#define NdCx__ ND_ constexpr
#define NdCxIn ND_ inline constexpr
#define NdCxIF ND_ forceinline constexpr
#define NdCxIA ND_ AE_FLATTEN_FN forceinline constexpr
#define Nd__In ND_ inline
#define Nd__IF ND_ forceinline
#define Nd__IA ND_ AE_FLATTEN_FN forceinline
#define __Cv__ cxx20_consteval
#define NdCv__ ND_ cxx20_consteval
#define Nd__IA ND_ AE_FLATTEN_FN forceinline
#define __Cv__ cxx20_consteval
#define NdCv__ ND_ cxx20_consteval


// has attribute (C++20)
Expand Down Expand Up @@ -116,12 +116,12 @@
# if defined(AE_CFG_DEBUG)
# define forceinline inline

# elif defined(AE_COMPILER_MSVC)
# elif defined(AE_COMPILER_MSVC) and not defined(AE_COMPILER_CLANG_CL)
# define forceinline __forceinline

# elif defined(AE_COMPILER_CLANG) or defined(AE_COMPILER_GCC)
# elif defined(AE_COMPILER_CLANG) or defined(AE_COMPILER_GCC) or defined(AE_COMPILER_CLANG_CL)
# if AE_HAS_ATTRIB( gnu::always_inline )
# define forceinline [[gnu::always_inline]]
# define forceinline [[gnu::always_inline]] inline
# else
# define forceinline __inline__ __attribute__((__always_inline__))
# endif
Expand Down Expand Up @@ -335,11 +335,9 @@
# endif
#endif
#if defined(AE_COMPILER_GCC)
# if AE_HAS_ATTRIB( gnu::flatten ) and AE_HAS_ATTRIB( gnu::always_inline )
# define AE_INLINE_ALL [[gnu::flatten]]
# define AE_INLINE_CALLS [[gnu::always_inline]]
# define AE_INLINE_ALL //[[gnu::flatten]]
# define AE_INLINE_CALLS //[[gnu::always_inline]]
# define AE_FLATTEN_FN __attribute__((flatten))
# endif
#endif
#ifndef AE_INLINE_ALL
# define AE_INLINE_ALL
Expand Down
10 changes: 10 additions & 0 deletions AE/engine/src/base/Platforms/CPUInfo_Apple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,16 @@ namespace AE::Base
feats.SSE2 = true; // always supported
}

// get cache hierarhy
{
uint cache_line = ReadUInt("hw.cachelinesize");
CHECK( cache_line == AE_CACHE_LINE );

cache.L1_Inst.size = Bytes32u{ReadUInt("hw.l1icachesize")};
cache.L1_Data.size = Bytes32u{ReadUInt("hw.l1dcachesize")};
cache.L2.size = Bytes32u{ReadUInt("hw.l2cachesize")};
}

_Validate();
}

Expand Down
2 changes: 1 addition & 1 deletion AE/engine/src/base/Platforms/Perf_Apple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace AE::Base
GetPerfCounters
=================================================
*/
bool PerformanceStat::GetPerfCounters (OUT PerProcessCounters &, OUT PerThreadCounters &) __NE___
bool PerformanceStat::GetPerfCounters (OUT PerProcessCounters*, OUT PerThreadCounters*, OUT MemoryCounters *) __NE___
{
return false;
}
Expand Down
18 changes: 9 additions & 9 deletions AE/engine/src/base/Utils/Atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ namespace AE::Base

private:
template <typename From>
ND_ static forceinline InternalType& _Ref (From &src) __NE___
Nd__IF static InternalType& _Ref (From &src) __NE___
{
if constexpr( IsSameTypes< InternalType, From >)
return src;
Expand Down Expand Up @@ -232,11 +232,11 @@ namespace AE::Base
}

private:
ND_ static forceinline IT _Cast (const T &value) __NE___ { return BitCast<IT>( value ); }
ND_ static forceinline T _Cast (const IT &value) __NE___ { return BitCast<T>( value ); }
Nd__IF static IT _Cast (const T &value) __NE___ { return BitCast<IT>( value ); }
Nd__IF static T _Cast (const IT &value) __NE___ { return BitCast<T>( value ); }

ND_ static forceinline T& _Ref (IT &value) __NE___ { return reinterpret_cast< T &>( value ); }
ND_ static forceinline IT& _Ref (T &value) __NE___ { return reinterpret_cast< IT &>( value ); }
Nd__IF static T& _Ref (IT &value) __NE___ { return reinterpret_cast< T &>( value ); }
Nd__IF static IT& _Ref (T &value) __NE___ { return reinterpret_cast< IT &>( value ); }
};
//-----------------------------------------------------------------------------

Expand Down Expand Up @@ -368,7 +368,7 @@ namespace AE::Base
ND_ T GetFirstZeroBit () C_NE___ { return Load().GetFirstZeroBit(); }

private:
ND_ static forceinline T _Range (usize first, usize count) __NE___ { ASSERT( first < _BitCount ); ASSERT( first+count <= _BitCount ); return ToBitMask<T>( count ) << first; }
Nd__IF static T _Range (usize first, usize count) __NE___ { ASSERT( first < _BitCount ); ASSERT( first+count <= _BitCount ); return ToBitMask<T>( count ) << first; }
};
//-----------------------------------------------------------------------------

Expand Down Expand Up @@ -472,9 +472,9 @@ namespace AE::Base
}

private:
ND_ static forceinline IT _Cast (const T &value) __NE___ { return BitCast<IT>( value ); }
ND_ static forceinline T _Cast (const IT &value) __NE___ { return BitCast<T>( value ); }
ND_ static forceinline IT& _Ref (T &value) __NE___ { return reinterpret_cast<IT &>( value ); }
Nd__IF static IT _Cast (const T &value) __NE___ { return BitCast<IT>( value ); }
Nd__IF static T _Cast (const IT &value) __NE___ { return BitCast<T>( value ); }
Nd__IF static IT& _Ref (T &value) __NE___ { return reinterpret_cast<IT &>( value ); }
};
//-----------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ namespace
CHECK( not is_sp_input or is_sp_input == AllBits( desc.usage, EImageUsage::InputAttachment ));

Unused( img_type );
CHECK_ERR_MSG( PipelineCompiler::EImageType_IsCompatible( img_type, un->image.type ),
ASSERT_MSG( PipelineCompiler::EImageType_IsCompatible( img_type, un->image.type ),
"image view '"s << view->GetDebugName() << "' with type (" << ToString( img_type ) <<
") is not compatible with sampler '" << name.GetName() << "' type (" << ToString( un->image.type ) << ")" );
)
Expand Down Expand Up @@ -480,7 +480,7 @@ namespace
CHECK( AllBits( desc.usage, EImageUsage::Sampled ));

Unused( img_type );
CHECK_ERR_MSG( PipelineCompiler::EImageType_IsCompatible( img_type, un->image.type ),
ASSERT_MSG( PipelineCompiler::EImageType_IsCompatible( img_type, un->image.type ),
"image view '"s << view->GetDebugName() << "' with type " << ToString( img_type ) <<
" is not compatible with sampler '" << name.GetName() << "' type " << ToString( un->image.type ));
)
Expand Down Expand Up @@ -897,7 +897,7 @@ namespace
CHECK( not is_storage or is_storage == AllBits( desc.usage, EBufferUsage::StorageTexel ));

Unused( img_type );
CHECK_ERR_MSG( PipelineCompiler::EImageType_IsCompatible( img_type, un->texelBuffer.type ),
ASSERT_MSG( PipelineCompiler::EImageType_IsCompatible( img_type, un->texelBuffer.type ),
"buffer view '"s << view->GetDebugName() << "' with type " << ToString( img_type ) <<
" is not compatible with sampler '" << name.GetName() << "' type " << ToString( un->texelBuffer.type ));
)
Expand Down
2 changes: 1 addition & 1 deletion AE/engine/src/profiler/Remote/RemoteGeneralProfiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ namespace AE::Profiler
if ( auto msg = _msgProducer->CreateMsg< CSMsg_GenProf_CpuCluster >( StringSizeOf(src.name) ))
{
msg->idx = ubyte(idx);
msg->logicalCores = src.logicalCores.to_ulong();
msg->logicalCores = uint(src.logicalCores.to_ulong());

msg.Put( &CSMsg_GenProf_CpuCluster::name, &CSMsg_GenProf_CpuCluster::length, StringView{src.name} );

Expand Down
30 changes: 17 additions & 13 deletions AE/engine/src/scripting/Bindings/CoreBindings_BindQuaternion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,39 @@ namespace
QuatCtor
=================================================
*/
template <typename Q>
template <typename T>
struct QuatCtor
{
private:
using T = typename Q::Value_t;
using Quat_t = TQuat< T, GLMPackedQualifier >;
using Vec4_t = PackedVec< T, 4 >;


static void _Ctor3 (void* mem, T w, T x, T y, T z)
{
PlacementNew< Q >( OUT mem, w, x, y, z );
PlacementNew< Quat_t >( OUT mem, w, x, y, z );
}


static void _V4Ctor (void* mem, const Q &q)
static void _V4Ctor (void* mem, const Quat_t &q)
{
PlacementNew< Vec4_t >( OUT mem, q.x, q.y, q.z, q.w );
}


public:
static void Bind (ClassBinder<Q> &binder, ClassBinder<Vec4_t> &binder2)
static void Bind (ClassBinder<Quat_t> &binder, ClassBinder<Vec4_t> &binder2)
{
using Field_t = T (Quat_t::*);

binder.CreateClassValue();

binder.AddConstructor( &_Ctor3, {"w", "x", "y", "z"} );

binder.AddProperty( &Q::x, "x" );
binder.AddProperty( &Q::y, "y" );
binder.AddProperty( &Q::z, "z" );
binder.AddProperty( &Q::w, "w" );
binder.AddProperty( BitCast<Field_t>( &Quat_t::x ), "x" );
binder.AddProperty( BitCast<Field_t>( &Quat_t::y ), "y" );
binder.AddProperty( BitCast<Field_t>( &Quat_t::z ), "z" );
binder.AddProperty( BitCast<Field_t>( &Quat_t::w ), "w" );

binder2.AddConstructor( &_V4Ctor, {"quat"} );
}
Expand Down Expand Up @@ -144,12 +146,14 @@ namespace
template <typename T, usize Index>
void operator () ()
{
using Vec4_t = PackedVec< typename T::Value_t, 4 >;
using Value_t = typename T::Value_t;
using Quat_t = T;
using Vec4_t = PackedVec< Value_t, 4 >;

ClassBinder<T> binder { _se };
ClassBinder<Vec4_t> binder2 { _se };
ClassBinder<Quat_t> binder { _se };
ClassBinder<Vec4_t> binder2 { _se };

QuatCtor<T>::Bind( binder, binder2 );
QuatCtor<Value_t>::Bind( binder, binder2 );

BindFloatQuat( binder, _se );
}
Expand Down
2 changes: 1 addition & 1 deletion AE/engine/tools/cicd/BuildMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ namespace AE::CICD

String cmd = "unzip \"";
cmd << ToString(zip);
cmd < "\" -d \"";
cmd << "\" -d \"";
cmd << ToString(dir);
cmd << "\"";

Expand Down
2 changes: 1 addition & 1 deletion AE/engine/tools/graphics_lib/GraphicsLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ namespace
#if defined(AE_ENABLE_VULKAN)
Graphics::VDeviceInitializer _device;
Graphics::VSwapchainInitializer _swapchain;
Graphics::VulkanSyncLog _syncLog;
//Graphics::VulkanSyncLog _syncLog;

#elif defined(AE_ENABLE_METAL)
Graphics::MDeviceInitializer _device;
Expand Down
6 changes: 3 additions & 3 deletions AE/samples/res_editor/Scripting/ScriptExe_MeshGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -748,19 +748,19 @@ namespace AE::ResEditor
packed_float3 ScriptExe::_CM_CubeSC_Forward (const packed_float3 &c)
{
using namespace AE::GeometryTools;
return packed_float3{ SCProj2_Cube< SCProj1_Identity >::Forward( double2{c.x, c.y}, ECubeFace(c.z) )};
return packed_float3{ SCProj2_Cube< SCProj1_Identity >::Forward( double2{float2{c.x, c.y}}, ECubeFace(c.z) )};
}

packed_float3 ScriptExe::_CM_IdentitySC_Forward (const packed_float3 &c)
{
using namespace AE::GeometryTools;
return packed_float3{ SCProj2_Spherical< SCProj1_Identity >::Forward( double2{c.x, c.y}, ECubeFace(c.z) )};
return packed_float3{ SCProj2_Spherical< SCProj1_Identity >::Forward( double2{float2{c.x, c.y}}, ECubeFace(c.z) )};
}

packed_float3 ScriptExe::_CM_TangentialSC_Forward (const packed_float3 &c)
{
using namespace AE::GeometryTools;
return packed_float3{ SCProj2_Spherical< SCProj1_Tangential >::Forward( double2{c.x, c.y}, ECubeFace(c.z) )};
return packed_float3{ SCProj2_Spherical< SCProj1_Tangential >::Forward( double2{float2{c.x, c.y}}, ECubeFace(c.z) )};
}


Expand Down
2 changes: 1 addition & 1 deletion AE/samples/res_editor/Scripting/ScriptPostprocess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ namespace
binder.AddFactoryCtor( &ScriptPostprocess_Ctor5, {"shaderPath", "defines"} );

binder.Comment( "Can be used only if pass hasn't attachments." );
binder.AddMethod( &ScriptBasePass::_SetDynamicDimension, "SetDimension", {} );
binder.AddMethod( &ScriptPostprocess::_SetDynamicDimension2, "SetDimension", {} );
}
}

Expand Down
2 changes: 2 additions & 0 deletions AE/samples/res_editor/Scripting/ScriptPostprocess.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ namespace AE::ResEditor
EPipelineOpt pplnOpt) C_Th___;

ND_ static auto _CreateUBType () __Th___;

void _SetDynamicDimension2 (const ScriptDynamicDimPtr &value) __Th___ { ScriptBasePass::_SetDynamicDimension( value ); }

// ScriptBasePass //
void _OnAddArg (INOUT ScriptPassArgs::Argument &arg) C_Th_OV;
Expand Down
2 changes: 1 addition & 1 deletion AE/samples/res_editor/Scripting/ScriptScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ namespace AE::ResEditor
binder.AddMethod( &ScriptSceneGraphicsPass::SetFragmentShadingRate, "FragmentShadingRate", {"rate", "primitiveOp", "textureOp"} );

binder.Comment( "Can be used only if pass hasn't attachments." );
binder.AddMethod( &ScriptBasePass::_SetDynamicDimension, "SetDimension", {} );
binder.AddMethod( &ScriptSceneGraphicsPass::_SetDynamicDimension2, "SetDimension", {} );
}
}

Expand Down
1 change: 1 addition & 0 deletions AE/samples/res_editor/Scripting/ScriptScene.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ namespace AE::ResEditor
ND_ static auto _CreateUBType () __Th___;

void _WithPipelineCompiler () C_Th___;
void _SetDynamicDimension2 (const ScriptDynamicDimPtr &value) __Th___ { ScriptBasePass::_SetDynamicDimension( value ); }

// ScriptBasePass //
void _OnAddArg (INOUT ScriptPassArgs::Argument &arg) C_Th_OV;
Expand Down
Loading

0 comments on commit 6c8bf4f

Please sign in to comment.