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
parent d35efdf5
#define MAJOR_VERSION 1 #define MAJOR_VERSION 1
#define MINOR_VERSION 0 #define MINOR_VERSION 0
#define BUILD_VERSION 0 #define BUILD_VERSION 0
#define BUILD_REVISION 1178 #define BUILD_REVISION 1191
#define STRINGIFY(x) #x #define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x) #define MACRO_STRINGIFY(x) STRINGIFY(x)
......
...@@ -474,6 +474,15 @@ void Display::initializeDevice() ...@@ -474,6 +474,15 @@ void Display::initializeDevice()
mDevice->SetRenderState(D3DRS_POINTSPRITEENABLE, TRUE); mDevice->SetRenderState(D3DRS_POINTSPRITEENABLE, TRUE);
mDevice->SetRenderState(D3DRS_LASTPIXEL, FALSE); 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; mSceneStarted = false;
} }
......
...@@ -264,6 +264,7 @@ void Context::makeCurrent(egl::Display *display, egl::Surface *surface) ...@@ -264,6 +264,7 @@ void Context::makeCurrent(egl::Display *display, egl::Surface *surface)
mBlit = new Blit(this); mBlit = new Blit(this);
mSupportsShaderModel3 = mDeviceCaps.PixelShaderVersion >= D3DPS_VERSION(3, 0); mSupportsShaderModel3 = mDeviceCaps.PixelShaderVersion >= D3DPS_VERSION(3, 0);
mMaximumPointSize = mDeviceCaps.MaxPointSize;
mSupportsVertexTexture = mDisplay->getVertexTextureSupport(); mSupportsVertexTexture = mDisplay->getVertexTextureSupport();
mSupportsNonPower2Texture = mDisplay->getNonPower2TextureSupport(); mSupportsNonPower2Texture = mDisplay->getNonPower2TextureSupport();
mSupportsInstancing = mDisplay->getInstancingSupport(); mSupportsInstancing = mDisplay->getInstancingSupport();
...@@ -1406,7 +1407,7 @@ bool Context::getFloatv(GLenum pname, GLfloat *params) ...@@ -1406,7 +1407,7 @@ bool Context::getFloatv(GLenum pname, GLfloat *params)
break; break;
case GL_ALIASED_POINT_SIZE_RANGE: case GL_ALIASED_POINT_SIZE_RANGE:
params[0] = gl::ALIASED_POINT_SIZE_RANGE_MIN; 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; break;
case GL_DEPTH_RANGE: case GL_DEPTH_RANGE:
params[0] = mState.zNear; params[0] = mState.zNear;
...@@ -3362,6 +3363,11 @@ bool Context::supportsShaderModel3() const ...@@ -3362,6 +3363,11 @@ bool Context::supportsShaderModel3() const
return mSupportsShaderModel3; return mSupportsShaderModel3;
} }
float Context::getMaximumPointSize() const
{
return mSupportsShaderModel3 ? mMaximumPointSize : ALIASED_POINT_SIZE_RANGE_MAX_SM2;
}
int Context::getMaximumVaryingVectors() const int Context::getMaximumVaryingVectors() const
{ {
return mSupportsShaderModel3 ? MAX_VARYING_VECTORS_SM3 : MAX_VARYING_VECTORS_SM2; return mSupportsShaderModel3 ? MAX_VARYING_VECTORS_SM3 : MAX_VARYING_VECTORS_SM2;
......
...@@ -90,7 +90,6 @@ const float ALIASED_LINE_WIDTH_RANGE_MIN = 1.0f; ...@@ -90,7 +90,6 @@ const float ALIASED_LINE_WIDTH_RANGE_MIN = 1.0f;
const float ALIASED_LINE_WIDTH_RANGE_MAX = 1.0f; const float ALIASED_LINE_WIDTH_RANGE_MAX = 1.0f;
const float ALIASED_POINT_SIZE_RANGE_MIN = 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_SM2 = 1.0f;
const float ALIASED_POINT_SIZE_RANGE_MAX_SM3 = 64.0f;
struct Color struct Color
{ {
...@@ -471,6 +470,7 @@ class Context ...@@ -471,6 +470,7 @@ class Context
virtual bool isResetNotificationEnabled(); virtual bool isResetNotificationEnabled();
bool supportsShaderModel3() const; bool supportsShaderModel3() const;
float getMaximumPointSize() const;
int getMaximumVaryingVectors() const; int getMaximumVaryingVectors() const;
unsigned int getMaximumVertexTextureImageUnits() const; unsigned int getMaximumVertexTextureImageUnits() const;
unsigned int getMaximumCombinedTextureImageUnits() const; unsigned int getMaximumCombinedTextureImageUnits() const;
...@@ -597,6 +597,7 @@ class Context ...@@ -597,6 +597,7 @@ class Context
Framebuffer *mBoundDrawFramebuffer; Framebuffer *mBoundDrawFramebuffer;
bool mSupportsShaderModel3; bool mSupportsShaderModel3;
float mMaximumPointSize;
bool mSupportsVertexTexture; bool mSupportsVertexTexture;
bool mSupportsNonPower2Texture; bool mSupportsNonPower2Texture;
bool mSupportsInstancing; bool mSupportsInstancing;
......
...@@ -1392,7 +1392,7 @@ bool ProgramBinary::linkVaryings(InfoLog &infoLog, std::string& pixelHLSL, std:: ...@@ -1392,7 +1392,7 @@ bool ProgramBinary::linkVaryings(InfoLog &infoLog, std::string& pixelHLSL, std::
if (vertexShader->mUsesPointSize && sm3) 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) if (fragmentShader->mUsesFragCoord)
......
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