summaryrefslogtreecommitdiff
path: root/indra/llrender/llvertexbuffer.cpp
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2018-01-17 03:20:12 +0200
committerAndreyL ProductEngine <alihatskiy@productengine.com>2018-01-17 03:20:12 +0200
commit57a99273ed023bd71c54399969e66ffc23eebc57 (patch)
treed8569d41eaf78348e458f550f382375cac47924d /indra/llrender/llvertexbuffer.cpp
parent6ac2b2bb4f569b6663607894034b4ec64804e905 (diff)
parent7acbd8ed8d73c507675d45360df07d232c431a8b (diff)
Merged in lindenlab/viewer-release
Diffstat (limited to 'indra/llrender/llvertexbuffer.cpp')
-rw-r--r--indra/llrender/llvertexbuffer.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 35c771b61b..f10301b42d 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -1473,13 +1473,22 @@ void LLVertexBuffer::setupVertexArray()
//glVertexattribIPointer requires GLSL 1.30 or later
if (gGLManager.mGLSLVersionMajor > 1 || gGLManager.mGLSLVersionMinor >= 30)
{
- glVertexAttribIPointer(i, attrib_size[i], attrib_type[i], sTypeSize[i], (void*) mOffsets[i]);
+ glVertexAttribIPointer(i, attrib_size[i], attrib_type[i], sTypeSize[i], (const GLvoid*) mOffsets[i]);
}
#endif
}
else
{
- glVertexAttribPointerARB(i, attrib_size[i], attrib_type[i], attrib_normalized[i], sTypeSize[i], (void*) mOffsets[i]);
+ // nat 2016-12-16: With 64-bit clang compile, the compiler
+ // produces an error if we simply cast mOffsets[i] -- an S32
+ // -- to (GLvoid *), the type of the parameter. It correctly
+ // points out that there's no way an S32 could fit a real
+ // pointer value. Ruslan asserts that in this case the last
+ // param is interpreted as an array data offset within the VBO
+ // rather than as an actual pointer, so it's okay.
+ glVertexAttribPointerARB(i, attrib_size[i], attrib_type[i],
+ attrib_normalized[i], sTypeSize[i],
+ reinterpret_cast<GLvoid*>(mOffsets[i]));
}
}
else