aboutsummaryrefslogtreecommitdiff
path: root/PhysX_3.4/Source/LowLevel/software/src/PxsNphaseImplementationContext.cpp
diff options
context:
space:
mode:
authorSheikh Dawood Abdul Ajees <[email protected]>2017-04-25 16:02:08 -0500
committerSheikh Dawood Abdul Ajees <[email protected]>2017-04-25 16:02:08 -0500
commitd11708e398c2f6377d9eac2b1f7248c62faab569 (patch)
tree5778e794690c046ab4b0205d8f764960a5af168b /PhysX_3.4/Source/LowLevel/software/src/PxsNphaseImplementationContext.cpp
parentPhysX 3.4, APEX 1.4 patch release @21821222 (diff)
downloadphysx-3.4-d11708e398c2f6377d9eac2b1f7248c62faab569.tar.xz
physx-3.4-d11708e398c2f6377d9eac2b1f7248c62faab569.zip
PhysX 3.4, APEX 1.4 patch release @22017166
Diffstat (limited to 'PhysX_3.4/Source/LowLevel/software/src/PxsNphaseImplementationContext.cpp')
-rw-r--r--PhysX_3.4/Source/LowLevel/software/src/PxsNphaseImplementationContext.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/PhysX_3.4/Source/LowLevel/software/src/PxsNphaseImplementationContext.cpp b/PhysX_3.4/Source/LowLevel/software/src/PxsNphaseImplementationContext.cpp
index fa39ba6f..5a2823a5 100644
--- a/PhysX_3.4/Source/LowLevel/software/src/PxsNphaseImplementationContext.cpp
+++ b/PhysX_3.4/Source/LowLevel/software/src/PxsNphaseImplementationContext.cpp
@@ -54,6 +54,58 @@ using namespace physx;
using namespace physx::shdfnd;
+class PxsCMUpdateTask : public Cm::Task
+{
+public:
+
+ static const PxU32 BATCH_SIZE = 128;
+
+ PxsCMUpdateTask(PxsContext* context, PxReal dt, PxsContactManager** cmArray, PxsContactManagerOutput* cmOutputs, Gu::Cache* caches, PxU32 cmCount, PxContactModifyCallback* callback) :
+ Cm::Task (context->getContextId()),
+ mCmArray (cmArray),
+ mCmOutputs (cmOutputs),
+ mCaches (caches),
+ mCmCount (cmCount),
+ mDt (dt),
+ mContext (context),
+ mCallback (callback)
+ {
+ }
+
+ virtual void release();
+
+ /*PX_FORCE_INLINE void insert(PxsContactManager* cm)
+ {
+ PX_ASSERT(mCmCount < BATCH_SIZE);
+ mCmArray[mCmCount++]=cm;
+ }*/
+
+protected:
+ //PxsContactManager* mCmArray[BATCH_SIZE];
+ PxsContactManager** mCmArray;
+ PxsContactManagerOutput* mCmOutputs;
+ Gu::Cache* mCaches;
+ PxU32 mCmCount;
+ PxReal mDt; //we could probably retrieve from context to save space?
+ PxsContext* mContext;
+ PxContactModifyCallback* mCallback;
+};
+
+void PxsCMUpdateTask::release()
+{
+ // We used to do Task::release(); here before fixing DE1106 (xbox pure virtual crash)
+ // Release in turn causes the dependent tasks to start running
+ // The problem was that between the time release was called and by the time we got to the destructor
+ // The task chain would get all the way to scene finalization code which would reset the allocation pool
+ // And a new task would get allocated at the same address, then we would invoke the destructor on that freshly created task
+ // This could potentially cause any number of other problems, it is suprising that it only manifested itself
+ // as a pure virtual crash
+ PxBaseTask* saveContinuation = mCont;
+ this->~PxsCMUpdateTask();
+ if (saveContinuation)
+ saveContinuation->removeReference();
+}
+
class PxsCMDiscreteUpdateTask : public PxsCMUpdateTask
{
public: