diff options
author | Oliver Wolff <oliver.wolff@theqtcompany.com> | 2016-03-24 12:38:18 +0100 |
---|---|---|
committer | Oliver Wolff <oliver.wolff@qt.io> | 2016-04-25 05:57:38 +0000 |
commit | e12ba07322cd61c5cf50c25ed8d1f08f6b1ff879 (patch) | |
tree | d31a44c9f123ed764a00eff7b4fff656a07d54ab /src/3rdparty/angle/src/libANGLE/VertexAttribute.h | |
parent | d3dcc6f610b97be7cbfbb0a65988e5940568c825 (diff) |
Update ANGLE to chromium/2651
Change-Id: I1cd32b780b1a0b913fab870e155ae1f4f9ac40d7
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'src/3rdparty/angle/src/libANGLE/VertexAttribute.h')
-rw-r--r-- | src/3rdparty/angle/src/libANGLE/VertexAttribute.h | 73 |
1 files changed, 13 insertions, 60 deletions
diff --git a/src/3rdparty/angle/src/libANGLE/VertexAttribute.h b/src/3rdparty/angle/src/libANGLE/VertexAttribute.h index bdffe97466..d1ee1b47a2 100644 --- a/src/3rdparty/angle/src/libANGLE/VertexAttribute.h +++ b/src/3rdparty/angle/src/libANGLE/VertexAttribute.h @@ -40,34 +40,13 @@ bool operator==(const VertexAttribute &a, const VertexAttribute &b); bool operator!=(const VertexAttribute &a, const VertexAttribute &b); template <typename T> -T QuerySingleVertexAttributeParameter(const VertexAttribute& attrib, GLenum pname) -{ - switch (pname) - { - case GL_VERTEX_ATTRIB_ARRAY_ENABLED: - return static_cast<T>(attrib.enabled ? GL_TRUE : GL_FALSE); - case GL_VERTEX_ATTRIB_ARRAY_SIZE: - return static_cast<T>(attrib.size); - case GL_VERTEX_ATTRIB_ARRAY_STRIDE: - return static_cast<T>(attrib.stride); - case GL_VERTEX_ATTRIB_ARRAY_TYPE: - return static_cast<T>(attrib.type); - case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED: - return static_cast<T>(attrib.normalized ? GL_TRUE : GL_FALSE); - case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: - return static_cast<T>(attrib.buffer.id()); - case GL_VERTEX_ATTRIB_ARRAY_DIVISOR: - return static_cast<T>(attrib.divisor); - case GL_VERTEX_ATTRIB_ARRAY_INTEGER: - return static_cast<T>(attrib.pureInteger ? GL_TRUE : GL_FALSE); - default: - UNREACHABLE(); - return static_cast<T>(0); - } -} +T QuerySingleVertexAttributeParameter(const VertexAttribute& attrib, GLenum pname); size_t ComputeVertexAttributeTypeSize(const VertexAttribute& attrib); size_t ComputeVertexAttributeStride(const VertexAttribute& attrib); +size_t ComputeVertexAttributeElementCount(const VertexAttribute &attrib, + size_t drawCount, + size_t instanceCount); struct VertexAttribCurrentValueData { @@ -79,44 +58,18 @@ struct VertexAttribCurrentValueData }; GLenum Type; - void setFloatValues(const GLfloat floatValues[4]) - { - for (unsigned int valueIndex = 0; valueIndex < 4; valueIndex++) - { - FloatValues[valueIndex] = floatValues[valueIndex]; - } - Type = GL_FLOAT; - } - - void setIntValues(const GLint intValues[4]) - { - for (unsigned int valueIndex = 0; valueIndex < 4; valueIndex++) - { - IntValues[valueIndex] = intValues[valueIndex]; - } - Type = GL_INT; - } - - void setUnsignedIntValues(const GLuint unsignedIntValues[4]) - { - for (unsigned int valueIndex = 0; valueIndex < 4; valueIndex++) - { - UnsignedIntValues[valueIndex] = unsignedIntValues[valueIndex]; - } - Type = GL_UNSIGNED_INT; - } - - bool operator==(const VertexAttribCurrentValueData &other) - { - return (Type == other.Type && memcmp(FloatValues, other.FloatValues, sizeof(float) * 4) == 0); - } + VertexAttribCurrentValueData(); - bool operator!=(const VertexAttribCurrentValueData &other) - { - return !(*this == other); - } + void setFloatValues(const GLfloat floatValues[4]); + void setIntValues(const GLint intValues[4]); + void setUnsignedIntValues(const GLuint unsignedIntValues[4]); }; +bool operator==(const VertexAttribCurrentValueData &a, const VertexAttribCurrentValueData &b); +bool operator!=(const VertexAttribCurrentValueData &a, const VertexAttribCurrentValueData &b); + } +#include "VertexAttribute.inl" + #endif // LIBANGLE_VERTEXATTRIBUTE_H_ |