From 2e2345289cbc01814cd130e612c35e43315aca35 Mon Sep 17 00:00:00 2001 From: Benau Date: Thu, 15 Dec 2016 12:17:39 +0800 Subject: [PATCH] Don't upload / bind skinning ubo if not supported --- src/graphics/shader_based_renderer.cpp | 5 +++-- src/graphics/shared_gpu_objects.cpp | 5 +++-- src/graphics/vao_manager.hpp | 2 -- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/graphics/shader_based_renderer.cpp b/src/graphics/shader_based_renderer.cpp index 655f0141b..4c8e3e278 100644 --- a/src/graphics/shader_based_renderer.cpp +++ b/src/graphics/shader_based_renderer.cpp @@ -268,11 +268,12 @@ void ShaderBasedRenderer::renderScene(scene::ICameraSceneNode * const camnode, bool hasShadow, bool forceRTT) { - if(CVS->isARBUniformBufferObjectUsable()) + if (CVS->isARBUniformBufferObjectUsable()) { glBindBufferBase(GL_UNIFORM_BUFFER, 0, SharedGPUObjects::getViewProjectionMatricesUBO()); glBindBufferBase(GL_UNIFORM_BUFFER, 1, SharedGPUObjects::getLightingDataUBO()); - glBindBufferBase(GL_UNIFORM_BUFFER, 2, SharedGPUObjects::getSkinningUBO()); + if (CVS->supportsHardwareSkinning()) + glBindBufferBase(GL_UNIFORM_BUFFER, 2, SharedGPUObjects::getSkinningUBO()); } irr_driver->getSceneManager()->setActiveCamera(camnode); diff --git a/src/graphics/shared_gpu_objects.cpp b/src/graphics/shared_gpu_objects.cpp index 700406cdb..0ae121a1d 100644 --- a/src/graphics/shared_gpu_objects.cpp +++ b/src/graphics/shared_gpu_objects.cpp @@ -223,11 +223,12 @@ void SharedGPUObjects::init() initFrustrumVBO(); initParticleQuadVBO(); - if(CVS->isARBUniformBufferObjectUsable()) + if (CVS->isARBUniformBufferObjectUsable()) { initShadowVPMUBO(); initLightingDataUBO(); - initSkinningUBO(); + if (CVS->supportsHardwareSkinning()) + initSkinningUBO(); } m_has_been_initialised = true; diff --git a/src/graphics/vao_manager.hpp b/src/graphics/vao_manager.hpp index a9aff69cd..c02d19d43 100644 --- a/src/graphics/vao_manager.hpp +++ b/src/graphics/vao_manager.hpp @@ -26,8 +26,6 @@ #include #include -class RenderInfo; - enum InstanceType { InstanceTypeThreeTex,