Don't upload / bind skinning ubo if not supported

This commit is contained in:
Benau 2016-12-15 12:17:39 +08:00
parent 1f23e6e783
commit 2e2345289c
3 changed files with 6 additions and 6 deletions

View File

@ -268,10 +268,11 @@ void ShaderBasedRenderer::renderScene(scene::ICameraSceneNode * const camnode,
bool hasShadow, bool hasShadow,
bool forceRTT) bool forceRTT)
{ {
if(CVS->isARBUniformBufferObjectUsable()) if (CVS->isARBUniformBufferObjectUsable())
{ {
glBindBufferBase(GL_UNIFORM_BUFFER, 0, SharedGPUObjects::getViewProjectionMatricesUBO()); glBindBufferBase(GL_UNIFORM_BUFFER, 0, SharedGPUObjects::getViewProjectionMatricesUBO());
glBindBufferBase(GL_UNIFORM_BUFFER, 1, SharedGPUObjects::getLightingDataUBO()); glBindBufferBase(GL_UNIFORM_BUFFER, 1, SharedGPUObjects::getLightingDataUBO());
if (CVS->supportsHardwareSkinning())
glBindBufferBase(GL_UNIFORM_BUFFER, 2, SharedGPUObjects::getSkinningUBO()); glBindBufferBase(GL_UNIFORM_BUFFER, 2, SharedGPUObjects::getSkinningUBO());
} }
irr_driver->getSceneManager()->setActiveCamera(camnode); irr_driver->getSceneManager()->setActiveCamera(camnode);

View File

@ -223,10 +223,11 @@ void SharedGPUObjects::init()
initFrustrumVBO(); initFrustrumVBO();
initParticleQuadVBO(); initParticleQuadVBO();
if(CVS->isARBUniformBufferObjectUsable()) if (CVS->isARBUniformBufferObjectUsable())
{ {
initShadowVPMUBO(); initShadowVPMUBO();
initLightingDataUBO(); initLightingDataUBO();
if (CVS->supportsHardwareSkinning())
initSkinningUBO(); initSkinningUBO();
} }

View File

@ -26,8 +26,6 @@
#include <map> #include <map>
#include <unordered_map> #include <unordered_map>
class RenderInfo;
enum InstanceType enum InstanceType
{ {
InstanceTypeThreeTex, InstanceTypeThreeTex,