diff options
author | Dave Houlton <euclid@lindenlab.com> | 2020-07-23 12:21:18 -0600 |
---|---|---|
committer | Dave Houlton <euclid@lindenlab.com> | 2020-07-23 12:21:18 -0600 |
commit | 64a9ad0f5f52dac633a76e39335a7def2573b82e (patch) | |
tree | e47af1ff1bd1db52fd93c11d857b11387bacf01a /indra/llrender | |
parent | 05200cf827d9a6263adc4905bf41a4905bce2659 (diff) | |
parent | 72423372d6cd7f763a5567ad75752fa4e7131d60 (diff) |
Merge branch 'master' v6.4.6 into DRTVWR-497
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/llgl.cpp | 6 | ||||
-rw-r--r-- | indra/llrender/llvertexbuffer.cpp | 9 |
2 files changed, 9 insertions, 6 deletions
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 4c56b8eace..84f3796398 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -2461,9 +2461,8 @@ void LLGLNamePool::release(GLuint name) //static void LLGLNamePool::upkeepPools() { - for (tracker_t::instance_iter iter = beginInstances(); iter != endInstances(); ++iter) + for (auto& pool : instance_snapshot()) { - LLGLNamePool & pool = *iter; pool.upkeep(); } } @@ -2471,9 +2470,8 @@ void LLGLNamePool::upkeepPools() //static void LLGLNamePool::cleanupPools() { - for (tracker_t::instance_iter iter = beginInstances(); iter != endInstances(); ++iter) + for (auto& pool : instance_snapshot()) { - LLGLNamePool & pool = *iter; pool.cleanup(); } } 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 |