summaryrefslogtreecommitdiff
path: root/indra/llrender/llvertexbuffer.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2020-07-22 17:51:10 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2020-07-22 17:51:10 +0100
commit6037847ea133c6faed0ff4bea023d72f5799d9e1 (patch)
tree4153ae1af4b074b9bd3cd9a0d84fc2b429a909f3 /indra/llrender/llvertexbuffer.cpp
parenta9ddf20ff2c704d30ec4b4d8652da0b0775b7631 (diff)
parent72423372d6cd7f763a5567ad75752fa4e7131d60 (diff)
Merge remote-tracking branch 'origin/master' into SL-12995
Diffstat (limited to 'indra/llrender/llvertexbuffer.cpp')
-rw-r--r--indra/llrender/llvertexbuffer.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 94a04d4ddb..6a02cd9c19 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -1478,7 +1478,12 @@ 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], (const GLvoid*) mOffsets[i]);
+ // nat 2018-10-24: VS 2017 also notices the issue
+ // described below, and warns even with reinterpret_cast.
+ // Cast via intptr_t to make it painfully obvious to the
+ // compiler that we're doing this intentionally.
+ glVertexAttribIPointer(i, attrib_size[i], attrib_type[i], sTypeSize[i],
+ reinterpret_cast<const GLvoid*>(intptr_t(mOffsets[i])));
}
#endif
}
@@ -1493,7 +1498,7 @@ void LLVertexBuffer::setupVertexArray()
// 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]));
+ reinterpret_cast<GLvoid*>(intptr_t(mOffsets[i])));
}
}
else