From 4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 11 Jul 2018 18:11:13 +0200 Subject: Roll back to ANGLE/2845 --- gfx/angle/src/libANGLE/VertexAttribute.inl | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'gfx/angle/src/libANGLE/VertexAttribute.inl') diff --git a/gfx/angle/src/libANGLE/VertexAttribute.inl b/gfx/angle/src/libANGLE/VertexAttribute.inl index a1f88f317..0cd31f676 100755 --- a/gfx/angle/src/libANGLE/VertexAttribute.inl +++ b/gfx/angle/src/libANGLE/VertexAttribute.inl @@ -27,6 +27,33 @@ inline bool operator!=(const VertexAttribute &a, const VertexAttribute &b) return !(a == b); } +template +T QuerySingleVertexAttributeParameter(const VertexAttribute& attrib, GLenum pname) +{ + switch (pname) + { + case GL_VERTEX_ATTRIB_ARRAY_ENABLED: + return static_cast(attrib.enabled ? GL_TRUE : GL_FALSE); + case GL_VERTEX_ATTRIB_ARRAY_SIZE: + return static_cast(attrib.size); + case GL_VERTEX_ATTRIB_ARRAY_STRIDE: + return static_cast(attrib.stride); + case GL_VERTEX_ATTRIB_ARRAY_TYPE: + return static_cast(attrib.type); + case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED: + return static_cast(attrib.normalized ? GL_TRUE : GL_FALSE); + case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: + return static_cast(attrib.buffer.id()); + case GL_VERTEX_ATTRIB_ARRAY_DIVISOR: + return static_cast(attrib.divisor); + case GL_VERTEX_ATTRIB_ARRAY_INTEGER: + return static_cast(attrib.pureInteger ? GL_TRUE : GL_FALSE); + default: + UNREACHABLE(); + return static_cast(0); + } +} + inline VertexAttribCurrentValueData::VertexAttribCurrentValueData() : Type(GL_FLOAT) { -- cgit v1.2.3