Skip to content

Commit

Permalink
Fixed some compile errors and warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
DragonJoker committed Feb 21, 2024
1 parent fab2b92 commit ee06f3c
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 80 deletions.
6 changes: 3 additions & 3 deletions include/Core/Castor3D/Shader/Shaders/GlslDerivativeValue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ namespace castor3d::shader
{
}

auto value()const { return this->getMember< "value" >(); }
auto dPdx()const { return this->getMember< "dPdx" >(); }
auto dPdy()const { return this->getMember< "dPdy" >(); }
auto value()const { return this->template getMember< "value" >(); }
auto dPdx()const { return this->template getMember< "dPdx" >(); }
auto dPdy()const { return this->template getMember< "dPdy" >(); }

DerivativeValueT operator-()const;
DerivativeValueT & operator+=( DerivativeValueT const & rhs );
Expand Down
40 changes: 20 additions & 20 deletions include/Core/Castor3D/Shader/Shaders/GlslSurface.inl
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ namespace castor3d::shader
, ast::expr::ExprPtr expr
, bool enabled )
: StructInstance{ writer, castor::move( expr ), enabled }
, clipPosition{ this->getMember< sdw::Vec3 >( "clipPosition", true ) }
, viewPosition{ this->getMember< Position4T >( "viewPosition", true ) }
, worldPosition{ this->getMember< Position4T >( "worldPosition", true ) }
, normal{ this->getMember< NormalT >( "normal", true ) }
, clipPosition{ this->template getMember< sdw::Vec3 >( "clipPosition", true ) }
, viewPosition{ this->template getMember< Position4T >( "viewPosition", true ) }
, worldPosition{ this->template getMember< Position4T >( "worldPosition", true ) }
, normal{ this->template getMember< NormalT >( "normal", true ) }
{
}

Expand Down Expand Up @@ -179,7 +179,7 @@ namespace castor3d::shader
, ast::expr::ExprPtr expr
, bool enabled )
: SurfaceBaseT< Position3T, Position4T, NormalT >{ writer, castor::move( expr ), enabled }
, texCoord{ this->getMember< sdw::Vec3 >( "texture0" ) }
, texCoord{ this->template getMember< sdw::Vec3 >( "texture0" ) }
{
}

Expand Down Expand Up @@ -320,17 +320,17 @@ namespace castor3d::shader
, sdw::expr::ExprPtr expr
, bool enabled )
: SurfaceBaseT< Position3T, Position4T, Normal3T >{ writer, castor::move( expr ), enabled }
, curPosition{ this->getMember< Position4T >( "curPosition", true ) }
, prvPosition{ this->getMember< Position4T >( "prvPosition", true ) }
, tangentSpaceFragPosition{ this->getMember< Position3T >( "tangentSpaceFragPosition", true ) }
, tangentSpaceViewPosition{ this->getMember< sdw::Vec3 >( "tangentSpaceViewPosition", true ) }
, tangent{ this->getMember< Normal4T >( "tangent", true ) }
, bitangent{ this->getMember< Normal3T >( "bitangent", true ) }
, colour{ this->getMember< sdw::Vec3 >( "colour", true ) }
, passMultipliers{ this->getMemberArray< sdw::Vec4 >( "passMultipliers", true ) }
, nodeId{ this->getMember< sdw::UInt >( "nodeId", true ) }
, vertexId{ this->getMember< sdw::UInt >( "vertexId", true ) }
, meshletId{ this->getMember< sdw::UInt >( "meshletId", true ) }
, curPosition{ this->template getMember< Position4T >( "curPosition", true ) }
, prvPosition{ this->template getMember< Position4T >( "prvPosition", true ) }
, tangentSpaceFragPosition{ this->template getMember< Position3T >( "tangentSpaceFragPosition", true ) }
, tangentSpaceViewPosition{ this->template getMember< sdw::Vec3 >( "tangentSpaceViewPosition", true ) }
, tangent{ this->template getMember< Normal4T >( "tangent", true ) }
, bitangent{ this->template getMember< Normal3T >( "bitangent", true ) }
, colour{ this->template getMember< sdw::Vec3 >( "colour", true ) }
, passMultipliers{ this->template getMemberArray< sdw::Vec4 >( "passMultipliers", true ) }
, nodeId{ this->template getMember< sdw::UInt >( "nodeId", true ) }
, vertexId{ this->template getMember< sdw::UInt >( "vertexId", true ) }
, meshletId{ this->template getMember< sdw::UInt >( "meshletId", true ) }
{
}

