Commit 662c3afa by Geoff Lang

Change the offset variable to an unsigned int since it cannot be negative and is…

Change the offset variable to an unsigned int since it cannot be negative and is assigned to streamOffset which is an unsigned int. TRAC #23671 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods Author: Geoff Lang
parent 23307051
......@@ -115,13 +115,19 @@ GLenum IndexDataManager::prepareIndexData(GLenum type, GLsizei count, gl::Buffer
}
GLenum destinationIndexType = (type == GL_UNSIGNED_INT) ? GL_UNSIGNED_INT : GL_UNSIGNED_SHORT;
intptr_t offset = reinterpret_cast<intptr_t>(indices);
unsigned int offset = 0;
bool alignedOffset = false;
BufferStorage *storage = NULL;
if (buffer != NULL)
{
if (reinterpret_cast<uintptr_t>(indices) > std::numeric_limits<unsigned int>::max())
{
return GL_OUT_OF_MEMORY;
}
offset = static_cast<unsigned int>(reinterpret_cast<uintptr_t>(indices));
storage = buffer->getStorage();
switch (type)
......
......@@ -16,7 +16,7 @@
namespace rx
{
void IndexRangeCache::addRange(GLenum type, intptr_t offset, GLsizei count, unsigned int minIdx, unsigned int maxIdx,
void IndexRangeCache::addRange(GLenum type, unsigned int offset, GLsizei count, unsigned int minIdx, unsigned int maxIdx,
unsigned int streamOffset)
{
mIndexRangeCache[IndexRange(type, offset, count)] = IndexBounds(minIdx, maxIdx, streamOffset);
......@@ -44,7 +44,7 @@ void IndexRangeCache::invalidateRange(unsigned int offset, unsigned int size)
}
}
bool IndexRangeCache::findRange(GLenum type, intptr_t offset, GLsizei count, unsigned int *outMinIndex,
bool IndexRangeCache::findRange(GLenum type, unsigned int offset, GLsizei count, unsigned int *outMinIndex,
unsigned int *outMaxIndex, unsigned int *outStreamOffset) const
{
IndexRangeMap::const_iterator i = mIndexRangeCache.find(IndexRange(type, offset, count));
......
......@@ -18,9 +18,9 @@ namespace rx
class IndexRangeCache
{
public:
void addRange(GLenum type, intptr_t offset, GLsizei count, unsigned int minIdx, unsigned int maxIdx,
void addRange(GLenum type, unsigned int offset, GLsizei count, unsigned int minIdx, unsigned int maxIdx,
unsigned int streamOffset);
bool findRange(GLenum type, intptr_t offset, GLsizei count, unsigned int *outMinIndex,
bool findRange(GLenum type, unsigned int offset, GLsizei count, unsigned int *outMinIndex,
unsigned int *outMaxIndex, unsigned int *outStreamOffset) const;
void invalidateRange(unsigned int offset, unsigned int size);
......@@ -30,7 +30,7 @@ class IndexRangeCache
struct IndexRange
{
GLenum type;
intptr_t offset;
unsigned int offset;
GLsizei count;
IndexRange();
......
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