From 1d4e38d364f365c568f676927611656f76b6bcb3 Mon Sep 17 00:00:00 2001 From: Jamie Madill Date: Tue, 17 Jun 2014 10:23:54 -0400 Subject: [PATCH] Fix compile warnings with attributes. BUG=angle:676 Change-Id: I291c0b618854179f726cb4c969fb65182d3b591e Reviewed-on: https://chromium-review.googlesource.com/204340 Tested-by: Jamie Madill Reviewed-by: Geoff Lang Reviewed-by: Shannon Woods --- src/libGLESv2/renderer/VertexBuffer.cpp | 5 +++-- src/libGLESv2/renderer/VertexBuffer.h | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/libGLESv2/renderer/VertexBuffer.cpp b/src/libGLESv2/renderer/VertexBuffer.cpp index 87d023f17..cbcd8016c 100644 --- a/src/libGLESv2/renderer/VertexBuffer.cpp +++ b/src/libGLESv2/renderer/VertexBuffer.cpp @@ -236,7 +236,8 @@ bool StaticVertexBufferInterface::lookupAttribute(const gl::VertexAttribute &att mCache[element].normalized == attrib.normalized && mCache[element].pureInteger == attrib.pureInteger) { - if (mCache[element].attributeOffset == attrib.offset % ComputeVertexAttributeStride(attrib)) + size_t offset = (static_cast(attrib.offset) % ComputeVertexAttributeStride(attrib)); + if (mCache[element].attributeOffset == offset) { if (outStreamOffset) { @@ -275,7 +276,7 @@ bool StaticVertexBufferInterface::storeVertexAttributes(const gl::VertexAttribut unsigned int streamOffset; if (VertexBufferInterface::storeVertexAttributes(attrib, currentValue, start, count, instances, &streamOffset)) { - int attributeOffset = attrib.offset % ComputeVertexAttributeStride(attrib); + size_t attributeOffset = static_cast(attrib.offset) % ComputeVertexAttributeStride(attrib); VertexElement element = { attrib.type, attrib.size, ComputeVertexAttributeStride(attrib), attrib.normalized, attrib.pureInteger, attributeOffset, streamOffset }; mCache.push_back(element); diff --git a/src/libGLESv2/renderer/VertexBuffer.h b/src/libGLESv2/renderer/VertexBuffer.h index d492de74d..c5022d8c9 100644 --- a/src/libGLESv2/renderer/VertexBuffer.h +++ b/src/libGLESv2/renderer/VertexBuffer.h @@ -110,7 +110,7 @@ class StaticVertexBufferInterface : public VertexBufferInterface ~StaticVertexBufferInterface(); bool storeVertexAttributes(const gl::VertexAttribute &attrib, const gl::VertexAttribCurrentValueData ¤tValue, - 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); @@ -121,11 +121,11 @@ class StaticVertexBufferInterface : public VertexBufferInterface struct VertexElement { GLenum type; - GLint size; - GLsizei stride; + GLuint size; + GLuint stride; bool normalized; bool pureInteger; - int attributeOffset; + size_t attributeOffset; unsigned int streamOffset; };