Expand Down Expand Up @@ -653,10 +653,10 @@ namespace castor3d::shader
, sdw::expr::ExprPtr expr
, bool enabled )
: RasterizerSurfaceBaseT< Position3T, Position4T, Normal3T, Normal4T >{ writer, castor::move( expr ), enabled }
, texture0{ this->getMember< TexcoordT >( "texture0", true ) }
, texture1{ this->getMember< TexcoordT >( "texture1", true ) }
, texture2{ this->getMember< TexcoordT >( "texture2", true ) }
, texture3{ this->getMember< TexcoordT >( "texture3", true ) }
, texture0{ this->template getMember< TexcoordT >( "texture0", true ) }
, texture1{ this->template getMember< TexcoordT >( "texture1", true ) }
, texture2{ this->template getMember< TexcoordT >( "texture2", true ) }
, texture3{ this->template getMember< TexcoordT >( "texture3", true ) }
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ See LICENSE file in root folder
#define ___GLSL_TextureConfiguration_H___

#include "GlslBuffer.hpp"
#include "GlslDerivativeValue.hpp"
#include "GlslTextureTransform.hpp"

#include <ShaderWriter/MatTypes/Mat4.hpp>
Expand Down
8 changes: 6 additions & 2 deletions include/Core/CastorUtils/Math/Matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,14 @@ namespace castor
explicit Matrix( Array< Type, Columns * Rows > const & rhs );
template< typename Type >
explicit Matrix( Matrix< Type, Columns, Rows > const & matrix );
template< typename ... Types >
explicit Matrix( Types && ... inits ) requires isRightSize< Types... >;
explicit Matrix( std::initializer_list< T > rhs );
~Matrix()noexcept = default;

