Use SV_Target semantic for gl_Color when compiling for Shader Model 4+.

TRAC #22191 Signed-off-by: Shannon Woods Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1527 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 77fbf973
......@@ -1204,7 +1204,8 @@ bool ProgramBinary::linkVaryings(InfoLog &infoLog, std::string& pixelHLSL, std::
}
// Write the HLSL input/output declarations
const bool sm3 = mRenderer->getMajorShaderModel() >= 3;
const bool sm3 = (mRenderer->getMajorShaderModel() >= 3);
const bool sm4 = (mRenderer->getMajorShaderModel() >= 4);
Context *context = getContext();
const int maxVaryingVectors = context->getMaximumVaryingVectors();
......@@ -1248,6 +1249,7 @@ bool ProgramBinary::linkVaryings(InfoLog &infoLog, std::string& pixelHLSL, std::
mUsesPointSize = vertexShader->mUsesPointSize;
std::string varyingSemantic = (mUsesPointSize && sm3) ? "COLOR" : "TEXCOORD";
std::string targetSemantic = sm4 ? "SV_Target" : "COLOR";
vertexHLSL += "struct VS_INPUT\n"
"{\n";
......@@ -1438,7 +1440,7 @@ bool ProgramBinary::linkVaryings(InfoLog &infoLog, std::string& pixelHLSL, std::
"\n"
"struct PS_OUTPUT\n"
"{\n"
" float4 gl_Color[1] : COLOR;\n"
" float4 gl_Color[1] : " + targetSemantic + ";\n"
"};\n"
"\n"
"PS_OUTPUT main(PS_INPUT input)\n"
......
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