Skip to content

Commit

Permalink
Fixed remaining warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
DragonJoker committed Sep 29, 2023
1 parent 9a15195 commit ba421a9
Show file tree
Hide file tree
Showing 38 changed files with 246 additions and 268 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
shell: bash
working-directory: ${{runner.workspace}}/build-${{ matrix.buildType }}
run: |
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.buildType }} -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/external/vcpkg/scripts/buildsystems/vcpkg.cmake -DSDW_UNITY_BUILD=ON -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/package/shaderwriter -DPROJECTS_WARNINGS_AS_ERRORS=$PROJ_WAE -DSDW_GENERATE_SOURCE=OFF -DSDW_BUILD_TESTS=ON -DSDW_TESTS_ENABLE_VALIDATION=OFF -DSDW_ALL_TESTS=OFF
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.buildType }} --preset ci -DPROJECTS_WARNINGS_AS_ERRORS=$PROJ_WAE
- name: Build
if: (steps.configure.conclusion == 'success')
id: build
Expand All @@ -72,7 +72,7 @@ jobs:
shell: bash
run: |
cmake --install . --config ${{ matrix.buildType }}
7z a $GITHUB_WORKSPACE/ShaderWriter-${{ matrix.os[1] }}.zip $GITHUB_WORKSPACE/package/shaderwriter/
7z a $GITHUB_WORKSPACE/ShaderWriter-${{ matrix.os[1] }}.zip $GITHUB_WORKSPACE/package/ShaderWriter/
- name: Clean build folder
if: (steps.build.conclusion == 'success')
working-directory: ${{runner.workspace}}/build-${{ matrix.buildType }}
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
shell: bash
working-directory: ${{runner.workspace}}/build-${{ matrix.buildType }}
run: |
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.buildType }} -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/external/vcpkg/scripts/buildsystems/vcpkg.cmake -DSDW_UNITY_BUILD=ON -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/package/shaderwriter -DPROJECTS_WARNINGS_AS_ERRORS=$PROJ_WAE -DSDW_GENERATE_SOURCE=OFF -DSDW_BUILD_TESTS=ON -DSDW_TESTS_ENABLE_VALIDATION=OFF -DSDW_ALL_TESTS=OFF
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.buildType }} --preset ci -DPROJECTS_WARNINGS_AS_ERRORS=$PROJ_WAE
- name: Build
if: (steps.configure.conclusion == 'success')
id: build
Expand All @@ -139,7 +139,7 @@ jobs:
shell: bash
run: |
cmake --install . --config ${{ matrix.buildType }}
7z a $GITHUB_WORKSPACE/ShaderWriter-${{ matrix.os[1] }}.zip $GITHUB_WORKSPACE/package/shaderwriter/
7z a $GITHUB_WORKSPACE/ShaderWriter-${{ matrix.os[1] }}.zip $GITHUB_WORKSPACE/package/ShaderWriter/
- name: Clean build folder
if: (steps.build.conclusion == 'success')
working-directory: ${{runner.workspace}}/build-${{ matrix.buildType }}
Expand Down Expand Up @@ -199,7 +199,7 @@ jobs:
shell: bash
working-directory: ${{runner.workspace}}/build-${{ matrix.buildType }}
run: |
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.buildType }} -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/external/vcpkg/scripts/buildsystems/vcpkg.cmake -DSDW_UNITY_BUILD=ON -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/package/shaderwriter -DPROJECTS_WARNINGS_AS_ERRORS=$PROJ_WAE -DSDW_GENERATE_SOURCE=OFF -DSDW_BUILD_TESTS=ON -DSDW_TESTS_ENABLE_VALIDATION=OFF -DSDW_ALL_TESTS=OFF
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.buildType }} --preset ci -DPROJECTS_WARNINGS_AS_ERRORS=$PROJ_WAE
- name: Build
if: (steps.configure.conclusion == 'success')
id: build
Expand All @@ -219,7 +219,7 @@ jobs:
shell: bash
run: |
cmake --install . --config ${{ matrix.buildType }}
7z a $GITHUB_WORKSPACE/ShaderWriter-${{ matrix.os[1] }}.zip $GITHUB_WORKSPACE/package/shaderwriter/
7z a $GITHUB_WORKSPACE/ShaderWriter-${{ matrix.os[1] }}.zip $GITHUB_WORKSPACE/package/ShaderWriter/
- name: Clean build folder
if: (steps.build.conclusion == 'success')
working-directory: ${{runner.workspace}}/build-${{ matrix.buildType }}
Expand Down
25 changes: 25 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,31 @@
"description": "Build configuration using Ninja, for ShaderWriter developers",
"inherits": "dev-base",
"generator": "Ninja"
},
{
"name": "ci",
"installDir": "${sourceDir}/package/ShaderWriter",
"displayName": "ShaderWriter CI Config",
"description": "Build configuration using Ninja, for ShaderWriter CI",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/external/vcpkg/scripts/buildsystems/vcpkg.cmake",
"SDW_ALL_TESTS": false,
"SDW_BUILD_EXPORTERS": true,
"SDW_BUILD_EXPORTER_GLSL": true,
"SDW_BUILD_EXPORTER_HLSL": true,
"SDW_BUILD_EXPORTER_SPIRV": true,
"SDW_BUILD_TESTS": true,
"SDW_BUILD_VULKAN_LAYER": true,
"SDW_BUILD_STATIC_EXPORTERS": false,
"SDW_BUILD_STATIC_SDAST": false,
"SDW_BUILD_STATIC_SDW": false,
"SDW_BUILD_STATIC": false,
"SDW_GENERATE_SOURCE": false,
"SDW_TESTS_ENABLE_VALIDATION": false,
"SDW_UNITY_BUILD": true,
"PROJECTS_WARNINGS_AS_ERRORS": true,
"PROJECTS_OUTPUT_DIR": "${sourceDir}"
}
}
]
}
2 changes: 1 addition & 1 deletion include/ShaderAST/Expr/ExprCache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace ast::expr
class ExprCache
{
public:
SDAST_API ExprCache( ShaderAllocatorBlock & allocator );
SDAST_API explicit ExprCache( ShaderAllocatorBlock & allocator );
SDAST_API ~ExprCache() = default;

SDAST_API AddPtr makeAdd( type::TypePtr type, ExprPtr lhs, ExprPtr rhs );
Expand Down
4 changes: 3 additions & 1 deletion include/ShaderAST/ShaderAllocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ See LICENSE file in root folder

#include "ShaderASTPrerequisites.hpp"

#include <list>
#include <memory>
#include <unordered_map>
#include <vector>

namespace ast
Expand Down Expand Up @@ -122,7 +124,7 @@ namespace ast
friend class ShaderAllocatorBlock;

public:
SDAST_API ShaderAllocator( AllocationMode allocationMode = AllocationMode::eFragmented );
SDAST_API explicit ShaderAllocator( AllocationMode allocationMode = AllocationMode::eFragmented );
SDAST_API ~ShaderAllocator() = default;

SDAST_API void * allocate( size_t size );
Expand Down
2 changes: 1 addition & 1 deletion include/ShaderAST/Stmt/PreprocEndif.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ast::stmt
: public Stmt
{
public:
SDAST_API PreprocEndif( StmtCache & stmtCache );
SDAST_API explicit PreprocEndif( StmtCache & stmtCache );

SDAST_API void accept( VisitorPtr vis )override;
};
Expand Down
2 changes: 1 addition & 1 deletion include/ShaderAST/Stmt/StmtCache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace ast::stmt
class StmtCache
{
public:
SDAST_API StmtCache( ShaderAllocatorBlock & allocator );
SDAST_API explicit StmtCache( ShaderAllocatorBlock & allocator );
SDAST_API ~StmtCache() = default;

SDAST_API PreprocDefinePtr makePreprocDefine( EntityName nameId, std::string name, expr::ExprPtr expr );
Expand Down
4 changes: 2 additions & 2 deletions include/ShaderAST/Stmt/StmtCompound.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ namespace ast::stmt
: public Container
{
protected:
SDAST_API explicit Compound( StmtCache & stmtCache
SDAST_API Compound( StmtCache & stmtCache
, size_t size
, Kind kind );

public:
SDAST_API Compound( StmtCache & stmtCache );
SDAST_API explicit Compound( StmtCache & stmtCache );

SDAST_API void accept( VisitorPtr vis )override;
};
Expand Down
2 changes: 1 addition & 1 deletion include/ShaderAST/Stmt/StmtContainer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ast::stmt
: public Stmt
{
protected:
SDAST_API explicit Container( StmtCache & stmtCache
SDAST_API Container( StmtCache & stmtCache
, size_t size
, Kind kind );

Expand Down
2 changes: 1 addition & 1 deletion include/ShaderAST/Stmt/StmtContinue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ast::stmt
: public Stmt
{
public:
SDAST_API Continue( StmtCache & stmtCache );
SDAST_API explicit Continue( StmtCache & stmtCache );

SDAST_API void accept( VisitorPtr vis )override;
};
Expand Down
2 changes: 1 addition & 1 deletion include/ShaderAST/Stmt/StmtDemote.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ast::stmt
: public Stmt
{
public:
SDAST_API Demote( StmtCache & stmtCache );
SDAST_API explicit Demote( StmtCache & stmtCache );

SDAST_API void accept( VisitorPtr vis )override;
};
Expand Down
2 changes: 1 addition & 1 deletion include/ShaderAST/Stmt/StmtIgnoreIntersection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace ast::stmt
: public Stmt
{
public:
SDAST_API IgnoreIntersection( StmtCache & stmtCache );
SDAST_API explicit IgnoreIntersection( StmtCache & stmtCache );

SDAST_API void accept( VisitorPtr vis )override;
};
Expand Down
2 changes: 1 addition & 1 deletion include/ShaderAST/Stmt/StmtTerminateInvocation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ast::stmt
: public Stmt
{
public:
SDAST_API TerminateInvocation( StmtCache & stmtCache );
SDAST_API explicit TerminateInvocation( StmtCache & stmtCache );

SDAST_API void accept( VisitorPtr vis )override;
};
Expand Down
2 changes: 1 addition & 1 deletion include/ShaderAST/Stmt/StmtTerminateRay.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace ast::stmt
: public Stmt
{
public:
SDAST_API TerminateRay( StmtCache & stmtCache );
SDAST_API explicit TerminateRay( StmtCache & stmtCache );

SDAST_API void accept( VisitorPtr vis )override;
};
Expand Down
5 changes: 2 additions & 3 deletions include/ShaderAST/Visitors/CloneExpr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ namespace ast
SDAST_API explicit ExprCloner( expr::ExprCache & exprCache
, expr::ExprPtr & result );

private:
protected:
SDAST_API virtual expr::ExprPtr doSubmit( expr::Expr * expr );
SDAST_API virtual expr::ExprPtr doSubmit( expr::ExprPtr const & expr );
SDAST_API expr::ExprPtr doSubmit( expr::ExprPtr const & expr );

protected:
SDAST_API void visitAddExpr( expr::Add * expr )override;
SDAST_API void visitAddAssignExpr( expr::AddAssign * expr )override;
SDAST_API void visitAggrInitExpr( expr::AggrInit * expr )override;
Expand Down
2 changes: 1 addition & 1 deletion include/ShaderAST/Visitors/CloneStmt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace ast

protected:
SDAST_API virtual expr::ExprPtr doSubmit( expr::Expr * expr );
SDAST_API virtual expr::ExprPtr doSubmit( expr::ExprPtr const & expr );
SDAST_API expr::ExprPtr doSubmit( expr::ExprPtr const & expr );

SDAST_API void visitContainerStmt( stmt::Container * cont )override;
SDAST_API void visitAccelerationStructureDeclStmt( stmt::AccelerationStructureDecl * stmt )override;
Expand Down
2 changes: 1 addition & 1 deletion include/ShaderWriter/RayIntersectionWriter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ namespace sdw
: public ShaderWriter
{
public:
SDW_API RayIntersectionWriter( ShaderAllocator * allocator = nullptr );
SDW_API explicit RayIntersectionWriter( ShaderAllocator * allocator = nullptr );

SDW_API void implementMain( RayIntersectionMainFunc const & function );
};
Expand Down
5 changes: 0 additions & 5 deletions source/CompilerGlsl/GlslExprAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,6 @@ namespace glsl
return result;
}

ast::expr::ExprPtr ExprAdapter::doSubmit( ast::expr::ExprPtr const & expr )
{
return doSubmit( expr.get() );
}

void ExprAdapter::visitAssignExpr( ast::expr::Assign * expr )
{
auto lhs = expr->getLHS();
Expand Down
2 changes: 1 addition & 1 deletion source/CompilerGlsl/GlslExprAdapter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ namespace glsl
, ast::stmt::Container * container
, ast::expr::ExprPtr & result );

using ast::ExprCloner::doSubmit;
ast::expr::ExprPtr doSubmit( ast::expr::Expr * expr )override;
ast::expr::ExprPtr doSubmit( ast::expr::ExprPtr const & expr )override;
void visitAssignExpr( ast::expr::Assign * expr )override;
void visitArrayAccessExpr( ast::expr::ArrayAccess * expr )override;
void visitIdentifierExpr( ast::expr::Identifier * expr )override;
Expand Down
5 changes: 0 additions & 5 deletions source/CompilerGlsl/GlslStmtAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,11 +432,6 @@ namespace glsl
, m_adaptationData
, m_current );
}

ast::expr::ExprPtr StmtAdapter::doSubmit( ast::expr::ExprPtr const & expr )
{
return doSubmit( expr.get() );
}

void StmtAdapter::visitConstantBufferDeclStmt( ast::stmt::ConstantBufferDecl * stmt )
{
Expand Down
2 changes: 1 addition & 1 deletion source/CompilerGlsl/GlslStmtAdapter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ namespace glsl
, ast::stmt::Container * globalsCont
, ast::stmt::ContainerPtr & result );

using ast::StmtCloner::doSubmit;
ast::expr::ExprPtr doSubmit( ast::expr::Expr * expr )override;
ast::expr::ExprPtr doSubmit( ast::expr::ExprPtr const & expr )override;

void visitConstantBufferDeclStmt( ast::stmt::ConstantBufferDecl * stmt )override;
void visitFunctionDeclStmt( ast::stmt::FunctionDecl * stmt )override;
Expand Down
5 changes: 0 additions & 5 deletions source/CompilerHlsl/HlslExprAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,11 +503,6 @@ namespace hlsl
return result;
}

ast::expr::ExprPtr ExprAdapter::doSubmit( ast::expr::ExprPtr const & expr )
{
return doSubmit( expr.get() );
}

void ExprAdapter::visitArrayAccessExpr( ast::expr::ArrayAccess * expr )
{
auto arrayIndex = doSubmit( expr->getRHS() );
Expand Down
2 changes: 1 addition & 1 deletion source/CompilerHlsl/HlslExprAdapter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ namespace hlsl
, ast::stmt::Container * intrinsics
, bool preventVarTypeReplacement );

using ast::ExprCloner::doSubmit;
ast::expr::ExprPtr doSubmit( ast::expr::Expr * expr )override;
ast::expr::ExprPtr doSubmit( ast::expr::ExprPtr const & expr )override;
void visitArrayAccessExpr( ast::expr::ArrayAccess * expr )override;
void visitCompositeConstructExpr( ast::expr::CompositeConstruct * expr )override;
void visitIdentifierExpr( ast::expr::Identifier * expr )override;
Expand Down
5 changes: 0 additions & 5 deletions source/CompilerHlsl/HlslStmtAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ namespace hlsl
, false );
}

