Expand GL sampler arguments to a texture and sampler argument for D3D11.

TRAC #22593 Signed-off-by: Shannon Woods Signed-off-by: Geoff Lang Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1919 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 96c21eea
...@@ -1735,8 +1735,6 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node) ...@@ -1735,8 +1735,6 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
break; break;
case EOpFunctionCall: case EOpFunctionCall:
{ {
if (visit == PreVisit)
{
TString name = TFunction::unmangleName(node->getName()); TString name = TFunction::unmangleName(node->getName());
bool lod0 = mInsideDiscontinuousLoop || mOutputLod0Function; bool lod0 = mInsideDiscontinuousLoop || mOutputLod0Function;
...@@ -1870,23 +1868,30 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node) ...@@ -1870,23 +1868,30 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
out << "gl_textureCubeLod("; out << "gl_textureCubeLod(";
} }
else UNREACHABLE(); else UNREACHABLE();
}
if (mOutputType == SH_HLSL11_OUTPUT) TIntermSequence &arguments = node->getSequence();
for (TIntermSequence::iterator arg = arguments.begin(); arg != arguments.end(); arg++)
{
if (mOutputType == SH_HLSL11_OUTPUT && IsSampler((*arg)->getAsTyped()->getBasicType()))
{ {
out << "texture_"; out << "texture_";
node->getSequence()[0]->traverse(this); (*arg)->traverse(this);
out << ", sampler_"; out << ", sampler_";
} }
}
} (*arg)->traverse(this);
else if (visit == InVisit)
if (arg < arguments.end() - 1)
{ {
out << ", "; out << ", ";
} }
else
{
out << ")";
} }
out << ")";
return false;
} }
break; break;
case EOpParameters: outputTriplet(visit, "(", ", ", ")\n{\n"); break; case EOpParameters: outputTriplet(visit, "(", ", ", ")\n{\n"); break;
...@@ -2493,6 +2498,12 @@ TString OutputHLSL::argumentString(const TIntermSymbol *symbol) ...@@ -2493,6 +2498,12 @@ TString OutputHLSL::argumentString(const TIntermSymbol *symbol)
name = decorate(name); name = decorate(name);
} }
if (mOutputType == SH_HLSL11_OUTPUT && IsSampler(type.getBasicType()))
{
return qualifierString(qualifier) + " " + textureString(type) + " texture_" + name + arrayString(type) + ", " +
qualifierString(qualifier) + " SamplerState sampler_" + name + arrayString(type);
}
return qualifierString(qualifier) + " " + typeString(type) + " " + name + arrayString(type); return qualifierString(qualifier) + " " + typeString(type) + " " + name + arrayString(type);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment