Removes Direct3D9 functionality.

This commit is contained in:
Areloch 2017-05-28 16:51:31 -05:00
parent 5ac6f6beb3
commit edd1e0a270
86 changed files with 382 additions and 10445 deletions

View file

@ -42,7 +42,6 @@ void BumpFeatHLSL::processVert( Vector<ShaderComponent*> &componentList,
// Output the texture coord.
getOutTexCoord( "texCoord",
"float2",
true,
useTexAnim,
meta,
componentList );
@ -64,18 +63,14 @@ void BumpFeatHLSL::processPix( Vector<ShaderComponent*> &componentList,
output = meta;
// Get the texture coord.
Var *texCoord = getInTexCoord( "texCoord", "float2", true, componentList );
Var *texCoord = getInTexCoord("texCoord", "float2", componentList);
// Sample the bumpmap.
Var *bumpMap = getNormalMapTex();
LangElement *texOp = NULL;
//if it's D3D11 let's create the texture object
Var* bumpMapTex = NULL;
if (mIsDirect3D11)
{
bumpMapTex = (Var*)LangElement::find("bumpMapTex");
}
Var* bumpMapTex = (Var*)LangElement::find("bumpMapTex");
// Handle atlased textures
// http://www.infinity-universe.com/Infinity/index.php?option=com_content&task=view&id=65&Itemid=47
@ -134,25 +129,11 @@ void BumpFeatHLSL::processPix( Vector<ShaderComponent*> &componentList,
// Add a newline
meta->addStatement( new GenOp( "\r\n" ) );
if (mIsDirect3D11)
{
texOp = new GenOp("@.SampleLevel(@, @, mipLod_bump)", bumpMapTex, bumpMap, texCoord);
}
else if (is_sm3)
{
texOp = new GenOp("tex2Dlod(@, float4(@, 0.0, mipLod_bump))", bumpMap, texCoord);
}
else
{
texOp = new GenOp("tex2D(@, @)", bumpMap, texCoord);
}
texOp = new GenOp("@.SampleLevel(@, @, mipLod_bump)", bumpMapTex, bumpMap, texCoord);
}
else
{
if (mIsDirect3D11)
texOp = new GenOp("@.Sample(@, @)", bumpMapTex, bumpMap, texCoord);
else
texOp = new GenOp("tex2D(@, @)", bumpMap, texCoord);
texOp = new GenOp("@.Sample(@, @)", bumpMapTex, bumpMap, texCoord);
}
Var *bumpNorm = new Var( "bumpNormal", "float4" );
@ -164,32 +145,22 @@ void BumpFeatHLSL::processPix( Vector<ShaderComponent*> &componentList,
if ( fd.features.hasFeature( MFT_DetailNormalMap ) )
{
bumpMap = new Var;
bumpMap->setType( "sampler2D" );
bumpMap->setType( "SamplerState" );
bumpMap->setName( "detailBumpMap" );
bumpMap->uniform = true;
bumpMap->sampler = true;
bumpMap->constNum = Var::getTexUnitNum();
Var* detailBumpTex = NULL;
if (mIsDirect3D11)
{
bumpMap->setType("SamplerState");
detailBumpTex = new Var;
detailBumpTex->setName("detailBumpTex");
detailBumpTex->setType("Texture2D");
detailBumpTex->uniform = true;
detailBumpTex->texture = true;
detailBumpTex->constNum = bumpMap->constNum;
}
else
bumpMap->setType("sampler2D");
Var* detailBumpTex = new Var;
detailBumpTex->setName("detailBumpTex");
detailBumpTex->setType("Texture2D");
detailBumpTex->uniform = true;
detailBumpTex->texture = true;
detailBumpTex->constNum = bumpMap->constNum;
texCoord = getInTexCoord( "detCoord", "float2", true, componentList );
texCoord = getInTexCoord( "detCoord", "float2", componentList );
if (mIsDirect3D11)
texOp = new GenOp("@.Sample(@, @)", detailBumpTex, bumpMap, texCoord);
else
texOp = new GenOp("tex2D(@, @)", bumpMap, texCoord);
texOp = new GenOp("@.Sample(@, @)", detailBumpTex, bumpMap, texCoord);
Var *detailBump = new Var;
detailBump->setName( "detailBump" );
@ -299,7 +270,6 @@ void ParallaxFeatHLSL::processVert( Vector<ShaderComponent*> &componentList,
// Add the texture coords.
getOutTexCoord( "texCoord",
"float2",
true,
fd.features[MFT_TexAnim],
meta,
componentList );
@ -344,7 +314,7 @@ void ParallaxFeatHLSL::processPix( Vector<ShaderComponent*> &componentList,
MultiLine *meta = new MultiLine;
// Order matters... get this first!
Var *texCoord = getInTexCoord( "texCoord", "float2", true, componentList );
Var *texCoord = getInTexCoord( "texCoord", "float2", componentList );
ShaderConnector *connectComp = dynamic_cast<ShaderConnector *>( componentList[C_CONNECTOR] );
@ -374,21 +344,13 @@ void ParallaxFeatHLSL::processPix( Vector<ShaderComponent*> &componentList,
// Call the library function to do the rest.
if (fd.features.hasFeature(MFT_IsDXTnm, getProcessIndex()))
{
if (mIsDirect3D11)
meta->addStatement(new GenOp(" @.xy += parallaxOffsetDxtnm( @, @, @.xy, @, @ );\r\n",
meta->addStatement(new GenOp(" @.xy += parallaxOffsetDxtnm( @, @, @.xy, @, @ );\r\n",
texCoord, bumpMapTexture, normalMap, texCoord, negViewTS, parallaxInfo));
else
meta->addStatement(new GenOp(" @.xy += parallaxOffsetDxtnm( @, @.xy, @, @ );\r\n",
texCoord, normalMap, texCoord, negViewTS, parallaxInfo));
}
else
{
if (mIsDirect3D11)
meta->addStatement(new GenOp(" @.xy += parallaxOffset( @, @, @.xy, @, @ );\r\n",
meta->addStatement(new GenOp(" @.xy += parallaxOffset( @, @, @.xy, @, @ );\r\n",
texCoord, bumpMapTexture, normalMap, texCoord, negViewTS, parallaxInfo));
else
meta->addStatement(new GenOp(" @.xy += parallaxOffset( @, @.xy, @, @ );\r\n",
texCoord, normalMap, texCoord, negViewTS, parallaxInfo));
}
// TODO: Fix second UV maybe?
@ -449,7 +411,6 @@ void NormalsOutFeatHLSL::processVert( Vector<ShaderComponent*> &componentList,
outNormal->setName( "wsNormal" );
outNormal->setStructName( "OUT" );
outNormal->setType( "float3" );
outNormal->mapsToSampler = false;
// Find the incoming vertex normal.
Var *inNormal = (Var*)LangElement::find( "normal" );