template< typename ... Types >
explicit Matrix( Types && ... inits ) requires isRightSize< Types... >
: Matrix{ Array< T, Columns * Rows >{ std::forward< Types >( inits )... } }
{
}
/**@}*/
/**
*\~english
Expand Down
7 changes: 0 additions & 7 deletions include/Core/CastorUtils/Math/Matrix.inl
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,6 @@ namespace castor
}
}

template< typename T, uint32_t Columns, uint32_t Rows >
template< typename ... Types >
Matrix< T, Columns, Rows >::Matrix( Types && ... inits ) requires isRightSize< Types... >
: Matrix{ Array< T, Columns * Rows >{ std::forward< Types >( inits )... } }
{
}

template< typename T, uint32_t Columns, uint32_t Rows >
Matrix< T, Columns, Rows >::Matrix( std::initializer_list< T > rhs )
{
Expand Down
8 changes: 6 additions & 2 deletions include/Core/CastorUtils/Math/SquareMatrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,13 @@ namespace castor
explicit SquareMatrix( Array< Type, Count * Count > const & rhs );
template< typename Type >
explicit SquareMatrix( Type const * rhs );
template< typename ... Types >
explicit SquareMatrix( Types && ... inits ) requires isRightSize< Types... >;
explicit SquareMatrix( std::initializer_list< T > rhs );

template< typename ... Types >
explicit SquareMatrix( Types && ... inits ) requires isRightSize< Types... >
: matrix_type{ std::forward< Types >( inits )... }
{
}
/**@}*/
/**
*\~english
Expand Down
7 changes: 0 additions & 7 deletions include/Core/CastorUtils/Math/SquareMatrix.inl
Original file line number Diff line number Diff line change
Expand Up @@ -450,13 +450,6 @@ namespace castor
{
}

template< typename T, uint32_t Count >
template< typename ... Types >
SquareMatrix< T, Count >::SquareMatrix( Types && ... inits ) requires isRightSize< Types... >
: matrix_type{ std::forward< Types >( inits )... }
{
}

template< typename T, uint32_t Count >
inline SquareMatrix< T, Count >::SquareMatrix( std::initializer_list< T > rhs )
: matrix_type( castor::move( rhs ) )
Expand Down
5 changes: 2 additions & 3 deletions source/Core/Castor3D/Render/Node/QueueRenderNodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1452,7 +1452,7 @@ namespace castor3d

for ( auto const & [buffer, nodes] : pipelinesNodes.nodes )
{
if ( auto firstVisibleNode = queuerndnd::hasVisibleNode( nodes ) )
if ( queuerndnd::hasVisibleNode( nodes ) )
{
auto & pipelineNodes = getPipelineNodes( pipeline.pipeline->getFlagsHash()
, *buffer
Expand Down Expand Up @@ -2078,7 +2078,6 @@ namespace castor3d
{
C3D_DebugTime( getOwner()->getOwner()->getTypeName() + " - Billboards" );
uint32_t result{};
uint32_t idxIndex{};
uint32_t nidxIndex{};

for ( auto const & [_, pipelinesNodes] : m_billboardNodes )
Expand All @@ -2087,7 +2086,7 @@ namespace castor3d

for ( auto const & [buffer, nodes] : pipelinesNodes.nodes )
{
if ( auto firstVisibleNode = queuerndnd::hasVisibleNode( nodes ) )
if ( queuerndnd::hasVisibleNode( nodes ) )
{
auto & pipelineNodes = getPipelineNodes( pipeline.pipeline->getFlagsHash()
, *buffer
Expand Down
46 changes: 23 additions & 23 deletions source/Core/Castor3D/Shader/Shaders/GlslDerivativeValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace castor3d::shader
, DerivT const & pa )
{
auto & writer = sdw::findWriterMandat( pa );
auto function = writer.implementFunction< ReturnT >( name
auto function = writer.template implementFunction< ReturnT >( name
, [&writer, func]( DerivT const & a )
{
auto a00 = writer.declLocale( "a00", a.value() );
Expand All @@ -29,7 +29,7 @@ namespace castor3d::shader
, DerivT const & pa )
{
auto & writer = sdw::findWriterMandat( pa );
auto function = writer.implementFunction< ReturnT >( name
auto function = writer.template implementFunction< ReturnT >( name
, [&writer, func]( DerivT const & a )
{
auto a00 = writer.declLocale( "a00", a.value() );
Expand All @@ -49,7 +49,7 @@ namespace castor3d::shader
, DerivT const & pa, DerivT const & pb )
{
auto & writer = sdw::findWriterMandat( pa, pb );
auto function = writer.implementFunction< ReturnT >( name
auto function = writer.template implementFunction< ReturnT >( name
, [&writer, func]( DerivT const & a
, DerivT const & b )
{
Expand All @@ -74,7 +74,7 @@ namespace castor3d::shader
, DerivT const & pa, DerivT const & pb, DerivT const & pc )
{
auto & writer = sdw::findWriterMandat( pa, pb, pc );
auto function = writer.implementFunction< ReturnT >( name
auto function = writer.template implementFunction< ReturnT >( name
, [&writer, func]( DerivT const & a
, DerivT const & b
, DerivT const & c )
Expand Down Expand Up @@ -104,7 +104,7 @@ namespace castor3d::shader
, DerivT const & pa, DerivT const & pb, sdw::Float const & pc )
{
auto & writer = sdw::findWriterMandat( pa, pb, pc );
auto function = writer.implementFunction< ReturnT >( name
auto function = writer.template implementFunction< ReturnT >( name
, [&writer, func]( DerivT const & a
, DerivT const & b
, sdw::Float const & c )
Expand All @@ -131,7 +131,7 @@ namespace castor3d::shader
, DerivT const & pa, sdw::Float const & pb, sdw::Float const & pc )
{
auto & writer = sdw::findWriterMandat( pa, pb, pc );
auto function = writer.implementFunction< ReturnT >( name
auto function = writer.template implementFunction< ReturnT >( name
, [&writer, func]( DerivT const & a
, sdw::Float const & b
, sdw::Float const & c )
Expand All @@ -155,7 +155,7 @@ namespace castor3d::shader
, ValueT const & pa, DerivativeValueT< ValueU, StructNameT > const & pb )
{
auto & writer = sdw::findWriterMandat( pa, pb );
auto function = writer.implementFunction< DerivativeValueT< ValueU, StructNameT > >( name
auto function = writer.template implementFunction< DerivativeValueT< ValueU, StructNameT > >( name
, [&writer, func]( ValueT const & a
, DerivativeValueT< ValueU, StructNameT > const & b )
{
Expand All @@ -177,7 +177,7 @@ namespace castor3d::shader
, DerivativeValueT< ValueT, StructNameT > const & pa, ValueT const & pb )
{
auto & writer = sdw::findWriterMandat( pa, pb );
auto function = writer.implementFunction< DerivativeValueT< ValueT, StructNameT > >( name
auto function = writer.template implementFunction< DerivativeValueT< ValueT, StructNameT > >( name
, [&writer, func]( DerivativeValueT< ValueT, StructNameT > const & a
, ValueT const & b )
{
Expand All @@ -199,7 +199,7 @@ namespace castor3d::shader
, DerivativeValueT< ValueT, StructNameT > const & pa, DerivativeValueT< ValueT, StructNameT > const & pb )
{
auto & writer = sdw::findWriterMandat( pa, pb );
auto function = writer.implementFunction< DerivativeValueT< ValueT, StructNameT > >( name
auto function = writer.template implementFunction< DerivativeValueT< ValueT, StructNameT > >( name
, [&writer, func]( DerivativeValueT< ValueT, StructNameT > const & a
, DerivativeValueT< ValueT, StructNameT > const & b )
{
Expand All @@ -224,7 +224,7 @@ namespace castor3d::shader
, DerivativeValueT< ValueT, StructNameT > const & pa )
{
auto & writer = sdw::findWriterMandat( pa );
auto function = writer.implementFunction< ReturnT >( name
auto function = writer.template implementFunction< ReturnT >( name
, [&writer, func]( DerivativeValueT< ValueT, StructNameT > const & a )
{
writer.returnStmt( ReturnT{ ( a.value().*func )()
Expand All @@ -240,7 +240,7 @@ namespace castor3d::shader
, DerivativeValueT< ValueT, StructNameT > const & pa )
{
auto & writer = sdw::findWriterMandat( pa );
auto function = writer.implementFunction< ReturnT >( name
auto function = writer.template implementFunction< ReturnT >( name
, [&writer, func]( DerivativeValueT< ValueT, StructNameT > const & a )
{
writer.returnStmt( ReturnT{ func( a.value() )
Expand Down Expand Up @@ -384,19 +384,19 @@ namespace castor3d::shader

DerivVec2 negate( DerivVec2 const a )
{
using Func = sdw::Vec2( sdw::Vec2:: * )( )const;
using Func = sdw::Vec2( sdw::Vec2::* )( )const;
return deriv::applyMbr< DerivVec2, Func >( &sdw::Vec2::operator-, "derivNegate2", a );
}

DerivVec3 negate( DerivVec3 const a )
{
using Func = sdw::Vec3( sdw::Vec3:: * )( )const;
using Func = sdw::Vec3( sdw::Vec3::* )( )const;
return deriv::applyMbr< DerivVec3, Func >( &sdw::Vec3::operator-, "derivNegate3", a );
}

DerivVec4 negate( DerivVec4 const a )
{
using Func = sdw::Vec4( sdw::Vec4:: * )( )const;
using Func = sdw::Vec4( sdw::Vec4::* )( )const;
return deriv::applyMbr< DerivVec4, Func >( &sdw::Vec4::operator-, "derivNegate4", a );
}

Expand All @@ -423,55 +423,55 @@ namespace castor3d::shader

DerivFloat derivX( DerivVec2 const v )
{
using Func = sdw::Float( sdw::Vec2:: * )( )const;
using Func = sdw::Float( sdw::Vec2::* )( )const;
return deriv::applyMbrSel< DerivFloat, Func >( &sdw::Vec2::x, "derivDerivX2", v );
}

DerivFloat derivX( DerivVec3 const v )
{
using Func = sdw::Float( sdw::Vec3:: * )( )const;
using Func = sdw::Float( sdw::Vec3::* )( )const;
return deriv::applyMbrSel< DerivFloat, Func >( &sdw::Vec3::x, "derivDerivX3", v );
}

DerivFloat derivX( DerivVec4 const v )
{
using Func = sdw::Float( sdw::Vec4:: * )( )const;
using Func = sdw::Float( sdw::Vec4::* )( )const;
return deriv::applyMbrSel< DerivFloat, Func >( &sdw::Vec4::x, "derivDerivX4", v );
}

DerivFloat derivY( DerivVec2 const v )
{
using Func = sdw::Float( sdw::Vec2:: * )( )const;
using Func = sdw::Float( sdw::Vec2::* )( )const;
return deriv::applyMbrSel< DerivFloat, Func >( &sdw::Vec2::y, "derivDerivY2", v );
}

DerivFloat derivY( DerivVec3 const v )
{
using Func = sdw::Float( sdw::Vec3:: * )( )const;
using Func = sdw::Float( sdw::Vec3::* )( )const;
return deriv::applyMbrSel< DerivFloat, Func >( &sdw::Vec3::y, "derivDerivY3", v );
}

DerivFloat derivY( DerivVec4 const v )
{
using Func = sdw::Float( sdw::Vec4:: * )( )const;
using Func = sdw::Float( sdw::Vec4::* )( )const;
return deriv::applyMbrSel< DerivFloat, Func >( &sdw::Vec4::y, "derivDerivY4", v );
}

DerivFloat derivZ( DerivVec3 const v )
{
using Func = sdw::Float( sdw::Vec3:: * )( )const;
using Func = sdw::Float( sdw::Vec3::* )( )const;
return deriv::applyMbrSel< DerivFloat, Func >( &sdw::Vec3::z, "derivDerivZ3", v );
}

DerivFloat derivZ( DerivVec4 const v )
{
using Func = sdw::Float( sdw::Vec4:: * )( )const;
using Func = sdw::Float( sdw::Vec4::* )( )const;
return deriv::applyMbrSel< DerivFloat, Func >( &sdw::Vec4::z, "derivDerivZ4", v );
}

DerivFloat derivW( DerivVec4 const v )
{
using Func = sdw::Float( sdw::Vec4:: * )( )const;
using Func = sdw::Float( sdw::Vec4::* )( )const;
return deriv::applyMbrSel< DerivFloat, Func >( &sdw::Vec4::w, "derivDerivW4", v );
}

Expand Down
13 changes: 0 additions & 13 deletions source/Core/CastorUtils/Platform/MacOS/MacOSFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,6 @@ namespace castor
}
}

static bool isLink( Path const & filePath )
{
auto cfilePath = toUtf8( filePath );
struct stat buf;

if ( lstat( cfilePath.c_str(), &buf ) )
{
printErrnoName( cuT( "file" ), filePath );
}

return S_ISLNK( buf.st_mode );
}

template< typename TraverseDirT, typename HitFileT >
static void traverse( Path const & folderPath
, TraverseDirT const & directoryFunction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ namespace c3d_gltf
mimeType = std::get< 5 >( impDataSource ).mimeType;
data = getData( std::get< 5 >( impDataSource ), offset, size );
break;
case 6:
mimeType = std::get< 6 >( impDataSource ).mimeType;
data = getData( std::get< 6 >( impDataSource ), offset, size );
break;
default:
break;
}
Expand Down

0 comments on commit ee06f3c

Please sign in to comment.