diff --git a/libraries/gpu/src/gpu/GLBackend.cpp b/libraries/gpu/src/gpu/GLBackend.cpp index e429ae7ef1..dbabee65ff 100644 --- a/libraries/gpu/src/gpu/GLBackend.cpp +++ b/libraries/gpu/src/gpu/GLBackend.cpp @@ -161,6 +161,8 @@ void GLBackend::renderPassTransfer(Batch& batch) { _transform._cameras.clear(); _transform._cameraOffsets.clear(); _transform._objects.clear(); + _drawCallInfos.clear(); + _namedDrawCallInfos.clear(); for (_commandIndex = 0; _commandIndex < numCommands; ++_commandIndex) { switch (*command) { @@ -286,7 +288,7 @@ GLBackend::DrawCallInfoBuffer& GLBackend::getDrawCallInfoBuffer() { void GLBackend::captureDrawCallInfo() { auto& drawCallInfos = getDrawCallInfoBuffer(); - drawCallInfos.push_back(_transform._objects.size() - 1); + drawCallInfos.push_back((uint16)_transform._objects.size() - 1); } bool GLBackend::checkGLError(const char* name) { diff --git a/libraries/gpu/src/gpu/GLBackend.h b/libraries/gpu/src/gpu/GLBackend.h index 5fcf5316a9..85fada4016 100644 --- a/libraries/gpu/src/gpu/GLBackend.h +++ b/libraries/gpu/src/gpu/GLBackend.h @@ -251,8 +251,8 @@ protected: DrawCallInfo(Index idx) : index(idx) {} - Index index; - uint16_t unused; // Reserved space for later + Index index { 0 }; + uint16_t unused { 0 }; // Reserved space for later }; // Make sure DrawCallInfo has no extra padding static_assert(sizeof(DrawCallInfo) == 4, "DrawCallInfo size is incorrect."); @@ -344,7 +344,7 @@ protected: void killTransform(); // Synchronize the state cache of this Backend with the actual real state of the GL Context void syncTransformStateCache(); - void updateTransform() const; + void updateTransform(); void resetTransformStage(); struct TransformStageState { diff --git a/libraries/gpu/src/gpu/GLBackendTransform.cpp b/libraries/gpu/src/gpu/GLBackendTransform.cpp index cffe066e6d..b2f2e414ff 100755 --- a/libraries/gpu/src/gpu/GLBackendTransform.cpp +++ b/libraries/gpu/src/gpu/GLBackendTransform.cpp @@ -180,10 +180,10 @@ void GLBackend::TransformStageState::update(size_t commandIndex, const StereoSta (void)CHECK_GL_ERROR(); } -void GLBackend::updateTransform() const { +void GLBackend::updateTransform() { _transform.update(_commandIndex, _stereo); - auto& drawCallInfo = _drawCallInfos[_currentDraw]; + auto& drawCallInfo = getDrawCallInfoBuffer()[_currentDraw]; glVertexAttribI2i(gpu::Stream::DRAW_CALL_INFO, drawCallInfo.index, drawCallInfo.unused); }