Skip to content

Commit

Permalink
Compilation: Fixed some warnings from GCC and Clang.
Browse files Browse the repository at this point in the history
  • Loading branch information
DragonJoker committed Nov 20, 2024
1 parent f3d8529 commit 7722fdd
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 29 deletions.
3 changes: 1 addition & 2 deletions include/Core/Castor3D/Shader/LightingModelFactory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace castor3d
using ObjPtr = PtrType;
struct LightingModel
{
LightingModel( castor::String name = {}
explicit LightingModel( castor::String name = {}
, Creator create = {}
, shader::LightingModelDesc defaultDesc = {} )
: name{ std::move( name ) }
Expand Down Expand Up @@ -302,7 +302,6 @@ namespace castor3d
, shader::LightingModelNames const & descNames );

private:
LightingModelID m_currentId{};
ObjCont m_registered;
LightingModelCont m_models;
shader::DiffuseBrdfArray m_diffuseBrdfs;
Expand Down
2 changes: 1 addition & 1 deletion include/Core/Castor3D/Shader/Shaders/GlslLighting.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace castor3d::shader
class ScatteringModel
{
public:
C3D_API ScatteringModel( sdw::ShaderWriter & writer );
C3D_API explicit ScatteringModel( sdw::ShaderWriter & writer );
C3D_API virtual ~ScatteringModel() = default;

C3D_API virtual void initialiseBackground( BackgroundModel & background
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace castor3d
{
//*********************************************************************************************

namespace trscmp
namespace dftrclmk
{
static CU_ImplementAttributeParserBlock( parserUnitTransmissionMask, TextureContext )
{
Expand Down Expand Up @@ -133,25 +133,25 @@ namespace castor3d
castor::addParserT( parsers
, CSCNSection::eTexture
, cuT( "diffuse_transmission_colour_mask" )
, trscmp::parserUnitTransmissionMask
, dftrclmk::parserUnitTransmissionMask
, { castor::makeParameter< castor::ParameterType::eUInt32 >() } );

castor::addParserT( parsers
, CSCNSection::eTextureUnit
, cuT( "diffuse_transmission_colour_mask" )
, trscmp::parserUnitTransmissionMask
, dftrclmk::parserUnitTransmissionMask
, { castor::makeParameter< castor::ParameterType::eUInt32 >() } );

castor::addParserT( parsers
, CSCNSection::eTextureRemap
, CSCNSection::eTextureRemapChannel
, cuT( "diffuse_transmission_colour" )
, trscmp::parserTexRemapTransmission );
, dftrclmk::parserTexRemapTransmission );

castor::addParserT( parsers
, CSCNSection::eTextureRemapChannel
, cuT( "diffuse_transmission_colour_mask" )
, trscmp::parserTexRemapTransmissionMask
, dftrclmk::parserTexRemapTransmissionMask
, { castor::makeParameter< castor::ParameterType::eUInt32 >() } );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace castor3d
{
//*********************************************************************************************

namespace trscmp
namespace dftrftmk
{
static CU_ImplementAttributeParserBlock( parserUnitTransmissionMask, TextureContext )
{
Expand Down Expand Up @@ -133,25 +133,25 @@ namespace castor3d
castor::addParserT( parsers
, CSCNSection::eTexture
, cuT( "diffuse_transmission_factor_mask" )
, trscmp::parserUnitTransmissionMask
, dftrftmk::parserUnitTransmissionMask
, { castor::makeParameter< castor::ParameterType::eUInt32 >() } );

castor::addParserT( parsers
, CSCNSection::eTextureUnit
, cuT( "diffuse_transmission_factor_mask" )
, trscmp::parserUnitTransmissionMask
, dftrftmk::parserUnitTransmissionMask
, { castor::makeParameter< castor::ParameterType::eUInt32 >() } );

castor::addParserT( parsers
, CSCNSection::eTextureRemap
, CSCNSection::eTextureRemapChannel
, cuT( "diffuse_transmission_factor" )
, trscmp::parserTexRemapTransmission );
, dftrftmk::parserTexRemapTransmission );

castor::addParserT( parsers
, CSCNSection::eTextureRemapChannel
, cuT( "diffuse_transmission_factor_mask" )
, trscmp::parserTexRemapTransmissionMask
, dftrftmk::parserTexRemapTransmissionMask
, { castor::makeParameter< castor::ParameterType::eUInt32 >() } );
}

Expand Down
2 changes: 2 additions & 0 deletions source/Core/Castor3D/Render/Node/QueueRenderNodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
#include <RenderGraph/RecordContext.hpp>
#include <RenderGraph/RunnablePass.hpp>

#include <ashespp/Command/CommandBuffer.hpp>

CU_ImplementSmartPtr( castor3d, QueueRenderNodes )

using ashes::operator==;
Expand Down
4 changes: 2 additions & 2 deletions source/Core/Castor3D/Render/PipelineFlags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,9 @@ namespace castor3d
uint32_t offset{};
result |= uint32_t( pass.getComponentCombineID() & pipflags::hi::maxPassMask ) << offset;
offset += pipflags::hi::maxPassSize;
result |= ( uint32_t( pass.getTextureCombineID() ) & pipflags::hi::maxSubmeshMask ) << offset;
result |= uint32_t( pass.getTextureCombineID() & pipflags::hi::maxSubmeshMask ) << offset;
offset += pipflags::hi::maxTexturesSize;
result |= ( uint32_t( pass.getLightingModelId() - 1u ) & pipflags::hi::maxLightingModelIDMask ) << offset;
result |= uint32_t( ( pass.getLightingModelId() - 1u ) & pipflags::hi::maxLightingModelIDMask ) << offset;
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ namespace castor3d::shader
, components.perceptualRoughness );
}

sdw::RetVec3 NoIblBackgroundModel::computeDiffuse( sdw::Vec3 const & wsDirection
sdw::RetVec3 NoIblBackgroundModel::computeDiffuse( sdw::Vec3 const & pwsDirection
, BlendComponents & components
, DebugOutputCategory const & debugOutput )
{
Expand All @@ -133,7 +133,7 @@ namespace castor3d::shader
}

auto backgroundMap = m_writer.getVariable< sdw::CombinedImageCubeRgba32 >( "c3d_mapBackground" );
return m_computeDiffuse( wsDirection
return m_computeDiffuse( pwsDirection
, backgroundMap
, components.perceptualRoughness );
}
Expand Down
4 changes: 2 additions & 2 deletions source/Core/Castor3D/Shader/Shaders/GlslBlendComponents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace castor3d::shader

namespace blendcomp
{
void fillType( ast::type::BaseStruct & type )
static void fillType( ast::type::BaseStruct & type )
{
type.declMember( "dielectricF0", sdw::type::Kind::eVec3F );
type.declMember( "alphaRoughness", sdw::type::Kind::eFloat );
Expand All @@ -25,7 +25,7 @@ namespace castor3d::shader
type.declMember( "specularWeight", sdw::type::Kind::eFloat );
}

void fillInit( sdw::expr::ExprList & inits )
static void fillInit( sdw::expr::ExprList & inits )
{
inits.emplace_back( sdw::makeExpr( vec3( 0.04_f ) ) );
inits.emplace_back( sdw::makeExpr( 1.0_f ) );
Expand Down
8 changes: 4 additions & 4 deletions source/Core/Castor3D/Shader/Shaders/GlslDebugOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ namespace castor3d::shader
}
ROF
m_registerOutput = writer.implementFunction< sdw::Void >( "c3d_registerOutput"
, [this]( sdw::UInt const & index
, sdw::Vec3 const & value )
, [this]( sdw::UInt const & idx
, sdw::Vec3 const & val )
{
m_indices[index] = 1_u;
m_values[index] = value;
m_indices[idx] = 1_u;
m_values[idx] = val;
}
, sdw::InUInt{ writer, "index" }
, sdw::InVec3{ writer, "value" } );
Expand Down
2 changes: 2 additions & 0 deletions source/Core/Castor3D/Shader/Shaders/GlslOrenNayarBRDF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include "Castor3D/Shader/Shaders/GlslBlendComponents.hpp"
#include "Castor3D/Shader/Shaders/GlslLightSurface.hpp"

#include <ShaderWriter/Writer.hpp>

namespace castor3d::shader
{
//*********************************************************************************************
Expand Down
4 changes: 2 additions & 2 deletions source/Core/Castor3D/Shader/Shaders/GlslReflection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1219,10 +1219,10 @@ namespace castor3d::shader
, sdw::Vec3 & result
, DebugOutputCategory const & debugOutput )
{
auto & writer = *envMap.getWriter();

if ( m_hasEnvMap )
{
auto & writer = *envMap.getWriter();

IF( writer, hasEnvMap )
{
result = computeDiffuseEnvMaps( wsDirection
Expand Down
2 changes: 2 additions & 0 deletions source/Core/Castor3D/Shader/Shaders/GlslSpecularBRDF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include "Castor3D/Shader/Shaders/GlslOutputComponents.hpp"
#include "Castor3D/Shader/Shaders/GlslUtils.hpp"

#include <ShaderWriter/Writer.hpp>

CU_ImplementDeleter( castor3d::shader, SpecularBRDF )

namespace castor3d::shader
Expand Down
6 changes: 3 additions & 3 deletions source/Core/Castor3D/Shader/Shaders/GlslUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1165,8 +1165,8 @@ namespace castor3d::shader
, pshift );
}

sdw::RetFloat Utils::directionalAlbedoSheen( sdw::Float const & cosTheta
, sdw::Float const & roughness )
sdw::RetFloat Utils::directionalAlbedoSheen( sdw::Float const & pcosTheta
, sdw::Float const & proughness )
{
if ( !m_directionalAlbedoSheen )
{
Expand All @@ -1184,7 +1184,7 @@ namespace castor3d::shader
, sdw::InFloat{ m_writer, "roughness" } );
}

return m_directionalAlbedoSheen( cosTheta, roughness );
return m_directionalAlbedoSheen( pcosTheta, proughness );
}

sdw::Vec3 Utils::reconstructNormal( sdw::Vec2 const & normal )
Expand Down
3 changes: 2 additions & 1 deletion source/Core/SceneExporter/Text/TextRenderTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "TextClustersConfig.hpp"
#include "TextSsaoConfig.hpp"

#include <Castor3D/Material/MaterialModule.hpp>
#include <Castor3D/Miscellaneous/Logger.hpp>
#include <Castor3D/Render/Clustered/FrustumClusters.hpp>
#include <Castor3D/Render/PostEffect/PostEffect.hpp>
Expand Down Expand Up @@ -33,7 +34,7 @@ namespace castor
if ( auto block{ beginBlock( file, cuT( "render_target" ) ) } )
{
result = writeNamedSub( file, cuT( "size" ), target.getSize() )
&& write( file, cuT( "format" ), getFormatName( convert( target.getPixelFormat() ) ) )
&& write( file, cuT( "format" ), getFormatName( castor3d::convert( target.getPixelFormat() ) ) )
&& writeName( file, cuT( "tone_mapping" ), target.getToneMapping()->getName() );

if ( result && target.getScene() )
Expand Down

0 comments on commit 7722fdd

Please sign in to comment.