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:: ...@@ -1204,7 +1204,8 @@ bool ProgramBinary::linkVaryings(InfoLog &infoLog, std::string& pixelHLSL, std::
} }
// Write the HLSL input/output declarations // 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(); Context *context = getContext();
const int maxVaryingVectors = context->getMaximumVaryingVectors(); const int maxVaryingVectors = context->getMaximumVaryingVectors();
...@@ -1248,6 +1249,7 @@ bool ProgramBinary::linkVaryings(InfoLog &infoLog, std::string& pixelHLSL, std:: ...@@ -1248,6 +1249,7 @@ bool ProgramBinary::linkVaryings(InfoLog &infoLog, std::string& pixelHLSL, std::
mUsesPointSize = vertexShader->mUsesPointSize; mUsesPointSize = vertexShader->mUsesPointSize;
std::string varyingSemantic = (mUsesPointSize && sm3) ? "COLOR" : "TEXCOORD"; std::string varyingSemantic = (mUsesPointSize && sm3) ? "COLOR" : "TEXCOORD";
std::string targetSemantic = sm4 ? "SV_Target" : "COLOR";
vertexHLSL += "struct VS_INPUT\n" vertexHLSL += "struct VS_INPUT\n"
"{\n"; "{\n";
...@@ -1438,7 +1440,7 @@ bool ProgramBinary::linkVaryings(InfoLog &infoLog, std::string& pixelHLSL, std:: ...@@ -1438,7 +1440,7 @@ bool ProgramBinary::linkVaryings(InfoLog &infoLog, std::string& pixelHLSL, std::
"\n" "\n"
"struct PS_OUTPUT\n" "struct PS_OUTPUT\n"
"{\n" "{\n"
" float4 gl_Color[1] : COLOR;\n" " float4 gl_Color[1] : " + targetSemantic + ";\n"
"};\n" "};\n"
"\n" "\n"
"PS_OUTPUT main(PS_INPUT input)\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