diff --git a/.gitignore b/.gitignore index 22a248b4..5b50dec0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ /.vscode /binaries -/build +/build* /out /setup /doc/*coverage* diff --git a/CMakePresets.json b/CMakePresets.json index c95cf217..3f9756d5 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -27,12 +27,19 @@ } }, { - "name": "user-msvc", + "name": "user-msvc2022", "displayName": "ShaderWriter User Visual Studio Config", - "description": "Build configuration using Visual Studio, for ShaderWriter users", + "description": "Build configuration using Visual Studio 2022, for ShaderWriter users", "inherits": "user-base", "generator": "Visual Studio 17 2022" }, + { + "name": "user-msvc2026", + "displayName": "ShaderWriter User Visual Studio Config", + "description": "Build configuration using Visual Studio 2026, for ShaderWriter users", + "inherits": "user-base", + "generator": "Visual Studio 18 2026" + }, { "name": "user-ninja", "displayName": "ShaderWriter User Ninja Config", @@ -109,6 +116,32 @@ "VCPKG_MANIFEST_FEATURES": "glsl;hlsl;spirv;tests;vklayer" } }, + { + "name": "dev-mingw-base", + "hidden": true, + "displayName": "ShaderWriter Developer MinGW Config", + "description": "ShaderWriter Developer build configuration using Ninja, on MinGW", + "generator": "Ninja", + "inherits": "dev-base" + }, + { + "name": "dev-mingw-debug", + "displayName": "ShaderWriter Developer MinGW Config, Debug", + "description": "Build configuration using Ninja, for ShaderWriter developers on MinGW, Debug", + "inherits": "dev-mingw-base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "dev-mingw-release", + "displayName": "ShaderWriter Developer MinGW Config, Release", + "description": "Build configuration using Ninja, for ShaderWriter developers on MinGW, Release", + "inherits": "dev-mingw-base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + }, { "name": "ci", "installDir": "${sourceDir}/package/ShaderWriter", diff --git a/include/ShaderAST/Expr/Expr.hpp b/include/ShaderAST/Expr/Expr.hpp index 164747a1..9ea0b575 100644 --- a/include/ShaderAST/Expr/Expr.hpp +++ b/include/ShaderAST/Expr/Expr.hpp @@ -91,7 +91,7 @@ namespace ast::expr Expr & operator=( Expr && ) = delete; public: - SDAST_API virtual ~Expr()noexcept = default; + virtual ~Expr()noexcept = default; SDAST_API Expr( ExprCache & exprCache , size_t size @@ -102,7 +102,7 @@ namespace ast::expr SDAST_API ExprPtr clone()const; - SDAST_API virtual void accept( VisitorPtr )const + virtual void accept( VisitorPtr )const { } diff --git a/include/ShaderAST/Expr/ExprVisitor.hpp b/include/ShaderAST/Expr/ExprVisitor.hpp index aecd6280..51327aee 100644 --- a/include/ShaderAST/Expr/ExprVisitor.hpp +++ b/include/ShaderAST/Expr/ExprVisitor.hpp @@ -68,10 +68,10 @@ namespace ast::expr class Visitor { protected: - SDAST_API Visitor()noexcept = default; + Visitor()noexcept = default; public: - SDAST_API virtual ~Visitor()noexcept = default; + virtual ~Visitor()noexcept = default; SDAST_API virtual void visitAddExpr( Add const * ) = 0; SDAST_API virtual void visitAddAssignExpr( AddAssign const * ) = 0; @@ -156,10 +156,10 @@ namespace ast::expr : public Visitor { protected: - SDAST_API SimpleVisitor()noexcept = default; + SimpleVisitor()noexcept = default; public: - SDAST_API ~SimpleVisitor()noexcept override = default; + ~SimpleVisitor()noexcept override = default; virtual void visitUnaryExpr( Unary const * expr ) = 0; virtual void visitBinaryExpr( Binary const * expr ) = 0; diff --git a/include/ShaderAST/Expr/GetCombinedImageAccessName.hpp b/include/ShaderAST/Expr/GetCombinedImageAccessName.hpp index b50e9161..b7899073 100644 --- a/include/ShaderAST/Expr/GetCombinedImageAccessName.hpp +++ b/include/ShaderAST/Expr/GetCombinedImageAccessName.hpp @@ -13,6 +13,9 @@ This file is generated, don't modify it! #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdisabled-optimization" + namespace ast::expr { inline std::string getName( CombinedImageAccess value ) @@ -1894,4 +1897,6 @@ namespace ast::expr } } +#pragma GCC diagnostic pop + #endif diff --git a/include/ShaderAST/Expr/GetIntrinsicName.hpp b/include/ShaderAST/Expr/GetIntrinsicName.hpp index 30a4b02d..61bbd03d 100644 --- a/include/ShaderAST/Expr/GetIntrinsicName.hpp +++ b/include/ShaderAST/Expr/GetIntrinsicName.hpp @@ -13,6 +13,9 @@ This file is generated, don't modify it! #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdisabled-optimization" + namespace ast::expr { inline std::string getName( Intrinsic value ) @@ -5424,4 +5427,6 @@ namespace ast::expr } } +#pragma GCC diagnostic pop + #endif diff --git a/include/ShaderAST/Expr/GetStorageImageAccessName.hpp b/include/ShaderAST/Expr/GetStorageImageAccessName.hpp index dcd149ab..8b9f763c 100644 --- a/include/ShaderAST/Expr/GetStorageImageAccessName.hpp +++ b/include/ShaderAST/Expr/GetStorageImageAccessName.hpp @@ -13,6 +13,9 @@ This file is generated, don't modify it! #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdisabled-optimization" + namespace ast::expr { inline std::string getName( StorageImageAccess value ) @@ -1152,4 +1155,6 @@ namespace ast::expr } } +#pragma GCC diagnostic pop + #endif diff --git a/include/ShaderAST/ShaderAllocator.hpp b/include/ShaderAST/ShaderAllocator.hpp index 023ca9f7..5d0a320b 100644 --- a/include/ShaderAST/ShaderAllocator.hpp +++ b/include/ShaderAST/ShaderAllocator.hpp @@ -33,12 +33,12 @@ namespace ast *\param[in] minBlockSize * The minimum size for a block. */ - BuddyAllocator( uint32_t numLevels + SDAST_API BuddyAllocator( uint32_t numLevels , uint32_t minBlockSize ); /** * Reports memory leaks. */ - ~BuddyAllocator(); + SDAST_API ~BuddyAllocator(); /** * Allocates memory. *\param[in] size @@ -46,21 +46,21 @@ namespace ast *\return * The memory chunk. */ - PointerType allocate( size_t size ); + SDAST_API PointerType allocate( size_t size ); /** * Deallocates memory. *\param[in] pointer * The memory chunk. */ - bool deallocate( PointerType pointer ); + SDAST_API bool deallocate( PointerType pointer ); /** *\return * The pool total size. */ - size_t getTotalSize()const; + SDAST_API size_t getTotalSize()const; - PointerType getPointer( uint32_t offset ); - size_t getOffset( ConstPointerType pointer )const; + SDAST_API PointerType getPointer( uint32_t offset ); + SDAST_API size_t getOffset( ConstPointerType pointer )const; private: uint32_t doGetLevel( size_t size )const; @@ -141,7 +141,7 @@ namespace ast public: SDAST_API explicit ShaderAllocator( AllocationMode allocationMode = AllocationMode::eFragmented ); - SDAST_API ~ShaderAllocator() = default; + ~ShaderAllocator() = default; SDAST_API void * allocate( size_t size, size_t count = 1u ); SDAST_API void deallocate( void * mem, size_t size, size_t count = 1u )noexcept; @@ -150,7 +150,7 @@ namespace ast SDAST_API size_t getMemDiff( MemoryCursor const & cursor )const noexcept; SDAST_API size_t report()const; - SDAST_API ShaderAllocatorBlockPtr getBlock() + ShaderAllocatorBlockPtr getBlock() { return std::make_unique< ShaderAllocatorBlock >( *this ); } diff --git a/include/ShaderAST/Stmt/Stmt.hpp b/include/ShaderAST/Stmt/Stmt.hpp index 47548991..16bcc1ed 100644 --- a/include/ShaderAST/Stmt/Stmt.hpp +++ b/include/ShaderAST/Stmt/Stmt.hpp @@ -69,7 +69,7 @@ namespace ast::stmt SDAST_API explicit Stmt( StmtCache & stmtCache , size_t size , Kind kind ); - SDAST_API virtual ~Stmt()noexcept = default; + virtual ~Stmt()noexcept = default; SDAST_API virtual void accept( VisitorPtr )const = 0; diff --git a/include/ShaderAST/Stmt/StmtVisitor.hpp b/include/ShaderAST/Stmt/StmtVisitor.hpp index 887a6159..e891db41 100644 --- a/include/ShaderAST/Stmt/StmtVisitor.hpp +++ b/include/ShaderAST/Stmt/StmtVisitor.hpp @@ -60,10 +60,10 @@ namespace ast::stmt class Visitor { protected: - SDAST_API Visitor()noexcept = default; + Visitor()noexcept = default; public: - SDAST_API virtual ~Visitor()noexcept = default; + virtual ~Visitor()noexcept = default; SDAST_API virtual void visitAccelerationStructureDeclStmt( AccelerationStructureDecl const * ) = 0; SDAST_API virtual void visitBreakStmt( Break const * ) = 0; @@ -120,33 +120,33 @@ namespace ast::stmt : public Visitor { protected: - SDAST_API SimpleVisitor()noexcept = default; + SimpleVisitor()noexcept = default; public: - SDAST_API ~SimpleVisitor()noexcept override = default; + ~SimpleVisitor()noexcept override = default; - SDAST_API void visitAccelerationStructureDeclStmt( AccelerationStructureDecl const * stmt )override + void visitAccelerationStructureDeclStmt( AccelerationStructureDecl const * stmt )override { } - SDAST_API void visitBreakStmt( Break const * stmt )override + void visitBreakStmt( Break const * stmt )override { } - SDAST_API void visitBufferReferenceDeclStmt( BufferReferenceDecl const * stmt )override + void visitBufferReferenceDeclStmt( BufferReferenceDecl const * stmt )override { } - SDAST_API void visitCommentStmt( Comment const * stmt )override + void visitCommentStmt( Comment const * stmt )override { } - SDAST_API void visitCompoundStmt( Compound const * stmt )override + void visitCompoundStmt( Compound const * stmt )override { visitContainerStmt( stmt ); } - SDAST_API void visitContainerStmt( Container const * stmt )override + void visitContainerStmt( Container const * stmt )override { for ( auto & subStmt : *stmt ) { @@ -154,61 +154,61 @@ namespace ast::stmt } } - SDAST_API void visitContinueStmt( Continue const * stmt )override + void visitContinueStmt( Continue const * stmt )override { } - SDAST_API void visitConstantBufferDeclStmt( ConstantBufferDecl const * stmt )override + void visitConstantBufferDeclStmt( ConstantBufferDecl const * stmt )override { visitCompoundStmt( stmt ); } - SDAST_API void visitDemoteStmt( Demote const * stmt )override + void visitDemoteStmt( Demote const * stmt )override { } - SDAST_API void visitDispatchMeshStmt( DispatchMesh const * stmt )override + void visitDispatchMeshStmt( DispatchMesh const * stmt )override { } - SDAST_API void visitTerminateInvocationStmt( TerminateInvocation const * stmt )override + void visitTerminateInvocationStmt( TerminateInvocation const * stmt )override { } - SDAST_API void visitDoWhileStmt( DoWhile const * stmt )override + void visitDoWhileStmt( DoWhile const * stmt )override { visitCompoundStmt( stmt ); } - SDAST_API void visitElseIfStmt( ElseIf const * stmt )override + void visitElseIfStmt( ElseIf const * stmt )override { visitCompoundStmt( stmt ); } - SDAST_API void visitElseStmt( Else const * stmt )override + void visitElseStmt( Else const * stmt )override { visitCompoundStmt( stmt ); } - SDAST_API void visitForStmt( For const * stmt )override + void visitForStmt( For const * stmt )override { visitCompoundStmt( stmt ); } - SDAST_API void visitFragmentLayoutStmt( FragmentLayout const * stmt )override + void visitFragmentLayoutStmt( FragmentLayout const * stmt )override { } - SDAST_API void visitFunctionDeclStmt( FunctionDecl const * stmt )override + void visitFunctionDeclStmt( FunctionDecl const * stmt )override { visitCompoundStmt( stmt ); } - SDAST_API void visitHitAttributeVariableDeclStmt( HitAttributeVariableDecl const * stmt )override + void visitHitAttributeVariableDeclStmt( HitAttributeVariableDecl const * stmt )override { } - SDAST_API void visitIfStmt( If const * stmt )override + void visitIfStmt( If const * stmt )override { visitCompoundStmt( stmt ); @@ -223,128 +223,128 @@ namespace ast::stmt } } - SDAST_API void visitImageDeclStmt( ImageDecl const * stmt )override + void visitImageDeclStmt( ImageDecl const * stmt )override { } - SDAST_API void visitIgnoreIntersectionStmt( IgnoreIntersection const * stmt )override + void visitIgnoreIntersectionStmt( IgnoreIntersection const * stmt )override { } - SDAST_API void visitInOutCallableDataVariableDeclStmt( InOutCallableDataVariableDecl const * stmt )override + void visitInOutCallableDataVariableDeclStmt( InOutCallableDataVariableDecl const * stmt )override { } - SDAST_API void visitInOutRayPayloadVariableDeclStmt( InOutRayPayloadVariableDecl const * stmt )override + void visitInOutRayPayloadVariableDeclStmt( InOutRayPayloadVariableDecl const * stmt )override { } - SDAST_API void visitInOutVariableDeclStmt( InOutVariableDecl const * stmt )override + void visitInOutVariableDeclStmt( InOutVariableDecl const * stmt )override { } - SDAST_API void visitInputComputeLayoutStmt( InputComputeLayout const * stmt )override + void visitInputComputeLayoutStmt( InputComputeLayout const * stmt )override { } - SDAST_API void visitInputGeometryLayoutStmt( InputGeometryLayout const * stmt )override + void visitInputGeometryLayoutStmt( InputGeometryLayout const * stmt )override { } - SDAST_API void visitInputTessellationEvaluationLayoutStmt( InputTessellationEvaluationLayout const * stmt )override + void visitInputTessellationEvaluationLayoutStmt( InputTessellationEvaluationLayout const * stmt )override { } - SDAST_API void visitOutputGeometryLayoutStmt( OutputGeometryLayout const * stmt )override + void visitOutputGeometryLayoutStmt( OutputGeometryLayout const * stmt )override { } - SDAST_API void visitOutputMeshLayoutStmt( OutputMeshLayout const * stmt )override + void visitOutputMeshLayoutStmt( OutputMeshLayout const * stmt )override { } - SDAST_API void visitOutputTessellationControlLayoutStmt( OutputTessellationControlLayout const * stmt )override + void visitOutputTessellationControlLayoutStmt( OutputTessellationControlLayout const * stmt )override { } - SDAST_API void visitPerPrimitiveDeclStmt( PerPrimitiveDecl const * stmt )override + void visitPerPrimitiveDeclStmt( PerPrimitiveDecl const * stmt )override { } - SDAST_API void visitPerVertexDeclStmt( PerVertexDecl const * stmt )override + void visitPerVertexDeclStmt( PerVertexDecl const * stmt )override { } - SDAST_API void visitPushConstantsBufferDeclStmt( PushConstantsBufferDecl const * stmt )override + void visitPushConstantsBufferDeclStmt( PushConstantsBufferDecl const * stmt )override { visitCompoundStmt( stmt ); } - SDAST_API void visitReturnStmt( Return const * stmt )override + void visitReturnStmt( Return const * stmt )override { } - SDAST_API void visitCombinedImageDeclStmt( CombinedImageDecl const * stmt )override + void visitCombinedImageDeclStmt( CombinedImageDecl const * stmt )override { } - SDAST_API void visitSampledImageDeclStmt( SampledImageDecl const * stmt )override + void visitSampledImageDeclStmt( SampledImageDecl const * stmt )override { } - SDAST_API void visitSamplerDeclStmt( SamplerDecl const * stmt )override + void visitSamplerDeclStmt( SamplerDecl const * stmt )override { } - SDAST_API void visitShaderBufferDeclStmt( ShaderBufferDecl const * stmt )override + void visitShaderBufferDeclStmt( ShaderBufferDecl const * stmt )override { visitCompoundStmt( stmt ); } - SDAST_API void visitShaderStructBufferDeclStmt( ShaderStructBufferDecl const * stmt )override + void visitShaderStructBufferDeclStmt( ShaderStructBufferDecl const * stmt )override { } - SDAST_API void visitSimpleStmt( Simple const * stmt )override + void visitSimpleStmt( Simple const * stmt )override { } - SDAST_API void visitSpecialisationConstantDeclStmt( SpecialisationConstantDecl const * stmt )override + void visitSpecialisationConstantDeclStmt( SpecialisationConstantDecl const * stmt )override { } - SDAST_API void visitStructureDeclStmt( StructureDecl const * stmt )override + void visitStructureDeclStmt( StructureDecl const * stmt )override { } - SDAST_API void visitSwitchCaseStmt( SwitchCase const * stmt )override + void visitSwitchCaseStmt( SwitchCase const * stmt )override { visitCompoundStmt( stmt ); } - SDAST_API void visitSwitchStmt( Switch const * stmt )override + void visitSwitchStmt( Switch const * stmt )override { visitCompoundStmt( stmt ); } - SDAST_API void visitTerminateRayStmt( TerminateRay const * stmt )override + void visitTerminateRayStmt( TerminateRay const * stmt )override { } - SDAST_API void visitVariableDeclStmt( VariableDecl const * stmt )override + void visitVariableDeclStmt( VariableDecl const * stmt )override { } - SDAST_API void visitWhileStmt( While const * stmt )override + void visitWhileStmt( While const * stmt )override { visitCompoundStmt( stmt ); } - SDAST_API void visitPreprocExtension( PreprocExtension const * stmt )override + void visitPreprocExtension( PreprocExtension const * stmt )override { } - SDAST_API void visitPreprocVersion( PreprocVersion const * stmt )override + void visitPreprocVersion( PreprocVersion const * stmt )override { } }; diff --git a/include/ShaderAST/Visitors/CloneExpr.hpp b/include/ShaderAST/Visitors/CloneExpr.hpp index fa709188..9f6527bc 100644 --- a/include/ShaderAST/Visitors/CloneExpr.hpp +++ b/include/ShaderAST/Visitors/CloneExpr.hpp @@ -21,6 +21,7 @@ namespace ast protected: SDAST_API explicit ExprCloner( expr::ExprCache & exprCache , expr::ExprPtr & result ); + ~ExprCloner()noexcept override = default; protected: SDAST_API virtual expr::ExprPtr doSubmit( expr::Expr const & expr ); diff --git a/include/ShaderAST/Visitors/CloneStmt.hpp b/include/ShaderAST/Visitors/CloneStmt.hpp index 06708d00..ee0e8c8e 100644 --- a/include/ShaderAST/Visitors/CloneStmt.hpp +++ b/include/ShaderAST/Visitors/CloneStmt.hpp @@ -24,6 +24,7 @@ namespace ast SDAST_API explicit StmtCloner( stmt::StmtCache & stmtCache , expr::ExprCache & exprCache , stmt::ContainerPtr & result ); + ~StmtCloner()noexcept override = default; protected: SDAST_API virtual expr::ExprPtr doSubmit( expr::Expr const & expr ); diff --git a/include/ShaderAST/Visitors/PreprocessShader.hpp b/include/ShaderAST/Visitors/PreprocessShader.hpp index 2d3acb06..069bde03 100644 --- a/include/ShaderAST/Visitors/PreprocessShader.hpp +++ b/include/ShaderAST/Visitors/PreprocessShader.hpp @@ -18,8 +18,8 @@ namespace ast PreprocessResult( PreprocessResult const & ) = delete; PreprocessResult & operator=( PreprocessResult const & ) = delete; - SDAST_API PreprocessResult( PreprocessResult && )noexcept = default; - SDAST_API PreprocessResult & operator=( PreprocessResult && )noexcept = default; + PreprocessResult( PreprocessResult && )noexcept = default; + PreprocessResult & operator=( PreprocessResult && )noexcept = default; SDAST_API PreprocessResult( ShaderAllocatorBlock & allocator , Shader const & shader ); diff --git a/include/ShaderWriter/BaseTypes/ArithmeticValue.hpp b/include/ShaderWriter/BaseTypes/ArithmeticValue.hpp index 519182a4..e6f0b0a6 100644 --- a/include/ShaderWriter/BaseTypes/ArithmeticValue.hpp +++ b/include/ShaderWriter/BaseTypes/ArithmeticValue.hpp @@ -13,7 +13,7 @@ namespace sdw struct ArithmeticValue : public Value { - SDW_DeclValue( , ArithmeticValue ); + SDW_DeclValue( ArithmeticValue ); ArithmeticValue( ShaderWriter & writer , expr::ExprPtr expr diff --git a/include/ShaderWriter/BaseTypes/Array.hpp b/include/ShaderWriter/BaseTypes/Array.hpp index 19287214..9760de1f 100644 --- a/include/ShaderWriter/BaseTypes/Array.hpp +++ b/include/ShaderWriter/BaseTypes/Array.hpp @@ -13,7 +13,7 @@ namespace sdw struct Array : public Value { - SDW_DeclValue( , Array ); + SDW_DeclValue( Array ); Array( ShaderWriter & writer , expr::ExprPtr expr diff --git a/include/ShaderWriter/BaseTypes/Boolean.hpp b/include/ShaderWriter/BaseTypes/Boolean.hpp index 067d8fb4..2a05cd6b 100644 --- a/include/ShaderWriter/BaseTypes/Boolean.hpp +++ b/include/ShaderWriter/BaseTypes/Boolean.hpp @@ -12,7 +12,7 @@ namespace sdw struct Boolean : public Value { - SDW_DeclValue( SDW_API, Boolean ); + SDW_DeclValue( Boolean ); SDW_API Boolean( ShaderWriter & writer , expr::ExprPtr expr diff --git a/include/ShaderWriter/BaseTypes/CallableData.hpp b/include/ShaderWriter/BaseTypes/CallableData.hpp index b1ef6bf0..16d1991e 100644 --- a/include/ShaderWriter/BaseTypes/CallableData.hpp +++ b/include/ShaderWriter/BaseTypes/CallableData.hpp @@ -42,7 +42,7 @@ namespace sdw struct CallableDataBaseT : public ValueT { - SDW_DeclValue( , CallableDataBaseT ); + SDW_DeclValue( CallableDataBaseT ); template< typename ... ParamsT > CallableDataBaseT( ShaderWriter & writer diff --git a/include/ShaderWriter/BaseTypes/CombinedImage.hpp b/include/ShaderWriter/BaseTypes/CombinedImage.hpp index 2cd486f4..5de01c97 100644 --- a/include/ShaderWriter/BaseTypes/CombinedImage.hpp +++ b/include/ShaderWriter/BaseTypes/CombinedImage.hpp @@ -120,7 +120,7 @@ namespace sdw struct CombinedImage : public Value { - SDW_DeclValue( SDW_API, CombinedImage ); + SDW_DeclValue( CombinedImage ); SDW_API CombinedImage( ShaderWriter & writer , expr::ExprPtr expr @@ -138,7 +138,7 @@ namespace sdw struct CombinedImageFuncsT : public CombinedImage { - SDW_DeclValue( , CombinedImageFuncsT ); + SDW_DeclValue( CombinedImageFuncsT ); CombinedImageFuncsT( ShaderWriter & writer , expr::ExprPtr expr @@ -154,7 +154,7 @@ namespace sdw struct CombinedImageT : public combinedSmplImg::CombinedImageFuncsT< FormatT, DimT, ArrayedT, MsT, DepthT > { - SDW_DeclValue( , CombinedImageT ); + SDW_DeclValue( CombinedImageT ); static constexpr ast::type::ImageFormat Format = FormatT; static constexpr ast::type::ImageDim Dim = DimT; diff --git a/include/ShaderWriter/BaseTypes/CombinedImage.inl b/include/ShaderWriter/BaseTypes/CombinedImage.inl index 1b531a4c..38b22196 100644 --- a/include/ShaderWriter/BaseTypes/CombinedImage.inl +++ b/include/ShaderWriter/BaseTypes/CombinedImage.inl @@ -2716,7 +2716,7 @@ namespace sdw , public GatherOffsetFuncT< FormatT, DimT, ArrayedT, MsT > , public GatherOffsetsFuncT< FormatT, DimT, ArrayedT, MsT > { - SDW_DeclValue( , CombinedImageFuncsT ); + SDW_DeclValue( CombinedImageFuncsT ); using SampleFuncT< FormatT, DimT, ArrayedT, MsT >::sample; using SampleBiasFuncT< FormatT, DimT, ArrayedT, MsT >::sample; @@ -2785,7 +2785,7 @@ namespace sdw , public GradProjFuncT< FormatT, DimT, ArrayedT, MsT > , public GradProjOffsetFuncT< FormatT, DimT, ArrayedT, MsT > { - SDW_DeclValue( , CombinedImageFuncsT ); + SDW_DeclValue( CombinedImageFuncsT ); using SampleFuncT< FormatT, DimT, ArrayedT, MsT >::sample; using SampleBiasFuncT< FormatT, DimT, ArrayedT, MsT >::sample; @@ -2842,7 +2842,7 @@ namespace sdw , public GradFuncT< FormatT, DimT, ArrayedT, MsT > , public GradOffsetFuncT< FormatT, DimT, ArrayedT, MsT > { - SDW_DeclValue( , CombinedImageFuncsT ); + SDW_DeclValue( CombinedImageFuncsT ); using SampleFuncT< FormatT, DimT, ArrayedT, MsT >::sample; using SampleBiasFuncT< FormatT, DimT, ArrayedT, MsT >::sample; @@ -2894,7 +2894,7 @@ namespace sdw , public GatherOffsetFuncT< FormatT, DimT, ArrayedT, MsT > , public GatherOffsetsFuncT< FormatT, DimT, ArrayedT, MsT > { - SDW_DeclValue( , CombinedImageFuncsT ); + SDW_DeclValue( CombinedImageFuncsT ); using SampleFuncT< FormatT, DimT, ArrayedT, MsT >::sample; using SampleBiasFuncT< FormatT, DimT, ArrayedT, MsT >::sample; @@ -2942,7 +2942,7 @@ namespace sdw , public GradFuncT< FormatT, DimT, ArrayedT, MsT > , public GatherFuncT< FormatT, DimT, ArrayedT, MsT > { - SDW_DeclValue( , CombinedImageFuncsT ); + SDW_DeclValue( CombinedImageFuncsT ); using SampleFuncT< FormatT, DimT, ArrayedT, MsT >::sample; using SampleBiasFuncT< FormatT, DimT, ArrayedT, MsT >::sample; @@ -2990,7 +2990,7 @@ namespace sdw , public GradRefProjFuncT< FormatT, DimT, ArrayedT, MsT > , public GradRefProjOffsetFuncT< FormatT, DimT, ArrayedT, MsT > { - SDW_DeclValue( , CombinedImageFuncsT ); + SDW_DeclValue( CombinedImageFuncsT ); using SampleRefFuncT< FormatT, DimT, ArrayedT, MsT >::sample; using SampleRefBiasFuncT< FormatT, DimT, ArrayedT, MsT >::sample; @@ -3054,7 +3054,7 @@ namespace sdw , public GatherRefOffsetFuncT< FormatT, DimT, ArrayedT, MsT > , public GatherRefOffsetsFuncT< FormatT, DimT, ArrayedT, MsT > { - SDW_DeclValue( , CombinedImageFuncsT ); + SDW_DeclValue( CombinedImageFuncsT ); using SampleRefFuncT< FormatT, DimT, ArrayedT, MsT >::sample; using SampleRefBiasFuncT< FormatT, DimT, ArrayedT, MsT >::sample; @@ -3109,7 +3109,7 @@ namespace sdw , public GradRefFuncT< FormatT, DimT, ArrayedT, MsT > , public GradRefOffsetFuncT< FormatT, DimT, ArrayedT, MsT > { - SDW_DeclValue( , CombinedImageFuncsT ); + SDW_DeclValue( CombinedImageFuncsT ); using SampleRefFuncT< FormatT, DimT, ArrayedT, MsT >::sample; using SampleRefBiasFuncT< FormatT, DimT, ArrayedT, MsT >::sample; @@ -3155,7 +3155,7 @@ namespace sdw , public GatherRefOffsetFuncT< FormatT, DimT, ArrayedT, MsT > , public GatherRefOffsetsFuncT< FormatT, DimT, ArrayedT, MsT > { - SDW_DeclValue( , CombinedImageFuncsT ); + SDW_DeclValue( CombinedImageFuncsT ); using SampleRefFuncT< FormatT, DimT, ArrayedT, MsT >::sample; using SampleRefBiasFuncT< FormatT, DimT, ArrayedT, MsT >::sample; @@ -3199,7 +3199,7 @@ namespace sdw , public SampleRefLodFuncT< FormatT, DimT, ArrayedT, MsT > , public GatherRefFuncT< FormatT, DimT, ArrayedT, MsT > { - SDW_DeclValue( , CombinedImageFuncsT ); + SDW_DeclValue( CombinedImageFuncsT ); using SampleRefFuncT< FormatT, DimT, ArrayedT, MsT >::sample; using SampleRefBiasFuncT< FormatT, DimT, ArrayedT, MsT >::sample; @@ -3229,7 +3229,7 @@ namespace sdw , public TexSizeFuncT< FormatT, DimT, ArrayedT, MsT, DepthT > , public FetchFuncT< FormatT, DimT, ArrayedT, MsT > { - SDW_DeclValue( , CombinedImageFuncsT ); + SDW_DeclValue( CombinedImageFuncsT ); CombinedImageFuncsT( ShaderWriter & writer , expr::ExprPtr expr diff --git a/include/ShaderWriter/BaseTypes/HitAttribute.hpp b/include/ShaderWriter/BaseTypes/HitAttribute.hpp index 62f4f0ce..7b030641 100644 --- a/include/ShaderWriter/BaseTypes/HitAttribute.hpp +++ b/include/ShaderWriter/BaseTypes/HitAttribute.hpp @@ -46,7 +46,7 @@ namespace sdw struct HitAttributeT : public ValueT { - SDW_DeclValue( , HitAttributeT ); + SDW_DeclValue( HitAttributeT ); template< typename ... ParamsT > explicit HitAttributeT( ShaderWriter & writer diff --git a/include/ShaderWriter/BaseTypes/IntegerValue.hpp b/include/ShaderWriter/BaseTypes/IntegerValue.hpp index db284f86..b55c9fff 100644 --- a/include/ShaderWriter/BaseTypes/IntegerValue.hpp +++ b/include/ShaderWriter/BaseTypes/IntegerValue.hpp @@ -14,7 +14,7 @@ namespace sdw struct IntegerValue : public Value { - SDW_DeclValue( , IntegerValue ); + SDW_DeclValue( IntegerValue ); IntegerValue( ShaderWriter & writer , expr::ExprPtr expr diff --git a/include/ShaderWriter/BaseTypes/RayPayload.hpp b/include/ShaderWriter/BaseTypes/RayPayload.hpp index 348d3b5e..71ffea6f 100644 --- a/include/ShaderWriter/BaseTypes/RayPayload.hpp +++ b/include/ShaderWriter/BaseTypes/RayPayload.hpp @@ -49,7 +49,7 @@ namespace sdw struct RayPayloadBaseT : public ValueT { - SDW_DeclValue( , RayPayloadBaseT ); + SDW_DeclValue( RayPayloadBaseT ); template< typename ... ParamsT > RayPayloadBaseT( ShaderWriter & writer diff --git a/include/ShaderWriter/BaseTypes/SampledImage.hpp b/include/ShaderWriter/BaseTypes/SampledImage.hpp index 4eea0c12..75f00d51 100644 --- a/include/ShaderWriter/BaseTypes/SampledImage.hpp +++ b/include/ShaderWriter/BaseTypes/SampledImage.hpp @@ -11,7 +11,7 @@ namespace sdw struct SampledImage : public Value { - SDW_DeclValue( SDW_API, SampledImage ); + SDW_DeclValue( SampledImage ); SDW_API SampledImage( ShaderWriter & writer , expr::ExprPtr expr @@ -25,7 +25,7 @@ namespace sdw struct SampledImageT : public SampledImage { - SDW_DeclValue( , SampledImageT ); + SDW_DeclValue( SampledImageT ); static constexpr ast::type::ImageFormat Format = FormatT; static constexpr ast::type::ImageDim Dim = DimT; diff --git a/include/ShaderWriter/BaseTypes/Sampler.hpp b/include/ShaderWriter/BaseTypes/Sampler.hpp index 9180d3ba..40ea1c59 100644 --- a/include/ShaderWriter/BaseTypes/Sampler.hpp +++ b/include/ShaderWriter/BaseTypes/Sampler.hpp @@ -11,7 +11,7 @@ namespace sdw struct Sampler : public Value { - SDW_DeclValue( SDW_API, Sampler ); + SDW_DeclValue( Sampler ); SDW_API Sampler( ShaderWriter & writer , expr::ExprPtr expr @@ -28,7 +28,7 @@ namespace sdw struct SamplerT : public Sampler { - SDW_DeclValue( , SamplerT ); + SDW_DeclValue( SamplerT ); static constexpr bool Comparison = ComparisonT; diff --git a/include/ShaderWriter/BaseTypes/StorageImage.hpp b/include/ShaderWriter/BaseTypes/StorageImage.hpp index 243efa6a..d26af26f 100644 --- a/include/ShaderWriter/BaseTypes/StorageImage.hpp +++ b/include/ShaderWriter/BaseTypes/StorageImage.hpp @@ -23,7 +23,7 @@ namespace sdw struct StorageImage : public Value { - SDW_DeclValue( SDW_API, StorageImage ); + SDW_DeclValue( StorageImage ); SDW_API StorageImage( ShaderWriter & writer , expr::ExprPtr expr @@ -41,7 +41,7 @@ namespace sdw struct StorageImageFuncsT : public StorageImage { - SDW_DeclValue( , StorageImageFuncsT ); + SDW_DeclValue( StorageImageFuncsT ); StorageImageFuncsT( ShaderWriter & writer , expr::ExprPtr expr @@ -57,7 +57,7 @@ namespace sdw struct StorageImageT : public storageImg::StorageImageFuncsT< FormatT, AccessT, DimT, ArrayedT, MsT > { - SDW_DeclValue( , StorageImageT ); + SDW_DeclValue( StorageImageT ); static constexpr ast::type::ImageFormat Format = FormatT; static constexpr ast::type::AccessKind Access = AccessT; diff --git a/include/ShaderWriter/BaseTypes/StorageImage.inl b/include/ShaderWriter/BaseTypes/StorageImage.inl index 8f18ed88..8a7e06e9 100644 --- a/include/ShaderWriter/BaseTypes/StorageImage.inl +++ b/include/ShaderWriter/BaseTypes/StorageImage.inl @@ -1774,7 +1774,7 @@ namespace sdw : public StorageImage , public ImgSizeFuncT< FormatT, AccessT, DimT, ArrayedT, MsT > { - SDW_DeclValue( , StorageImageFuncsT ); + SDW_DeclValue( StorageImageFuncsT ); StorageImageFuncsT( ShaderWriter & writer , expr::ExprPtr expr @@ -1803,7 +1803,7 @@ namespace sdw , public ImgSizeFuncT< FormatT, AccessT, DimT, ArrayedT, MsT > , public ImgStoreFuncT< FormatT, AccessT, DimT, ArrayedT > { - SDW_DeclValue( , StorageImageFuncsT ); + SDW_DeclValue( StorageImageFuncsT ); StorageImageFuncsT( ShaderWriter & writer , expr::ExprPtr expr @@ -1832,7 +1832,7 @@ namespace sdw , public ImgSizeFuncT< FormatT, AccessT, DimT, ArrayedT, MsT > , public ImgLoadFuncT< FormatT, AccessT, DimT, ArrayedT > { - SDW_DeclValue( , StorageImageFuncsT ); + SDW_DeclValue( StorageImageFuncsT ); StorageImageFuncsT( ShaderWriter & writer , expr::ExprPtr expr @@ -1863,7 +1863,7 @@ namespace sdw , public ImgLoadFuncT< FormatT, AccessT, DimT, ArrayedT > , public ImgStoreFuncT< FormatT, AccessT, DimT, ArrayedT > { - SDW_DeclValue( , StorageImageFuncsT ); + SDW_DeclValue( StorageImageFuncsT ); StorageImageFuncsT( ShaderWriter & writer , expr::ExprPtr expr @@ -1909,7 +1909,7 @@ namespace sdw , public ImgAtomicAddFuncT< FormatT, AccessT, DimT, ArrayedT > , public ImgAtomicExchangeFuncT< FormatT, AccessT, DimT, ArrayedT > { - SDW_DeclValue( , StorageImageFuncsT ); + SDW_DeclValue( StorageImageFuncsT ); StorageImageFuncsT( ShaderWriter & writer , expr::ExprPtr expr @@ -1941,7 +1941,7 @@ namespace sdw , public ImgLoadFuncT< FormatT, AccessT, DimT, ArrayedT > , public ImgStoreFuncT< FormatT, AccessT, DimT, ArrayedT > { - SDW_DeclValue( , StorageImageFuncsT ); + SDW_DeclValue( StorageImageFuncsT ); StorageImageFuncsT( ShaderWriter & writer , expr::ExprPtr expr @@ -1980,7 +1980,7 @@ namespace sdw , public ImgAtomicExchangeFuncT< FormatT, AccessT, DimT, ArrayedT > , public ImgAtomicCompSwapFuncT< FormatT, AccessT, DimT, ArrayedT > { - SDW_DeclValue( , StorageImageFuncsT ); + SDW_DeclValue( StorageImageFuncsT ); StorageImageFuncsT( ShaderWriter & writer , expr::ExprPtr expr @@ -2009,7 +2009,7 @@ namespace sdw , public ImgSizeFuncT< FormatT, AccessT, DimT, ArrayedT, MsT > , public ImgSamplesFuncT< FormatT, AccessT, DimT, ArrayedT > { - SDW_DeclValue( , StorageImageFuncsT ); + SDW_DeclValue( StorageImageFuncsT ); StorageImageFuncsT( ShaderWriter & writer , expr::ExprPtr expr @@ -2039,7 +2039,7 @@ namespace sdw , public ImgSamplesFuncT< FormatT, AccessT, DimT, ArrayedT > , public ImgMsStoreFuncT< FormatT, AccessT, DimT, ArrayedT > { - SDW_DeclValue( , StorageImageFuncsT ); + SDW_DeclValue( StorageImageFuncsT ); StorageImageFuncsT( ShaderWriter & writer , expr::ExprPtr expr @@ -2069,7 +2069,7 @@ namespace sdw , public ImgSamplesFuncT< FormatT, AccessT, DimT, ArrayedT > , public ImgMsLoadFuncT< FormatT, AccessT, DimT, ArrayedT > { - SDW_DeclValue( , StorageImageFuncsT ); + SDW_DeclValue( StorageImageFuncsT ); StorageImageFuncsT( ShaderWriter & writer , expr::ExprPtr expr @@ -2101,7 +2101,7 @@ namespace sdw , public ImgMsLoadFuncT< FormatT, AccessT, DimT, ArrayedT > , public ImgMsStoreFuncT< FormatT, AccessT, DimT, ArrayedT > { - SDW_DeclValue( , StorageImageFuncsT ); + SDW_DeclValue( StorageImageFuncsT ); StorageImageFuncsT( ShaderWriter & writer , expr::ExprPtr expr @@ -2135,7 +2135,7 @@ namespace sdw , public ImgMsAtomicAddFuncT< FormatT, AccessT, DimT, ArrayedT > , public ImgMsAtomicExchangeFuncT< FormatT, AccessT, DimT, ArrayedT > { - SDW_DeclValue( , StorageImageFuncsT ); + SDW_DeclValue( StorageImageFuncsT ); StorageImageFuncsT( ShaderWriter & writer , expr::ExprPtr expr @@ -2175,7 +2175,7 @@ namespace sdw , public ImgMsAtomicExchangeFuncT< FormatT, AccessT, DimT, ArrayedT > , public ImgMsAtomicCompSwapFuncT< FormatT, AccessT, DimT, ArrayedT > { - SDW_DeclValue( , StorageImageFuncsT ); + SDW_DeclValue( StorageImageFuncsT ); StorageImageFuncsT( ShaderWriter & writer , expr::ExprPtr expr diff --git a/include/ShaderWriter/BaseTypes/Void.hpp b/include/ShaderWriter/BaseTypes/Void.hpp index aafc179a..3c970f2c 100644 --- a/include/ShaderWriter/BaseTypes/Void.hpp +++ b/include/ShaderWriter/BaseTypes/Void.hpp @@ -20,9 +20,9 @@ namespace sdw // Intently non explicit SDW_API Void( ReturnWrapperT< Void > const & rhs ); - SDW_API ~Void()override = default; - SDW_API Void( Void && rhs ) = default; - SDW_API Void( Void const & rhs ) = default; + ~Void()override = default; + Void( Void && rhs ) = default; + Void( Void const & rhs ) = default; SDW_API static ast::type::TypePtr makeType( ast::type::TypesCache & cache ); }; diff --git a/include/ShaderWriter/CallableWriter.hpp b/include/ShaderWriter/CallableWriter.hpp index 29517a02..9577842a 100644 --- a/include/ShaderWriter/CallableWriter.hpp +++ b/include/ShaderWriter/CallableWriter.hpp @@ -48,18 +48,18 @@ namespace sdw SDW_API explicit CallableWriter( ShaderBuilder & builder , uint32_t flags = 0 ); - SDW_API explicit CallableWriter( ShaderAllocator * allocator = nullptr ) + explicit CallableWriter( ShaderAllocator * allocator = nullptr ) : CallableWriter{ uint32_t( 0u ), allocator } { } - SDW_API explicit CallableWriter( ast::stmt::FunctionFlag flag + explicit CallableWriter( ast::stmt::FunctionFlag flag , ShaderAllocator * allocator = nullptr ) : CallableWriter{ uint32_t( flag ), allocator } { } - SDW_API CallableWriter( ShaderBuilder & builder + CallableWriter( ShaderBuilder & builder , ast::stmt::FunctionFlag flag ) : CallableWriter{ builder, uint32_t( flag ) } { diff --git a/include/ShaderWriter/CompositeTypes/RayDesc.hpp b/include/ShaderWriter/CompositeTypes/RayDesc.hpp index f967f87c..096c95d2 100644 --- a/include/ShaderWriter/CompositeTypes/RayDesc.hpp +++ b/include/ShaderWriter/CompositeTypes/RayDesc.hpp @@ -17,7 +17,7 @@ namespace sdw : public StructInstance { public: - SDW_DeclStructInstance( SDW_API, RayDesc ); + SDW_DeclStructInstance( RayDesc ); SDW_API RayDesc( ShaderWriter & writer , expr::ExprPtr expr diff --git a/include/ShaderWriter/CompositeTypes/StructInstance.hpp b/include/ShaderWriter/CompositeTypes/StructInstance.hpp index 8977124b..f2cd9481 100644 --- a/include/ShaderWriter/CompositeTypes/StructInstance.hpp +++ b/include/ShaderWriter/CompositeTypes/StructInstance.hpp @@ -135,7 +135,7 @@ namespace sdw : public Value { public: - SDW_DeclValue( SDW_API, StructInstance ); + SDW_DeclValue( StructInstance ); SDW_API StructInstance( ShaderWriter & writer , expr::ExprPtr expr @@ -172,7 +172,7 @@ namespace sdw }; } -#define SDW_DeclStructInstance( expdecl, name )\ +#define SDW_DeclStructInstance( name )\ template< typename ... ParamsT >\ name( sdw::StructInstance const & rhs\ , ParamsT && ... params )\ @@ -192,11 +192,11 @@ namespace sdw sdw::StructInstance::operator=( rhs );\ return *this;\ }\ - expdecl name & operator=( name const & rhs ) = default;\ - expdecl name & operator=( name && rhs )noexcept = default;\ - expdecl name( name const & rhs ) = default;\ - expdecl name( name && rhs )noexcept = default;\ - expdecl ~name()noexcept override = default + name & operator=( name const & rhs ) = default;\ + name & operator=( name && rhs )noexcept = default;\ + name( name const & rhs ) = default;\ + name( name && rhs )noexcept = default;\ + ~name()noexcept override = default #include "StructInstance.inl" #include "StructInstanceHelper.hpp" diff --git a/include/ShaderWriter/ComputeWriter.hpp b/include/ShaderWriter/ComputeWriter.hpp index 01614d75..83472b07 100644 --- a/include/ShaderWriter/ComputeWriter.hpp +++ b/include/ShaderWriter/ComputeWriter.hpp @@ -134,18 +134,18 @@ namespace sdw SDW_API explicit ComputeWriter( ShaderBuilder & builder , uint32_t flags = 0 ); - SDW_API explicit ComputeWriter( ShaderAllocator * allocator = nullptr ) + explicit ComputeWriter( ShaderAllocator * allocator = nullptr ) : ComputeWriter{ uint32_t( 0u ), allocator } { } - SDW_API explicit ComputeWriter( ast::stmt::FunctionFlag flag + explicit ComputeWriter( ast::stmt::FunctionFlag flag , ShaderAllocator * allocator = nullptr ) : ComputeWriter{ uint32_t( flag ), allocator } { } - SDW_API ComputeWriter( ShaderBuilder & builder + ComputeWriter( ShaderBuilder & builder , ast::stmt::FunctionFlag flag ) : ComputeWriter{ builder, uint32_t( flag ) } { diff --git a/include/ShaderWriter/EntryPointWriter.hpp b/include/ShaderWriter/EntryPointWriter.hpp index b0246473..8f56cc39 100644 --- a/include/ShaderWriter/EntryPointWriter.hpp +++ b/include/ShaderWriter/EntryPointWriter.hpp @@ -15,10 +15,10 @@ namespace sdw SDW_API EntryPointWriter( ast::ShaderStage type , uint32_t flags , ShaderAllocator * allocator ); - SDW_API EntryPointWriter( ast::ShaderStage type + SDW_API EntryPointWriter( ast::ShaderStage type , ShaderBuilder & builder , uint32_t flags ); - SDW_API ~EntryPointWriter()override = default; + SDW_API ~EntryPointWriter()noexcept; public: #pragma region Input declaration diff --git a/include/ShaderWriter/FragmentWriter.hpp b/include/ShaderWriter/FragmentWriter.hpp index fe64980c..d376f008 100644 --- a/include/ShaderWriter/FragmentWriter.hpp +++ b/include/ShaderWriter/FragmentWriter.hpp @@ -97,18 +97,18 @@ namespace sdw SDW_API explicit FragmentWriter( ShaderBuilder & builder , uint32_t flags = 0 ); - SDW_API explicit FragmentWriter( ShaderAllocator * allocator = nullptr ) + explicit FragmentWriter( ShaderAllocator * allocator = nullptr ) : FragmentWriter{ uint32_t( 0u ), allocator } { } - SDW_API explicit FragmentWriter( ast::stmt::FunctionFlag flag + explicit FragmentWriter( ast::stmt::FunctionFlag flag , ShaderAllocator * allocator = nullptr ) : FragmentWriter{ uint32_t( flag ), allocator } { } - SDW_API FragmentWriter( ShaderBuilder & builder + FragmentWriter( ShaderBuilder & builder , ast::stmt::FunctionFlag flag ) : FragmentWriter{ builder, uint32_t( flag ) } { diff --git a/include/ShaderWriter/GeometryWriter.hpp b/include/ShaderWriter/GeometryWriter.hpp index ef8490e8..497d03a7 100644 --- a/include/ShaderWriter/GeometryWriter.hpp +++ b/include/ShaderWriter/GeometryWriter.hpp @@ -147,18 +147,18 @@ namespace sdw SDW_API explicit GeometryWriter( ShaderBuilder & builder , uint32_t flags = 0 ); - SDW_API explicit GeometryWriter( ShaderAllocator * allocator = nullptr ) + explicit GeometryWriter( ShaderAllocator * allocator = nullptr ) : GeometryWriter{ uint32_t( 0u ), allocator } { } - SDW_API explicit GeometryWriter( ast::stmt::FunctionFlag flag + explicit GeometryWriter( ast::stmt::FunctionFlag flag , ShaderAllocator * allocator = nullptr ) : GeometryWriter{ uint32_t( flag ), allocator } { } - SDW_API GeometryWriter( ShaderBuilder & builder + GeometryWriter( ShaderBuilder & builder , ast::stmt::FunctionFlag flag ) : GeometryWriter{ builder, uint32_t( flag ) } { diff --git a/include/ShaderWriter/GraphicsPipelineWriter.hpp b/include/ShaderWriter/GraphicsPipelineWriter.hpp index 8d710cc6..1b3bef13 100644 --- a/include/ShaderWriter/GraphicsPipelineWriter.hpp +++ b/include/ShaderWriter/GraphicsPipelineWriter.hpp @@ -12,10 +12,13 @@ namespace sdw class GraphicsPipelineWriter : public PipelineWriter { - public: + protected: SDW_API explicit GraphicsPipelineWriter( ast::ShaderStage type , ShaderAllocator * allocator = nullptr ); SDW_API explicit GraphicsPipelineWriter( ShaderBuilder & builder ); + SDW_API ~GraphicsPipelineWriter()noexcept; + + public: #pragma region Fragment Shader /** *name diff --git a/include/ShaderWriter/MatTypes/Mat2.hpp b/include/ShaderWriter/MatTypes/Mat2.hpp index f2828cb3..b36df9f9 100644 --- a/include/ShaderWriter/MatTypes/Mat2.hpp +++ b/include/ShaderWriter/MatTypes/Mat2.hpp @@ -13,7 +13,7 @@ namespace sdw struct Mat2x2T : public Value { - SDW_DeclValue( , Mat2x2T ); + SDW_DeclValue( Mat2x2T ); using ValueType = ValueT; using my_vec = Vec2T< ValueT >; diff --git a/include/ShaderWriter/MatTypes/Mat2x3.hpp b/include/ShaderWriter/MatTypes/Mat2x3.hpp index 62142439..13c1715c 100644 --- a/include/ShaderWriter/MatTypes/Mat2x3.hpp +++ b/include/ShaderWriter/MatTypes/Mat2x3.hpp @@ -13,7 +13,7 @@ namespace sdw struct Mat2x3T : public Value { - SDW_DeclValue( , Mat2x3T ); + SDW_DeclValue( Mat2x3T ); using ValueType = ValueT; using my_vec = Vec3T< ValueT >; diff --git a/include/ShaderWriter/MatTypes/Mat2x4.hpp b/include/ShaderWriter/MatTypes/Mat2x4.hpp index a0d3e32d..cd86fc85 100644 --- a/include/ShaderWriter/MatTypes/Mat2x4.hpp +++ b/include/ShaderWriter/MatTypes/Mat2x4.hpp @@ -13,7 +13,7 @@ namespace sdw struct Mat2x4T : public Value { - SDW_DeclValue( , Mat2x4T ); + SDW_DeclValue( Mat2x4T ); using ValueType = ValueT; using my_vec = Vec4T< ValueT >; diff --git a/include/ShaderWriter/MatTypes/Mat3.hpp b/include/ShaderWriter/MatTypes/Mat3.hpp index 9171a8d4..a3fc4377 100644 --- a/include/ShaderWriter/MatTypes/Mat3.hpp +++ b/include/ShaderWriter/MatTypes/Mat3.hpp @@ -13,7 +13,7 @@ namespace sdw struct Mat3x3T : public Value { - SDW_DeclValue( , Mat3x3T ); + SDW_DeclValue( Mat3x3T ); using ValueType = ValueT; using my_vec = Vec3T< ValueT >; diff --git a/include/ShaderWriter/MatTypes/Mat3x2.hpp b/include/ShaderWriter/MatTypes/Mat3x2.hpp index 8990e132..ea042d8e 100644 --- a/include/ShaderWriter/MatTypes/Mat3x2.hpp +++ b/include/ShaderWriter/MatTypes/Mat3x2.hpp @@ -13,7 +13,7 @@ namespace sdw struct Mat3x2T : public Value { - SDW_DeclValue( , Mat3x2T ); + SDW_DeclValue( Mat3x2T ); using ValueType = ValueT; using my_vec = Vec2T< ValueT >; diff --git a/include/ShaderWriter/MatTypes/Mat3x4.hpp b/include/ShaderWriter/MatTypes/Mat3x4.hpp index fd8b5d23..4394ff1f 100644 --- a/include/ShaderWriter/MatTypes/Mat3x4.hpp +++ b/include/ShaderWriter/MatTypes/Mat3x4.hpp @@ -13,7 +13,7 @@ namespace sdw struct Mat3x4T : public Value { - SDW_DeclValue( , Mat3x4T ); + SDW_DeclValue( Mat3x4T ); using ValueType = ValueT; using my_vec = Vec4T< ValueT >; diff --git a/include/ShaderWriter/MatTypes/Mat4.hpp b/include/ShaderWriter/MatTypes/Mat4.hpp index ba2af904..06224239 100644 --- a/include/ShaderWriter/MatTypes/Mat4.hpp +++ b/include/ShaderWriter/MatTypes/Mat4.hpp @@ -13,7 +13,7 @@ namespace sdw struct Mat4x4T : public Value { - SDW_DeclValue( , Mat4x4T ); + SDW_DeclValue( Mat4x4T ); using ValueType = ValueT; using my_vec = Vec4T< ValueT >; diff --git a/include/ShaderWriter/MatTypes/Mat4x2.hpp b/include/ShaderWriter/MatTypes/Mat4x2.hpp index ee2ad0f9..4662f642 100644 --- a/include/ShaderWriter/MatTypes/Mat4x2.hpp +++ b/include/ShaderWriter/MatTypes/Mat4x2.hpp @@ -13,7 +13,7 @@ namespace sdw struct Mat4x2T : public Value { - SDW_DeclValue( , Mat4x2T ); + SDW_DeclValue( Mat4x2T ); using ValueType = ValueT; using my_vec = Vec2T< ValueT >; diff --git a/include/ShaderWriter/MatTypes/Mat4x3.hpp b/include/ShaderWriter/MatTypes/Mat4x3.hpp index 56e0d843..2587eb30 100644 --- a/include/ShaderWriter/MatTypes/Mat4x3.hpp +++ b/include/ShaderWriter/MatTypes/Mat4x3.hpp @@ -13,7 +13,7 @@ namespace sdw struct Mat4x3T : public Value { - SDW_DeclValue( , Mat4x3T ); + SDW_DeclValue( Mat4x3T ); using ValueType = ValueT; using my_vec = Vec3T< ValueT >; diff --git a/include/ShaderWriter/MeshWriterEXT.hpp b/include/ShaderWriter/MeshWriterEXT.hpp index 53ab0dd5..6e565bd8 100644 --- a/include/ShaderWriter/MeshWriterEXT.hpp +++ b/include/ShaderWriter/MeshWriterEXT.hpp @@ -336,18 +336,18 @@ namespace sdw SDW_API explicit MeshWriterEXT( ShaderBuilder & builder , uint32_t flags = 0 ); - SDW_API explicit MeshWriterEXT( ShaderAllocator * allocator = nullptr ) + explicit MeshWriterEXT( ShaderAllocator * allocator = nullptr ) : MeshWriterEXT{ uint32_t( 0u ), allocator } { } - SDW_API explicit MeshWriterEXT( ast::stmt::FunctionFlag flag + explicit MeshWriterEXT( ast::stmt::FunctionFlag flag , ShaderAllocator * allocator = nullptr ) : MeshWriterEXT{ uint32_t( flag ), allocator } { } - SDW_API MeshWriterEXT( ShaderBuilder & builder + MeshWriterEXT( ShaderBuilder & builder , ast::stmt::FunctionFlag flag ) : MeshWriterEXT{ builder, uint32_t( flag ) } { diff --git a/include/ShaderWriter/MeshWriterNV.hpp b/include/ShaderWriter/MeshWriterNV.hpp index 41772241..cdcf35b6 100644 --- a/include/ShaderWriter/MeshWriterNV.hpp +++ b/include/ShaderWriter/MeshWriterNV.hpp @@ -252,18 +252,18 @@ namespace sdw SDW_API explicit MeshWriterNV( ShaderBuilder & builder , uint32_t flags = 0 ); - SDW_API explicit MeshWriterNV( ShaderAllocator * allocator = nullptr ) + explicit MeshWriterNV( ShaderAllocator * allocator = nullptr ) : MeshWriterNV{ uint32_t( 0u ), allocator } { } - SDW_API explicit MeshWriterNV( ast::stmt::FunctionFlag flag + explicit MeshWriterNV( ast::stmt::FunctionFlag flag , ShaderAllocator * allocator = nullptr ) : MeshWriterNV{ uint32_t( flag ), allocator } { } - SDW_API MeshWriterNV( ShaderBuilder & builder + MeshWriterNV( ShaderBuilder & builder , ast::stmt::FunctionFlag flag ) : MeshWriterNV{ builder, uint32_t( flag ) } { diff --git a/include/ShaderWriter/PipelineWriter.hpp b/include/ShaderWriter/PipelineWriter.hpp index 37740ba4..71c5ff81 100644 --- a/include/ShaderWriter/PipelineWriter.hpp +++ b/include/ShaderWriter/PipelineWriter.hpp @@ -15,7 +15,7 @@ namespace sdw SDW_API explicit PipelineWriter( ast::ShaderStage type , ShaderAllocator * allocator = nullptr ); SDW_API explicit PipelineWriter( ShaderBuilder & builder ); - SDW_API ~PipelineWriter()override = default; + SDW_API ~PipelineWriter()noexcept; public: void enableMaximalReconvergence( ast::EntryPoint type )noexcept diff --git a/include/ShaderWriter/RayAnyHitWriter.hpp b/include/ShaderWriter/RayAnyHitWriter.hpp index 57afe6f7..7baa9474 100644 --- a/include/ShaderWriter/RayAnyHitWriter.hpp +++ b/include/ShaderWriter/RayAnyHitWriter.hpp @@ -91,18 +91,18 @@ namespace sdw SDW_API explicit RayAnyHitWriter( ShaderBuilder & builder , uint32_t flags = 0 ); - SDW_API explicit RayAnyHitWriter( ShaderAllocator * allocator = nullptr ) + explicit RayAnyHitWriter( ShaderAllocator * allocator = nullptr ) : RayAnyHitWriter{ uint32_t( 0u ), allocator } { } - SDW_API explicit RayAnyHitWriter( ast::stmt::FunctionFlag flag + explicit RayAnyHitWriter( ast::stmt::FunctionFlag flag , ShaderAllocator * allocator = nullptr ) : RayAnyHitWriter{ uint32_t( flag ), allocator } { } - SDW_API RayAnyHitWriter( ShaderBuilder & builder + RayAnyHitWriter( ShaderBuilder & builder , ast::stmt::FunctionFlag flag ) : RayAnyHitWriter{ builder, uint32_t( flag ) } { diff --git a/include/ShaderWriter/RayClosestHitWriter.hpp b/include/ShaderWriter/RayClosestHitWriter.hpp index 11a653f8..aafe6efe 100644 --- a/include/ShaderWriter/RayClosestHitWriter.hpp +++ b/include/ShaderWriter/RayClosestHitWriter.hpp @@ -91,18 +91,18 @@ namespace sdw SDW_API explicit RayClosestHitWriter( ShaderBuilder & builder , uint32_t flags = 0 ); - SDW_API explicit RayClosestHitWriter( ShaderAllocator * allocator = nullptr ) + explicit RayClosestHitWriter( ShaderAllocator * allocator = nullptr ) : RayClosestHitWriter{ uint32_t( 0u ), allocator } { } - SDW_API explicit RayClosestHitWriter( ast::stmt::FunctionFlag flag + explicit RayClosestHitWriter( ast::stmt::FunctionFlag flag , ShaderAllocator * allocator = nullptr ) : RayClosestHitWriter{ uint32_t( flag ), allocator } { } - SDW_API RayClosestHitWriter( ShaderBuilder & builder + RayClosestHitWriter( ShaderBuilder & builder , ast::stmt::FunctionFlag flag ) : RayClosestHitWriter{ builder, uint32_t( flag ) } { diff --git a/include/ShaderWriter/RayGenerationWriter.hpp b/include/ShaderWriter/RayGenerationWriter.hpp index 97e6e68f..b618e9fe 100644 --- a/include/ShaderWriter/RayGenerationWriter.hpp +++ b/include/ShaderWriter/RayGenerationWriter.hpp @@ -45,18 +45,18 @@ namespace sdw SDW_API explicit RayGenerationWriter( ShaderBuilder & builder , uint32_t flags = 0 ); - SDW_API explicit RayGenerationWriter( ShaderAllocator * allocator = nullptr ) + explicit RayGenerationWriter( ShaderAllocator * allocator = nullptr ) : RayGenerationWriter{ uint32_t( 0u ), allocator } { } - SDW_API explicit RayGenerationWriter( ast::stmt::FunctionFlag flag + explicit RayGenerationWriter( ast::stmt::FunctionFlag flag , ShaderAllocator * allocator = nullptr ) : RayGenerationWriter{ uint32_t( flag ), allocator } { } - SDW_API RayGenerationWriter( ShaderBuilder & builder + RayGenerationWriter( ShaderBuilder & builder , ast::stmt::FunctionFlag flag ) : RayGenerationWriter{ builder, uint32_t( flag ) } { diff --git a/include/ShaderWriter/RayIntersectionWriter.hpp b/include/ShaderWriter/RayIntersectionWriter.hpp index d2f4c4aa..4cb4a90b 100644 --- a/include/ShaderWriter/RayIntersectionWriter.hpp +++ b/include/ShaderWriter/RayIntersectionWriter.hpp @@ -84,18 +84,18 @@ namespace sdw SDW_API explicit RayIntersectionWriter( ShaderBuilder & builder , uint32_t flags = 0 ); - SDW_API explicit RayIntersectionWriter( ShaderAllocator * allocator = nullptr ) + explicit RayIntersectionWriter( ShaderAllocator * allocator = nullptr ) : RayIntersectionWriter{ uint32_t( 0u ), allocator } { } - SDW_API explicit RayIntersectionWriter( ast::stmt::FunctionFlag flag + explicit RayIntersectionWriter( ast::stmt::FunctionFlag flag , ShaderAllocator * allocator = nullptr ) : RayIntersectionWriter{ uint32_t( flag ), allocator } { } - SDW_API RayIntersectionWriter( ShaderBuilder & builder + RayIntersectionWriter( ShaderBuilder & builder , ast::stmt::FunctionFlag flag ) : RayIntersectionWriter{ builder, uint32_t( flag ) } { diff --git a/include/ShaderWriter/RayMissWriter.hpp b/include/ShaderWriter/RayMissWriter.hpp index bef96ef7..4316f830 100644 --- a/include/ShaderWriter/RayMissWriter.hpp +++ b/include/ShaderWriter/RayMissWriter.hpp @@ -66,18 +66,18 @@ namespace sdw SDW_API explicit RayMissWriter( ShaderBuilder & builder , uint32_t flags = 0 ); - SDW_API explicit RayMissWriter( ShaderAllocator * allocator = nullptr ) + explicit RayMissWriter( ShaderAllocator * allocator = nullptr ) : RayMissWriter{ uint32_t( 0u ), allocator } { } - SDW_API explicit RayMissWriter( ast::stmt::FunctionFlag flag + explicit RayMissWriter( ast::stmt::FunctionFlag flag , ShaderAllocator * allocator = nullptr ) : RayMissWriter{ uint32_t( flag ), allocator } { } - SDW_API RayMissWriter( ShaderBuilder & builder + RayMissWriter( ShaderBuilder & builder , ast::stmt::FunctionFlag flag ) : RayMissWriter{ builder, uint32_t( flag ) } { diff --git a/include/ShaderWriter/TaskWriterEXT.hpp b/include/ShaderWriter/TaskWriterEXT.hpp index a1e782ab..d789891a 100644 --- a/include/ShaderWriter/TaskWriterEXT.hpp +++ b/include/ShaderWriter/TaskWriterEXT.hpp @@ -128,18 +128,18 @@ namespace sdw SDW_API explicit TaskWriterEXT( ShaderBuilder & builder , uint32_t flags = 0 ); - SDW_API explicit TaskWriterEXT( ShaderAllocator * allocator = nullptr ) + explicit TaskWriterEXT( ShaderAllocator * allocator = nullptr ) : TaskWriterEXT{ uint32_t( 0u ), allocator } { } - SDW_API explicit TaskWriterEXT( ast::stmt::FunctionFlag flag + explicit TaskWriterEXT( ast::stmt::FunctionFlag flag , ShaderAllocator * allocator = nullptr ) : TaskWriterEXT{ uint32_t( flag ), allocator } { } - SDW_API TaskWriterEXT( ShaderBuilder & builder + TaskWriterEXT( ShaderBuilder & builder , ast::stmt::FunctionFlag flag ) : TaskWriterEXT{ builder, uint32_t( flag ) } { diff --git a/include/ShaderWriter/TaskWriterNV.hpp b/include/ShaderWriter/TaskWriterNV.hpp index 079b9687..12b06914 100644 --- a/include/ShaderWriter/TaskWriterNV.hpp +++ b/include/ShaderWriter/TaskWriterNV.hpp @@ -124,18 +124,18 @@ namespace sdw SDW_API explicit TaskWriterNV( ShaderBuilder & builder , uint32_t flags = 0 ); - SDW_API explicit TaskWriterNV( ShaderAllocator * allocator = nullptr ) + explicit TaskWriterNV( ShaderAllocator * allocator = nullptr ) : TaskWriterNV{ uint32_t( 0u ), allocator } { } - SDW_API explicit TaskWriterNV( ast::stmt::FunctionFlag flag + explicit TaskWriterNV( ast::stmt::FunctionFlag flag , ShaderAllocator * allocator = nullptr ) : TaskWriterNV{ uint32_t( flag ), allocator } { } - SDW_API TaskWriterNV( ShaderBuilder & builder + TaskWriterNV( ShaderBuilder & builder , ast::stmt::FunctionFlag flag ) : TaskWriterNV{ builder, uint32_t( flag ) } { diff --git a/include/ShaderWriter/TessellationControlWriter.hpp b/include/ShaderWriter/TessellationControlWriter.hpp index 5a4adaeb..791cbc40 100644 --- a/include/ShaderWriter/TessellationControlWriter.hpp +++ b/include/ShaderWriter/TessellationControlWriter.hpp @@ -224,18 +224,18 @@ namespace sdw SDW_API explicit TessellationControlWriter( ShaderBuilder & builder , uint32_t flags = 0 ); - SDW_API explicit TessellationControlWriter( ShaderAllocator * allocator = nullptr ) + explicit TessellationControlWriter( ShaderAllocator * allocator = nullptr ) : TessellationControlWriter{ uint32_t( 0u ), allocator } { } - SDW_API explicit TessellationControlWriter( ast::stmt::FunctionFlag flag + explicit TessellationControlWriter( ast::stmt::FunctionFlag flag , ShaderAllocator * allocator = nullptr ) : TessellationControlWriter{ uint32_t( flag ), allocator } { } - SDW_API TessellationControlWriter( ShaderBuilder & builder + TessellationControlWriter( ShaderBuilder & builder , ast::stmt::FunctionFlag flag ) : TessellationControlWriter{ builder, uint32_t( flag ) } { diff --git a/include/ShaderWriter/TessellationEvaluationWriter.hpp b/include/ShaderWriter/TessellationEvaluationWriter.hpp index 0e11e01d..54775d0f 100644 --- a/include/ShaderWriter/TessellationEvaluationWriter.hpp +++ b/include/ShaderWriter/TessellationEvaluationWriter.hpp @@ -169,18 +169,18 @@ namespace sdw SDW_API explicit TessellationEvaluationWriter( ShaderBuilder & builder , uint32_t flags = 0 ); - SDW_API explicit TessellationEvaluationWriter( ShaderAllocator * allocator = nullptr ) + explicit TessellationEvaluationWriter( ShaderAllocator * allocator = nullptr ) : TessellationEvaluationWriter{ uint32_t( 0u ), allocator } { } - SDW_API explicit TessellationEvaluationWriter( ast::stmt::FunctionFlag flag + explicit TessellationEvaluationWriter( ast::stmt::FunctionFlag flag , ShaderAllocator * allocator = nullptr ) : TessellationEvaluationWriter{ uint32_t( flag ), allocator } { } - SDW_API TessellationEvaluationWriter( ShaderBuilder & builder + TessellationEvaluationWriter( ShaderBuilder & builder , ast::stmt::FunctionFlag flag ) : TessellationEvaluationWriter{ builder, uint32_t( flag ) } { diff --git a/include/ShaderWriter/Value.hpp b/include/ShaderWriter/Value.hpp index d38caf71..2d9b3d4c 100644 --- a/include/ShaderWriter/Value.hpp +++ b/include/ShaderWriter/Value.hpp @@ -17,7 +17,7 @@ namespace sdw , expr::ExprPtr expr , bool enabled ); - SDW_API virtual ~Value() = default; + virtual ~Value() = default; SDW_API Value( Value && rhs )noexcept; SDW_API Value( Value const & rhs ); SDW_API Value & operator=( Value && rhs )noexcept; @@ -195,18 +195,18 @@ namespace sdw , CreatorT creator ); } -#define SDW_DeclValue( expdecl, name )\ - expdecl name( name && rhs )noexcept = default;\ - expdecl name( name const & rhs ) = default;\ - expdecl name & operator=( name && rhs )noexcept = default;\ - expdecl name & operator=( name const & rhs ) = default;\ - expdecl name( sdw::ReturnWrapperT< name > const & rhs )\ +#define SDW_DeclValue( name )\ + name( name && rhs )noexcept = default;\ + name( name const & rhs ) = default;\ + name & operator=( name && rhs )noexcept = default;\ + name & operator=( name const & rhs ) = default;\ + name( sdw::ReturnWrapperT< name > const & rhs )\ : name{ findWriterMandat( rhs )\ , makeExpr( findWriterMandat( rhs ), rhs )\ , rhs.isEnabled() }\ {\ }\ - expdecl name & operator=( sdw::ReturnWrapperT< name > && rhs )\ + name & operator=( sdw::ReturnWrapperT< name > && rhs )\ {\ if ( rhs.isEnabled() && this->isEnabled() && this->m_expr && !this->m_expr->isConstant() )\ {\ @@ -219,7 +219,7 @@ namespace sdw }\ return *this;\ }\ - expdecl name & operator=( sdw::ReturnWrapperT< name > const & rhs )\ + name & operator=( sdw::ReturnWrapperT< name > const & rhs )\ {\ if ( rhs.isEnabled() && this->isEnabled() && this->m_expr && !this->m_expr->isConstant() )\ {\ @@ -232,7 +232,7 @@ namespace sdw }\ return *this;\ }\ - expdecl ~name()override = default + ~name()override = default #include "Value.inl" diff --git a/include/ShaderWriter/VecTypes/Vec2.hpp b/include/ShaderWriter/VecTypes/Vec2.hpp index 5d1399fd..7495dfee 100644 --- a/include/ShaderWriter/VecTypes/Vec2.hpp +++ b/include/ShaderWriter/VecTypes/Vec2.hpp @@ -14,7 +14,7 @@ namespace sdw struct Vec2T : public Value { - SDW_DeclValue( , Vec2T ); + SDW_DeclValue( Vec2T ); using ValueType = ValueT; using Vec2Type = Vec2T< ValueT >; diff --git a/include/ShaderWriter/VecTypes/Vec3.hpp b/include/ShaderWriter/VecTypes/Vec3.hpp index 8e0c103c..71eed657 100644 --- a/include/ShaderWriter/VecTypes/Vec3.hpp +++ b/include/ShaderWriter/VecTypes/Vec3.hpp @@ -13,7 +13,7 @@ namespace sdw struct Vec3T : public Value { - SDW_DeclValue( , Vec3T ); + SDW_DeclValue( Vec3T ); using ValueType = ValueT; using Vec2Type = Vec2T< ValueT >; diff --git a/include/ShaderWriter/VecTypes/Vec4.hpp b/include/ShaderWriter/VecTypes/Vec4.hpp index 99f9411d..e8db4b56 100644 --- a/include/ShaderWriter/VecTypes/Vec4.hpp +++ b/include/ShaderWriter/VecTypes/Vec4.hpp @@ -13,7 +13,7 @@ namespace sdw struct Vec4T : public Value { - SDW_DeclValue( , Vec4T ); + SDW_DeclValue( Vec4T ); using ValueType = ValueT; using Vec2Type = Vec2T< ValueT >; diff --git a/include/ShaderWriter/VertexWriter.hpp b/include/ShaderWriter/VertexWriter.hpp index f7127b0d..bd8bfa74 100644 --- a/include/ShaderWriter/VertexWriter.hpp +++ b/include/ShaderWriter/VertexWriter.hpp @@ -83,18 +83,18 @@ namespace sdw SDW_API explicit VertexWriter( ShaderBuilder & builder , uint32_t flags = 0 ); - SDW_API explicit VertexWriter( ShaderAllocator * allocator = nullptr ) + explicit VertexWriter( ShaderAllocator * allocator = nullptr ) : VertexWriter{ uint32_t( 0u ), allocator } { } - SDW_API explicit VertexWriter( ast::stmt::FunctionFlag flag + explicit VertexWriter( ast::stmt::FunctionFlag flag , ShaderAllocator * allocator = nullptr ) : VertexWriter{ uint32_t( flag ), allocator } { } - SDW_API VertexWriter( ShaderBuilder & builder + VertexWriter( ShaderBuilder & builder , ast::stmt::FunctionFlag flag ) : VertexWriter{ builder, uint32_t( flag ) } { diff --git a/include/ShaderWriter/Writer.hpp b/include/ShaderWriter/Writer.hpp index 08d1c3a7..2b203c3a 100644 --- a/include/ShaderWriter/Writer.hpp +++ b/include/ShaderWriter/Writer.hpp @@ -90,7 +90,7 @@ namespace sdw SDW_API explicit ShaderWriter( ast::ShaderStage type , ShaderAllocator * allocator = nullptr ); SDW_API explicit ShaderWriter( ShaderBuilder & builder ); - SDW_API virtual ~ShaderWriter(); + SDW_API ~ShaderWriter()noexcept; public: #pragma region Type registration diff --git a/scripts/GlslCommon/genGlslNameFromEnum.py b/scripts/GlslCommon/genGlslNameFromEnum.py index 94fd9cf7..7b853368 100644 --- a/scripts/GlslCommon/genGlslNameFromEnum.py +++ b/scripts/GlslCommon/genGlslNameFromEnum.py @@ -26,12 +26,12 @@ def printHeader( outs, match ): def computeEnumName( name ): result = name - intrName6 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName5 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName4 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName3 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName2 = re.compile( "([\w]*), ([\w]*), ([\w]*)" ) - intrName1 = re.compile( "([\w]*), ([\w]*)" ) + intrName6 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName5 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName4 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName3 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName2 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName1 = re.compile( "([\\w]*), ([\\w]*)" ) resName6 = intrName6.match( name ) resName5 = intrName5.match( name ) resName4 = intrName4.match( name ) @@ -54,12 +54,12 @@ def computeEnumName( name ): def computeGlslName( name ): result = name - intrName6 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName5 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName4 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName3 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName2 = re.compile( "([\w]*), ([\w]*), ([\w]*)" ) - intrName1 = re.compile( "([\w]*), ([\w]*)" ) + intrName6 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName5 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName4 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName3 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName2 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName1 = re.compile( "([\\w]*), ([\\w]*)" ) resName6 = intrName6.match( name ) resName5 = intrName5.match( name ) resName4 = intrName4.match( name ) @@ -121,9 +121,9 @@ def main( argv ): print(inEnumFile + " is not an existing file.") return - intrDecl = re.compile("^ASTIntrDecl\( ([^ ]*) \)$") + intrDecl = re.compile("^ASTIntrDecl\\( ([^ ]*) \\)$") intrEnd = re.compile("^ASTIntrEnd$") - intrValue = re.compile("^\s*ASTIntrValue\( ([^,]*), ASTIntrName\( ([^)]*) \)([\w:, ()\[\]]*) \)$") + intrValue = re.compile("^\\s*ASTIntrValue\\( ([^,]*), ASTIntrName\\( ([^)]*) \\)([\\w:, ()\\[\\]]*) \\)$") with open(inEnumFile, "r") as ins: with open(outEnumFile, "w", newline='\r\n') as outs: array = [] diff --git a/scripts/ShaderAST/genEnumFromEnum.py b/scripts/ShaderAST/genEnumFromEnum.py index 42a668ae..5cd59f0a 100644 --- a/scripts/ShaderAST/genEnumFromEnum.py +++ b/scripts/ShaderAST/genEnumFromEnum.py @@ -18,12 +18,12 @@ def printHeader( outs, match ): def computeName( name ): result = name - intrName6 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName5 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName4 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName3 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName2 = re.compile( "([\w]*), ([\w]*), ([\w]*)" ) - intrName1 = re.compile( "([\w]*), ([\w]*)" ) + intrName6 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName5 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName4 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName3 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName2 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName1 = re.compile( "([\\w]*), ([\\w]*)" ) resName6 = intrName6.match( name ) resName5 = intrName5.match( name ) resName4 = intrName4.match( name ) @@ -72,9 +72,9 @@ def main( argv ): print(inEnumFile + " is not an existing file.") return - intrDecl = re.compile("^ASTIntrDecl\( ([^ ]*) \)$") + intrDecl = re.compile("^ASTIntrDecl\\( ([^ ]*) \\)$") intrEnd = re.compile("^ASTIntrEnd$") - intrValue = re.compile("^\s*ASTIntrValue\( ([^,]*), ASTIntrName\( ([^)]*) \)([\w:, ()\[\]]*) \)$") + intrValue = re.compile("^\\s*ASTIntrValue\\( ([^,]*), ASTIntrName\\( ([^)]*) \\)([\\w:, ()\\[\\]]*) \\)$") with open(inEnumFile, "r") as ins: with open(outEnumFile, "w", newline='\r\n') as outs: array = [] diff --git a/scripts/ShaderAST/genGetNameFromEnum.py b/scripts/ShaderAST/genGetNameFromEnum.py index 7928789a..9cae3579 100644 --- a/scripts/ShaderAST/genGetNameFromEnum.py +++ b/scripts/ShaderAST/genGetNameFromEnum.py @@ -14,6 +14,9 @@ def printHeader( outs, match ): outs.write( "\n" ) outs.write( '#include \n' ) outs.write( "\n" ) + outs.write( "#pragma GCC diagnostic push\n" ) + outs.write( '#pragma GCC diagnostic ignored "-Wdisabled-optimization"\n' ) + outs.write( "\n" ) outs.write( "namespace ast::expr\n" ) outs.write( "{\n" ) outs.write( "\tinline std::string getName( " + enumName + " value )\n" ) @@ -38,12 +41,12 @@ def printHeader( outs, match ): def computeName( name ): result = name - intrName6 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName5 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName4 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName3 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName2 = re.compile( "([\w]*), ([\w]*), ([\w]*)" ) - intrName1 = re.compile( "([\w]*), ([\w]*)" ) + intrName6 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName5 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName4 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName3 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName2 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName1 = re.compile( "([\\w]*), ([\\w]*)" ) resName6 = intrName6.match( name ) resName5 = intrName5.match( name ) resName4 = intrName4.match( name ) @@ -80,6 +83,8 @@ def printFooter( outs, enumName ): outs.write( "\t}\n" ) outs.write( "}\n" ) outs.write( "\n" ) + outs.write( "#pragma GCC diagnostic pop\n" ) + outs.write( "\n" ) outs.write( "#endif\n" ) def main( argv ): @@ -96,9 +101,9 @@ def main( argv ): print(inEnumFile + " is not an existing file.") return - intrDecl = re.compile("^ASTIntrDecl\( ([^ ]*) \)$") + intrDecl = re.compile("^ASTIntrDecl\\( ([^ ]*) \\)$") intrEnd = re.compile("^ASTIntrEnd$") - intrValue = re.compile("^\s*ASTIntrValue\( ([^,]*), ASTIntrName\( ([^)]*) \)([\w:, ()\[\]]*) \)$") + intrValue = re.compile("^\\s*ASTIntrValue\\( ([^,]*), ASTIntrName\\( ([^)]*) \\)([\\w:, ()\\[\\]]*) \\)$") with open(inEnumFile, "r") as ins: with open(outEnumFile, "w", newline='\r\n') as outs: array = [] diff --git a/scripts/ShaderAST/genMakeSourceFromEnum.py b/scripts/ShaderAST/genMakeSourceFromEnum.py index 9ce08c93..5032964e 100644 --- a/scripts/ShaderAST/genMakeSourceFromEnum.py +++ b/scripts/ShaderAST/genMakeSourceFromEnum.py @@ -25,12 +25,12 @@ def printHeader( outs, match ): def computeIntrinsicName( name ): result = name - intrName6 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName5 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName4 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName3 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName2 = re.compile( "([\w]*), ([\w]*), ([\w]*)" ) - intrName1 = re.compile( "([\w]*), ([\w]*)" ) + intrName6 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName5 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName4 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName3 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName2 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName1 = re.compile( "([\\w]*), ([\\w]*)" ) resName6 = intrName6.match( name ) resName5 = intrName5.match( name ) resName4 = intrName4.match( name ) @@ -53,12 +53,12 @@ def computeIntrinsicName( name ): def computeEnum( enumName, name ): result = enumName + "::e" - intrName6 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName5 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName4 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName3 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName2 = re.compile( "([\w]*), ([\w]*), ([\w]*)" ) - intrName1 = re.compile( "([\w]*), ([\w]*)" ) + intrName6 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName5 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName4 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName3 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName2 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName1 = re.compile( "([\\w]*), ([\\w]*)" ) resName6 = intrName6.match( name ) resName5 = intrName5.match( name ) resName4 = intrName4.match( name ) @@ -80,7 +80,7 @@ def computeEnum( enumName, name ): return result def discardArray( name ): - result = re.sub( "\[\d*\]", "", name ) + result = re.sub( "\\[\\d*\\]", "", name ) return result def isArray( name ): @@ -88,10 +88,10 @@ def isArray( name ): def computeParams( params, sep ): result = "" - intrParams = re.compile("[, ]*ASTIntrParams\( ([\w, :()\[\]]*) \)$") + intrParams = re.compile("[, ]*ASTIntrParams\\( ([\\w, :()\\[\\]]*) \\)$") resParams = intrParams.match( params ) if resParams: - intrParam = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\( ([^,]*), ([^ ]*) \)") + intrParam = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\\( ([^,]*), ([^ ]*) \\)") resParam = intrParam.split( resParams.group( 1 ) ) index = 1 while len( resParam ) > index: @@ -109,10 +109,10 @@ def computeParams( params, sep ): def computeParamsDoc( paramsGroup ): result = "" - intrParams = re.compile("[, ]*ASTIntrParams\( ([\w, :()\[\]]*) \)$") + intrParams = re.compile("[, ]*ASTIntrParams\\( ([\\w, :()\\[\\]]*) \\)$") resParams = intrParams.match( paramsGroup ) if resParams: - intrParam = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\( ([^,]*), ([^ ]*) \)") + intrParam = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\\( ([^,]*), ([^ ]*) \\)") resParam = intrParam.split( resParams.group( 1 ) ) index = 1 while len( resParam ) > index: @@ -130,10 +130,10 @@ def computeParamsDoc( paramsGroup ): def computeParamsDocEx( paramsGroup, lastTypeKind ): result = "" - intrParams = re.compile("[, ]*ASTIntrParams\( ([\w, :()\[\]]*) \)$") + intrParams = re.compile("[, ]*ASTIntrParams\\( ([\\w, :()\\[\\]]*) \\)$") resParams = intrParams.match( paramsGroup ) if resParams: - intrParam = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\( ([^,]*), ([^ ]*) \)") + intrParam = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\\( ([^,]*), ([^ ]*) \\)") resParam = intrParam.split( resParams.group( 1 ) ) index = 1 while len( resParam ) > index: @@ -154,10 +154,10 @@ def computeParamsDocEx( paramsGroup, lastTypeKind ): def assertParams( params, tabs ): result = "" - intrParams = re.compile("[, ]*ASTIntrParams\( ([\w, :()\[\]]*) \)$") + intrParams = re.compile("[, ]*ASTIntrParams\\( ([\\w, :()\\[\\]]*) \\)$") resParams = intrParams.match( params ) if resParams: - intrParam = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\( ([^,]*), ([^ ]*) \)") + intrParam = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\\( ([^,]*), ([^ ]*) \\)") resParam = intrParam.split( resParams.group( 1 ) ) index = 1 while len( resParam ) > index + 2: @@ -179,10 +179,10 @@ def assertParams( params, tabs ): def assertParamsEx( params, tabs, lastType ): result = "" - intrParams = re.compile("[, ]*ASTIntrParams\( ([\w, :()\[\]]*) \)$") + intrParams = re.compile("[, ]*ASTIntrParams\\( ([\\w, :()\\[\\]]*) \\)$") resParams = intrParams.match( params ) if resParams: - intrParam = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\( ([^,]*), ([^ ]*) \)") + intrParam = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\\( ([^,]*), ([^ ]*) \\)") resParam = intrParam.split( resParams.group( 1 ) ) index = 1 while len( resParam ) > index + 2: @@ -201,10 +201,10 @@ def assertParamsEx( params, tabs, lastType ): def computeArgs( args ): result = "" - intrArgs = re.compile("[, ]*ASTIntrParams\( ([\w, :()\[\]]*) \)$") + intrArgs = re.compile("[, ]*ASTIntrParams\\( ([\\w, :()\\[\\]]*) \\)$") resArgs = intrArgs.match( args ) if resArgs: - intrArg = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\( ([^,]*), ([^ ]*) \)") + intrArg = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\\( ([^,]*), ([^ ]*) \\)") resArg = intrArg.split( resArgs.group( 1 ) ) index = 2 while len( resArg ) > index: @@ -214,12 +214,12 @@ def computeArgs( args ): return result def getPostfix( functionGroup ): - intrName6 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName5 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName4 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName3 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName2 = re.compile( "([\w]*), ([\w]*), ([\w]*)" ) - intrName1 = re.compile( "([\w]*), ([\w]*)" ) + intrName6 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName5 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName4 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName3 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName2 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName1 = re.compile( "([\\w]*), ([\\w]*)" ) resName6 = intrName6.match( functionGroup ) resName5 = intrName5.match( functionGroup ) resName4 = intrName4.match( functionGroup ) @@ -578,9 +578,9 @@ def main( argv ): print(inEnumFile + " is not an existing file.") return - intrDecl = re.compile("^ASTIntrDecl\( ([^ ]*) \)$") + intrDecl = re.compile("^ASTIntrDecl\\( ([^ ]*) \\)$") intrEnd = re.compile("^ASTIntrEnd$") - intrValue = re.compile("^\s*ASTIntrValue\( ([^,]*), ASTIntrName\( ([^)]*) \)([\w:, ()\[\]]*) \)$") + intrValue = re.compile("^\\s*ASTIntrValue\\( ([^,]*), ASTIntrName\\( ([^)]*) \\)([\\w:, ()\\[\\]]*) \\)$") enumName = "" with open(inEnumFile, "r") as ins: with open(outEnumFile, "w", newline='\r\n') as outs: diff --git a/scripts/ShaderWriter/genFunctionHeaderFromEnum.py b/scripts/ShaderWriter/genFunctionHeaderFromEnum.py index 3b228505..06cff2b5 100644 --- a/scripts/ShaderWriter/genFunctionHeaderFromEnum.py +++ b/scripts/ShaderWriter/genFunctionHeaderFromEnum.py @@ -99,12 +99,12 @@ def printHeader( outs, match ): return enumName def computeIntrinsicName( functionGroup ): - intrName6 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName5 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName4 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName3 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName2 = re.compile( "([\w]*), ([\w]*), ([\w]*)" ) - intrName1 = re.compile( "([\w]*), ([\w]*)" ) + intrName6 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName5 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName4 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName3 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName2 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName1 = re.compile( "([\\w]*), ([\\w]*)" ) resName6 = intrName6.match( functionGroup ) resName5 = intrName5.match( functionGroup ) resName4 = intrName4.match( functionGroup ) @@ -127,12 +127,12 @@ def computeIntrinsicName( functionGroup ): return result def computeFullName( functionGroup ): - intrName6 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName5 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName4 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName3 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName2 = re.compile( "([\w]*), ([\w]*), ([\w]*)" ) - intrName1 = re.compile( "([\w]*), ([\w]*)" ) + intrName6 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName5 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName4 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName3 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName2 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName1 = re.compile( "([\\w]*), ([\\w]*)" ) resName6 = intrName6.match( functionGroup ) resName5 = intrName5.match( functionGroup ) resName4 = intrName4.match( functionGroup ) @@ -155,12 +155,12 @@ def computeFullName( functionGroup ): return result def getPostfix( functionGroup ): - intrName6 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName5 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName4 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName3 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName2 = re.compile( "([\w]*), ([\w]*), ([\w]*)" ) - intrName1 = re.compile( "([\w]*), ([\w]*)" ) + intrName6 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName5 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName4 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName3 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName2 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName1 = re.compile( "([\\w]*), ([\\w]*)" ) resName6 = intrName6.match( functionGroup ) resName5 = intrName5.match( functionGroup ) resName4 = intrName4.match( functionGroup ) @@ -196,19 +196,19 @@ def getDoublePostfix( postfix ): return "" def isArray( name ): - result = re.sub( "\[\d*\]", "", name ) + result = re.sub( "\\[\\d*\\]", "", name ) return result != name def discardArray( name ): - result = re.sub( "\[\d*\]", "", name ) + result = re.sub( "\\[\\d*\\]", "", name ) return result def computeParams( params, sep, allowEmpty ): result = "" - intrParams = re.compile("[, ]*ASTIntrParams\( ([\w, :()\[\]]*) \)$") + intrParams = re.compile("[, ]*ASTIntrParams\\( ([\\w, :()\\[\\]]*) \\)$") resParams = intrParams.match( params ) if resParams: - intrParam = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\( ([^,]*), ([^ ]*) \)") + intrParam = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\\( ([^,]*), ([^ ]*) \\)") resParam = intrParam.split( resParams.group( 1 ) ) index = 1 while len( resParam ) > index: @@ -237,10 +237,10 @@ def computeParams( params, sep, allowEmpty ): def computeParamsEx( params, sep, lastType ): result = "" - intrParams = re.compile("[, ]*ASTIntrParams\( ([\w, :()\[\]]*) \)$") + intrParams = re.compile("[, ]*ASTIntrParams\\( ([\\w, :()\\[\\]]*) \\)$") resParams = intrParams.match( params ) if resParams: - intrParam = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\( ([^,]*), ([^ ]*) \)") + intrParam = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\\( ([^,]*), ([^ ]*) \\)") resParam = intrParam.split( resParams.group( 1 ) ) index = 1 while len( resParam ) > index: @@ -272,10 +272,10 @@ def computeParamsEx( params, sep, lastType ): def listParams( params, sep ): result = "" - intrParams = re.compile("[, ]*ASTIntrParams\( ([\w, :()\[\]]*) \)$") + intrParams = re.compile("[, ]*ASTIntrParams\\( ([\\w, :()\\[\\]]*) \\)$") resParams = intrParams.match( params ) if resParams: - intrParam = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\( ([^,]*), ([^ ]*) \)") + intrParam = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\\( ([^,]*), ([^ ]*) \\)") resParam = intrParam.split( resParams.group( 1 ) ) index = 2 while len( resParam ) > index: @@ -287,10 +287,10 @@ def listParams( params, sep ): def computeArgs( args, sep ): result = "" - intrArgs = re.compile("[, ]*ASTIntrParams\( ([\w, :()\[\]]*) \)$") + intrArgs = re.compile("[, ]*ASTIntrParams\\( ([\\w, :()\\[\\]]*) \\)$") resArgs = intrArgs.match( args ) if resArgs: - intrArg = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\( ([^,]*), ([^ ]*) \)") + intrArg = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\\( ([^,]*), ([^ ]*) \\)") resArg = intrArg.split( resArgs.group( 1 ) ) index = 2 while len( resArg ) > index: @@ -533,9 +533,9 @@ def main( argv ): print(inEnumFile + " is not an existing file.") return - intrDecl = re.compile("^ASTIntrDecl\( ([^ ]*) \)$") + intrDecl = re.compile("^ASTIntrDecl\\( ([^ ]*) \\)$") intrEnd = re.compile("^ASTIntrEnd$") - intrValue = re.compile("^\s*ASTIntrValue\( ([^,]*), ASTIntrName\( ([^)]*) \)([\w:, ()\[\]]*) \)$") + intrValue = re.compile("^\\s*ASTIntrValue\\( ([^,]*), ASTIntrName\\( ([^)]*) \\)([\\w:, ()\\[\\]]*) \\)$") enumName = "" prvFunctionGroup = "" prvParamsGroup = "" diff --git a/scripts/ShaderWriter/genFunctionSourceFromEnum.py b/scripts/ShaderWriter/genFunctionSourceFromEnum.py index 48a34d6c..35240a01 100644 --- a/scripts/ShaderWriter/genFunctionSourceFromEnum.py +++ b/scripts/ShaderWriter/genFunctionSourceFromEnum.py @@ -84,12 +84,12 @@ def printHeader( outs, match ): return enumName def computeIntrinsicName( functionGroup ): - intrName6 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName5 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName4 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName3 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName2 = re.compile( "([\w]*), ([\w]*), ([\w]*)" ) - intrName1 = re.compile( "([\w]*), ([\w]*)" ) + intrName6 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName5 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName4 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName3 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName2 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName1 = re.compile( "([\\w]*), ([\\w]*)" ) resName6 = intrName6.match( functionGroup ) resName5 = intrName5.match( functionGroup ) resName4 = intrName4.match( functionGroup ) @@ -112,12 +112,12 @@ def computeIntrinsicName( functionGroup ): return result def computeFullName( functionGroup ): - intrName6 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName5 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName4 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName3 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName2 = re.compile( "([\w]*), ([\w]*), ([\w]*)" ) - intrName1 = re.compile( "([\w]*), ([\w]*)" ) + intrName6 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName5 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName4 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName3 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName2 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName1 = re.compile( "([\\w]*), ([\\w]*)" ) resName6 = intrName6.match( functionGroup ) resName5 = intrName5.match( functionGroup ) resName4 = intrName4.match( functionGroup ) @@ -140,12 +140,12 @@ def computeFullName( functionGroup ): return result def getPostfix( functionGroup ): - intrName6 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName5 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName4 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName3 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName2 = re.compile( "([\w]*), ([\w]*), ([\w]*)" ) - intrName1 = re.compile( "([\w]*), ([\w]*)" ) + intrName6 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName5 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName4 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName3 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName2 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName1 = re.compile( "([\\w]*), ([\\w]*)" ) resName6 = intrName6.match( functionGroup ) resName5 = intrName5.match( functionGroup ) resName4 = intrName4.match( functionGroup ) @@ -181,19 +181,19 @@ def getDoublePostfix( postfix ): return "" def isArray( name ): - result = re.sub( "\[\d*\]", "", name ) + result = re.sub( "\\[\\d*\\]", "", name ) return result != name def discardArray( name ): - result = re.sub( "\[\d*\]", "", name ) + result = re.sub( "\\[\\d*\\]", "", name ) return result def computeParams( params, sep, allowEmpty ): result = "" - intrParams = re.compile("[, ]*ASTIntrParams\( ([\w, :()\[\]]*) \)$") + intrParams = re.compile("[, ]*ASTIntrParams\\( ([\\w, :()\\[\\]]*) \\)$") resParams = intrParams.match( params ) if resParams: - intrParam = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\( ([^,]*), ([^ ]*) \)") + intrParam = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\\( ([^,]*), ([^ ]*) \\)") resParam = intrParam.split( resParams.group( 1 ) ) index = 1 while len( resParam ) > index: @@ -222,10 +222,10 @@ def computeParams( params, sep, allowEmpty ): def computeParamsEx( params, sep, lastType ): result = "" - intrParams = re.compile("[, ]*ASTIntrParams\( ([\w, :()\[\]]*) \)$") + intrParams = re.compile("[, ]*ASTIntrParams\\( ([\\w, :()\\[\\]]*) \\)$") resParams = intrParams.match( params ) if resParams: - intrParam = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\( ([^,]*), ([^ ]*) \)") + intrParam = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\\( ([^,]*), ([^ ]*) \\)") resParam = intrParam.split( resParams.group( 1 ) ) index = 1 while len( resParam ) > index: @@ -257,10 +257,10 @@ def computeParamsEx( params, sep, lastType ): def listParams( params, sep, allowEmpty ): result = "" - intrParams = re.compile("[, ]*ASTIntrParams\( ([\w, :()\[\]]*) \)$") + intrParams = re.compile("[, ]*ASTIntrParams\\( ([\\w, :()\\[\\]]*) \\)$") resParams = intrParams.match( params ) if resParams: - intrParam = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\( ([^,]*), ([^ ]*) \)") + intrParam = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\\( ([^,]*), ([^ ]*) \\)") resParam = intrParam.split( resParams.group( 1 ) ) index = 2 while len( resParam ) > index: @@ -274,10 +274,10 @@ def listParams( params, sep, allowEmpty ): def computeArgs( args, indent, sep ): result = "" - intrArgs = re.compile("[, ]*ASTIntrParams\( ([\w, :()\[\]]*) \)$") + intrArgs = re.compile("[, ]*ASTIntrParams\\( ([\\w, :()\\[\\]]*) \\)$") resArgs = intrArgs.match( args ) if resArgs: - intrArg = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\( ([^,]*), ([^ ]*) \)") + intrArg = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\\( ([^,]*), ([^ ]*) \\)") resArg = intrArg.split( resArgs.group( 1 ) ) index = 2 while len( resArg ) > index: @@ -561,9 +561,9 @@ def main( argv ): print(inEnumFile + " is not an existing file.") return - intrDecl = re.compile("^ASTIntrDecl\( ([^ ]*) \)$") + intrDecl = re.compile("^ASTIntrDecl\\( ([^ ]*) \\)$") intrEnd = re.compile("^ASTIntrEnd$") - intrValue = re.compile("^\s*ASTIntrValue\( ([^,]*), ASTIntrName\( ([^)]*) \)([\w:, ()\[\]]*) \)$") + intrValue = re.compile("^\\s*ASTIntrValue\\( ([^,]*), ASTIntrName\\( ([^)]*) \\)([\\w:, ()\\[\\]]*) \\)$") enumName = "" prvFunctionGroup = "" prvParamsGroup = "" diff --git a/source/CompilerGlsl/GlslAdaptStatements.cpp b/source/CompilerGlsl/GlslAdaptStatements.cpp index 2d4179ca..f61b265f 100644 --- a/source/CompilerGlsl/GlslAdaptStatements.cpp +++ b/source/CompilerGlsl/GlslAdaptStatements.cpp @@ -10,6 +10,8 @@ See LICENSE file in root folder #include +#pragma GCC diagnostic ignored "-Wnull-dereference" + namespace glsl { namespace adapt diff --git a/source/CompilerHlsl/HlslGenerateStatements.cpp b/source/CompilerHlsl/HlslGenerateStatements.cpp index f4b95dcb..e800c5d6 100644 --- a/source/CompilerHlsl/HlslGenerateStatements.cpp +++ b/source/CompilerHlsl/HlslGenerateStatements.cpp @@ -19,6 +19,7 @@ See LICENSE file in root folder #include #pragma GCC diagnostic ignored "-Wrestrict" +#pragma GCC diagnostic ignored "-Wnull-dereference" namespace hlsl { diff --git a/source/CompilerSpirV/SpirVBlock.hpp b/source/CompilerSpirV/SpirVBlock.hpp index d18fac70..b678f0c9 100644 --- a/source/CompilerSpirV/SpirVBlock.hpp +++ b/source/CompilerSpirV/SpirVBlock.hpp @@ -55,7 +55,7 @@ namespace spirv public: SDWSPIRV_API Block( Block && rhs )noexcept; SDWSPIRV_API Block & operator=( Block && rhs )noexcept; - SDWSPIRV_API ~Block()noexcept = default; + ~Block()noexcept = default; SDWSPIRV_API explicit Block( ast::ShaderAllocatorBlock * alloc , spv::Id plabel = {} ); diff --git a/source/CompilerSpirV/SpirVExprAdapter.cpp b/source/CompilerSpirV/SpirVExprAdapter.cpp index 9e045afb..59b82d5d 100644 --- a/source/CompilerSpirV/SpirVExprAdapter.cpp +++ b/source/CompilerSpirV/SpirVExprAdapter.cpp @@ -19,6 +19,8 @@ See LICENSE file in root folder #include +#pragma GCC diagnostic ignored "-Wnull-dereference" + namespace spirv { namespace adapt diff --git a/source/CompilerSpirV/SpirVFunction.hpp b/source/CompilerSpirV/SpirVFunction.hpp index 570f377c..5c5fa2e4 100644 --- a/source/CompilerSpirV/SpirVFunction.hpp +++ b/source/CompilerSpirV/SpirVFunction.hpp @@ -120,9 +120,9 @@ namespace spirv Function & operator=( Function const & rhs ) = delete; public: - SDWSPIRV_API Function( Function && rhs )noexcept = default; - SDWSPIRV_API Function & operator=( Function && rhs )noexcept = default; - SDWSPIRV_API ~Function()noexcept = default; + Function( Function && rhs )noexcept = default; + Function & operator=( Function && rhs )noexcept = default; + ~Function()noexcept = default; SDWSPIRV_API Function( ast::ShaderAllocatorBlock * alloc , DebugId id ); diff --git a/source/CompilerSpirV/SpirVGenerateStatements.cpp b/source/CompilerSpirV/SpirVGenerateStatements.cpp index 604a4a72..437fef59 100644 --- a/source/CompilerSpirV/SpirVGenerateStatements.cpp +++ b/source/CompilerSpirV/SpirVGenerateStatements.cpp @@ -29,6 +29,8 @@ See LICENSE file in root folder #include #include +#pragma GCC diagnostic ignored "-Wnull-dereference" + namespace spirv { namespace vis diff --git a/source/CompilerSpirV/SpirVInstruction.hpp b/source/CompilerSpirV/SpirVInstruction.hpp index bef615cb..10691e3a 100644 --- a/source/CompilerSpirV/SpirVInstruction.hpp +++ b/source/CompilerSpirV/SpirVInstruction.hpp @@ -353,7 +353,7 @@ namespace spirv , BufferCIt & buffer ); SDWSPIRV_API static InstructionPtr deserialize( ast::ShaderAllocatorBlock * alloc , BufferIt & buffer ); - SDWSPIRV_API virtual ~Instruction() = default; + virtual ~Instruction() = default; // Serialisable. Op op; diff --git a/source/GlslCommon/GenerateGlslStatements.cpp b/source/GlslCommon/GenerateGlslStatements.cpp index 36ed801b..b298ebe0 100644 --- a/source/GlslCommon/GenerateGlslStatements.cpp +++ b/source/GlslCommon/GenerateGlslStatements.cpp @@ -1565,7 +1565,7 @@ namespace glsl , Statements & result , uint32_t & line ) { - result.source += std::move( text ); + result.source += text; addLineEnd( result, line ); } } diff --git a/source/ShaderWriter/EntryPointWriter.cpp b/source/ShaderWriter/EntryPointWriter.cpp index 6c134458..5c4c4211 100644 --- a/source/ShaderWriter/EntryPointWriter.cpp +++ b/source/ShaderWriter/EntryPointWriter.cpp @@ -5,6 +5,8 @@ See LICENSE file in root folder namespace sdw { + EntryPointWriter::~EntryPointWriter()noexcept = default; + EntryPointWriter::EntryPointWriter( ast::ShaderStage type , uint32_t flags , ShaderAllocator * allocator ) diff --git a/source/ShaderWriter/GraphicsPipelineWriter.cpp b/source/ShaderWriter/GraphicsPipelineWriter.cpp index 5f7bfe92..f9edaee9 100644 --- a/source/ShaderWriter/GraphicsPipelineWriter.cpp +++ b/source/ShaderWriter/GraphicsPipelineWriter.cpp @@ -7,6 +7,8 @@ See LICENSE file in root folder namespace sdw { + GraphicsPipelineWriter::~GraphicsPipelineWriter()noexcept = default; + GraphicsPipelineWriter::GraphicsPipelineWriter( ast::ShaderStage type , ShaderAllocator * allocator ) : PipelineWriter{ type, allocator } diff --git a/source/ShaderWriter/PipelineWriter.cpp b/source/ShaderWriter/PipelineWriter.cpp index 4f8157f7..649387b9 100644 --- a/source/ShaderWriter/PipelineWriter.cpp +++ b/source/ShaderWriter/PipelineWriter.cpp @@ -5,6 +5,8 @@ See LICENSE file in root folder namespace sdw { + PipelineWriter::~PipelineWriter()noexcept = default; + PipelineWriter::PipelineWriter( ast::ShaderStage type , ShaderAllocator * allocator ) : ShaderWriter{ type, allocator } diff --git a/source/ShaderWriter/Writer.cpp b/source/ShaderWriter/Writer.cpp index 68a4887e..1e04464a 100644 --- a/source/ShaderWriter/Writer.cpp +++ b/source/ShaderWriter/Writer.cpp @@ -58,7 +58,7 @@ namespace sdw assert( doGetCurrentWriter() ); } - ShaderWriter::~ShaderWriter() + ShaderWriter::~ShaderWriter()noexcept { m_ownBuilder.reset(); assert( doGetCurrentWriter() && "Ooops... 0xDDDDDDDD" ); diff --git a/source/ShaderWriter/WriterInt.cpp b/source/ShaderWriter/WriterInt.cpp index 69c948e9..9f9279de 100644 --- a/source/ShaderWriter/WriterInt.cpp +++ b/source/ShaderWriter/WriterInt.cpp @@ -5,7 +5,7 @@ See LICENSE file in root folder namespace sdw { - ShaderWriter *& doGetCurrentWriter() + ShaderWriter *& doGetCurrentWriter()noexcept { thread_local ShaderWriter * current = nullptr; return current; diff --git a/source/ShaderWriter/WriterInt.hpp b/source/ShaderWriter/WriterInt.hpp index 64df312e..00cc5765 100644 --- a/source/ShaderWriter/WriterInt.hpp +++ b/source/ShaderWriter/WriterInt.hpp @@ -7,5 +7,5 @@ See LICENSE file in root folder namespace sdw { - ShaderWriter *& doGetCurrentWriter(); + ShaderWriter *& doGetCurrentWriter()noexcept; } diff --git a/source/VulkanLayer/PipelineBuilder.cpp b/source/VulkanLayer/PipelineBuilder.cpp index c649776f..2aedfb14 100644 --- a/source/VulkanLayer/PipelineBuilder.cpp +++ b/source/VulkanLayer/PipelineBuilder.cpp @@ -232,7 +232,7 @@ namespace ast::vk return VK_ERROR_VALIDATION_FAILED_EXT; } -# if defined( WIN32 ) +# if defined( WIN32 ) && defined( _MSC_VER ) __try { # endif @@ -244,7 +244,7 @@ namespace ast::vk , result ); checkError( err ); return err; -# if defined( WIN32 ) +# if defined( WIN32 ) && defined( _MSC_VER ) } __except ( GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ) { diff --git a/test/Common.cpp b/test/Common.cpp index e17b01a4..6cd7cb72 100644 --- a/test/Common.cpp +++ b/test/Common.cpp @@ -242,15 +242,13 @@ namespace test //********************************************************************************************* + TestCounts::~TestCounts()noexcept = default; + TestCounts::TestCounts() : allocatorBlock{ allocator.getBlock() } { } - TestCounts::~TestCounts()noexcept - { - } - void TestCounts::printBlock( std::string const & text ) { GTEST_MESSAGE_( ( "\n" + text ).c_str(), ::testing::TestPartResult::kSuccess ); diff --git a/test/ShaderAST/TestASTBase_Expressions.cpp b/test/ShaderAST/TestASTBase_Expressions.cpp index 821d3a0a..aa6ee9d6 100644 --- a/test/ShaderAST/TestASTBase_Expressions.cpp +++ b/test/ShaderAST/TestASTBase_Expressions.cpp @@ -16,6 +16,7 @@ #include #include +#pragma GCC diagnostic ignored "-Wdisabled-optimization" #pragma warning( disable:4146 ) #pragma warning( disable:4883 ) diff --git a/test/ShaderAST/TestASTBase_InterfaceBlock.cpp b/test/ShaderAST/TestASTBase_InterfaceBlock.cpp index f9148bcb..a4aec048 100644 --- a/test/ShaderAST/TestASTBase_InterfaceBlock.cpp +++ b/test/ShaderAST/TestASTBase_InterfaceBlock.cpp @@ -5,6 +5,7 @@ #include #pragma clang diagnostic ignored "-Wunused-member-function" +#pragma GCC diagnostic ignored "-Wdisabled-optimization" #pragma warning( disable:5245 ) namespace diff --git a/test/ShaderAST/TestASTBase_Intrinsics.cpp b/test/ShaderAST/TestASTBase_Intrinsics.cpp index 4a9911d9..fa7384c0 100644 --- a/test/ShaderAST/TestASTBase_Intrinsics.cpp +++ b/test/ShaderAST/TestASTBase_Intrinsics.cpp @@ -13,6 +13,8 @@ See LICENSE file in root folder #include #include +#pragma GCC diagnostic ignored "-Wdisabled-optimization" + namespace checks { using namespace ast; @@ -35069,3 +35071,4 @@ namespace checks } astTestSuiteMain() + diff --git a/test/ShaderAST/TestASTBase_Other.cpp b/test/ShaderAST/TestASTBase_Other.cpp index f0744825..f75c7235 100644 --- a/test/ShaderAST/TestASTBase_Other.cpp +++ b/test/ShaderAST/TestASTBase_Other.cpp @@ -10,6 +10,7 @@ #include #pragma clang diagnostic ignored "-Wunused-member-function" +#pragma GCC diagnostic ignored "-Wdisabled-optimization" #pragma warning( disable:5245 ) namespace diff --git a/test/ShaderAST/TestASTBase_Variables.cpp b/test/ShaderAST/TestASTBase_Variables.cpp index 455dafb9..25921a6c 100644 --- a/test/ShaderAST/TestASTBase_Variables.cpp +++ b/test/ShaderAST/TestASTBase_Variables.cpp @@ -4,6 +4,7 @@ #include #pragma clang diagnostic ignored "-Wunused-member-function" +#pragma GCC diagnostic ignored "-Wdisabled-optimization" #pragma warning( disable:5245 ) namespace diff --git a/test/ShaderAST/TestASTTypes_Base.cpp b/test/ShaderAST/TestASTTypes_Base.cpp index 810f467c..ebbdebd0 100644 --- a/test/ShaderAST/TestASTTypes_Base.cpp +++ b/test/ShaderAST/TestASTTypes_Base.cpp @@ -5,6 +5,7 @@ #include #pragma clang diagnostic ignored "-Wunused-member-function" +#pragma GCC diagnostic ignored "-Wdisabled-optimization" #pragma warning( disable:5245 ) namespace diff --git a/test/ShaderAST/TestASTTypes_CombinedImage.cpp b/test/ShaderAST/TestASTTypes_CombinedImage.cpp index ff8d2462..67e4e2c7 100644 --- a/test/ShaderAST/TestASTTypes_CombinedImage.cpp +++ b/test/ShaderAST/TestASTTypes_CombinedImage.cpp @@ -4,6 +4,7 @@ #include #pragma clang diagnostic ignored "-Wunused-member-function" +#pragma GCC diagnostic ignored "-Wdisabled-optimization" #pragma warning( disable:5245 ) namespace diff --git a/test/ShaderAST/TestASTTypes_IOStruct.cpp b/test/ShaderAST/TestASTTypes_IOStruct.cpp index 35b72fb9..39673294 100644 --- a/test/ShaderAST/TestASTTypes_IOStruct.cpp +++ b/test/ShaderAST/TestASTTypes_IOStruct.cpp @@ -5,6 +5,7 @@ #include #pragma clang diagnostic ignored "-Wunused-member-function" +#pragma GCC diagnostic ignored "-Wdisabled-optimization" #pragma warning( disable:5245 ) namespace diff --git a/test/ShaderAST/TestASTTypes_Other.cpp b/test/ShaderAST/TestASTTypes_Other.cpp index 9b31a5f7..a2da5925 100644 --- a/test/ShaderAST/TestASTTypes_Other.cpp +++ b/test/ShaderAST/TestASTTypes_Other.cpp @@ -6,6 +6,7 @@ #include #pragma clang diagnostic ignored "-Wunused-member-function" +#pragma GCC diagnostic ignored "-Wdisabled-optimization" #pragma warning( disable:5245 ) namespace diff --git a/test/ShaderAST/TestASTTypes_SampledImage.cpp b/test/ShaderAST/TestASTTypes_SampledImage.cpp index 40ed6503..dba7e7ce 100644 --- a/test/ShaderAST/TestASTTypes_SampledImage.cpp +++ b/test/ShaderAST/TestASTTypes_SampledImage.cpp @@ -4,6 +4,7 @@ #include #pragma clang diagnostic ignored "-Wunused-member-function" +#pragma GCC diagnostic ignored "-Wdisabled-optimization" #pragma warning( disable:5245 ) namespace diff --git a/test/ShaderAST/TestASTTypes_StorageImage.cpp b/test/ShaderAST/TestASTTypes_StorageImage.cpp index 8e495c3b..c005e598 100644 --- a/test/ShaderAST/TestASTTypes_StorageImage.cpp +++ b/test/ShaderAST/TestASTTypes_StorageImage.cpp @@ -4,6 +4,7 @@ #include #pragma clang diagnostic ignored "-Wunused-member-function" +#pragma GCC diagnostic ignored "-Wdisabled-optimization" #pragma warning( disable:5245 ) namespace diff --git a/test/ShaderAST/TestASTTypes_Struct.cpp b/test/ShaderAST/TestASTTypes_Struct.cpp index ae89e30d..ee433fa2 100644 --- a/test/ShaderAST/TestASTTypes_Struct.cpp +++ b/test/ShaderAST/TestASTTypes_Struct.cpp @@ -5,6 +5,7 @@ #include #pragma clang diagnostic ignored "-Wunused-member-function" +#pragma GCC diagnostic ignored "-Wdisabled-optimization" #pragma warning( disable:5245 ) namespace diff --git a/test/ShaderAST/scripts/genTestASTIntrinsicsFromEnum.py b/test/ShaderAST/scripts/genTestASTIntrinsicsFromEnum.py index ceef634d..b9e7126e 100644 --- a/test/ShaderAST/scripts/genTestASTIntrinsicsFromEnum.py +++ b/test/ShaderAST/scripts/genTestASTIntrinsicsFromEnum.py @@ -19,6 +19,8 @@ def printHeader( outs, match ): outs.write( '#include \n' ) outs.write( '#include \n' ) outs.write( '\n' ) + outs.write( '#pragma GCC diagnostic ignored "-Wdisabled-optimization"\n' ) + outs.write( '\n' ) outs.write( 'namespace checks\n' ) outs.write( '{\n' ) outs.write( '\tusing namespace ast;\n' ) @@ -229,12 +231,12 @@ def printHeader( outs, match ): def computeIntrinsicName( name ): result = name - intrName6 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName5 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName4 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName3 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName2 = re.compile( "([\w]*), ([\w]*), ([\w]*)" ) - intrName1 = re.compile( "([\w]*), ([\w]*)" ) + intrName6 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName5 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName4 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName3 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName2 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName1 = re.compile( "([\\w]*), ([\\w]*)" ) resName6 = intrName6.match( name ) resName5 = intrName5.match( name ) resName4 = intrName4.match( name ) @@ -257,12 +259,12 @@ def computeIntrinsicName( name ): def computeEnum( enumName, name ): result = enumName + "::e" - intrName6 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName5 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName4 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName3 = re.compile( "([\w]*), ([\w]*), ([\w]*), ([\w]*)" ) - intrName2 = re.compile( "([\w]*), ([\w]*), ([\w]*)" ) - intrName1 = re.compile( "([\w]*), ([\w]*)" ) + intrName6 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName5 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName4 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName3 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName2 = re.compile( "([\\w]*), ([\\w]*), ([\\w]*)" ) + intrName1 = re.compile( "([\\w]*), ([\\w]*)" ) resName6 = intrName6.match( name ) resName5 = intrName5.match( name ) resName4 = intrName4.match( name ) @@ -284,7 +286,7 @@ def computeEnum( enumName, name ): return result def discardArray( name ): - result = re.sub( "\[\d*\]", "", name ) + result = re.sub( "\\[\\d*\\]", "", name ) return result def isArray( name ): @@ -303,10 +305,10 @@ def computeGetTypeCall( paramType ): def computeParams( params, tabs ): result = "" - intrParams = re.compile("[, ]*ASTIntrParams\( ([\w, :()\[\]]*) \)$") + intrParams = re.compile("[, ]*ASTIntrParams\\( ([\\w, :()\\[\\]]*) \\)$") resParams = intrParams.match( params ) if resParams: - intrParam = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\( ([^,]*), ([^ ]*) \)") + intrParam = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\\( ([^,]*), ([^ ]*) \\)") resParam = intrParam.split( resParams.group( 1 ) ) index = 1 while len( resParam ) > index + 2: @@ -480,10 +482,10 @@ def computeLiteralValue( paramType ): def computeLiteralParams( params, tabs ): result = "" - intrParams = re.compile("[, ]*ASTIntrParams\( ([\w, :()\[\]]*) \)$") + intrParams = re.compile("[, ]*ASTIntrParams\\( ([\\w, :()\\[\\]]*) \\)$") resParams = intrParams.match( params ) if resParams: - intrParam = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\( ([^,]*), ([^ ]*) \)") + intrParam = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\\( ([^,]*), ([^ ]*) \\)") resParam = intrParam.split( resParams.group( 1 ) ) index = 1 while len( resParam ) > index + 2: @@ -513,10 +515,10 @@ def computeLiteralParams( params, tabs ): def computeArgs( args ): result = "" - intrArgs = re.compile("[, ]*ASTIntrParams\( ([\w, :()\[\]]*) \)$") + intrArgs = re.compile("[, ]*ASTIntrParams\\( ([\\w, :()\\[\\]]*) \\)$") resArgs = intrArgs.match( args ) if resArgs: - intrArg = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\( ([^,]*), ([^ ]*) \)") + intrArg = re.compile("(ASTIntrParam|ASTCppParam|ASTIntrOutParam)\\( ([^,]*), ([^ ]*) \\)") resArg = intrArg.split( resArgs.group( 1 ) ) index = 2 while len( resArg ) > index: @@ -569,7 +571,9 @@ def printFooter( outFile, outs ): testsName = os.path.basename(outFile) testsName = testsName.replace( ".cpp", "" ) - outs.write( "}" ) + outs.write( "}\n" ) + outs.write( "\n" ) + outs.write( "astTestSuiteMain()\n" ) outs.write( "\n" ) def main( argv ): @@ -586,9 +590,9 @@ def main( argv ): print(inEnumFile + " is not an existing file.") return - intrDecl = re.compile("^ASTIntrDecl\( ([^ ]*) \)$") + intrDecl = re.compile("^ASTIntrDecl\\( ([^ ]*) \\)$") intrEnd = re.compile("^ASTIntrEnd$") - intrValue = re.compile("^\s*ASTIntrValue\( ([^,]*), ASTIntrName\( ([^)]*) \)([\w:, ()\[\]]*) \)$") + intrValue = re.compile("^\\s*ASTIntrValue\\( ([^,]*), ASTIntrName\\( ([^)]*) \\)([\\w:, ()\\[\\]]*) \\)$") enumName = "" with open( inEnumFile, "r" ) as ins: with open( outFile, "w", newline='\r\n' ) as outs: diff --git a/test/ShaderWriter/CMakeLists.txt b/test/ShaderWriter/CMakeLists.txt index 76f0e246..7cdb7990 100644 --- a/test/ShaderWriter/CMakeLists.txt +++ b/test/ShaderWriter/CMakeLists.txt @@ -7,7 +7,7 @@ endif() option( SDW_ALL_TESTS "Builds all tests (relative to data type and image pixel formats)" ON ) option( SDW_TESTS_ENABLE_VALIDATION "Enables validation through respective API (Vulkan, OpenGL, and Direct3D" OFF ) -find_package( glslang CONFIG REQUIRED glslang OGLCompiler OSDependent SPIRV SPVRemapper ) +find_package( glslang CONFIG REQUIRED glslang OSDependent SPIRV ) find_package( Threads REQUIRED ) set( TEST_WRITER_COMMON_HEADER_FILES ${TEST_COMMON_HEADER_FILES} @@ -62,9 +62,7 @@ target_link_libraries( TestWriterCommon ${BinLibraries} glslang::OSDependent glslang::glslang - # glslang::OGLCompiler glslang::SPIRV - glslang::SPVRemapper Threads::Threads PRIVATE ${SDW_EXPORTERS_LIST} @@ -136,7 +134,13 @@ endif () find_package( SPIRV-Tools CONFIG ) if ( SPIRV-Tools_FOUND ) - target_link_libraries( TestWriterCommon PRIVATE SPIRV-Tools-static ) + if ( TARGET SPIRV-Tools-shared ) + target_link_libraries( TestWriterCommon PRIVATE SPIRV-Tools-shared ) + elseif ( TARGET SPIRV-Tools-static ) + target_link_libraries( TestWriterCommon PRIVATE SPIRV-Tools-static ) + else () + target_link_libraries( TestWriterCommon PRIVATE ${SPIRV-Tools_LIBRARIES} ) + endif () target_compile_definitions( TestWriterCommon PRIVATE SDW_Test_HasSpirVTools=1 ) endif () diff --git a/test/ShaderWriter/GlslToSpv.cpp b/test/ShaderWriter/GlslToSpv.cpp index 557b4e85..e8b24019 100644 --- a/test/ShaderWriter/GlslToSpv.cpp +++ b/test/ShaderWriter/GlslToSpv.cpp @@ -1,5 +1,7 @@ #include "GlslToSpv.hpp" +#include + #pragma warning( push ) #pragma warning( disable: 4365 ) #pragma warning( disable: 4464 ) @@ -29,7 +31,7 @@ namespace test { - namespace + namespace glspv { struct BlockLocale { @@ -61,7 +63,25 @@ namespace test std::locale m_prvLoc; }; - void doInitResources( TBuiltInResource & resources ) + class Exception + : public std::exception + { + public: + Exception( std::string msg ) + : m_msg{ std::move( msg ) } + { + } + + const char * what()const noexcept override + { + return m_msg.c_str(); + } + + private: + std::string m_msg; + }; + + static void initResources( TBuiltInResource & resources ) { resources.limits.nonInductiveForLoops = true; resources.limits.whileLoops = true; @@ -177,7 +197,7 @@ namespace test resources.maxDualSourceDrawBuffersEXT = 4; } - EShLanguage doGetLanguage( ast::ShaderStage stage ) + static EShLanguage getLanguage( ast::ShaderStage stage ) { switch ( stage ) { @@ -221,7 +241,7 @@ namespace test } } - glslang::EShTargetLanguageVersion doGetLanguageVersion( uint32_t spvVersion ) + static glslang::EShTargetLanguageVersion getLanguageVersion( uint32_t spvVersion ) { switch ( spvVersion ) { @@ -258,37 +278,50 @@ namespace test , uint32_t spvVersion ) { std::vector< uint32_t > spirv; - BlockLocale guard; - TBuiltInResource resources; - doInitResources( resources ); + try + { + glspv::BlockLocale guard; + TBuiltInResource resources; + glspv::initResources( resources ); - // Enable SPIR-V and Vulkan rules when parsing GLSL - auto messages = EShMessages( EShMsgSpvRules | EShMsgVulkanRules ); - auto glstage = doGetLanguage( stage ); - glslang::TShader glshader{ glstage }; - glshader.setEnvTarget( glslang::EShTargetSpv - , doGetLanguageVersion( spvVersion ) ); + // Enable SPIR-V and Vulkan rules when parsing GLSL + auto messages = EShMessages( EShMsgSpvRules | EShMsgVulkanRules ); + auto glstage = glspv::getLanguage( stage ); + glslang::TShader glshader{ glstage }; + glshader.setEnvTarget( glslang::EShTargetSpv + , glspv::getLanguageVersion( spvVersion ) ); - char const * const str = shader.data(); - glshader.setStrings( &str, 1 ); + char const * const str = shader.data(); + glshader.setStrings( &str, 1 ); - if ( !glshader.parse( &resources, 100, false, messages ) ) - { - throw std::runtime_error{ std::string{ "Shader compilation to SPIR-V failed.\n" } + glshader.getInfoLog() }; - } + if ( !glshader.parse( &resources, 100, false, messages ) ) + { + throw glspv::Exception{ std::string{ "Shader compilation to SPIR-V failed.\n" } + glshader.getInfoLog() }; + } - glslang::TProgram glprogram; - glprogram.addShader( &glshader ); + glslang::TProgram glprogram; + glprogram.addShader( &glshader ); - if ( !glprogram.link( messages ) ) - { - if ( glprogram.getInfoLog() ) + if ( !glprogram.link( messages ) ) { - throw std::runtime_error{ std::string{ "Program linkage failed.\n" } + glprogram.getInfoLog() }; + if ( glprogram.getInfoLog() ) + { + throw glspv::Exception{ std::string{ "Program linkage failed.\n" } + glprogram.getInfoLog() }; + } } + + glslang::GlslangToSpv( *glprogram.getIntermediate( glstage ), spirv ); + } + catch ( std::runtime_error & exc ) + { + // Catch runtime errors thrown internally + ast::Logger::logError( exc.what() ); + } + catch ( glspv::Exception & exc ) + { + throw std::runtime_error{ exc.what() }; } - glslang::GlslangToSpv( *glprogram.getIntermediate( glstage ), spirv ); return spirv; } } diff --git a/test/ShaderWriter/TestWriterIntrinsics_Constant.cpp b/test/ShaderWriter/TestWriterIntrinsics_Constant.cpp index 35d8e591..af7256b0 100644 --- a/test/ShaderWriter/TestWriterIntrinsics_Constant.cpp +++ b/test/ShaderWriter/TestWriterIntrinsics_Constant.cpp @@ -2,6 +2,7 @@ #pragma warning( disable:5245 ) #pragma GCC diagnostic ignored "-Wunused-function" +#pragma GCC diagnostic ignored "-Wdisabled-optimization" #pragma clang diagnostic ignored "-Wunused-member-function" namespace diff --git a/test/ShaderWriter/TestWriterIntrinsics_NonConstant.cpp b/test/ShaderWriter/TestWriterIntrinsics_NonConstant.cpp index c9e21534..44ceab21 100644 --- a/test/ShaderWriter/TestWriterIntrinsics_NonConstant.cpp +++ b/test/ShaderWriter/TestWriterIntrinsics_NonConstant.cpp @@ -2,6 +2,7 @@ #pragma warning( disable:5245 ) #pragma GCC diagnostic ignored "-Wunused-function" +#pragma GCC diagnostic ignored "-Wdisabled-optimization" #pragma clang diagnostic ignored "-Wunused-member-function" namespace @@ -2475,7 +2476,7 @@ namespace { } - SDW_DeclStructInstance( , PayloadT ); + SDW_DeclStructInstance( PayloadT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) diff --git a/test/ShaderWriter/TestWriterOthers_CustomType.cpp b/test/ShaderWriter/TestWriterOthers_CustomType.cpp index c5ca1699..16fb743a 100644 --- a/test/ShaderWriter/TestWriterOthers_CustomType.cpp +++ b/test/ShaderWriter/TestWriterOthers_CustomType.cpp @@ -19,7 +19,7 @@ namespace { } - SDW_DeclStructInstance( , ColourT ); + SDW_DeclStructInstance( ColourT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) @@ -60,7 +60,7 @@ namespace struct Light : public sdw::StructInstance { - SDW_DeclStructInstance( , Light ); + SDW_DeclStructInstance( Light ); Light( sdw::ShaderWriter & writer, ast::expr::ExprPtr expr, bool enabled ) : StructInstance{ writer, std::move( expr ), enabled } @@ -121,7 +121,7 @@ namespace struct Parameterized : public sdw::StructInstance { - SDW_DeclStructInstance( , Parameterized ); + SDW_DeclStructInstance( Parameterized ); Parameterized( sdw::ShaderWriter & writer, ast::expr::ExprPtr expr, bool enabled ) : StructInstance{ writer, std::move( expr ), enabled } diff --git a/test/ShaderWriter/TestWriterOthers_Function.cpp b/test/ShaderWriter/TestWriterOthers_Function.cpp index b52f2bae..147d563a 100644 --- a/test/ShaderWriter/TestWriterOthers_Function.cpp +++ b/test/ShaderWriter/TestWriterOthers_Function.cpp @@ -10,7 +10,7 @@ namespace struct St : public sdw::StructInstance { - SDW_DeclStructInstance( , St ); + SDW_DeclStructInstance( St ); St( sdw::ShaderWriter & writer , ast::expr::ExprPtr expr @@ -47,7 +47,7 @@ namespace struct St2 : public sdw::StructInstance { - SDW_DeclStructInstance( , St2 ); + SDW_DeclStructInstance( St2 ); St2( sdw::ShaderWriter & writer , ast::expr::ExprPtr expr diff --git a/test/ShaderWriter/TestWriterShaderStage_Callable.cpp b/test/ShaderWriter/TestWriterShaderStage_Callable.cpp index 0c754ff9..254b259f 100644 --- a/test/ShaderWriter/TestWriterShaderStage_Callable.cpp +++ b/test/ShaderWriter/TestWriterShaderStage_Callable.cpp @@ -22,7 +22,7 @@ namespace { } - SDW_DeclStructInstance( , RayLight ); + SDW_DeclStructInstance( RayLight ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { diff --git a/test/ShaderWriter/TestWriterShaderStage_Compute.cpp b/test/ShaderWriter/TestWriterShaderStage_Compute.cpp index 71812417..f2f59efd 100644 --- a/test/ShaderWriter/TestWriterShaderStage_Compute.cpp +++ b/test/ShaderWriter/TestWriterShaderStage_Compute.cpp @@ -9,7 +9,7 @@ namespace struct Voxel : public sdw::StructInstance { - SDW_DeclStructInstance( , Voxel ); + SDW_DeclStructInstance( Voxel ); Voxel( sdw::ShaderWriter & writer , ast::expr::ExprPtr expr @@ -640,7 +640,7 @@ namespace { } - SDW_DeclStructInstance( , Vertex ); + SDW_DeclStructInstance( Vertex ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -697,7 +697,7 @@ namespace { } - SDW_DeclStructInstance( , MorphTargetData ); + SDW_DeclStructInstance( MorphTargetData ); static ast::type::BaseStructPtr makeType( ast::type::TypesCache & cache ) { @@ -729,7 +729,7 @@ namespace { } - SDW_DeclStructInstance( , MorphTargetsData ); + SDW_DeclStructInstance( MorphTargetsData ); static ast::type::BaseStructPtr makeType( ast::type::TypesCache & cache ) { diff --git a/test/ShaderWriter/TestWriterShaderStage_Fragment.cpp b/test/ShaderWriter/TestWriterShaderStage_Fragment.cpp index a514d1b1..0a91ca74 100644 --- a/test/ShaderWriter/TestWriterShaderStage_Fragment.cpp +++ b/test/ShaderWriter/TestWriterShaderStage_Fragment.cpp @@ -18,7 +18,7 @@ namespace { } - SDW_DeclStructInstance( , PositionT ); + SDW_DeclStructInstance( PositionT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) @@ -69,7 +69,7 @@ namespace { } - SDW_DeclStructInstance( , PosTexT ); + SDW_DeclStructInstance( PosTexT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) @@ -128,7 +128,7 @@ namespace { } - SDW_DeclStructInstance( , PosColT ); + SDW_DeclStructInstance( PosColT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) @@ -186,7 +186,7 @@ namespace { } - SDW_DeclStructInstance( , ColourT ); + SDW_DeclStructInstance( ColourT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) diff --git a/test/ShaderWriter/TestWriterShaderStage_Geometry.cpp b/test/ShaderWriter/TestWriterShaderStage_Geometry.cpp index 9451c956..add2a60a 100644 --- a/test/ShaderWriter/TestWriterShaderStage_Geometry.cpp +++ b/test/ShaderWriter/TestWriterShaderStage_Geometry.cpp @@ -16,7 +16,7 @@ namespace { } - SDW_DeclStructInstance( , PositionT ); + SDW_DeclStructInstance( PositionT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) diff --git a/test/ShaderWriter/TestWriterShaderStage_MeshEXT.cpp b/test/ShaderWriter/TestWriterShaderStage_MeshEXT.cpp index d87ae54f..11ce99e9 100644 --- a/test/ShaderWriter/TestWriterShaderStage_MeshEXT.cpp +++ b/test/ShaderWriter/TestWriterShaderStage_MeshEXT.cpp @@ -67,7 +67,7 @@ namespace { } - SDW_DeclStructInstance( , Meshlet ); + SDW_DeclStructInstance( Meshlet ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -111,7 +111,7 @@ namespace { } - SDW_DeclStructInstance( , Vertex ); + SDW_DeclStructInstance( Vertex ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -146,7 +146,7 @@ namespace { } - SDW_DeclStructInstance( , TriIndex ); + SDW_DeclStructInstance( TriIndex ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -177,7 +177,7 @@ namespace { } - SDW_DeclStructInstance( , VtxIndex ); + SDW_DeclStructInstance( VtxIndex ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -212,7 +212,7 @@ namespace { } - SDW_DeclStructInstance( , MyVertexOutT ); + SDW_DeclStructInstance( MyVertexOutT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) @@ -286,7 +286,7 @@ namespace { } - SDW_DeclStructInstance( , PayloadT ); + SDW_DeclStructInstance( PayloadT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) @@ -341,7 +341,7 @@ namespace { } - SDW_DeclStructInstance( , Constants ); + SDW_DeclStructInstance( Constants ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -385,7 +385,7 @@ namespace { } - SDW_DeclStructInstance( , MeshInfo ); + SDW_DeclStructInstance( MeshInfo ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -425,7 +425,7 @@ namespace { } - SDW_DeclStructInstance( , Constants ); + SDW_DeclStructInstance( Constants ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -465,7 +465,7 @@ namespace { } - SDW_DeclStructInstance( , DrawParams ); + SDW_DeclStructInstance( DrawParams ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -502,7 +502,7 @@ namespace { } - SDW_DeclStructInstance( , MeshInfo ); + SDW_DeclStructInstance( MeshInfo ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -542,7 +542,7 @@ namespace { } - SDW_DeclStructInstance( , Instance ); + SDW_DeclStructInstance( Instance ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -589,7 +589,7 @@ namespace { } - SDW_DeclStructInstance( , Constants ); + SDW_DeclStructInstance( Constants ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -651,7 +651,7 @@ namespace { } - SDW_DeclStructInstance( , Instance ); + SDW_DeclStructInstance( Instance ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -696,7 +696,7 @@ namespace { } - SDW_DeclStructInstance( , CullData ); + SDW_DeclStructInstance( CullData ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -738,7 +738,7 @@ namespace { } - SDW_DeclStructInstance( , MeshInfo ); + SDW_DeclStructInstance( MeshInfo ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -782,7 +782,7 @@ namespace { } - SDW_DeclStructInstance( , PayloadT ); + SDW_DeclStructInstance( PayloadT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) @@ -833,7 +833,7 @@ namespace { } - SDW_DeclStructInstance( , PerVertexColourT ); + SDW_DeclStructInstance( PerVertexColourT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) diff --git a/test/ShaderWriter/TestWriterShaderStage_MeshNV.cpp b/test/ShaderWriter/TestWriterShaderStage_MeshNV.cpp index 81c43c02..06ebeee0 100644 --- a/test/ShaderWriter/TestWriterShaderStage_MeshNV.cpp +++ b/test/ShaderWriter/TestWriterShaderStage_MeshNV.cpp @@ -69,7 +69,7 @@ namespace { } - SDW_DeclStructInstance( , Meshlet ); + SDW_DeclStructInstance( Meshlet ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -113,7 +113,7 @@ namespace { } - SDW_DeclStructInstance( , Vertex ); + SDW_DeclStructInstance( Vertex ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -148,7 +148,7 @@ namespace { } - SDW_DeclStructInstance( , Index ); + SDW_DeclStructInstance( Index ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -179,7 +179,7 @@ namespace { } - SDW_DeclStructInstance( , TriIndex ); + SDW_DeclStructInstance( TriIndex ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -210,7 +210,7 @@ namespace { } - SDW_DeclStructInstance( , VtxIndex ); + SDW_DeclStructInstance( VtxIndex ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -245,7 +245,7 @@ namespace { } - SDW_DeclStructInstance( , MyVertexOutT ); + SDW_DeclStructInstance( MyVertexOutT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) @@ -319,7 +319,7 @@ namespace { } - SDW_DeclStructInstance( , PayloadT ); + SDW_DeclStructInstance( PayloadT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) @@ -374,7 +374,7 @@ namespace { } - SDW_DeclStructInstance( , Constants ); + SDW_DeclStructInstance( Constants ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -418,7 +418,7 @@ namespace { } - SDW_DeclStructInstance( , MeshInfo ); + SDW_DeclStructInstance( MeshInfo ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -458,7 +458,7 @@ namespace { } - SDW_DeclStructInstance( , Constants ); + SDW_DeclStructInstance( Constants ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -498,7 +498,7 @@ namespace { } - SDW_DeclStructInstance( , DrawParams ); + SDW_DeclStructInstance( DrawParams ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -535,7 +535,7 @@ namespace { } - SDW_DeclStructInstance( , MeshInfo ); + SDW_DeclStructInstance( MeshInfo ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -575,7 +575,7 @@ namespace { } - SDW_DeclStructInstance( , Instance ); + SDW_DeclStructInstance( Instance ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -620,7 +620,7 @@ namespace { } - SDW_DeclStructInstance( , Constants ); + SDW_DeclStructInstance( Constants ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -682,7 +682,7 @@ namespace { } - SDW_DeclStructInstance( , Instance ); + SDW_DeclStructInstance( Instance ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -727,7 +727,7 @@ namespace { } - SDW_DeclStructInstance( , CullData ); + SDW_DeclStructInstance( CullData ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -769,7 +769,7 @@ namespace { } - SDW_DeclStructInstance( , MeshInfo ); + SDW_DeclStructInstance( MeshInfo ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -814,7 +814,7 @@ namespace { } - SDW_DeclStructInstance( , PerVertexColourT ); + SDW_DeclStructInstance( PerVertexColourT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) diff --git a/test/ShaderWriter/TestWriterShaderStage_Mesh_EXT.cpp b/test/ShaderWriter/TestWriterShaderStage_Mesh_EXT.cpp index d96d7ec3..013830e2 100644 --- a/test/ShaderWriter/TestWriterShaderStage_Mesh_EXT.cpp +++ b/test/ShaderWriter/TestWriterShaderStage_Mesh_EXT.cpp @@ -33,7 +33,7 @@ namespace { } - SDW_DeclStructInstance( , Meshlet ); + SDW_DeclStructInstance( Meshlet ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -77,7 +77,7 @@ namespace { } - SDW_DeclStructInstance( , Vertex ); + SDW_DeclStructInstance( Vertex ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -112,7 +112,7 @@ namespace { } - SDW_DeclStructInstance( , TriIndex ); + SDW_DeclStructInstance( TriIndex ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -143,7 +143,7 @@ namespace { } - SDW_DeclStructInstance( , VtxIndex ); + SDW_DeclStructInstance( VtxIndex ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -197,7 +197,7 @@ namespace { } - SDW_DeclStructInstance( , MyVertexOutT ); + SDW_DeclStructInstance( MyVertexOutT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) @@ -271,7 +271,7 @@ namespace { } - SDW_DeclStructInstance( , PayloadT ); + SDW_DeclStructInstance( PayloadT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) @@ -326,7 +326,7 @@ namespace { } - SDW_DeclStructInstance( , Constants ); + SDW_DeclStructInstance( Constants ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -370,7 +370,7 @@ namespace { } - SDW_DeclStructInstance( , MeshInfo ); + SDW_DeclStructInstance( MeshInfo ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -410,7 +410,7 @@ namespace { } - SDW_DeclStructInstance( , Constants ); + SDW_DeclStructInstance( Constants ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -450,7 +450,7 @@ namespace { } - SDW_DeclStructInstance( , DrawParams ); + SDW_DeclStructInstance( DrawParams ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -487,7 +487,7 @@ namespace { } - SDW_DeclStructInstance( , MeshInfo ); + SDW_DeclStructInstance( MeshInfo ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -527,7 +527,7 @@ namespace { } - SDW_DeclStructInstance( , Instance ); + SDW_DeclStructInstance( Instance ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -574,7 +574,7 @@ namespace { } - SDW_DeclStructInstance( , Constants ); + SDW_DeclStructInstance( Constants ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -636,7 +636,7 @@ namespace { } - SDW_DeclStructInstance( , Instance ); + SDW_DeclStructInstance( Instance ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -681,7 +681,7 @@ namespace { } - SDW_DeclStructInstance( , CullData ); + SDW_DeclStructInstance( CullData ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -723,7 +723,7 @@ namespace { } - SDW_DeclStructInstance( , MeshInfo ); + SDW_DeclStructInstance( MeshInfo ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -767,7 +767,7 @@ namespace { } - SDW_DeclStructInstance( , PayloadT ); + SDW_DeclStructInstance( PayloadT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) @@ -818,7 +818,7 @@ namespace { } - SDW_DeclStructInstance( , PerVertexColourT ); + SDW_DeclStructInstance( PerVertexColourT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) diff --git a/test/ShaderWriter/TestWriterShaderStage_Mesh_NV.cpp b/test/ShaderWriter/TestWriterShaderStage_Mesh_NV.cpp index 6320b7bc..f7a611a2 100644 --- a/test/ShaderWriter/TestWriterShaderStage_Mesh_NV.cpp +++ b/test/ShaderWriter/TestWriterShaderStage_Mesh_NV.cpp @@ -33,7 +33,7 @@ namespace { } - SDW_DeclStructInstance( , Meshlet ); + SDW_DeclStructInstance( Meshlet ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -77,7 +77,7 @@ namespace { } - SDW_DeclStructInstance( , Vertex ); + SDW_DeclStructInstance( Vertex ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -112,7 +112,7 @@ namespace { } - SDW_DeclStructInstance( , TriIndex ); + SDW_DeclStructInstance( TriIndex ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -143,7 +143,7 @@ namespace { } - SDW_DeclStructInstance( , VtxIndex ); + SDW_DeclStructInstance( VtxIndex ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -197,7 +197,7 @@ namespace { } - SDW_DeclStructInstance( , MyVertexOutT ); + SDW_DeclStructInstance( MyVertexOutT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) @@ -271,7 +271,7 @@ namespace { } - SDW_DeclStructInstance( , PayloadT ); + SDW_DeclStructInstance( PayloadT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) @@ -326,7 +326,7 @@ namespace { } - SDW_DeclStructInstance( , Constants ); + SDW_DeclStructInstance( Constants ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -370,7 +370,7 @@ namespace { } - SDW_DeclStructInstance( , MeshInfo ); + SDW_DeclStructInstance( MeshInfo ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -410,7 +410,7 @@ namespace { } - SDW_DeclStructInstance( , Constants ); + SDW_DeclStructInstance( Constants ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -450,7 +450,7 @@ namespace { } - SDW_DeclStructInstance( , DrawParams ); + SDW_DeclStructInstance( DrawParams ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -487,7 +487,7 @@ namespace { } - SDW_DeclStructInstance( , MeshInfo ); + SDW_DeclStructInstance( MeshInfo ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -527,7 +527,7 @@ namespace { } - SDW_DeclStructInstance( , Instance ); + SDW_DeclStructInstance( Instance ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -574,7 +574,7 @@ namespace { } - SDW_DeclStructInstance( , Constants ); + SDW_DeclStructInstance( Constants ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -636,7 +636,7 @@ namespace { } - SDW_DeclStructInstance( , Instance ); + SDW_DeclStructInstance( Instance ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -681,7 +681,7 @@ namespace { } - SDW_DeclStructInstance( , CullData ); + SDW_DeclStructInstance( CullData ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -723,7 +723,7 @@ namespace { } - SDW_DeclStructInstance( , MeshInfo ); + SDW_DeclStructInstance( MeshInfo ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -767,7 +767,7 @@ namespace { } - SDW_DeclStructInstance( , PayloadT ); + SDW_DeclStructInstance( PayloadT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) @@ -818,7 +818,7 @@ namespace { } - SDW_DeclStructInstance( , PerVertexColourT ); + SDW_DeclStructInstance( PerVertexColourT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) diff --git a/test/ShaderWriter/TestWriterShaderStage_RayAnyHit.cpp b/test/ShaderWriter/TestWriterShaderStage_RayAnyHit.cpp index c227a50e..e907b0f6 100644 --- a/test/ShaderWriter/TestWriterShaderStage_RayAnyHit.cpp +++ b/test/ShaderWriter/TestWriterShaderStage_RayAnyHit.cpp @@ -26,7 +26,7 @@ namespace { } - SDW_DeclStructInstance( , HitPayload ); + SDW_DeclStructInstance( HitPayload ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -89,7 +89,7 @@ namespace { } - SDW_DeclStructInstance( , ObjDesc ); + SDW_DeclStructInstance( ObjDesc ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -139,7 +139,7 @@ namespace { } - SDW_DeclStructInstance( , Vertex ); + SDW_DeclStructInstance( Vertex ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -191,7 +191,7 @@ namespace { } - SDW_DeclStructInstance( , WaveFrontMaterial ); + SDW_DeclStructInstance( WaveFrontMaterial ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { diff --git a/test/ShaderWriter/TestWriterShaderStage_RayClosestHit.cpp b/test/ShaderWriter/TestWriterShaderStage_RayClosestHit.cpp index c077a461..8ffda87f 100644 --- a/test/ShaderWriter/TestWriterShaderStage_RayClosestHit.cpp +++ b/test/ShaderWriter/TestWriterShaderStage_RayClosestHit.cpp @@ -20,7 +20,7 @@ namespace { } - SDW_DeclStructInstance( , HitPayload ); + SDW_DeclStructInstance( HitPayload ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -55,7 +55,7 @@ namespace { } - SDW_DeclStructInstance( , ObjDesc ); + SDW_DeclStructInstance( ObjDesc ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -106,7 +106,7 @@ namespace { } - SDW_DeclStructInstance( , VertexT ); + SDW_DeclStructInstance( VertexT ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -151,7 +151,7 @@ namespace { } - SDW_DeclStructInstance( , Index ); + SDW_DeclStructInstance( Index ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -182,7 +182,7 @@ namespace { } - SDW_DeclStructInstance( , MatIndex ); + SDW_DeclStructInstance( MatIndex ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -223,7 +223,7 @@ namespace { } - SDW_DeclStructInstance( , WaveFrontMaterialT ); + SDW_DeclStructInstance( WaveFrontMaterialT ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -372,7 +372,7 @@ namespace { } - SDW_DeclStructInstance( , RayLight ); + SDW_DeclStructInstance( RayLight ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { diff --git a/test/ShaderWriter/TestWriterShaderStage_RayIntersection.cpp b/test/ShaderWriter/TestWriterShaderStage_RayIntersection.cpp index bcc13196..0849ab8a 100644 --- a/test/ShaderWriter/TestWriterShaderStage_RayIntersection.cpp +++ b/test/ShaderWriter/TestWriterShaderStage_RayIntersection.cpp @@ -17,7 +17,7 @@ namespace { } - SDW_DeclStructInstance( , Sphere ); + SDW_DeclStructInstance( Sphere ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -53,7 +53,7 @@ namespace { } - SDW_DeclStructInstance( , Aabb ); + SDW_DeclStructInstance( Aabb ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -89,7 +89,7 @@ namespace { } - SDW_DeclStructInstance( , Ray ); + SDW_DeclStructInstance( Ray ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { diff --git a/test/ShaderWriter/TestWriterShaderStage_RayMiss.cpp b/test/ShaderWriter/TestWriterShaderStage_RayMiss.cpp index 1899a811..5259688d 100644 --- a/test/ShaderWriter/TestWriterShaderStage_RayMiss.cpp +++ b/test/ShaderWriter/TestWriterShaderStage_RayMiss.cpp @@ -16,7 +16,7 @@ namespace { } - SDW_DeclStructInstance( , HitPayload ); + SDW_DeclStructInstance( HitPayload ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { diff --git a/test/ShaderWriter/TestWriterShaderStage_TaskEXT.cpp b/test/ShaderWriter/TestWriterShaderStage_TaskEXT.cpp index 5922f68b..658d2526 100644 --- a/test/ShaderWriter/TestWriterShaderStage_TaskEXT.cpp +++ b/test/ShaderWriter/TestWriterShaderStage_TaskEXT.cpp @@ -25,7 +25,7 @@ namespace { } - SDW_DeclStructInstance( , Constants ); + SDW_DeclStructInstance( Constants ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -87,7 +87,7 @@ namespace { } - SDW_DeclStructInstance( , Instance ); + SDW_DeclStructInstance( Instance ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -133,7 +133,7 @@ namespace { } - SDW_DeclStructInstance( , Meshlet ); + SDW_DeclStructInstance( Meshlet ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -177,7 +177,7 @@ namespace { } - SDW_DeclStructInstance( , Vertex ); + SDW_DeclStructInstance( Vertex ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -212,7 +212,7 @@ namespace { } - SDW_DeclStructInstance( , Index ); + SDW_DeclStructInstance( Index ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -245,7 +245,7 @@ namespace { } - SDW_DeclStructInstance( , CullData ); + SDW_DeclStructInstance( CullData ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -287,7 +287,7 @@ namespace { } - SDW_DeclStructInstance( , MeshInfo ); + SDW_DeclStructInstance( MeshInfo ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -331,7 +331,7 @@ namespace { } - SDW_DeclStructInstance( , PayloadT ); + SDW_DeclStructInstance( PayloadT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) @@ -384,7 +384,7 @@ namespace { } - SDW_DeclStructInstance( , MyVertexOutT ); + SDW_DeclStructInstance( MyVertexOutT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) diff --git a/test/ShaderWriter/TestWriterShaderStage_TaskNV.cpp b/test/ShaderWriter/TestWriterShaderStage_TaskNV.cpp index 25e4f5b0..9e7c7c9f 100644 --- a/test/ShaderWriter/TestWriterShaderStage_TaskNV.cpp +++ b/test/ShaderWriter/TestWriterShaderStage_TaskNV.cpp @@ -25,7 +25,7 @@ namespace { } - SDW_DeclStructInstance( , Constants ); + SDW_DeclStructInstance( Constants ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -87,7 +87,7 @@ namespace { } - SDW_DeclStructInstance( , Instance ); + SDW_DeclStructInstance( Instance ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -133,7 +133,7 @@ namespace { } - SDW_DeclStructInstance( , Meshlet ); + SDW_DeclStructInstance( Meshlet ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -177,7 +177,7 @@ namespace { } - SDW_DeclStructInstance( , Vertex ); + SDW_DeclStructInstance( Vertex ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -212,7 +212,7 @@ namespace { } - SDW_DeclStructInstance( , Index ); + SDW_DeclStructInstance( Index ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -245,7 +245,7 @@ namespace { } - SDW_DeclStructInstance( , CullData ); + SDW_DeclStructInstance( CullData ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -287,7 +287,7 @@ namespace { } - SDW_DeclStructInstance( , MeshInfo ); + SDW_DeclStructInstance( MeshInfo ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -331,7 +331,7 @@ namespace { } - SDW_DeclStructInstance( , PayloadT ); + SDW_DeclStructInstance( PayloadT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) @@ -384,7 +384,7 @@ namespace { } - SDW_DeclStructInstance( , MyVertexOutT ); + SDW_DeclStructInstance( MyVertexOutT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) diff --git a/test/ShaderWriter/TestWriterShaderStage_Task_EXT.cpp b/test/ShaderWriter/TestWriterShaderStage_Task_EXT.cpp index 7b427bcc..987ae342 100644 --- a/test/ShaderWriter/TestWriterShaderStage_Task_EXT.cpp +++ b/test/ShaderWriter/TestWriterShaderStage_Task_EXT.cpp @@ -28,7 +28,7 @@ namespace { } - SDW_DeclStructInstance( , Constants ); + SDW_DeclStructInstance( Constants ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -90,7 +90,7 @@ namespace { } - SDW_DeclStructInstance( , Instance ); + SDW_DeclStructInstance( Instance ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -136,7 +136,7 @@ namespace { } - SDW_DeclStructInstance( , Meshlet ); + SDW_DeclStructInstance( Meshlet ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -180,7 +180,7 @@ namespace { } - SDW_DeclStructInstance( , Vertex ); + SDW_DeclStructInstance( Vertex ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -215,7 +215,7 @@ namespace { } - SDW_DeclStructInstance( , Index ); + SDW_DeclStructInstance( Index ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -248,7 +248,7 @@ namespace { } - SDW_DeclStructInstance( , CullData ); + SDW_DeclStructInstance( CullData ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -290,7 +290,7 @@ namespace { } - SDW_DeclStructInstance( , MeshInfo ); + SDW_DeclStructInstance( MeshInfo ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -334,7 +334,7 @@ namespace { } - SDW_DeclStructInstance( , PayloadT ); + SDW_DeclStructInstance( PayloadT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) @@ -387,7 +387,7 @@ namespace { } - SDW_DeclStructInstance( , MyVertexOutT ); + SDW_DeclStructInstance( MyVertexOutT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) diff --git a/test/ShaderWriter/TestWriterShaderStage_Task_NV.cpp b/test/ShaderWriter/TestWriterShaderStage_Task_NV.cpp index 386b57af..3b730a9d 100644 --- a/test/ShaderWriter/TestWriterShaderStage_Task_NV.cpp +++ b/test/ShaderWriter/TestWriterShaderStage_Task_NV.cpp @@ -28,7 +28,7 @@ namespace { } - SDW_DeclStructInstance( , Constants ); + SDW_DeclStructInstance( Constants ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -90,7 +90,7 @@ namespace { } - SDW_DeclStructInstance( , Instance ); + SDW_DeclStructInstance( Instance ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -136,7 +136,7 @@ namespace { } - SDW_DeclStructInstance( , Meshlet ); + SDW_DeclStructInstance( Meshlet ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -180,7 +180,7 @@ namespace { } - SDW_DeclStructInstance( , Vertex ); + SDW_DeclStructInstance( Vertex ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -215,7 +215,7 @@ namespace { } - SDW_DeclStructInstance( , Index ); + SDW_DeclStructInstance( Index ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -248,7 +248,7 @@ namespace { } - SDW_DeclStructInstance( , CullData ); + SDW_DeclStructInstance( CullData ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -290,7 +290,7 @@ namespace { } - SDW_DeclStructInstance( , MeshInfo ); + SDW_DeclStructInstance( MeshInfo ); static sdw::type::BaseStructPtr makeType( sdw::type::TypesCache & cache ) { @@ -334,7 +334,7 @@ namespace { } - SDW_DeclStructInstance( , PayloadT ); + SDW_DeclStructInstance( PayloadT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) @@ -387,7 +387,7 @@ namespace { } - SDW_DeclStructInstance( , MyVertexOutT ); + SDW_DeclStructInstance( MyVertexOutT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) diff --git a/test/ShaderWriter/TestWriterShaderStage_TessellationControl.cpp b/test/ShaderWriter/TestWriterShaderStage_TessellationControl.cpp index 526006da..8ec5b176 100644 --- a/test/ShaderWriter/TestWriterShaderStage_TessellationControl.cpp +++ b/test/ShaderWriter/TestWriterShaderStage_TessellationControl.cpp @@ -18,7 +18,7 @@ namespace { } - SDW_DeclStructInstance( , PositionT ); + SDW_DeclStructInstance( PositionT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) @@ -73,7 +73,7 @@ namespace { } - SDW_DeclStructInstance( , SurfaceT ); + SDW_DeclStructInstance( SurfaceT ); template< sdw::var::Flag FlagU > SurfaceT operator=( SurfaceT< FlagU > const & rhs ) @@ -177,7 +177,7 @@ namespace { } - SDW_DeclStructInstance( , SimplePatchT ); + SDW_DeclStructInstance( SimplePatchT ); template< sdw::var::Flag FlagU > SimplePatchT operator=( SimplePatchT< FlagU > const & rhs ) @@ -242,7 +242,7 @@ namespace { } - SDW_DeclStructInstance( , PNTriPatchT ); + SDW_DeclStructInstance( PNTriPatchT ); template< sdw::var::Flag FlagU > PNTriPatchT operator=( PNTriPatchT< FlagU > const & rhs ) diff --git a/test/ShaderWriter/TestWriterShaderStage_TessellationEvaluation.cpp b/test/ShaderWriter/TestWriterShaderStage_TessellationEvaluation.cpp index 18704cd2..20b763a0 100644 --- a/test/ShaderWriter/TestWriterShaderStage_TessellationEvaluation.cpp +++ b/test/ShaderWriter/TestWriterShaderStage_TessellationEvaluation.cpp @@ -19,7 +19,7 @@ namespace { } - SDW_DeclStructInstance( , PositionT ); + SDW_DeclStructInstance( PositionT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) @@ -74,7 +74,7 @@ namespace { } - SDW_DeclStructInstance( , SurfaceT ); + SDW_DeclStructInstance( SurfaceT ); template< sdw::var::Flag FlagU > SurfaceT operator=( SurfaceT< FlagU > const & rhs ) @@ -178,7 +178,7 @@ namespace { } - SDW_DeclStructInstance( , SimplePatchT ); + SDW_DeclStructInstance( SimplePatchT ); template< sdw::var::Flag FlagU > SimplePatchT operator=( SimplePatchT< FlagU > const & rhs ) @@ -243,7 +243,7 @@ namespace { } - SDW_DeclStructInstance( , PNTriPatchT ); + SDW_DeclStructInstance( PNTriPatchT ); template< sdw::var::Flag FlagU > PNTriPatchT operator=( PNTriPatchT< FlagU > const & rhs ) diff --git a/test/ShaderWriter/TestWriterShaderStage_Vertex.cpp b/test/ShaderWriter/TestWriterShaderStage_Vertex.cpp index 23e264ca..0d9d8bed 100644 --- a/test/ShaderWriter/TestWriterShaderStage_Vertex.cpp +++ b/test/ShaderWriter/TestWriterShaderStage_Vertex.cpp @@ -18,7 +18,7 @@ namespace { } - SDW_DeclStructInstance( , PositionT ); + SDW_DeclStructInstance( PositionT ); static ast::type::IOStructPtr makeIOType( ast::type::TypesCache & cache , ast::EntryPoint entryPoint ) @@ -69,7 +69,7 @@ namespace { } - SDW_DeclStructInstance( , PosTexT ); + SDW_DeclStructInstance( PosTexT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) @@ -128,7 +128,7 @@ namespace { } - SDW_DeclStructInstance( , SmaaVertexInT ); + SDW_DeclStructInstance( SmaaVertexInT ); static ast::type::IOStructPtr makeIOType( ast::type::TypesCache & cache , ast::EntryPoint entryPoint ) @@ -187,7 +187,7 @@ namespace { } - SDW_DeclStructInstance( , SmaaVertexOutT ); + SDW_DeclStructInstance( SmaaVertexOutT ); static ast::type::IOStructPtr makeIOType( ast::type::TypesCache & cache , ast::EntryPoint entryPoint ) @@ -514,7 +514,7 @@ namespace { } - SDW_DeclStructInstance( , PositionT ); + SDW_DeclStructInstance( PositionT ); static sdw::type::IOStructPtr makeIOType( sdw::type::TypesCache & cache , ast::EntryPoint entryPoint ) diff --git a/test/ShaderWriter/WriterCommon.cpp b/test/ShaderWriter/WriterCommon.cpp index 60129b7a..91130bf4 100644 --- a/test/ShaderWriter/WriterCommon.cpp +++ b/test/ShaderWriter/WriterCommon.cpp @@ -113,6 +113,8 @@ namespace test { //***************************************************************************************** + TestSuite::~TestSuite() = default; + TestSuite::TestSuite( std::string const & name ) : test::TestSuite{ name } { @@ -144,6 +146,8 @@ namespace test //***************************************************************************************** + TestCounts::~TestCounts()noexcept = default; + TestCounts::TestCounts() : m_glsl{ SDWTest::glsl } , m_hlsl{ SDWTest::hlsl } @@ -534,6 +538,8 @@ std::shared_ptr< test::sdw_test::GLSLContext > SDWTest::glsl; std::shared_ptr< test::sdw_test::HLSLContext > SDWTest::hlsl; std::shared_ptr< test::sdw_test::SPIRVContext > SDWTest::spirv; +SDWTest::~SDWTest() = default; + void SDWTest::SetUpTestSuite() { test::createGLSLContext(); diff --git a/test/ShaderWriter/WriterCommon.hpp b/test/ShaderWriter/WriterCommon.hpp index 559c63bf..41531da2 100644 --- a/test/ShaderWriter/WriterCommon.hpp +++ b/test/ShaderWriter/WriterCommon.hpp @@ -74,26 +74,26 @@ namespace test : test::TestCounts { SDWTest_API TestCounts(); - SDWTest_API ~TestCounts()noexcept override = default; + SDWTest_API ~TestCounts()noexcept override; SDWTest_API TimerBlock beginTimer( std::string_view name ); SDWTest_API void printTime( std::string const & text ); - ASTTest_API void printBlock( std::string const & text )override; - ASTTest_API void printError( std::string const & text )override; + SDWTest_API void printBlock( std::string const & text )override; + SDWTest_API void printError( std::string const & text )override; - bool isSpirVInitialised( uint32_t infoIndex )const; - bool isSpvIgnored( uint32_t infoIndex, uint32_t ignoredSpvVersion )const; - uint32_t getVulkanVersion( uint32_t infoIndex )const; - uint32_t getSpirVVersion( uint32_t infoIndex )const; - uint32_t getSpirvInfosSize()const; + SDWTest_API bool isSpirVInitialised( uint32_t infoIndex )const; + SDWTest_API bool isSpvIgnored( uint32_t infoIndex, uint32_t ignoredSpvVersion )const; + SDWTest_API uint32_t getVulkanVersion( uint32_t infoIndex )const; + SDWTest_API uint32_t getSpirVVersion( uint32_t infoIndex )const; + SDWTest_API uint32_t getSpirvInfosSize()const; - bool isHlslInitialised( uint32_t infoIndex )const; - uint32_t getHlslVersion( uint32_t infoIndex )const; - uint32_t getHlslInfosSize()const; + SDWTest_API bool isHlslInitialised( uint32_t infoIndex )const; + SDWTest_API uint32_t getHlslVersion( uint32_t infoIndex )const; + SDWTest_API uint32_t getHlslInfosSize()const; - bool isGlslInitialised( uint32_t infoIndex )const; - uint32_t getGlslVersion( uint32_t infoIndex )const; - uint32_t getGlslInfosSize()const; + SDWTest_API bool isGlslInitialised( uint32_t infoIndex )const; + SDWTest_API uint32_t getGlslVersion( uint32_t infoIndex )const; + SDWTest_API uint32_t getGlslInfosSize()const; GLSLContext const & glsl()const { @@ -113,8 +113,8 @@ namespace test std::string expectedError; private: - void doInitialise()override; - void doCleanup()override; + SDWTest_API void doInitialise()override; + SDWTest_API void doCleanup()override; friend struct TimerBlock; void doEndTimer( std::string const & name, TimePoint startTime )noexcept; @@ -132,6 +132,7 @@ namespace test { public: SDWTest_API TestSuite( std::string const & name ); + SDWTest_API ~TestSuite()override; SDWTest_API void SetUp() override; SDWTest_API void TearDown() override; @@ -217,6 +218,8 @@ class SDWTest public: SDWTest_API static void SetUpTestSuite(); SDWTest_API static void TearDownTestSuite(); + + SDWTest_API ~SDWTest()override; SDWTest_API void SetUp() override; SDWTest_API void TearDown() override; diff --git a/test/ShaderWriter/WriterCommonSpirV.cpp b/test/ShaderWriter/WriterCommonSpirV.cpp index a1c94d7b..c873c1ce 100644 --- a/test/ShaderWriter/WriterCommonSpirV.cpp +++ b/test/ShaderWriter/WriterCommonSpirV.cpp @@ -254,7 +254,7 @@ namespace test::sdw_test try { auto cfg = getGlslConfig( glsl::v4_6, testCounts ); - auto glslangSpirv = compileGlslToSpv( stage + if ( auto glslangSpirv = compileGlslToSpv( stage , glsl::compileGlsl( *testCounts.allocatorBlock , shader , statements @@ -262,12 +262,15 @@ namespace test::sdw_test , specialisation , cfg ) , retrieveSPIRVVersion( testCounts, infoIndex ) ); - std::string glslangCompileErrors; - if ( test::compileSpirV( shader, glslangSpirv, glslangCompileErrors, testCounts, infoIndex ) ) + !glslangSpirv.empty() ) { - auto parsedShader = spirv::displaySpirv( *testCounts.allocatorBlock, glslangSpirv ); - errors += "glslang generated SPIR-V:\n" - + parsedShader; + std::string glslangCompileErrors; + if ( test::compileSpirV( shader, glslangSpirv, glslangCompileErrors, testCounts, infoIndex ) ) + { + auto parsedShader = spirv::displaySpirv( *testCounts.allocatorBlock, glslangSpirv ); + errors += "glslang generated SPIR-V:\n" + + parsedShader; + } } } catch ( std::exception & ) diff --git a/test/ShaderWriter/WriterCommonVulkanLayer.cpp b/test/ShaderWriter/WriterCommonVulkanLayer.cpp index bc2b08c9..47dd3958 100644 --- a/test/ShaderWriter/WriterCommonVulkanLayer.cpp +++ b/test/ShaderWriter/WriterCommonVulkanLayer.cpp @@ -257,7 +257,7 @@ namespace test::sdw_test , true , true ); auto cfg = getGlslConfig( glsl::v4_6, testCounts ); - auto glslangSpirv = compileGlslToSpv( entryPoint.stage + if ( auto glslangSpirv = compileGlslToSpv( entryPoint.stage , glsl::compileGlsl( *testCounts.allocatorBlock , shader , statements.get() @@ -265,11 +265,14 @@ namespace test::sdw_test , ast::SpecialisationInfo{} , cfg ) , config.specVersion ); - displayShader( "glslang SPIR-V" - , spirv::displaySpirv( *testCounts.allocatorBlock, glslangSpirv ) - , testCounts - , true - , false ); + !glslangSpirv.empty() ) + { + displayShader( "glslang SPIR-V" + , spirv::displaySpirv( *testCounts.allocatorBlock, glslangSpirv ) + , testCounts + , true + , false ); + } } #endif }