summaryrefslogtreecommitdiffstats
path: root/src/render/graphicshelpers/graphicshelpergl3_3.cpp
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2017-08-05 15:22:33 +0100
committerSean Harmer <sean.harmer@kdab.com>2017-08-10 10:41:30 +0000
commit8103be87b5810f7dd30082844549a5192dd6d180 (patch)
treeb70a2238984791038c793734e5da6580929e2d2b /src/render/graphicshelpers/graphicshelpergl3_3.cpp
parente2e1a7986f92f76a2a2e79f911248de604af382f (diff)
Add wrappers for glEnableVertexAttrib and glVertexAttrib*Pointer
Needed to work around QTBUG-43199 to be able to specify integer vertex attributes such as joint indices. Change-Id: I39ab83e881b6afb75467c76b56125917013b3bca Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/graphicshelpers/graphicshelpergl3_3.cpp')
-rw-r--r--src/render/graphicshelpers/graphicshelpergl3_3.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/render/graphicshelpers/graphicshelpergl3_3.cpp b/src/render/graphicshelpers/graphicshelpergl3_3.cpp
index abde62355..fbb1455c6 100644
--- a/src/render/graphicshelpers/graphicshelpergl3_3.cpp
+++ b/src/render/graphicshelpers/graphicshelpergl3_3.cpp
@@ -276,6 +276,38 @@ void GraphicsHelperGL3_3::vertexAttribDivisor(GLuint index, GLuint divisor)
m_funcs->glVertexAttribDivisor(index, divisor);
}
+void GraphicsHelperGL3_3::vertexAttributePointer(GLenum shaderDataType,
+ GLuint index,
+ GLint size,
+ GLenum type,
+ GLboolean normalized,
+ GLsizei stride,
+ const GLvoid *pointer)
+{
+ switch (shaderDataType) {
+ case GL_FLOAT:
+ case GL_FLOAT_VEC2:
+ case GL_FLOAT_VEC3:
+ case GL_FLOAT_VEC4:
+ m_funcs->glVertexAttribPointer(index, size, type, normalized, stride, pointer);
+ break;
+
+ case GL_INT:
+ case GL_INT_VEC2:
+ case GL_INT_VEC3:
+ case GL_INT_VEC4:
+ case GL_UNSIGNED_INT:
+ case GL_UNSIGNED_INT_VEC2:
+ case GL_UNSIGNED_INT_VEC3:
+ case GL_UNSIGNED_INT_VEC4:
+ m_funcs->glVertexAttribIPointer(index, size, type, stride, pointer);
+ break;
+
+ default:
+ qCWarning(Render::Rendering) << "vertexAttribPointer: Unhandled type";
+ }
+}
+
void GraphicsHelperGL3_3::blendEquation(GLenum mode)
{
m_funcs->glBlendEquation(mode);
@@ -819,6 +851,11 @@ void GraphicsHelperGL3_3::enablePrimitiveRestart(int primitiveRestartIndex)
m_funcs->glEnable(GL_PRIMITIVE_RESTART);
}
+void GraphicsHelperGL3_3::enableVertexAttributeArray(int location)
+{
+ m_funcs->glEnableVertexAttribArray(location);
+}
+
void GraphicsHelperGL3_3::disablePrimitiveRestart()
{
m_funcs->glDisable(GL_PRIMITIVE_RESTART);