From 2bc8191fa628b49492e1f02c6c5d4ddbe5ae94b8 Mon Sep 17 00:00:00 2001 From: samcake Date: Wed, 20 Apr 2016 18:04:11 -0700 Subject: [PATCH] one more comment from review --- libraries/gpu/src/gpu/GLBackend.h | 3 ++- libraries/gpu/src/gpu/GLBackendTransform.cpp | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libraries/gpu/src/gpu/GLBackend.h b/libraries/gpu/src/gpu/GLBackend.h index 38475d415a..bf94cf9b87 100644 --- a/libraries/gpu/src/gpu/GLBackend.h +++ b/libraries/gpu/src/gpu/GLBackend.h @@ -320,6 +320,7 @@ public: void do_setStateColorWriteMask(uint32 mask); protected: + static const size_t INVALID_OFFSET = (size_t)-1; bool _inRenderTransferPass; @@ -435,7 +436,7 @@ protected: using List = std::list; List _cameraOffsets; mutable List::const_iterator _camerasItr; - mutable size_t _currentCameraOffset; + mutable size_t _currentCameraOffset{ INVALID_OFFSET }; void preUpdate(size_t commandIndex, const StereoState& stereo); void update(size_t commandIndex, const StereoState& stereo) const; diff --git a/libraries/gpu/src/gpu/GLBackendTransform.cpp b/libraries/gpu/src/gpu/GLBackendTransform.cpp index fa54acf72c..ae8f28fbe3 100755 --- a/libraries/gpu/src/gpu/GLBackendTransform.cpp +++ b/libraries/gpu/src/gpu/GLBackendTransform.cpp @@ -171,8 +171,10 @@ void GLBackend::TransformStageState::transfer(const Batch& batch) const { #endif CHECK_GL_ERROR(); + + // Make sure the current Camera offset is unknown before render Draw + _currentCameraOffset = INVALID_OFFSET; } -static const size_t INVALID_OFFSET = (size_t)-1; void GLBackend::TransformStageState::update(size_t commandIndex, const StereoState& stereo) const { size_t offset = INVALID_OFFSET;