aboutsummaryrefslogtreecommitdiff
path: root/docs/_source
diff options
context:
space:
mode:
authorAnton Novoselov <[email protected]>2017-08-14 16:41:28 +0300
committerAnton Novoselov <[email protected]>2017-08-14 16:41:28 +0300
commit9a1c1d814f3fa0b54b49d90b43130c02bc280f44 (patch)
treeeae6ead883173c66619c30b6a1ed085f3cb70f4d /docs/_source
parentUpdated to CL 22627414: (diff)
downloadblast-9a1c1d814f3fa0b54b49d90b43130c02bc280f44.tar.xz
blast-9a1c1d814f3fa0b54b49d90b43130c02bc280f44.zip
Updated to CL 22661993:
* docs updates * authoring fixes * asset view in sample fix * latest blast_tools_and_samples-windows.zip
Diffstat (limited to 'docs/_source')
-rw-r--r--docs/_source/api_globals_users_guide.txt6
-rw-r--r--docs/_source/api_hl_users_guide.txt17
-rw-r--r--docs/_source/ext_physx.txt93
3 files changed, 109 insertions, 7 deletions
diff --git a/docs/_source/api_globals_users_guide.txt b/docs/_source/api_globals_users_guide.txt
index fe6d59f..00b35ef 100644
--- a/docs/_source/api_globals_users_guide.txt
+++ b/docs/_source/api_globals_users_guide.txt
@@ -90,5 +90,11 @@ NvBlastProfilerSetCallback
A NULL pointer may be passed in, disabling profiling. Profiler features are only active in checked, debug and profile builds.
+The granularity of events reported can be selected with
+
+\code
+NvBlastProfilerSetDetail
+\endcode
+
<br>
*/
diff --git a/docs/_source/api_hl_users_guide.txt b/docs/_source/api_hl_users_guide.txt
index c1504f5..ae8dd4a 100644
--- a/docs/_source/api_hl_users_guide.txt
+++ b/docs/_source/api_hl_users_guide.txt
@@ -269,7 +269,7 @@ by the group's actors. After all jobs have been run, the user must call TkGroup
with families with actors in the group.
A convenience function, TkGroup::process(), is provided which uses one worker to perform all jobs sequentially on the calling thread. This is useful shortcut to
-get BlastTk up and running quickly. A multithreaded group processing implementation is given by Nv::Blast::ExtGroupTaskManagerImpl (in NvBlastExtPxTaskImpl.h).
+get BlastTk up and running quickly. A multithreaded group processing implementation is given by Nv::Blast::ExtGroupTaskManager (in NvBlastExtPxTask.h).
This resides in \ref pageextphysx, because it uses physx::PxTask.
Actors resulting from the split of a "parent" actor will be placed automatically into the group that the parent belonged to. This is similar to the assigment of
@@ -321,6 +321,21 @@ group2->release();
\endcode
<br>
+<b>Multithreaded processing</b>
+
+When distributing the jobs as mentioned above, every job must be processed exactly once (over all user tasks).
+
+The number of jobs processed per worker can range from a single job (resulting in a user task per job) to all jobs (like Nv::Blast::TkGroup::process() does).
+
+At any point in time, no more than the set workerCount amount of workers may have been acquired. Return the worker at the end of each task.
+
+\code
+Nv::Blast::TkGroupWorker* worker = group->acquireWorker();
+// process some jobs
+group->returnWorker(worker);
+\endcode
+
+<br>
\section damage_in_tk Applying Damage to Actors and Families
Damage in NvBlastTk uses the same damage program scheme as the low-level SDK (see \ref splitting). One passes the program
diff --git a/docs/_source/ext_physx.txt b/docs/_source/ext_physx.txt
index ff998c2..7a3627c 100644
--- a/docs/_source/ext_physx.txt
+++ b/docs/_source/ext_physx.txt
@@ -1,14 +1,17 @@
/*! \page pageextphysx PhysX&tm; Extensions (NvBlastExtPhysX)
NvBlastExtPhysX contains classes for easier use of Blast&tm; Toolkit with the PhysX&tm; SDK.
-There are 3 of them:
-- <b>ExtPxManager</b>: Manager to keep Blast&tm; actors in sync with PhysX&tm; actors.
-- <b>ExtImpactDamageManager</b>: Manager to collect and apply impact damage caused by collision in PhysX&tm; scene.
-- <b>ExtPxStressSolver</b>: Stress Solver to propagate stress through support graph and apply it as damage to Blast&tm; actors.
+There are three of them:
+- \ref ExtPxManager - Manager to keep Blast&tm; actors in sync with PhysX&tm; actors.
+- \ref ExtImpactDamageManager - Manager to collect and apply impact damage caused by collision in PhysX&tm; scene.
+- \ref ExtPxStressSolver - Stress Solver to propagate stress through support graph and apply it as damage to Blast&tm; actors.
This library also contains an extension for synchronizing Blast&tm; state:
-- <b>ExtSync</b> - Utility for writing Blast&tm; state to a buffer, to be read by a client. This may be used for networking, for example.
+- \ref ExtSync - Utility for writing Blast&tm; state to a buffer, to be read by a client. This may be used for networking, for example.
+It also provides classes for utilizing PhysX&tm; SDK Foundation capabilities:
+- \ref ExtGroupTaskManager - Multithreaded TkGroup processing using PxTask.
+- \ref ExtCustomProfiler - Serves Blast&tm; profiling zones to PxFoundation profiler (e.g. PVD) and platform specific profilers.
<br>
\section ExtPxManager
@@ -133,7 +136,7 @@ sceneDesc.filterShader = ExtImpactDamageManager::FilterShader;
\endcode
<br>
-\section extpxstresssolver ExtPxStressSolver
+\section ExtPxStressSolver
<b>Stress Solver</b> - this wrapper class uses \ref pageextstress to apply stress calculations to an ExtPxFamily. See \ref pageextstress for
the details of the underlying stress solver.
@@ -232,4 +235,82 @@ ExtPxManager is required only if sync buffer contains ExtSyncEventType::Physics
<br>
+\section ExtGroupTaskManager
+This class provides a basic implementation for multithreaded TkGroup processing using PxTask and a PxTaskManager from PxFoundation.
+
+In the simplest use case, all worker threads provided by PxTaskManager are used to process the group.
+
+\code
+// creating ExtGroupTaskManager from existing taskManager and tkGroup
+ExtGroupTaskManager* gtm = ExtGroupTaskManager::create(*taskManager, tkGroup);
+
+while (running)
+{
+ // ... add TkActors to TkGroup and damage ...
+
+ // start processing on all worker threads provided
+ gtm->process();
+
+ // ... do something else ...
+
+ // wait for the group processing to finish
+ gtm->wait();
+}
+
+// after use, release the ExtGroupTaskManager
+gtm->release();
+\endcode
+
+<br>
+
+Groups can be processed concurrently as well as follows.
+
+\code
+// creating ExtGroupTaskManager from existing taskManager and groups
+
+ExtGroupTaskManager* gtm0 = ExtGroupTaskManager::create(*taskManager, tkGroup0);
+ExtGroupTaskManager* gtm1 = ExtGroupTaskManager::create(*taskManager, tkGroup1);
+\endcode
+
+TkActors are added to TkGroups and damaged as usual.
+
+The PxTaskManager used in this example provides four worker threads of which each ExtGroupTaskManager uses two for its group.
+
+\code
+uint32_t started = 0;
+if (gtm0->process(2) > 0) { started++; }
+if (gtm1->process(2) > 0) { started++; }
+\endcode
+
+Note that ExtGroupTaskManager::wait() never returns true if no processing has started, as reported by ExtGroupTaskManager::process().
+The illustrative busy loop is not recomended for actual use.
+
+\code
+uint32_t completed = 0;
+while (completed < started)
+{
+ if (gtm0->wait(false)) { completed++; }
+ if (gtm1->wait(false)) { completed++; }
+}
+\endcode
+
+<br>
+
+\section ExtCustomProfiler
+This Nv::Blast::ProfileCallback implementation forwards Blast&tm; profile events to the PxProfilerCallback attached to PxFoundation, typically a PhysX&tm; Visual Debugger (PVD) instance.
+To use it, simply attach one to Blast&tm;.
+
+\code
+static Nv::Blast::ExtCustomProfiler gBlastProfiler;
+NvBlastProfilerSetCallback(&gBlastProfiler);
+\endcode
+
+For convenience, it also provides sending profile events to platform specific profilers. These are disabled by default.
+
+\code
+gBlastProfiler.setPlatformEnabled(true);
+\endcode
+
+<br>
+
*/