Commit 1d4e38d3 by Jamie Madill

Fix compile warnings with attributes.

BUG=angle:676 Change-Id: I291c0b618854179f726cb4c969fb65182d3b591e Reviewed-on: https://chromium-review.googlesource.com/204340Tested-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarShannon Woods <shannonwoods@chromium.org>
parent 2a59292d
...@@ -236,7 +236,8 @@ bool StaticVertexBufferInterface::lookupAttribute(const gl::VertexAttribute &att ...@@ -236,7 +236,8 @@ bool StaticVertexBufferInterface::lookupAttribute(const gl::VertexAttribute &att
mCache[element].normalized == attrib.normalized && mCache[element].normalized == attrib.normalized &&
mCache[element].pureInteger == attrib.pureInteger) mCache[element].pureInteger == attrib.pureInteger)
{ {
if (mCache[element].attributeOffset == attrib.offset % ComputeVertexAttributeStride(attrib)) size_t offset = (static_cast<size_t>(attrib.offset) % ComputeVertexAttributeStride(attrib));
if (mCache[element].attributeOffset == offset)
{ {
if (outStreamOffset) if (outStreamOffset)
{ {
...@@ -275,7 +276,7 @@ bool StaticVertexBufferInterface::storeVertexAttributes(const gl::VertexAttribut ...@@ -275,7 +276,7 @@ bool StaticVertexBufferInterface::storeVertexAttributes(const gl::VertexAttribut
unsigned int streamOffset; unsigned int streamOffset;
if (VertexBufferInterface::storeVertexAttributes(attrib, currentValue, start, count, instances, &streamOffset)) if (VertexBufferInterface::storeVertexAttributes(attrib, currentValue, start, count, instances, &streamOffset))
{ {
int attributeOffset = attrib.offset % ComputeVertexAttributeStride(attrib); size_t attributeOffset = static_cast<size_t>(attrib.offset) % ComputeVertexAttributeStride(attrib);
VertexElement element = { attrib.type, attrib.size, ComputeVertexAttributeStride(attrib), attrib.normalized, attrib.pureInteger, attributeOffset, streamOffset }; VertexElement element = { attrib.type, attrib.size, ComputeVertexAttributeStride(attrib), attrib.normalized, attrib.pureInteger, attributeOffset, streamOffset };
mCache.push_back(element); mCache.push_back(element);
......
...@@ -110,7 +110,7 @@ class StaticVertexBufferInterface : public VertexBufferInterface ...@@ -110,7 +110,7 @@ class StaticVertexBufferInterface : public VertexBufferInterface
~StaticVertexBufferInterface(); ~StaticVertexBufferInterface();
bool storeVertexAttributes(const gl::VertexAttribute &attrib, const gl::VertexAttribCurrentValueData &currentValue, bool storeVertexAttributes(const gl::VertexAttribute &attrib, const gl::VertexAttribCurrentValueData &currentValue,
GLint start, GLsizei count, GLsizei instances, unsigned int *outStreamOffset); GLint start, GLsizei count, GLsizei instances, unsigned int *outStreamOffset);
bool lookupAttribute(const gl::VertexAttribute &attribute, unsigned int* outStreamFffset); bool lookupAttribute(const gl::VertexAttribute &attribute, unsigned int* outStreamFffset);
...@@ -121,11 +121,11 @@ class StaticVertexBufferInterface : public VertexBufferInterface ...@@ -121,11 +121,11 @@ class StaticVertexBufferInterface : public VertexBufferInterface
struct VertexElement struct VertexElement
{ {
GLenum type; GLenum type;
GLint size; GLuint size;
GLsizei stride; GLuint stride;
bool normalized; bool normalized;
bool pureInteger; bool pureInteger;
int attributeOffset; size_t attributeOffset;
unsigned int streamOffset; unsigned int streamOffset;
}; };
......
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