ast::expr::ExprPtr StmtAdapter::doSubmit( ast::expr::ExprPtr const & expr )
{
return doSubmit( expr.get() );
}

void StmtAdapter::linkVars( ast::var::VariablePtr textureSampler
, ast::var::VariablePtr texture
, ast::var::VariablePtr sampler )
Expand Down
2 changes: 1 addition & 1 deletion source/CompilerHlsl/HlslStmtAdapter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ namespace hlsl
, AdaptationData & adaptationData
, ast::stmt::ContainerPtr & result );

using ast::StmtCloner::doSubmit;
ast::expr::ExprPtr doSubmit( ast::expr::Expr * expr )override;
ast::expr::ExprPtr doSubmit( ast::expr::ExprPtr const & expr )override;

void linkVars( ast::var::VariablePtr textureSampler
, ast::var::VariablePtr texture
Expand Down
1 change: 1 addition & 0 deletions source/CompilerHlsl/HlslVariableReplacer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ namespace hlsl
, ast::var::VariablePtr origin
, ast::var::VariablePtr replacement );

using ast::ExprCloner::doSubmit;
ast::expr::ExprPtr doSubmit( ast::expr::Expr * expr )override;
void visitIdentifierExpr( ast::expr::Identifier * expr )override;

Expand Down
5 changes: 0 additions & 5 deletions source/CompilerSpirV/SpirvExprAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,6 @@ namespace spirv
return result;
}

