Bladeren bron

Merge pull request #1526 from rextimmy/signed_mat_feature_fix

Corrected signed mismatches in featureSet & shaderFeature
Areloch 9 jaren geleden
bovenliggende
commit
ba270868dc

+ 1 - 1
Engine/source/shaderGen/featureSet.cpp

@@ -170,7 +170,7 @@ void FeatureSet::removeFeature( const FeatureType &type )
    }
    }
 }
 }
 
 
-U32 FeatureSet::getNextFeatureIndex( const FeatureType &type, S32 index ) const
+S32 FeatureSet::getNextFeatureIndex( const FeatureType &type, S32 index ) const
 {
 {
    for ( U32 i=0; i < mFeatures.size(); i++ )
    for ( U32 i=0; i < mFeatures.size(); i++ )
    {
    {

+ 1 - 1
Engine/source/shaderGen/featureSet.h

@@ -106,7 +106,7 @@ public:
    void removeFeature( const FeatureType &type );
    void removeFeature( const FeatureType &type );
 
 
    ///
    ///
-   U32 getNextFeatureIndex( const FeatureType &type, S32 index ) const;
+   S32 getNextFeatureIndex( const FeatureType &type, S32 index ) const;
 
 
    /// Removes features that are not in the input set.
    /// Removes features that are not in the input set.
    void filter( const FeatureSet &features );
    void filter( const FeatureSet &features );

+ 1 - 1
Engine/source/shaderGen/shaderFeature.h

@@ -153,7 +153,7 @@ public:
    void setProcessIndex( S32 index ) { mProcessIndex = index; }
    void setProcessIndex( S32 index ) { mProcessIndex = index; }
 
 
    ///
    ///
-   U32 getProcessIndex() const { return mProcessIndex; }
+   S32 getProcessIndex() const { return mProcessIndex; }
 
 
    //-----------------------------------------------------------------------
    //-----------------------------------------------------------------------
    // Virtual Functions
    // Virtual Functions

+ 5 - 5
Engine/source/terrain/hlsl/terrFeatureHLSL.cpp

@@ -298,7 +298,7 @@ TerrainDetailMapFeatHLSL::TerrainDetailMapFeatHLSL()
 void TerrainDetailMapFeatHLSL::processVert(  Vector<ShaderComponent*> &componentList, 
 void TerrainDetailMapFeatHLSL::processVert(  Vector<ShaderComponent*> &componentList, 
                                              const MaterialFeatureData &fd )
                                              const MaterialFeatureData &fd )
 {
 {
-   const U32 detailIndex = getProcessIndex();
+   const S32 detailIndex = getProcessIndex();
 
 
    // Grab incoming texture coords... the base map feature
    // Grab incoming texture coords... the base map feature
    // made sure this was created.
    // made sure this was created.
@@ -383,7 +383,7 @@ void TerrainDetailMapFeatHLSL::processVert(  Vector<ShaderComponent*> &component
 void TerrainDetailMapFeatHLSL::processPix(   Vector<ShaderComponent*> &componentList, 
 void TerrainDetailMapFeatHLSL::processPix(   Vector<ShaderComponent*> &componentList, 
                                              const MaterialFeatureData &fd )
                                              const MaterialFeatureData &fd )
 {
 {
-   const U32 detailIndex = getProcessIndex();
+   const S32 detailIndex = getProcessIndex();
    Var *inTex = getVertTexCoord( "texCoord" );
    Var *inTex = getVertTexCoord( "texCoord" );
    
    
    MultiLine *meta = new MultiLine;
    MultiLine *meta = new MultiLine;
@@ -615,7 +615,7 @@ TerrainMacroMapFeatHLSL::TerrainMacroMapFeatHLSL()
 void TerrainMacroMapFeatHLSL::processVert(  Vector<ShaderComponent*> &componentList, 
 void TerrainMacroMapFeatHLSL::processVert(  Vector<ShaderComponent*> &componentList, 
                                              const MaterialFeatureData &fd )
                                              const MaterialFeatureData &fd )
 {
 {
-   const U32 detailIndex = getProcessIndex();
+   const S32 detailIndex = getProcessIndex();
 
 
    // Grab incoming texture coords... the base map feature
    // Grab incoming texture coords... the base map feature
    // made sure this was created.
    // made sure this was created.
@@ -673,7 +673,7 @@ void TerrainMacroMapFeatHLSL::processVert(  Vector<ShaderComponent*> &componentL
 void TerrainMacroMapFeatHLSL::processPix(   Vector<ShaderComponent*> &componentList, 
 void TerrainMacroMapFeatHLSL::processPix(   Vector<ShaderComponent*> &componentList, 
                                              const MaterialFeatureData &fd )
                                              const MaterialFeatureData &fd )
 {
 {
-   const U32 detailIndex = getProcessIndex();
+   const S32 detailIndex = getProcessIndex();
    Var *inTex = getVertTexCoord( "texCoord" );
    Var *inTex = getVertTexCoord( "texCoord" );
    
    
    MultiLine *meta = new MultiLine;
    MultiLine *meta = new MultiLine;
@@ -900,7 +900,7 @@ void TerrainNormalMapFeatHLSL::processPix(   Vector<ShaderComponent*> &component
       meta->addStatement( new GenOp( "   @ = @[2];\r\n", new DecOp( gbNormal ), viewToTangent ) );
       meta->addStatement( new GenOp( "   @ = @[2];\r\n", new DecOp( gbNormal ), viewToTangent ) );
    }
    }
 
 
-   const U32 normalIndex = getProcessIndex();
+   const S32 normalIndex = getProcessIndex();
 
 
    Var *detailBlend = (Var*)LangElement::find( String::ToString( "detailBlend%d", normalIndex ) );
    Var *detailBlend = (Var*)LangElement::find( String::ToString( "detailBlend%d", normalIndex ) );
    AssertFatal( detailBlend, "The detail blend is missing!" );
    AssertFatal( detailBlend, "The detail blend is missing!" );