From a72d4157935a43a9848e539230e521198d2dd3f9 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sat, 21 Feb 2015 12:42:05 +0100 Subject: [PATCH] GRAPHICS: Revert "GRAPHICS: Add support for integer shader attributes" This is not supported in OpenGL 2.1 This reverts commit a081bbfdc3844a11463baf190acb6d9dd884f1ae. --- graphics/opengles2/shader.cpp | 18 +----------------- graphics/opengles2/shader.h | 4 +--- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/graphics/opengles2/shader.cpp b/graphics/opengles2/shader.cpp index d3752be1f10..1cf8bd95a73 100644 --- a/graphics/opengles2/shader.cpp +++ b/graphics/opengles2/shader.cpp @@ -170,11 +170,7 @@ void Shader::use(bool forceReload) { if (attrib._enabled) { glEnableVertexAttribArray(i); glBindBuffer(GL_ARRAY_BUFFER, attrib._vbo); - if (attrib._integer) { - glVertexAttribIPointer(i, attrib._size, attrib._type, attrib._stride, (const GLvoid *)attrib._offset); - } else { - glVertexAttribPointer(i, attrib._size, attrib._type, attrib._normalized, attrib._stride, (const GLvoid *)attrib._offset); - } + glVertexAttribPointer(i, attrib._size, attrib._type, attrib._normalized, attrib._stride, (const GLvoid *)attrib._offset); } else { glDisableVertexAttribArray(i); switch (attrib._size) { @@ -220,7 +216,6 @@ VertexAttrib &Shader::getAttribute(const char *attrib) { void Shader::enableVertexAttribute(const char *attrib, GLuint vbo, GLint size, GLenum type, GLboolean normalized, GLsizei stride, uint32 offset) { VertexAttrib &va = getAttribute(attrib); va._enabled = true; - va._integer = false; va._vbo = vbo; va._size = size; va._type = type; @@ -229,17 +224,6 @@ void Shader::enableVertexAttribute(const char *attrib, GLuint vbo, GLint size, G va._offset = offset; } -void Shader::enableIntegerVertexAttribute(const char *attrib, GLuint vbo, GLint size, GLenum type, GLsizei stride, uint32 offset) { - VertexAttrib &va = getAttribute(attrib); - va._enabled = true; - va._integer = true; - va._vbo = vbo; - va._size = size; - va._type = type; - va._stride = stride; - va._offset = offset; -} - void Shader::disableVertexAttribute(const char *attrib, int size, const float *data) { VertexAttrib &va = getAttribute(attrib); va._enabled = false; diff --git a/graphics/opengles2/shader.h b/graphics/opengles2/shader.h index 682a6c6ede5..2f9aade3b0b 100644 --- a/graphics/opengles2/shader.h +++ b/graphics/opengles2/shader.h @@ -45,10 +45,9 @@ namespace BuiltinShaders { struct VertexAttrib { VertexAttrib(uint32 idx, const char *name) : - _enabled(false), _integer(false), _idx(idx), _name(name), _vbo(0), _size(0), + _enabled(false), _idx(idx), _name(name), _vbo(0), _size(0), _type(GL_FLOAT), _normalized(false), _stride(0), _offset(0) {} bool _enabled; - bool _integer; uint32 _idx; Common::String _name; GLuint _vbo; @@ -126,7 +125,6 @@ public: } void enableVertexAttribute(const char *attrib, GLuint vbo, GLint size, GLenum type, GLboolean normalized, GLsizei stride, uint32 offset); - void enableIntegerVertexAttribute(const char *attrib, GLuint vbo, GLint size, GLenum type, GLsizei stride, uint32 offset); void disableVertexAttribute(const char *attrib, int size, const float *data); template void disableVertexAttribute(const char *attrib, const Math::Matrix &m) {