Fix D3D11 errors from specifying the order of FragCoord, PointCoord, etc…

Fix D3D11 errors from specifying the order of FragCoord, PointCoord, etc different between GS and PS. TRAC #22646 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods Author: Jamie Madill git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1946 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 157c655f
...@@ -1421,14 +1421,22 @@ bool ProgramBinary::linkVaryings(InfoLog &infoLog, int registers, const Varying ...@@ -1421,14 +1421,22 @@ bool ProgramBinary::linkVaryings(InfoLog &infoLog, int registers, const Varying
if (fragmentShader->mUsesFragCoord) if (fragmentShader->mUsesFragCoord)
{ {
pixelHLSL += " float4 gl_FragCoord : " + fragCoordSemantic + ";\n"; pixelHLSL += " float4 gl_FragCoord : " + fragCoordSemantic + ";\n";
}
// Must consume the PSIZE element if the geometry shader is not active if (fragmentShader->mUsesPointCoord && shaderModel >= 3)
// We won't know if we use a GS until we draw {
if (vertexShader->mUsesPointSize && shaderModel >= 4) pixelHLSL += " float2 gl_PointCoord : " + pointCoordSemantic + ";\n";
{ }
pixelHLSL += " float gl_PointSize : PSIZE;\n";
}
// Must consume the PSIZE element if the geometry shader is not active
// We won't know if we use a GS until we draw
if (vertexShader->mUsesPointSize && shaderModel >= 4)
{
pixelHLSL += " float gl_PointSize : PSIZE;\n";
}
if (fragmentShader->mUsesFragCoord)
{
if (shaderModel >= 4) if (shaderModel >= 4)
{ {
pixelHLSL += " float4 dx_VPos : SV_Position;\n"; pixelHLSL += " float4 dx_VPos : SV_Position;\n";
...@@ -1439,11 +1447,6 @@ bool ProgramBinary::linkVaryings(InfoLog &infoLog, int registers, const Varying ...@@ -1439,11 +1447,6 @@ bool ProgramBinary::linkVaryings(InfoLog &infoLog, int registers, const Varying
} }
} }
if (fragmentShader->mUsesPointCoord && shaderModel >= 3)
{
pixelHLSL += " float2 gl_PointCoord : " + pointCoordSemantic + ";\n";
}
pixelHLSL += "};\n" pixelHLSL += "};\n"
"\n" "\n"
"struct PS_OUTPUT\n" "struct PS_OUTPUT\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