diff options
-rw-r--r-- | external/libgltf/UnpackedTarball_libgltf.mk | 1 | ||||
-rw-r--r-- | external/libgltf/pathces/fix_rendering_of_resized_model.patch | 71 |
2 files changed, 72 insertions, 0 deletions
diff --git a/external/libgltf/UnpackedTarball_libgltf.mk b/external/libgltf/UnpackedTarball_libgltf.mk index 176c1d15246b..a7565ea09efc 100644 --- a/external/libgltf/UnpackedTarball_libgltf.mk +++ b/external/libgltf/UnpackedTarball_libgltf.mk @@ -16,6 +16,7 @@ $(eval $(call gb_UnpackedTarball_set_patchflags,libgltf,--binary)) $(eval $(call gb_UnpackedTarball_set_patchlevel,libgltf,1)) $(eval $(call gb_UnpackedTarball_add_patches,libgltf,\ + external/libgltf/pathces/fix_rendering_of_resized_model.patch \ )) # vim: set noet sw=4 ts=4: diff --git a/external/libgltf/pathces/fix_rendering_of_resized_model.patch b/external/libgltf/pathces/fix_rendering_of_resized_model.patch new file mode 100644 index 000000000000..57af9f9e08eb --- /dev/null +++ b/external/libgltf/pathces/fix_rendering_of_resized_model.patch @@ -0,0 +1,71 @@ +diff -ur libgltf.org/src/RenderScene.cpp libgltf/src/RenderScene.cpp +--- libgltf.org/src/RenderScene.cpp 2014-07-15 17:33:12.615059856 +0200 ++++ libgltf/src/RenderScene.cpp 2014-07-15 22:24:20.862307666 +0200 +@@ -639,7 +639,7 @@ + , pScene(0) + , mLoadJson() + , mBindBufferMap() +- , viewport() ++ , mCurrentViewport() + , fbo() + , mEnableTransparency(false) + , mEnableRotation(false) +@@ -1555,10 +1555,9 @@ + pFPSCounter->timeStamp(); + } + #endif +- viewport = *((glTFViewport*)lpParam); + { + TRACE_TIME; +- status = initSSAAFrameBuf(&viewport); ++ status = initSSAAFrameBuf(((glTFViewport*)lpParam)); + if (LIBGLTF_SUCCESS != status) + return status; + } +@@ -1569,6 +1568,15 @@ + { + if (0 == pViewport->width) + return LIBGLTF_INVALID_SIZE; ++ ++ // When viewport changes we need to release fbo and create a new one ++ if( mCurrentViewport.x != pViewport->x || mCurrentViewport.y != pViewport->y || ++ mCurrentViewport.width != pViewport->width || mCurrentViewport.height != pViewport->height ) ++ { ++ fbo.releaseFbo(); ++ mCurrentViewport = *pViewport; ++ } ++ + #if DEFAULT_VIEW + unsigned int width = SSAA * DEFAULT_VIEW; + unsigned int height = (SSAA * DEFAULT_VIEW * +@@ -1730,14 +1738,14 @@ + #if ENABLE_FPS + if (0 != pFPSCounter) + { +- pFPSCounter->printFPS(&viewport); ++ pFPSCounter->printFPS(&mCurrentViewport); + } + #endif + + { + TRACE_TIME; +- glViewport(viewport.x, viewport.y, +- viewport.width, viewport.height); ++ glViewport(mCurrentViewport.x, mCurrentViewport.y, ++ mCurrentViewport.width, mCurrentViewport.height); + glBindFramebuffer(GL_FRAMEBUFFER, 0); + fbo.renderFboTexture(); + } +Only in libgltf/src: RenderScene.cpp~ +diff -ur libgltf.org/src/RenderScene.h libgltf/src/RenderScene.h +--- libgltf.org/src/RenderScene.h 2014-07-15 17:33:12.615059856 +0200 ++++ libgltf/src/RenderScene.h 2014-07-15 22:18:01.306324010 +0200 +@@ -349,7 +349,7 @@ + std::map<std::string, BindBufferInfo> mBindBufferMap; + + static ShaderProgram mShaderProgram; +- glTFViewport viewport; ++ glTFViewport mCurrentViewport; + RenderWithFBO fbo; + + bool mEnableTransparency; |