Showing the changes to libraries/render-utils/src/GeometryCache.cpp (1 of 1 file). Show all
Unified · Split
| @@ -673,8 +673,7 @@ void GeometryCache::renderQuad(const glm::vec2& minCorner, const glm::vec2& maxC · 672 unmodified lines | ||
| 673 | 673 | Vec2Pair key(minCorner, maxCorner); |
| 674 | 674 | VerticesIndices& vbo = registeredQuad ? _registeredQuadVBOs[quadID] : _quad2DVBOs[key]; |
| 675 | 675 | |
| 676 | − // if this is a registered quad, and we have buffers, then clear them and rebuild | |
| 677 | − // TODO: would be nice to only rebuild if the geometry changed from last time. | |
| 676 | + // if this is a registered quad, and we have buffers, then check to see if the geometry changed and rebuild if needed | |
| 678 | 677 | if (registeredQuad && vbo.first != 0) { |
| 679 | 678 | Vec2Pair& lastKey = _lastRegisteredQuad2D[quadID]; |
| 680 | 679 | if (lastKey != key) { |
| @@ -757,7 +756,7 @@ void GeometryCache::renderQuad(const glm::vec2& minCorner, const glm::vec2& maxC · 76 unmodified lines | ||
| 757 | 756 | Vec2PairPair key(Vec2Pair(minCorner, maxCorner), Vec2Pair(texCoordMinCorner, texCoordMaxCorner)); |
| 758 | 757 | VerticesIndices& vbo = registeredQuad ? _registeredQuadVBOs[quadID] : _quad2DTextureVBOs[key]; |
| 759 | 758 | |
| 760 | − // if this is a registered quad, and we have buffers, then clear them and rebuild | |
| 759 | + // if this is a registered quad, and we have buffers, then check to see if the geometry changed and rebuild if needed | |
| 761 | 760 | if (registeredQuad && vbo.first != 0) { |
| 762 | 761 | Vec2PairPair& lastKey = _lastRegisteredQuad2DTexture[quadID]; |
| 763 | 762 | if (lastKey != key) { |
| @@ -855,8 +854,7 @@ void GeometryCache::renderQuad(const glm::vec3& minCorner, const glm::vec3& maxC · 91 unmodified lines | ||
| 855 | 854 | Vec3Pair key(minCorner, maxCorner); |
| 856 | 855 | VerticesIndices& vbo = registeredQuad ? _registeredQuadVBOs[quadID] : _quad3DVBOs[key]; |
| 857 | 856 | |
| 858 | − // if this is a registered quad, and we have buffers, then clear them and rebuild | |
| 859 | − // TODO: would be nice to only rebuild if the geometry changed from last time. | |
| 857 | + // if this is a registered quad, and we have buffers, then check to see if the geometry changed and rebuild if needed | |
| 860 | 858 | if (registeredQuad && vbo.first != 0) { |
| 861 | 859 | Vec3Pair& lastKey = _lastRegisteredQuad3D[quadID]; |
| 862 | 860 | if (lastKey != key) { |
| @@ -959,8 +957,7 @@ void GeometryCache::renderQuad(const glm::vec3& topLeft, const glm::vec3& bottom · 96 unmodified lines | ||
| 959 | 957 | Vec3PairVec2Pair key(Vec3Pair(topLeft, bottomRight), Vec2Pair(texCoordTopLeft, texCoordBottomRight)); |
| 960 | 958 | VerticesIndices& vbo = registeredQuad ? _registeredQuadVBOs[quadID] : _quad3DTextureVBOs[key]; |
| 961 | 959 | |
| 962 | − // if this is a registered quad, and we have buffers, then clear them and rebuild | |
| 963 | − // TODO: would be nice to only rebuild if the geometry changed from last time. | |
| 960 | + // if this is a registered quad, and we have buffers, then check to see if the geometry changed and rebuild if needed | |
| 964 | 961 | if (registeredQuad && vbo.first != 0) { |
| 965 | 962 | Vec3PairVec2Pair& lastKey = _lastRegisteredQuad3DTexture[quadID]; |
| 966 | 963 | if (lastKey != key) { |