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 MINOR_VERSION 0
#define BUILD_VERSION 0
#define BUILD_REVISION 965
#define BUILD_REVISION 976
#define STRINGIFY(x) #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
// found in the LICENSE file.
//
......@@ -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
// found in the LICENSE file.
//
......@@ -79,6 +79,7 @@ class Display
virtual bool getVertexTextureSupport() const;
virtual bool getNonPower2TextureSupport() const;
virtual bool getOcclusionQuerySupport() const;
virtual bool getInstancingSupport() const;
virtual D3DPOOL getBufferPool(DWORD usage) const;
virtual D3DPOOL getTexturePool(bool renderable) const;
......
......@@ -262,9 +262,10 @@ void Context::makeCurrent(egl::Display *display, egl::Surface *surface)
mIndexDataManager = new IndexDataManager(this, mDevice);
mBlit = new Blit(this);
mSupportsShaderModel3 = mDeviceCaps.PixelShaderVersion == D3DPS_VERSION(3, 0);
mSupportsShaderModel3 = mDeviceCaps.PixelShaderVersion >= D3DPS_VERSION(3, 0);
mSupportsVertexTexture = mDisplay->getVertexTextureSupport();
mSupportsNonPower2Texture = mDisplay->getNonPower2TextureSupport();
mSupportsInstancing = mDisplay->getInstancingSupport();
mMaxTextureDimension = std::min(std::min((int)mDeviceCaps.MaxTextureWidth, (int)mDeviceCaps.MaxTextureHeight),
(int)gl::IMPLEMENTATION_MAX_TEXTURE_SIZE);
......@@ -3461,6 +3462,11 @@ bool Context::supportsNonPower2Texture() const
return mSupportsNonPower2Texture;
}
bool Context::supportsInstancing() const
{
return mSupportsInstancing;
}
void Context::detachBuffer(GLuint buffer)
{
// [OpenGL ES 2.0.24] section 2.9 page 22:
......@@ -3720,7 +3726,7 @@ void Context::initExtensionString()
mExtensionString += "GL_ANGLE_framebuffer_multisample ";
}
if (supportsShaderModel3())
if (supportsInstancing())
{
mExtensionString += "GL_ANGLE_instanced_arrays ";
}
......
......@@ -497,6 +497,7 @@ class Context
bool supportsLuminanceAlphaTextures() const;
bool supports32bitIndices() const;
bool supportsNonPower2Texture() const;
bool supportsInstancing() const;
void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
......@@ -596,6 +597,7 @@ class Context
bool mSupportsShaderModel3;
bool mSupportsVertexTexture;
bool mSupportsNonPower2Texture;
bool mSupportsInstancing;
int mMaxRenderbufferDimension;
int mMaxTextureDimension;
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