Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions include/ShaderAST/Expr/Expr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,13 @@ namespace ast::expr

class Expr
{
private:
Expr( Expr const & ) = delete;
Expr & operator=( Expr const & )noexcept = delete;
Expr( Expr && )noexcept = delete;
Expr & operator=( Expr && ) = delete;

public:
SDAST_API Expr( Expr const & ) = delete;
SDAST_API Expr & operator=( Expr const & )noexcept = delete;
SDAST_API Expr( Expr && )noexcept = delete;
SDAST_API Expr & operator=( Expr && ) = delete;
SDAST_API virtual ~Expr()noexcept = default;

SDAST_API Expr( ExprCache & exprCache
Expand Down
8 changes: 5 additions & 3 deletions include/ShaderAST/Shader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,13 @@ namespace ast
{
friend class ShaderBuilder;

private:
Shader( Shader const & ) = delete;
Shader & operator=( Shader const & ) = delete;
Shader & operator=( Shader && rhs )noexcept = delete;

public:
SDAST_API Shader( Shader const & ) = delete;
SDAST_API Shader & operator=( Shader const & ) = delete;
SDAST_API Shader( Shader && rhs )noexcept;
SDAST_API Shader & operator=( Shader && rhs )noexcept = delete;

SDAST_API explicit Shader( ast::ShaderStage type
, ShaderAllocator * allocator = nullptr );
Expand Down
6 changes: 4 additions & 2 deletions include/ShaderAST/ShaderAllocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,12 @@ namespace ast

class ShaderAllocatorBlock
{
private:
ShaderAllocatorBlock( ShaderAllocatorBlock const & rhs ) = delete;
ShaderAllocatorBlock & operator=( ShaderAllocatorBlock const & rhs ) = delete;

public:
SDAST_API explicit ShaderAllocatorBlock( ShaderAllocator & allocator )noexcept;
SDAST_API ShaderAllocatorBlock( ShaderAllocatorBlock const & rhs ) = delete;
SDAST_API ShaderAllocatorBlock & operator=( ShaderAllocatorBlock const & rhs ) = delete;
SDAST_API ShaderAllocatorBlock( ShaderAllocatorBlock && rhs )noexcept;
SDAST_API ShaderAllocatorBlock & operator=( ShaderAllocatorBlock && rhs )noexcept;
SDAST_API ~ShaderAllocatorBlock()noexcept;
Expand Down
5 changes: 3 additions & 2 deletions include/ShaderAST/Type/Type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ namespace ast::type
friend class TypeCache;
friend class Struct;

Type( Type const & ) = delete;
Type & operator=( Type const & ) = delete;

public:
SDAST_API Type( TypesCache & typesCache
, Kind kind );
Expand All @@ -290,8 +293,6 @@ namespace ast::type
SDAST_API Type const * getNonMemberType()const;

SDAST_API virtual ~Type()noexcept = default;
SDAST_API Type( Type const & ) = delete;
SDAST_API Type & operator=( Type const & ) = delete;

Kind getRawKind()const
{
Expand Down
3 changes: 3 additions & 0 deletions include/ShaderWriter/BaseTypes/NonUniform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ namespace sdw
struct NonUniformT
: public ValueT
{
private:
NonUniformT( NonUniformT const & rhs ) = delete;
NonUniformT & operator=( NonUniformT const & rhs ) = delete;
NonUniformT & operator=( NonUniformT && rhs ) = delete;

public:
~NonUniformT()noexcept override = default;

NonUniformT( ShaderWriter & writer
Expand Down
2 changes: 2 additions & 0 deletions include/ShaderWriter/BaseTypes/ReturnWrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ namespace sdw
struct ReturnWrapperT
: public ValueT
{
private:
ReturnWrapperT( ReturnWrapperT const & rhs ) = delete;
ReturnWrapperT & operator=( ReturnWrapperT const & rhs ) = delete;
ReturnWrapperT & operator=( ReturnWrapperT && rhs )noexcept = delete;

public:
ReturnWrapperT( ShaderWriter & writer
, expr::ExprPtr expr
, bool enabled );
Expand Down
2 changes: 2 additions & 0 deletions include/ShaderWriter/CompositeTypes/StructHelper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ See LICENSE file in root folder

#include "ShaderWriter/BaseTypes/Void.hpp"

#include <algorithm>

namespace sdw
{
template< size_t N >
Expand Down
41 changes: 23 additions & 18 deletions include/ShaderWriter/Writer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1037,10 +1037,11 @@ namespace sdw
template< typename WriterT >
struct WriterScopeT
{
public:
private:
WriterScopeT( WriterScopeT const & rhs ) = delete;
WriterScopeT & operator=( WriterScopeT const& rhs ) = delete;
WriterScopeT & operator=( WriterScopeT const & rhs ) = delete;

public:
WriterScopeT( WriterScopeT && rhs )noexcept
: m_writer{ rhs.m_writer }
{
Expand Down Expand Up @@ -1094,7 +1095,9 @@ namespace sdw
}
}

#define FOR( Writer, Type, Name, Init, Cond, Incr )\
#if !defined( SDW_DISABLE_CTRL_MACROS )

#define sdwFOR( Writer, Type, Name, Init, Cond, Incr )\
if ( auto writerScope = makeScope( Writer ) )\
{\
auto ctrlVar##Name = ( Writer ).registerLoopVar( #Name, Type::makeType( ( Writer ).getTypesCache() ) );\
Expand All @@ -1109,61 +1112,63 @@ namespace sdw
, sdw::makeExpr( Writer, incr##Name )\
, [&]()noexcept

#define ROF\
#define sdwROF\
);\
}

#define WHILE( Writer, Condition )\
#define sdwWHILE( Writer, Condition )\
( Writer ).whileStmt( sdw::makeCondition( Condition )\
, [&]()noexcept

#define ELIHW\
#define sdwELIHW\
);

#define DOWHILE( Writer, Condition )\
#define sdwDOWHILE( Writer, Condition )\
( Writer ).doWhileStmt( sdw::makeCondition( Condition )\
, [&]()noexcept

#define ELIHWOD\
#define sdwELIHWOD\
);

#define IF( Writer, Condition )\
#define sdwIF( Writer, Condition )\
( Writer ).ifStmt( sdw::makeCondition( Condition )\
, [&]()noexcept

#define ELSE\
#define sdwELSE\
).elseStmt( [&]()noexcept

#define ELSEIF( Condition )\
#define sdwELSEIF( Condition )\
).elseIfStmt( sdw::makeCondition( Condition )\
, [&]()noexcept

#define FI\
#define sdwFI\
).endIf();

#define SWITCH( Writer, Value )\
#define sdwSWITCH( Writer, Value )\
if ( auto writerScope = makeScope( Writer ) )\
{\
writerScope->switchStmt( sdw::makeExpr( *writerScope, Value )\
, [&]()noexcept

#define CASE( Literal )\
#define sdwCASE( Literal )\
writerScope->caseStmt( sdw::makeLiteral( *writerScope, Literal )\
, [&]()noexcept

#define ESAC\
#define sdwESAC\
)

#define DEFAULT\
#define sdwDEFAULT\
writerScope->defaultStmt( [&]()noexcept

#define TLUAFED\
#define sdwTLUAFED\
)

#define HCTIWS\
#define sdwHCTIWS\
).endSwitch();\
}

#endif

#include "Writer.inl"

#endif
2 changes: 2 additions & 0 deletions source/CompilerGlsl/compileGlsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ See LICENSE file in root folder
#include <ShaderAST/Visitors/SpecialiseStatements.hpp>
#include <ShaderAST/Visitors/TransformSSA.hpp>

#include <algorithm>

namespace glsl
{
std::string compileGlsl( ast::ShaderAllocatorBlock & allocator
Expand Down
1 change: 1 addition & 0 deletions source/CompilerHlsl/HlslGenerateStatements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ See LICENSE file in root folder

#pragma warning( disable:4365 )
#pragma warning( disable:5262 )
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <sstream>
Expand Down
1 change: 1 addition & 0 deletions source/CompilerHlsl/HlslHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ See LICENSE file in root folder
#include <ShaderAST/Visitors/CloneExpr.hpp>
#include <ShaderAST/Visitors/GetExprName.hpp>

#include <algorithm>
#include <stdexcept>

namespace hlsl
Expand Down
1 change: 1 addition & 0 deletions source/CompilerHlsl/HlslHelpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ See LICENSE file in root folder
#include <ShaderAST/Stmt/StmtInputGeometryLayout.hpp>
#include <ShaderAST/Stmt/StmtOutputGeometryLayout.hpp>

#include <algorithm>
#include <set>
#include <unordered_set>

Expand Down
2 changes: 2 additions & 0 deletions source/CompilerHlsl/compileHlsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ See LICENSE file in root folder
#include <ShaderAST/Visitors/SpecialiseStatements.hpp>
#include <ShaderAST/Visitors/TransformSSA.hpp>

#include <algorithm>

namespace hlsl
{
namespace
Expand Down
3 changes: 3 additions & 0 deletions source/CompilerSpirV/SpirVBlock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ namespace spirv

struct Block
{
private:
Block( Block const & rhs ) = delete;
Block & operator=( Block const & rhs ) = delete;

public:
SDWSPIRV_API Block( Block && rhs )noexcept;
SDWSPIRV_API Block & operator=( Block && rhs )noexcept;
SDWSPIRV_API ~Block()noexcept = default;
Expand Down
3 changes: 3 additions & 0 deletions source/CompilerSpirV/SpirVFunction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,11 @@ namespace spirv

struct Function
{
private:
Function( Function const & rhs ) = delete;
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;
Expand Down
1 change: 1 addition & 0 deletions source/CompilerSpirV/SpirVHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ See LICENSE file in root folder
#include <ShaderAST/Visitors/GetExprName.hpp>
#include <ShaderAST/Visitors/SimplifyStatements.hpp>

#include <algorithm>
#include <sstream>

namespace spirv
Expand Down
2 changes: 2 additions & 0 deletions source/CompilerSpirV/SpirVModuleLiterals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ See LICENSE file in root folder

#include "CompilerSpirV/SpirVModule.hpp"

#include <algorithm>

namespace spirv
{
//*************************************************************************
Expand Down
2 changes: 2 additions & 0 deletions source/CompilerSpirV/SpirVModuleTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ See LICENSE file in root folder

#include <ShaderAST/Type/TypeCache.hpp>

#include <algorithm>

namespace spirv
{
//*************************************************************************
Expand Down
1 change: 1 addition & 0 deletions source/CompilerSpirV/compileSpirV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ See LICENSE file in root folder
#include <ShaderAST/Visitors/SimplifyStatements.hpp>
#include <ShaderAST/Visitors/TransformSSA.hpp>

#include <algorithm>
#include <iostream>

namespace spirv
Expand Down
1 change: 1 addition & 0 deletions source/GlslCommon/GenerateGlslStatements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ See LICENSE file in root folder
#include <ShaderAST/Type/TypeCombinedImage.hpp>
#include <ShaderAST/Visitors/SimplifyStatements.hpp>

#include <algorithm>
#include <cmath>
#include <cstring>
#pragma warning( push )
Expand Down
1 change: 1 addition & 0 deletions source/ShaderAST/ShaderAllocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ See LICENSE file in root folder
#include "ShaderAST/ShaderAllocator.hpp"
#include "ShaderAST/ShaderLog.hpp"

#include <algorithm>
#pragma warning( push )
#pragma warning( disable: 4365 )
#pragma warning( disable: 5262 )
Expand Down
1 change: 1 addition & 0 deletions source/ShaderAST/Visitors/ResolveConstants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ See LICENSE file in root folder
#include "ShaderAST/Visitors/GetExprName.hpp"
#include "ShaderAST/Visitors/SimplifyStatements.hpp"

#include <algorithm>
#include <cmath>
#include <numbers>
#include <math.h>
Expand Down
3 changes: 3 additions & 0 deletions source/ShaderAST/Visitors/SelectEntryPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,11 @@ namespace ast

struct Used
{
private:
Used( Used const & ) = delete;
Used & operator=( Used const & ) = delete;

public:
Used( Used && )noexcept = default;
Used & operator=( Used && )noexcept = default;

Expand Down
2 changes: 2 additions & 0 deletions source/ShaderAST/Visitors/TransformSSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ See LICENSE file in root folder
#include "ShaderAST/Visitors/GetExprName.hpp"
#include "ShaderAST/Visitors/SimplifyStatements.hpp"

#include <algorithm>

namespace ast
{
namespace ssa
Expand Down
1 change: 1 addition & 0 deletions source/VulkanLayer/ProgramPipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ See LICENSE file in root folder

#include <CompilerSpirV/compileSpirV.hpp>

#include <algorithm>
#pragma warning( push )
#pragma warning( disable: 4365 )
#pragma warning( disable: 5262 )
Expand Down
1 change: 1 addition & 0 deletions source/VulkanLayer/ShaderDataPtr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ See LICENSE file in root folder
*/
#include "VulkanLayer/ShaderDataPtr.hpp"

#include <algorithm>
#pragma warning( push )
#pragma warning( disable: 4365 )
#pragma warning( disable: 5262 )
Expand Down
1 change: 1 addition & 0 deletions test/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# include <sys/sysctl.h>
#endif

#include <algorithm>
#include <thread>

namespace test
Expand Down
2 changes: 2 additions & 0 deletions test/ShaderWriter/CompileSPIRV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -757,11 +757,13 @@ namespace test
{
struct SPIRVContext
{
private:
SPIRVContext( SPIRVContext const & ) = delete;
SPIRVContext & operator=( SPIRVContext const & ) = delete;
SPIRVContext( SPIRVContext && )noexcept = delete;
SPIRVContext & operator=( SPIRVContext && )noexcept = delete;

public:
SPIRVContext()noexcept
{
static const std::vector< uint32_t > spvVersions{ spv1_0, spv1_1, spv1_2, spv1_3, spv1_4, spv1_5, spv1_6 };
Expand Down
Loading
Loading