Centralize detection of instancing support.

TRAC #19489 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@976 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent dce02fda
#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 965 #define BUILD_REVISION 976
#define STRINGIFY(x) #x #define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x) #define MACRO_STRINGIFY(x) STRINGIFY(x)
......
// //
// Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved. // Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
...@@ -1215,4 +1215,9 @@ bool Display::getOcclusionQuerySupport() const ...@@ -1215,4 +1215,9 @@ bool Display::getOcclusionQuerySupport() const
} }
} }
bool Display::getInstancingSupport() const
{
return mDeviceCaps.PixelShaderVersion >= D3DPS_VERSION(3, 0);
}
} }
// //
// Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved. // Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
...@@ -79,6 +79,7 @@ class Display ...@@ -79,6 +79,7 @@ class Display
virtual bool getVertexTextureSupport() const; virtual bool getVertexTextureSupport() const;
virtual bool getNonPower2TextureSupport() const; virtual bool getNonPower2TextureSupport() const;
virtual bool getOcclusionQuerySupport() const; virtual bool getOcclusionQuerySupport() const;
virtual bool getInstancingSupport() const;
virtual D3DPOOL getBufferPool(DWORD usage) const; virtual D3DPOOL getBufferPool(DWORD usage) const;
virtual D3DPOOL getTexturePool(bool renderable) const; virtual D3DPOOL getTexturePool(bool renderable) const;
......
...@@ -262,9 +262,10 @@ void Context::makeCurrent(egl::Display *display, egl::Surface *surface) ...@@ -262,9 +262,10 @@ void Context::makeCurrent(egl::Display *display, egl::Surface *surface)
mIndexDataManager = new IndexDataManager(this, mDevice); mIndexDataManager = new IndexDataManager(this, mDevice);
mBlit = new Blit(this); mBlit = new Blit(this);
mSupportsShaderModel3 = mDeviceCaps.PixelShaderVersion == D3DPS_VERSION(3, 0); mSupportsShaderModel3 = mDeviceCaps.PixelShaderVersion >= D3DPS_VERSION(3, 0);
mSupportsVertexTexture = mDisplay->getVertexTextureSupport(); mSupportsVertexTexture = mDisplay->getVertexTextureSupport();
mSupportsNonPower2Texture = mDisplay->getNonPower2TextureSupport(); mSupportsNonPower2Texture = mDisplay->getNonPower2TextureSupport();
mSupportsInstancing = mDisplay->getInstancingSupport();
mMaxTextureDimension = std::min(std::min((int)mDeviceCaps.MaxTextureWidth, (int)mDeviceCaps.MaxTextureHeight), mMaxTextureDimension = std::min(std::min((int)mDeviceCaps.MaxTextureWidth, (int)mDeviceCaps.MaxTextureHeight),
(int)gl::IMPLEMENTATION_MAX_TEXTURE_SIZE); (int)gl::IMPLEMENTATION_MAX_TEXTURE_SIZE);
...@@ -3461,6 +3462,11 @@ bool Context::supportsNonPower2Texture() const ...@@ -3461,6 +3462,11 @@ bool Context::supportsNonPower2Texture() const
return mSupportsNonPower2Texture; return mSupportsNonPower2Texture;
} }
bool Context::supportsInstancing() const
{
return mSupportsInstancing;
}
void Context::detachBuffer(GLuint buffer) void Context::detachBuffer(GLuint buffer)
{ {
// [OpenGL ES 2.0.24] section 2.9 page 22: // [OpenGL ES 2.0.24] section 2.9 page 22:
...@@ -3720,7 +3726,7 @@ void Context::initExtensionString() ...@@ -3720,7 +3726,7 @@ void Context::initExtensionString()
mExtensionString += "GL_ANGLE_framebuffer_multisample "; mExtensionString += "GL_ANGLE_framebuffer_multisample ";
} }
if (supportsShaderModel3()) if (supportsInstancing())
{ {
mExtensionString += "GL_ANGLE_instanced_arrays "; mExtensionString += "GL_ANGLE_instanced_arrays ";
} }
......
...@@ -497,6 +497,7 @@ class Context ...@@ -497,6 +497,7 @@ class Context
bool supportsLuminanceAlphaTextures() const; bool supportsLuminanceAlphaTextures() const;
bool supports32bitIndices() const; bool supports32bitIndices() const;
bool supportsNonPower2Texture() const; bool supportsNonPower2Texture() const;
bool supportsInstancing() const;
void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
...@@ -596,6 +597,7 @@ class Context ...@@ -596,6 +597,7 @@ class Context
bool mSupportsShaderModel3; bool mSupportsShaderModel3;
bool mSupportsVertexTexture; bool mSupportsVertexTexture;
bool mSupportsNonPower2Texture; bool mSupportsNonPower2Texture;
bool mSupportsInstancing;
int mMaxRenderbufferDimension; int mMaxRenderbufferDimension;
int mMaxTextureDimension; int mMaxTextureDimension;
int mMaxCubeTextureDimension; int mMaxCubeTextureDimension;
......
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