Use a hash map for faster resource lookups.

TRAC #14871 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@615 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 72b9e18c
#define MAJOR_VERSION 0
#define MINOR_VERSION 0
#define BUILD_VERSION 0
#define BUILD_REVISION 614
#define BUILD_REVISION 615
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
......
......@@ -186,12 +186,9 @@ GLuint Program::getAttributeLocation(const char *name)
int Program::getSemanticIndex(int attributeIndex)
{
if (attributeIndex >= 0 && attributeIndex < MAX_VERTEX_ATTRIBS)
{
return mSemanticIndex[attributeIndex];
}
return -1;
ASSERT(attributeIndex >= 0 && attributeIndex < MAX_VERTEX_ATTRIBS);
return mSemanticIndex[attributeIndex];
}
// Returns the index of the texture unit corresponding to a Direct3D 9 sampler
......
......@@ -13,7 +13,7 @@
#define GL_APICALL
#include <GLES2/gl2.h>
#include <map>
#include <hash_map>
#include "common/angleutils.h"
......@@ -71,19 +71,19 @@ class ResourceManager
std::size_t mRefCount;
typedef std::map<GLuint, Buffer*> BufferMap;
typedef stdext::hash_map<GLuint, Buffer*> BufferMap;
BufferMap mBufferMap;
typedef std::map<GLuint, Shader*> ShaderMap;
typedef stdext::hash_map<GLuint, Shader*> ShaderMap;
ShaderMap mShaderMap;
typedef std::map<GLuint, Program*> ProgramMap;
typedef stdext::hash_map<GLuint, Program*> ProgramMap;
ProgramMap mProgramMap;
typedef std::map<GLuint, Texture*> TextureMap;
typedef stdext::hash_map<GLuint, Texture*> TextureMap;
TextureMap mTextureMap;
typedef std::map<GLuint, Renderbuffer*> RenderbufferMap;
typedef stdext::hash_map<GLuint, Renderbuffer*> RenderbufferMap;
RenderbufferMap mRenderbufferMap;
};
......
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