Increase the maximum point size to what is reported by Direct3D.

TRAC #21121
Issue=345,305
Signed-off-by: Daniel Koch
Author: Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/trunk@1191 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/common/version.h b/src/common/version.h
index ef9f1cc..64f339c 100644
--- a/src/common/version.h
+++ b/src/common/version.h
@@ -1,7 +1,7 @@
 #define MAJOR_VERSION 1
 #define MINOR_VERSION 0
 #define BUILD_VERSION 0
-#define BUILD_REVISION 1178
+#define BUILD_REVISION 1191
 
 #define STRINGIFY(x) #x
 #define MACRO_STRINGIFY(x) STRINGIFY(x)
diff --git a/src/libEGL/Display.cpp b/src/libEGL/Display.cpp
index 0cc0b93..e1e4e16 100644
--- a/src/libEGL/Display.cpp
+++ b/src/libEGL/Display.cpp
@@ -474,6 +474,15 @@
     mDevice->SetRenderState(D3DRS_POINTSPRITEENABLE, TRUE);
     mDevice->SetRenderState(D3DRS_LASTPIXEL, FALSE);
 
+    if (mDeviceCaps.PixelShaderVersion >= D3DPS_VERSION(3, 0))
+    {
+        mDevice->SetRenderState(D3DRS_POINTSIZE_MAX, (DWORD&)mDeviceCaps.MaxPointSize);
+    }
+    else
+    {
+        mDevice->SetRenderState(D3DRS_POINTSIZE_MAX, 0x3F800000);   // 1.0f
+    }
+
     mSceneStarted = false;
 }
 
diff --git a/src/libGLESv2/Context.cpp b/src/libGLESv2/Context.cpp
index 1b4664c..a5659d8 100644
--- a/src/libGLESv2/Context.cpp
+++ b/src/libGLESv2/Context.cpp
@@ -264,6 +264,7 @@
         mBlit = new Blit(this);

 

         mSupportsShaderModel3 = mDeviceCaps.PixelShaderVersion >= D3DPS_VERSION(3, 0);

+        mMaximumPointSize = mDeviceCaps.MaxPointSize;

         mSupportsVertexTexture = mDisplay->getVertexTextureSupport();

         mSupportsNonPower2Texture = mDisplay->getNonPower2TextureSupport();

         mSupportsInstancing = mDisplay->getInstancingSupport();

@@ -1406,7 +1407,7 @@
         break;

       case GL_ALIASED_POINT_SIZE_RANGE:

         params[0] = gl::ALIASED_POINT_SIZE_RANGE_MIN;

-        params[1] = supportsShaderModel3() ? gl::ALIASED_POINT_SIZE_RANGE_MAX_SM3 : gl::ALIASED_POINT_SIZE_RANGE_MAX_SM2;

+        params[1] = getMaximumPointSize();

         break;

       case GL_DEPTH_RANGE:

         params[0] = mState.zNear;

@@ -3362,6 +3363,11 @@
     return mSupportsShaderModel3;

 }

 

+float Context::getMaximumPointSize() const

+{

+    return mSupportsShaderModel3 ? mMaximumPointSize : ALIASED_POINT_SIZE_RANGE_MAX_SM2;

+}

+

 int Context::getMaximumVaryingVectors() const

 {

     return mSupportsShaderModel3 ? MAX_VARYING_VECTORS_SM3 : MAX_VARYING_VECTORS_SM2;

diff --git a/src/libGLESv2/Context.h b/src/libGLESv2/Context.h
index 4d47ce7..2f21a2d 100644
--- a/src/libGLESv2/Context.h
+++ b/src/libGLESv2/Context.h
@@ -90,7 +90,6 @@
 const float ALIASED_LINE_WIDTH_RANGE_MAX = 1.0f;
 const float ALIASED_POINT_SIZE_RANGE_MIN = 1.0f;
 const float ALIASED_POINT_SIZE_RANGE_MAX_SM2 = 1.0f;
-const float ALIASED_POINT_SIZE_RANGE_MAX_SM3 = 64.0f;
 
 struct Color
 {
@@ -471,6 +470,7 @@
     virtual bool isResetNotificationEnabled();
 
     bool supportsShaderModel3() const;
+    float getMaximumPointSize() const;
     int getMaximumVaryingVectors() const;
     unsigned int getMaximumVertexTextureImageUnits() const;
     unsigned int getMaximumCombinedTextureImageUnits() const;
@@ -597,6 +597,7 @@
     Framebuffer *mBoundDrawFramebuffer;
 
     bool mSupportsShaderModel3;
+    float mMaximumPointSize;
     bool mSupportsVertexTexture;
     bool mSupportsNonPower2Texture;
     bool mSupportsInstancing;
diff --git a/src/libGLESv2/ProgramBinary.cpp b/src/libGLESv2/ProgramBinary.cpp
index ac28e51..4e2dfa4 100644
--- a/src/libGLESv2/ProgramBinary.cpp
+++ b/src/libGLESv2/ProgramBinary.cpp
@@ -1392,7 +1392,7 @@
 
     if (vertexShader->mUsesPointSize && sm3)
     {
-        vertexHLSL += "    output.gl_PointSize = clamp(gl_PointSize, 1.0, " + str((int)ALIASED_POINT_SIZE_RANGE_MAX_SM3) + ");\n";
+        vertexHLSL += "    output.gl_PointSize = gl_PointSize;\n";
     }
 
     if (fragmentShader->mUsesFragCoord)