ast::expr::ExprPtr ExprAdapter::doSubmit( ast::expr::ExprPtr const & expr )
{
return doSubmit( expr.get() );
}

void ExprAdapter::visitAssignExpr( ast::expr::Assign * expr )
{
TraceFunc;
Expand Down
2 changes: 1 addition & 1 deletion source/CompilerSpirV/SpirvExprAdapter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ namespace spirv
, AdaptationData & adaptationData
, ast::expr::ExprPtr & result );

using ast::ExprCloner::doSubmit;
ast::expr::ExprPtr doSubmit( ast::expr::Expr * expr )override;
ast::expr::ExprPtr doSubmit( ast::expr::ExprPtr const & expr )override;
void visitAssignExpr( ast::expr::Assign * expr )override;
void visitIdentifierExpr( ast::expr::Identifier * expr )override;
void visitIntrinsicCallExpr( ast::expr::IntrinsicCall * expr )override;
Expand Down
5 changes: 0 additions & 5 deletions source/CompilerSpirV/SpirvStmtAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ namespace spirv
return ExprAdapter::submit( m_exprCache, m_typesCache, expr, m_current, m_ioDeclarations, m_adaptationData );
}

ast::expr::ExprPtr StmtAdapter::doSubmit( ast::expr::ExprPtr const & expr )
{
return doSubmit( expr.get() );
}

void StmtAdapter::visitElseIfStmt( ast::stmt::ElseIf * stmt )
{
AST_Failure( "Unexpected ElseIf statement." );
Expand Down
4 changes: 2 additions & 2 deletions source/CompilerSpirV/SpirvStmtAdapter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ namespace spirv
, ast::type::TypesCache & typesCache
, ast::stmt::ContainerPtr & result
, AdaptationData & adaptationData );


using ast::StmtCloner::doSubmit;
ast::expr::ExprPtr doSubmit( ast::expr::Expr * expr )override;
ast::expr::ExprPtr doSubmit( ast::expr::ExprPtr const & expr )override;

void visitElseIfStmt( ast::stmt::ElseIf * stmt )override;
void visitElseStmt( ast::stmt::Else * stmt )override;
Expand Down
1 change: 0 additions & 1 deletion source/CompilerSpirV/compileSpirV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ namespace spirv
private:
ast::type::TypePtr type;
ast::var::VariablePtr var;
ast::expr::Expr * expr{};
};

auto module = spirv::Module::deserialize( spirv );
Expand Down
Loading

0 comments on commit ba421a9

Please sign in to comment.