From: kgv Date: Thu, 29 Jan 2015 10:14:49 +0000 (+0300) Subject: 0025762: Visualization, TKOpenGl - fix debug assertion within OpenGl_Workspace::Uploa... X-Git-Tag: V6_9_0_beta~150 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=1e99558fbd3ada8741244cdb4aa2848186e5b358 0025762: Visualization, TKOpenGl - fix debug assertion within OpenGl_Workspace::UploadRaytraceData() --- diff --git a/src/OpenGl/OpenGl_Workspace_Raytrace.cxx b/src/OpenGl/OpenGl_Workspace_Raytrace.cxx index cff5b57b65..acf15d182c 100644 --- a/src/OpenGl/OpenGl_Workspace_Raytrace.cxx +++ b/src/OpenGl/OpenGl_Workspace_Raytrace.cxx @@ -1832,13 +1832,16 @@ Standard_Boolean OpenGl_Workspace::UploadRaytraceData() } const NCollection_Handle >& aBVH = myRaytraceGeometry.BVH(); - - aResult &= mySceneNodeInfoTexture->SubData (myGlContext, 0, aBVH->Length(), - reinterpret_cast (&aBVH->NodeInfoBuffer().front())); - aResult &= mySceneMinPointTexture->SubData (myGlContext, 0, aBVH->Length(), - reinterpret_cast (&aBVH->MinPointBuffer().front())); - aResult &= mySceneMaxPointTexture->SubData (myGlContext, 0, aBVH->Length(), - reinterpret_cast (&aBVH->MaxPointBuffer().front())); + const Standard_Integer aBvhLength = aBVH->Length(); + if (aBvhLength > 0) + { + aResult &= mySceneNodeInfoTexture->SubData (myGlContext, 0, aBVH->Length(), + reinterpret_cast (&aBVH->NodeInfoBuffer().front())); + aResult &= mySceneMinPointTexture->SubData (myGlContext, 0, aBVH->Length(), + reinterpret_cast (&aBVH->MinPointBuffer().front())); + aResult &= mySceneMaxPointTexture->SubData (myGlContext, 0, aBVH->Length(), + reinterpret_cast (&aBVH->MaxPointBuffer().front())); + } for (Standard_Integer aNodeIdx = 0; aNodeIdx < aBVH->Length(); ++aNodeIdx) {