Pass through the PSIZE semantic all the way to the fragment shader in D3D11,…

Pass through the PSIZE semantic all the way to the fragment shader in D3D11, fixing a register error. In some cases when the app would draw triangles, and writes to gl_PointSize, the vertex shader would output PSIZE and the pixel shader would not read it as an input. TRAC #22561 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods Author: Jamie Madill git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1933 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 0a71ecfb
...@@ -1424,6 +1424,13 @@ bool ProgramBinary::linkVaryings(InfoLog &infoLog, int registers, const Varying ...@@ -1424,6 +1424,13 @@ bool ProgramBinary::linkVaryings(InfoLog &infoLog, int registers, const Varying
{ {
pixelHLSL += " float4 gl_FragCoord : " + fragCoordSemantic + ";\n"; pixelHLSL += " float4 gl_FragCoord : " + fragCoordSemantic + ";\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 (shaderModel >= 4) if (shaderModel >= 4)
{ {
pixelHLSL += " float4 dx_VPos : SV_Position;\n"; pixelHLSL += " float4 dx_VPos : SV_Position;\n";
...@@ -2185,7 +2192,8 @@ std::string ProgramBinary::generatePointSpriteHLSL(int registers, const Varying ...@@ -2185,7 +2192,8 @@ std::string ProgramBinary::generatePointSpriteHLSL(int registers, const Varying
geomHLSL += " float2 gl_PointCoord : " + pointCoordSemantic + ";\n"; geomHLSL += " float2 gl_PointCoord : " + pointCoordSemantic + ";\n";
} }
geomHLSL += " float4 gl_Position : SV_Position;\n" geomHLSL += " float gl_PointSize : PSIZE;\n"
" float4 gl_Position : SV_Position;\n"
"};\n" "};\n"
"\n" "\n"
"static float2 pointSpriteCorners[] = \n" "static float2 pointSpriteCorners[] = \n"
...@@ -2210,7 +2218,8 @@ std::string ProgramBinary::generatePointSpriteHLSL(int registers, const Varying ...@@ -2210,7 +2218,8 @@ std::string ProgramBinary::generatePointSpriteHLSL(int registers, const Varying
"[maxvertexcount(4)]\n" "[maxvertexcount(4)]\n"
"void main(point GS_INPUT input[1], inout TriangleStream<GS_OUTPUT> outStream)\n" "void main(point GS_INPUT input[1], inout TriangleStream<GS_OUTPUT> outStream)\n"
"{\n" "{\n"
" GS_OUTPUT output = (GS_OUTPUT)0;\n"; " GS_OUTPUT output = (GS_OUTPUT)0;\n"
" output.gl_PointSize = input[0].gl_PointSize;\n";
for (int r = 0; r < registers; r++) for (int r = 0; r < registers; r++)
{ {
......
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