2
0
Эх сурвалжийг харах

truncation warning cleanups dx side (was also causing cornercase crashes gl side)

Azaezel 9 жил өмнө
parent
commit
496b6a3ea8

+ 2 - 2
Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp

@@ -365,7 +365,7 @@ Var* ShaderFeatureGLSL::getOutTexCoord(   const char *name,
          
          
 			// Statement allows for casting of different types which
 			// Statement allows for casting of different types which
 		   // eliminates vector truncation problems.
 		   // eliminates vector truncation problems.
-         String statement = String::ToString( "   @ = %s(tMul(@, @));\r\n", type );
+         String statement = String::ToString( "   @ = %s(tMul(@, @).xy);\r\n", type );
 			meta->addStatement( new GenOp( statement , texCoord, texMat, inTex ) );      
 			meta->addStatement( new GenOp( statement , texCoord, texMat, inTex ) );      
       }
       }
       else
       else
@@ -813,7 +813,7 @@ Var* ShaderFeatureGLSL::addOutDetailTexCoord(   Vector<ShaderComponent*> &compon
 			texMat->constSortPos = cspPass;   
 			texMat->constSortPos = cspPass;   
 		}
 		}
 		
 		
-      meta->addStatement( new GenOp( "   @ = tMul(@, @) * @;\r\n", outTex, texMat, inTex, detScale ) );
+      meta->addStatement( new GenOp( "   @ = tMul(@, @).xy * @;\r\n", outTex, texMat, inTex, detScale ) );
 	}
 	}
 	else
 	else
 	{
 	{

+ 2 - 2
Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp

@@ -365,7 +365,7 @@ Var* ShaderFeatureHLSL::getOutTexCoord(   const char *name,
          
          
          // Statement allows for casting of different types which
          // Statement allows for casting of different types which
 		   // eliminates vector truncation problems.
 		   // eliminates vector truncation problems.
-         String statement = String::ToString( "   @ = (%s)mul(@, @);\r\n", type );
+         String statement = String::ToString( "   @ = (%s)mul(@, @).xy;\r\n", type );
          meta->addStatement( new GenOp( statement, texCoord, texMat, inTex ) );
          meta->addStatement( new GenOp( statement, texCoord, texMat, inTex ) );
       }
       }
       else
       else
@@ -811,7 +811,7 @@ Var* ShaderFeatureHLSL::addOutDetailTexCoord(   Vector<ShaderComponent*> &compon
          texMat->constSortPos = cspPass;   
          texMat->constSortPos = cspPass;   
       }
       }
 
 
-      meta->addStatement( new GenOp( "   @ = mul(@, @) * @;\r\n", outTex, texMat, inTex, detScale ) );
+      meta->addStatement( new GenOp( "   @ = mul(@, @).xy * @;\r\n", outTex, texMat, inTex, detScale ) );
    }
    }
    else
    else
    {
    {