aboutsummaryrefslogtreecommitdiff
path: root/PhysX_3.4/Documentation/PhysXAPI/files/PxTask_8h-source.html
blob: dbe222d327cf68174dd27e648e612d8e52a1659e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
<html>
	<head>
		<title>NVIDIA(R) PhysX(R) SDK 3.4 API Reference: PxTask.h Source File</title>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
		<LINK HREF="NVIDIA.css" REL="stylesheet" TYPE="text/css">
	</head>

	<body bgcolor="#FFFFFF">
		<div id="header">
			<hr class="first">
			<img alt="" src="images/PhysXlogo.png" align="middle"> <br>
			<center>
				<a class="qindex" href="main.html">Main Page</a> &nbsp; 
				<a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; 
				<a class="qindex" href="annotated.html">Compound List</a> &nbsp; 
				<a class="qindex" href="functions.html">Compound Members</a> &nbsp;  
			</center>
			<hr class="second">
		</div>
<!-- Generated by Doxygen 1.5.8 -->
<h1>PxTask.h</h1><a href="PxTask_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//</span>
<a name="l00002"></a>00002 <span class="comment">// Redistribution and use in source and binary forms, with or without</span>
<a name="l00003"></a>00003 <span class="comment">// modification, are permitted provided that the following conditions</span>
<a name="l00004"></a>00004 <span class="comment">// are met:</span>
<a name="l00005"></a>00005 <span class="comment">//  * Redistributions of source code must retain the above copyright</span>
<a name="l00006"></a>00006 <span class="comment">//    notice, this list of conditions and the following disclaimer.</span>
<a name="l00007"></a>00007 <span class="comment">//  * Redistributions in binary form must reproduce the above copyright</span>
<a name="l00008"></a>00008 <span class="comment">//    notice, this list of conditions and the following disclaimer in the</span>
<a name="l00009"></a>00009 <span class="comment">//    documentation and/or other materials provided with the distribution.</span>
<a name="l00010"></a>00010 <span class="comment">//  * Neither the name of NVIDIA CORPORATION nor the names of its</span>
<a name="l00011"></a>00011 <span class="comment">//    contributors may be used to endorse or promote products derived</span>
<a name="l00012"></a>00012 <span class="comment">//    from this software without specific prior written permission.</span>
<a name="l00013"></a>00013 <span class="comment">//</span>
<a name="l00014"></a>00014 <span class="comment">// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY</span>
<a name="l00015"></a>00015 <span class="comment">// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span>
<a name="l00016"></a>00016 <span class="comment">// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR</span>
<a name="l00017"></a>00017 <span class="comment">// PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR</span>
<a name="l00018"></a>00018 <span class="comment">// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,</span>
<a name="l00019"></a>00019 <span class="comment">// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,</span>
<a name="l00020"></a>00020 <span class="comment">// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR</span>
<a name="l00021"></a>00021 <span class="comment">// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY</span>
<a name="l00022"></a>00022 <span class="comment">// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</span>
<a name="l00023"></a>00023 <span class="comment">// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE</span>
<a name="l00024"></a>00024 <span class="comment">// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span>
<a name="l00025"></a>00025 <span class="comment">//</span>
<a name="l00026"></a>00026 <span class="comment">// Copyright (c) 2008-2018 NVIDIA Corporation. All rights reserved.</span>
<a name="l00027"></a>00027 
<a name="l00028"></a>00028 <span class="preprocessor">#ifndef PXTASK_PXTASK_H</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define PXTASK_PXTASK_H</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span>
<a name="l00031"></a>00031 <span class="preprocessor">#include "<a class="code" href="PxTaskDefine_8h.html">task/PxTaskDefine.h</a>"</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include "<a class="code" href="PxTaskManager_8h.html">task/PxTaskManager.h</a>"</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include "<a class="code" href="PxCpuDispatcher_8h.html">task/PxCpuDispatcher.h</a>"</span>
<a name="l00034"></a>00034 <span class="preprocessor">#include "<a class="code" href="PxGpuDispatcher_8h.html">task/PxGpuDispatcher.h</a>"</span>
<a name="l00035"></a>00035 <span class="preprocessor">#include "<a class="code" href="PxAssert_8h.html">foundation/PxAssert.h</a>"</span>
<a name="l00036"></a>00036 
<a name="l00037"></a>00037 <span class="keyword">namespace </span>physx
<a name="l00038"></a>00038 {
<a name="l00039"></a>00039 
<a name="l00045"></a><a class="code" href="classphysx_1_1PxBaseTask.html">00045</a> <span class="keyword">class </span><a class="code" href="classphysx_1_1PxBaseTask.html" title="Base class of all task types.">PxBaseTask</a>
<a name="l00046"></a>00046 {
<a name="l00047"></a>00047 <span class="keyword">public</span>:
<a name="l00048"></a><a class="code" href="classphysx_1_1PxBaseTask.html#387b986ef3916322502452724d9ba582">00048</a>     <a class="code" href="classphysx_1_1PxBaseTask.html#387b986ef3916322502452724d9ba582">PxBaseTask</a>() : <a class="code" href="classphysx_1_1PxBaseTask.html#67864643cd2dfaf8483f8b7a75376bc7" title="Context ID for profiler interface.">mContextID</a>(0), <a class="code" href="classphysx_1_1PxBaseTask.html#f23fffec1e92c794d3ad73e9fc4fa974" title="Owning PxTaskManager instance.">mTm</a>(NULL) {}
<a name="l00049"></a><a class="code" href="classphysx_1_1PxBaseTask.html#c3100494c97a23a88fcad8e28e222822">00049</a>     <span class="keyword">virtual</span> <a class="code" href="classphysx_1_1PxBaseTask.html#c3100494c97a23a88fcad8e28e222822">~PxBaseTask</a>() {}
<a name="l00050"></a>00050 
<a name="l00057"></a>00057     <span class="keyword">virtual</span> <span class="keywordtype">void</span>        <a class="code" href="classphysx_1_1PxBaseTask.html#517a16d9dc630c9274a7564deb3a7e4a" title="The user-implemented run method where the task&amp;#39;s work should be performed.">run</a>() = 0;
<a name="l00058"></a>00058 
<a name="l00066"></a>00066     <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classphysx_1_1PxBaseTask.html#a54eb4a1b50979436a797a62e383efee" title="Return a user-provided task name for profiling purposes.">getName</a>() <span class="keyword">const</span> = 0;
<a name="l00067"></a>00067 
<a name="l00069"></a>00069     <span class="keyword">virtual</span> <span class="keywordtype">void</span>        <a class="code" href="classphysx_1_1PxBaseTask.html#07c9f6e71f0723bcf914fce51036d36e" title="Implemented by derived implementation classes.">addReference</a>() = 0;
<a name="l00071"></a>00071     <span class="keyword">virtual</span> <span class="keywordtype">void</span>        <a class="code" href="classphysx_1_1PxBaseTask.html#78f9b745c6fb4114350cb1a26f3461d3" title="Implemented by derived implementation classes.">removeReference</a>() = 0;
<a name="l00073"></a>00073     <span class="keyword">virtual</span> int32_t     <a class="code" href="classphysx_1_1PxBaseTask.html#5a1570309c62a12c3ecfe7e695b9f21f" title="Implemented by derived implementation classes.">getReference</a>() <span class="keyword">const</span> = 0;
<a name="l00074"></a>00074 
<a name="l00081"></a>00081     <span class="keyword">virtual</span> <span class="keywordtype">void</span>        <a class="code" href="classphysx_1_1PxBaseTask.html#3be62f992c1ff7218e2cf0fc0ba5b244" title="Implemented by derived implementation classes.">release</a>() = 0;
<a name="l00082"></a>00082 
<a name="l00089"></a><a class="code" href="classphysx_1_1PxBaseTask.html#9dccf76144a25df2c2a7ed5fa8cea003">00089</a>     <a class="code" href="group__foundation.html#g6a774eed3cad34b0f636332a3d28c6bb">PX_FORCE_INLINE</a> <a class="code" href="classphysx_1_1PxTaskManager.html" title="The PxTaskManager interface.">PxTaskManager</a>* <a class="code" href="classphysx_1_1PxBaseTask.html#9dccf76144a25df2c2a7ed5fa8cea003" title="Return PxTaskManager to which this task was submitted.">getTaskManager</a>()<span class="keyword"> const</span>
<a name="l00090"></a>00090 <span class="keyword">    </span>{
<a name="l00091"></a>00091         <span class="keywordflow">return</span> <a class="code" href="classphysx_1_1PxBaseTask.html#f23fffec1e92c794d3ad73e9fc4fa974" title="Owning PxTaskManager instance.">mTm</a>;
<a name="l00092"></a>00092     }
<a name="l00093"></a>00093 
<a name="l00094"></a><a class="code" href="classphysx_1_1PxBaseTask.html#0fa6ca56b758ea6b8be5c3acc8e89364">00094</a>     <a class="code" href="group__foundation.html#g6a774eed3cad34b0f636332a3d28c6bb">PX_FORCE_INLINE</a> <span class="keywordtype">void</span>    <a class="code" href="classphysx_1_1PxBaseTask.html#0fa6ca56b758ea6b8be5c3acc8e89364">setContextId</a>(<a class="code" href="namespacephysx.html#8ee037dcecf7198800e1f302795c10ee">PxU64</a> <span class="keywordtype">id</span>)          { <a class="code" href="classphysx_1_1PxBaseTask.html#67864643cd2dfaf8483f8b7a75376bc7" title="Context ID for profiler interface.">mContextID</a> = id;      }
<a name="l00095"></a><a class="code" href="classphysx_1_1PxBaseTask.html#009e71e6c6274132392817f0e57716a0">00095</a>     <a class="code" href="group__foundation.html#g6a774eed3cad34b0f636332a3d28c6bb">PX_FORCE_INLINE</a> <a class="code" href="namespacephysx.html#8ee037dcecf7198800e1f302795c10ee">PxU64</a>   <a class="code" href="classphysx_1_1PxBaseTask.html#009e71e6c6274132392817f0e57716a0">getContextId</a>()<span class="keyword">          const   </span>{ <span class="keywordflow">return</span> <a class="code" href="classphysx_1_1PxBaseTask.html#67864643cd2dfaf8483f8b7a75376bc7" title="Context ID for profiler interface.">mContextID</a>;    }
<a name="l00096"></a>00096 
<a name="l00097"></a>00097 <span class="keyword">protected</span>:
<a name="l00098"></a><a class="code" href="classphysx_1_1PxBaseTask.html#67864643cd2dfaf8483f8b7a75376bc7">00098</a>     <a class="code" href="namespacephysx.html#8ee037dcecf7198800e1f302795c10ee">PxU64</a>               <a class="code" href="classphysx_1_1PxBaseTask.html#67864643cd2dfaf8483f8b7a75376bc7" title="Context ID for profiler interface.">mContextID</a>;     
<a name="l00099"></a><a class="code" href="classphysx_1_1PxBaseTask.html#f23fffec1e92c794d3ad73e9fc4fa974">00099</a>     <a class="code" href="classphysx_1_1PxTaskManager.html" title="The PxTaskManager interface.">PxTaskManager</a>*      <a class="code" href="classphysx_1_1PxBaseTask.html#f23fffec1e92c794d3ad73e9fc4fa974" title="Owning PxTaskManager instance.">mTm</a>;            
<a name="l00100"></a>00100 
<a name="l00101"></a><a class="code" href="classphysx_1_1PxBaseTask.html#c4a43ca8ae513a20c1d61bc9aecfce89">00101</a>     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classphysx_1_1PxBaseTask.html#c4a43ca8ae513a20c1d61bc9aecfce89">PxTaskMgr</a>;
<a name="l00102"></a>00102 };
<a name="l00103"></a>00103 
<a name="l00104"></a>00104 
<a name="l00111"></a><a class="code" href="classphysx_1_1PxTask.html">00111</a> <span class="keyword">class </span><a class="code" href="classphysx_1_1PxTask.html" title="A PxBaseTask implementation with deferred execution and full dependencies.">PxTask</a> : <span class="keyword">public</span> <a class="code" href="classphysx_1_1PxBaseTask.html" title="Base class of all task types.">PxBaseTask</a>
<a name="l00112"></a>00112 {
<a name="l00113"></a>00113 <span class="keyword">public</span>:
<a name="l00114"></a><a class="code" href="classphysx_1_1PxTask.html#01ed1f8968b3e631509c42994b10b5cd">00114</a>     <a class="code" href="classphysx_1_1PxTask.html#01ed1f8968b3e631509c42994b10b5cd">PxTask</a>() : <a class="code" href="classphysx_1_1PxTask.html#a67264a3a16ca138fd854539bf52ac06" title="ID assigned at submission.">mTaskID</a>(0) {}
<a name="l00115"></a><a class="code" href="classphysx_1_1PxTask.html#cde4da75284803e84d6cb20cda890223">00115</a>     <span class="keyword">virtual</span> <a class="code" href="classphysx_1_1PxTask.html#cde4da75284803e84d6cb20cda890223">~PxTask</a>() {}
<a name="l00116"></a>00116 
<a name="l00118"></a><a class="code" href="classphysx_1_1PxTask.html#cedcca7b8305c3ad519e537ab307c39a">00118</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classphysx_1_1PxTask.html#cedcca7b8305c3ad519e537ab307c39a" title="Release method implementation.">release</a>()
<a name="l00119"></a>00119     {
<a name="l00120"></a>00120         <a class="code" href="group__foundation.html#g4a83a657390b324a460f14684e5accee">PX_ASSERT</a>(<a class="code" href="classphysx_1_1PxBaseTask.html#f23fffec1e92c794d3ad73e9fc4fa974" title="Owning PxTaskManager instance.">mTm</a>);
<a name="l00121"></a>00121 
<a name="l00122"></a>00122         <span class="comment">// clear mTm before calling taskCompleted() for safety</span>
<a name="l00123"></a>00123         <a class="code" href="classphysx_1_1PxTaskManager.html" title="The PxTaskManager interface.">PxTaskManager</a>* save = <a class="code" href="classphysx_1_1PxBaseTask.html#f23fffec1e92c794d3ad73e9fc4fa974" title="Owning PxTaskManager instance.">mTm</a>;
<a name="l00124"></a>00124         <a class="code" href="classphysx_1_1PxBaseTask.html#f23fffec1e92c794d3ad73e9fc4fa974" title="Owning PxTaskManager instance.">mTm</a> = NULL;
<a name="l00125"></a>00125         save-&gt;<a class="code" href="classphysx_1_1PxTaskManager.html#36a746ff81e26d57195ebfdd0141e912" title="Called by the worker threads to inform the PxTaskManager that a task has completed...">taskCompleted</a>( *<span class="keyword">this</span> );
<a name="l00126"></a>00126     }
<a name="l00127"></a>00127 
<a name="l00129"></a>00129     <span class="comment">//         task is allowed to start.</span>
<a name="l00130"></a><a class="code" href="classphysx_1_1PxTask.html#a417f4d080c31178ff6ded2c92b8bb05">00130</a>     <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> <span class="keywordtype">void</span> <a class="code" href="classphysx_1_1PxTask.html#a417f4d080c31178ff6ded2c92b8bb05" title="Inform the PxTaskManager this task must finish before the given.">finishBefore</a>( <a class="code" href="namespacephysx.html#7a08e207472f32da1e024056f32d64a2">PxTaskID</a> taskID )
<a name="l00131"></a>00131     {
<a name="l00132"></a>00132         <a class="code" href="group__foundation.html#g4a83a657390b324a460f14684e5accee">PX_ASSERT</a>(<a class="code" href="classphysx_1_1PxBaseTask.html#f23fffec1e92c794d3ad73e9fc4fa974" title="Owning PxTaskManager instance.">mTm</a>);
<a name="l00133"></a>00133         <a class="code" href="classphysx_1_1PxBaseTask.html#f23fffec1e92c794d3ad73e9fc4fa974" title="Owning PxTaskManager instance.">mTm</a>-&gt;finishBefore( *<span class="keyword">this</span>, taskID);
<a name="l00134"></a>00134     }
<a name="l00135"></a>00135 
<a name="l00137"></a>00137     <span class="comment">//         task has completed.</span>
<a name="l00138"></a><a class="code" href="classphysx_1_1PxTask.html#5ea294d819b903a507efe1358f86b8cd">00138</a>     <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> <span class="keywordtype">void</span> <a class="code" href="classphysx_1_1PxTask.html#5ea294d819b903a507efe1358f86b8cd" title="Inform the PxTaskManager this task cannot start until the given.">startAfter</a>( <a class="code" href="namespacephysx.html#7a08e207472f32da1e024056f32d64a2">PxTaskID</a> taskID )
<a name="l00139"></a>00139     {
<a name="l00140"></a>00140         <a class="code" href="group__foundation.html#g4a83a657390b324a460f14684e5accee">PX_ASSERT</a>(<a class="code" href="classphysx_1_1PxBaseTask.html#f23fffec1e92c794d3ad73e9fc4fa974" title="Owning PxTaskManager instance.">mTm</a>);
<a name="l00141"></a>00141         <a class="code" href="classphysx_1_1PxBaseTask.html#f23fffec1e92c794d3ad73e9fc4fa974" title="Owning PxTaskManager instance.">mTm</a>-&gt;startAfter( *<span class="keyword">this</span>, taskID );
<a name="l00142"></a>00142     }
<a name="l00143"></a>00143 
<a name="l00148"></a><a class="code" href="classphysx_1_1PxTask.html#d3828abb4bd2237af28ecd08b972b1af">00148</a>     <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> <span class="keywordtype">void</span> <a class="code" href="classphysx_1_1PxTask.html#d3828abb4bd2237af28ecd08b972b1af" title="Manually increment this task&amp;#39;s reference count. The task will not be allowed...">addReference</a>()
<a name="l00149"></a>00149     {
<a name="l00150"></a>00150         <a class="code" href="group__foundation.html#g4a83a657390b324a460f14684e5accee">PX_ASSERT</a>(<a class="code" href="classphysx_1_1PxBaseTask.html#f23fffec1e92c794d3ad73e9fc4fa974" title="Owning PxTaskManager instance.">mTm</a>);
<a name="l00151"></a>00151         <a class="code" href="classphysx_1_1PxBaseTask.html#f23fffec1e92c794d3ad73e9fc4fa974" title="Owning PxTaskManager instance.">mTm</a>-&gt;addReference( <a class="code" href="classphysx_1_1PxTask.html#a67264a3a16ca138fd854539bf52ac06" title="ID assigned at submission.">mTaskID</a> );
<a name="l00152"></a>00152     }
<a name="l00153"></a>00153 
<a name="l00158"></a><a class="code" href="classphysx_1_1PxTask.html#097c70f1419ad4991ef876ddd9a74d48">00158</a>     <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> <span class="keywordtype">void</span> <a class="code" href="classphysx_1_1PxTask.html#097c70f1419ad4991ef876ddd9a74d48" title="Manually decrement this task&amp;#39;s reference count. If the reference count reaches...">removeReference</a>()
<a name="l00159"></a>00159     {
<a name="l00160"></a>00160         <a class="code" href="group__foundation.html#g4a83a657390b324a460f14684e5accee">PX_ASSERT</a>(<a class="code" href="classphysx_1_1PxBaseTask.html#f23fffec1e92c794d3ad73e9fc4fa974" title="Owning PxTaskManager instance.">mTm</a>);
<a name="l00161"></a>00161         <a class="code" href="classphysx_1_1PxBaseTask.html#f23fffec1e92c794d3ad73e9fc4fa974" title="Owning PxTaskManager instance.">mTm</a>-&gt;decrReference( <a class="code" href="classphysx_1_1PxTask.html#a67264a3a16ca138fd854539bf52ac06" title="ID assigned at submission.">mTaskID</a> );
<a name="l00162"></a>00162     }
<a name="l00163"></a>00163 
<a name="l00167"></a><a class="code" href="classphysx_1_1PxTask.html#7d7d155ba008883d3bed7db443421908">00167</a>     <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> int32_t <a class="code" href="classphysx_1_1PxTask.html#7d7d155ba008883d3bed7db443421908" title="Return the ref-count for this task.">getReference</a>()<span class="keyword"> const</span>
<a name="l00168"></a>00168 <span class="keyword">    </span>{
<a name="l00169"></a>00169         <span class="keywordflow">return</span> <a class="code" href="classphysx_1_1PxBaseTask.html#f23fffec1e92c794d3ad73e9fc4fa974" title="Owning PxTaskManager instance.">mTm</a>-&gt;getReference( <a class="code" href="classphysx_1_1PxTask.html#a67264a3a16ca138fd854539bf52ac06" title="ID assigned at submission.">mTaskID</a> );
<a name="l00170"></a>00170     }
<a name="l00171"></a>00171     
<a name="l00175"></a><a class="code" href="classphysx_1_1PxTask.html#762b45266ec713eb7f599574a7998057">00175</a>     <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> <a class="code" href="namespacephysx.html#7a08e207472f32da1e024056f32d64a2">PxTaskID</a>      <a class="code" href="classphysx_1_1PxTask.html#762b45266ec713eb7f599574a7998057" title="Return the unique ID for this task.">getTaskID</a>()<span class="keyword"> const</span>
<a name="l00176"></a>00176 <span class="keyword">    </span>{
<a name="l00177"></a>00177         <span class="keywordflow">return</span> <a class="code" href="classphysx_1_1PxTask.html#a67264a3a16ca138fd854539bf52ac06" title="ID assigned at submission.">mTaskID</a>;
<a name="l00178"></a>00178     }
<a name="l00179"></a>00179 
<a name="l00185"></a><a class="code" href="classphysx_1_1PxTask.html#2a0a6f83fcd05069f594631272faa8ae">00185</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classphysx_1_1PxTask.html#2a0a6f83fcd05069f594631272faa8ae" title="Called by PxTaskManager at submission time for initialization.">submitted</a>()
<a name="l00186"></a>00186     {
<a name="l00187"></a>00187         <a class="code" href="classphysx_1_1PxTask.html#5c506b76e0ce7380e77a384837fbbcc5" title="GpuTask CUDA stream index.">mStreamIndex</a> = 0;
<a name="l00188"></a>00188         <a class="code" href="classphysx_1_1PxTask.html#ddde0e4cc4291d493d0025682f767606" title="GpuTask sync flag.">mPreSyncRequired</a> = <span class="keyword">false</span>;
<a name="l00189"></a>00189     }
<a name="l00190"></a>00190 
<a name="l00194"></a><a class="code" href="classphysx_1_1PxTask.html#2506a8dacc91048a7baafba5187d787a">00194</a>     <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> <span class="keywordtype">void</span>      <a class="code" href="classphysx_1_1PxTask.html#2506a8dacc91048a7baafba5187d787a" title="Specify that the GpuTask sync flag be set.">requestSyncPoint</a>()
<a name="l00195"></a>00195     {
<a name="l00196"></a>00196         <a class="code" href="classphysx_1_1PxTask.html#ddde0e4cc4291d493d0025682f767606" title="GpuTask sync flag.">mPreSyncRequired</a> = <span class="keyword">true</span>;
<a name="l00197"></a>00197     }
<a name="l00198"></a>00198 
<a name="l00199"></a>00199 
<a name="l00200"></a>00200 <span class="keyword">protected</span>:
<a name="l00201"></a><a class="code" href="classphysx_1_1PxTask.html#a67264a3a16ca138fd854539bf52ac06">00201</a>     <a class="code" href="namespacephysx.html#7a08e207472f32da1e024056f32d64a2">PxTaskID</a>            <a class="code" href="classphysx_1_1PxTask.html#a67264a3a16ca138fd854539bf52ac06" title="ID assigned at submission.">mTaskID</a>;            
<a name="l00202"></a><a class="code" href="classphysx_1_1PxTask.html#5c506b76e0ce7380e77a384837fbbcc5">00202</a>     uint32_t            <a class="code" href="classphysx_1_1PxTask.html#5c506b76e0ce7380e77a384837fbbcc5" title="GpuTask CUDA stream index.">mStreamIndex</a>;       
<a name="l00203"></a><a class="code" href="classphysx_1_1PxTask.html#ddde0e4cc4291d493d0025682f767606">00203</a>     <span class="keywordtype">bool</span>                <a class="code" href="classphysx_1_1PxTask.html#ddde0e4cc4291d493d0025682f767606" title="GpuTask sync flag.">mPreSyncRequired</a>;   
<a name="l00204"></a>00204 
<a name="l00205"></a><a class="code" href="classphysx_1_1PxTask.html#c4a43ca8ae513a20c1d61bc9aecfce89">00205</a>     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classphysx_1_1PxTask.html#c4a43ca8ae513a20c1d61bc9aecfce89">PxTaskMgr</a>;
<a name="l00206"></a><a class="code" href="classphysx_1_1PxTask.html#7f49a59cfb28fd74ba8601e2d0d2d35a">00206</a>     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classphysx_1_1PxTask.html#7f49a59cfb28fd74ba8601e2d0d2d35a">PxGpuWorkerThread</a>;
<a name="l00207"></a>00207 };
<a name="l00208"></a>00208 
<a name="l00209"></a>00209 
<a name="l00223"></a><a class="code" href="classphysx_1_1PxLightCpuTask.html">00223</a> <span class="keyword">class </span><a class="code" href="classphysx_1_1PxLightCpuTask.html" title="A PxBaseTask implementation with immediate execution and simple dependencies.">PxLightCpuTask</a> : <span class="keyword">public</span> <a class="code" href="classphysx_1_1PxBaseTask.html" title="Base class of all task types.">PxBaseTask</a>
<a name="l00224"></a>00224 {
<a name="l00225"></a>00225 <span class="keyword">public</span>:
<a name="l00226"></a><a class="code" href="classphysx_1_1PxLightCpuTask.html#1576f85a8b81170e5fd28dec773c2a45">00226</a>     <a class="code" href="classphysx_1_1PxLightCpuTask.html#1576f85a8b81170e5fd28dec773c2a45">PxLightCpuTask</a>()
<a name="l00227"></a>00227         : <a class="code" href="classphysx_1_1PxLightCpuTask.html#7e5dbe5f98e11385d0e0a921d3af8243" title="Continuation task, can be NULL.">mCont</a>( NULL )
<a name="l00228"></a>00228         , <a class="code" href="classphysx_1_1PxLightCpuTask.html#04e7bde817081eb377f129e7de7e285a" title="PxTask is dispatched when reaches 0.">mRefCount</a>( 0 )
<a name="l00229"></a>00229     {
<a name="l00230"></a>00230     }
<a name="l00231"></a><a class="code" href="classphysx_1_1PxLightCpuTask.html#0d9094c15329d367cff90b95e0bdcf88">00231</a>     <span class="keyword">virtual</span> <a class="code" href="classphysx_1_1PxLightCpuTask.html#0d9094c15329d367cff90b95e0bdcf88">~PxLightCpuTask</a>()
<a name="l00232"></a>00232     {
<a name="l00233"></a>00233         <a class="code" href="classphysx_1_1PxBaseTask.html#f23fffec1e92c794d3ad73e9fc4fa974" title="Owning PxTaskManager instance.">mTm</a> = NULL;
<a name="l00234"></a>00234     }
<a name="l00235"></a>00235 
<a name="l00245"></a><a class="code" href="classphysx_1_1PxLightCpuTask.html#56ef764508a2bbc98d82bb6dbb09fa3e">00245</a>     <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> <span class="keywordtype">void</span> <a class="code" href="classphysx_1_1PxLightCpuTask.html#56ef764508a2bbc98d82bb6dbb09fa3e" title="Initialize this task and specify the task that will have its ref count decremented...">setContinuation</a>(<a class="code" href="classphysx_1_1PxTaskManager.html" title="The PxTaskManager interface.">PxTaskManager</a>&amp; tm, <a class="code" href="classphysx_1_1PxBaseTask.html" title="Base class of all task types.">PxBaseTask</a>* c)
<a name="l00246"></a>00246     {
<a name="l00247"></a>00247         <a class="code" href="group__foundation.html#g4a83a657390b324a460f14684e5accee">PX_ASSERT</a>( <a class="code" href="classphysx_1_1PxLightCpuTask.html#04e7bde817081eb377f129e7de7e285a" title="PxTask is dispatched when reaches 0.">mRefCount</a> == 0 );
<a name="l00248"></a>00248         <a class="code" href="classphysx_1_1PxLightCpuTask.html#04e7bde817081eb377f129e7de7e285a" title="PxTask is dispatched when reaches 0.">mRefCount</a> = 1;
<a name="l00249"></a>00249         <a class="code" href="classphysx_1_1PxLightCpuTask.html#7e5dbe5f98e11385d0e0a921d3af8243" title="Continuation task, can be NULL.">mCont</a> = c;
<a name="l00250"></a>00250         <a class="code" href="classphysx_1_1PxBaseTask.html#f23fffec1e92c794d3ad73e9fc4fa974" title="Owning PxTaskManager instance.">mTm</a> = &amp;tm;
<a name="l00251"></a>00251         <span class="keywordflow">if</span>( <a class="code" href="classphysx_1_1PxLightCpuTask.html#7e5dbe5f98e11385d0e0a921d3af8243" title="Continuation task, can be NULL.">mCont</a> )
<a name="l00252"></a>00252         {
<a name="l00253"></a>00253             <a class="code" href="classphysx_1_1PxLightCpuTask.html#7e5dbe5f98e11385d0e0a921d3af8243" title="Continuation task, can be NULL.">mCont</a>-&gt;<a class="code" href="classphysx_1_1PxBaseTask.html#07c9f6e71f0723bcf914fce51036d36e" title="Implemented by derived implementation classes.">addReference</a>();
<a name="l00254"></a>00254         }
<a name="l00255"></a>00255     }
<a name="l00256"></a>00256 
<a name="l00264"></a><a class="code" href="classphysx_1_1PxLightCpuTask.html#2ae16158861b04543919fdc456bb4559">00264</a>     <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> <span class="keywordtype">void</span> <a class="code" href="classphysx_1_1PxLightCpuTask.html#56ef764508a2bbc98d82bb6dbb09fa3e" title="Initialize this task and specify the task that will have its ref count decremented...">setContinuation</a>( <a class="code" href="classphysx_1_1PxBaseTask.html" title="Base class of all task types.">PxBaseTask</a>* c )
<a name="l00265"></a>00265     {
<a name="l00266"></a>00266         <a class="code" href="group__foundation.html#g4a83a657390b324a460f14684e5accee">PX_ASSERT</a>( c );
<a name="l00267"></a>00267         <a class="code" href="group__foundation.html#g4a83a657390b324a460f14684e5accee">PX_ASSERT</a>( <a class="code" href="classphysx_1_1PxLightCpuTask.html#04e7bde817081eb377f129e7de7e285a" title="PxTask is dispatched when reaches 0.">mRefCount</a> == 0 );
<a name="l00268"></a>00268         <a class="code" href="classphysx_1_1PxLightCpuTask.html#04e7bde817081eb377f129e7de7e285a" title="PxTask is dispatched when reaches 0.">mRefCount</a> = 1;
<a name="l00269"></a>00269         <a class="code" href="classphysx_1_1PxLightCpuTask.html#7e5dbe5f98e11385d0e0a921d3af8243" title="Continuation task, can be NULL.">mCont</a> = c;
<a name="l00270"></a>00270         <span class="keywordflow">if</span>( <a class="code" href="classphysx_1_1PxLightCpuTask.html#7e5dbe5f98e11385d0e0a921d3af8243" title="Continuation task, can be NULL.">mCont</a> )
<a name="l00271"></a>00271         {
<a name="l00272"></a>00272             <a class="code" href="classphysx_1_1PxLightCpuTask.html#7e5dbe5f98e11385d0e0a921d3af8243" title="Continuation task, can be NULL.">mCont</a>-&gt;<a class="code" href="classphysx_1_1PxBaseTask.html#07c9f6e71f0723bcf914fce51036d36e" title="Implemented by derived implementation classes.">addReference</a>();
<a name="l00273"></a>00273             <a class="code" href="classphysx_1_1PxBaseTask.html#f23fffec1e92c794d3ad73e9fc4fa974" title="Owning PxTaskManager instance.">mTm</a> = <a class="code" href="classphysx_1_1PxLightCpuTask.html#7e5dbe5f98e11385d0e0a921d3af8243" title="Continuation task, can be NULL.">mCont</a>-&gt;<a class="code" href="classphysx_1_1PxBaseTask.html#9dccf76144a25df2c2a7ed5fa8cea003" title="Return PxTaskManager to which this task was submitted.">getTaskManager</a>();
<a name="l00274"></a>00274             <a class="code" href="group__foundation.html#g4a83a657390b324a460f14684e5accee">PX_ASSERT</a>( <a class="code" href="classphysx_1_1PxBaseTask.html#f23fffec1e92c794d3ad73e9fc4fa974" title="Owning PxTaskManager instance.">mTm</a> );
<a name="l00275"></a>00275         }
<a name="l00276"></a>00276     }
<a name="l00277"></a>00277 
<a name="l00281"></a><a class="code" href="classphysx_1_1PxLightCpuTask.html#9896fbb4bbc97517e6ffb73749b6845e">00281</a>     <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> <a class="code" href="classphysx_1_1PxBaseTask.html" title="Base class of all task types.">PxBaseTask</a>*   <a class="code" href="classphysx_1_1PxLightCpuTask.html#9896fbb4bbc97517e6ffb73749b6845e" title="Retrieves continuation task.">getContinuation</a>()<span class="keyword">   const</span>
<a name="l00282"></a>00282 <span class="keyword">    </span>{
<a name="l00283"></a>00283         <span class="keywordflow">return</span> <a class="code" href="classphysx_1_1PxLightCpuTask.html#7e5dbe5f98e11385d0e0a921d3af8243" title="Continuation task, can be NULL.">mCont</a>;
<a name="l00284"></a>00284     }
<a name="l00285"></a>00285 
<a name="l00290"></a><a class="code" href="classphysx_1_1PxLightCpuTask.html#4f847956e5ba51a36bbb3ced5bb15a6c">00290</a>     <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> <span class="keywordtype">void</span> <a class="code" href="classphysx_1_1PxLightCpuTask.html#4f847956e5ba51a36bbb3ced5bb15a6c" title="Manually decrement this task&amp;#39;s reference count. If the reference count reaches...">removeReference</a>()
<a name="l00291"></a>00291     {
<a name="l00292"></a>00292         <a class="code" href="classphysx_1_1PxBaseTask.html#f23fffec1e92c794d3ad73e9fc4fa974" title="Owning PxTaskManager instance.">mTm</a>-&gt;decrReference(*<span class="keyword">this</span>);
<a name="l00293"></a>00293     }
<a name="l00294"></a>00294 
<a name="l00296"></a><a class="code" href="classphysx_1_1PxLightCpuTask.html#e45cef54851865477ee4f187e1fb5126">00296</a>     <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> int32_t <a class="code" href="classphysx_1_1PxLightCpuTask.html#e45cef54851865477ee4f187e1fb5126" title="Return the ref-count for this task.">getReference</a>()<span class="keyword"> const</span>
<a name="l00297"></a>00297 <span class="keyword">    </span>{
<a name="l00298"></a>00298         <span class="keywordflow">return</span> <a class="code" href="classphysx_1_1PxLightCpuTask.html#04e7bde817081eb377f129e7de7e285a" title="PxTask is dispatched when reaches 0.">mRefCount</a>;
<a name="l00299"></a>00299     }
<a name="l00300"></a>00300 
<a name="l00305"></a><a class="code" href="classphysx_1_1PxLightCpuTask.html#572d87fd23a65723d8e817f65e4681e6">00305</a>     <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> <span class="keywordtype">void</span> <a class="code" href="classphysx_1_1PxLightCpuTask.html#572d87fd23a65723d8e817f65e4681e6" title="Manually increment this task&amp;#39;s reference count. The task will not be allowed...">addReference</a>()
<a name="l00306"></a>00306     {
<a name="l00307"></a>00307         <a class="code" href="classphysx_1_1PxBaseTask.html#f23fffec1e92c794d3ad73e9fc4fa974" title="Owning PxTaskManager instance.">mTm</a>-&gt;addReference(*<span class="keyword">this</span>);
<a name="l00308"></a>00308     }
<a name="l00309"></a>00309 
<a name="l00315"></a><a class="code" href="classphysx_1_1PxLightCpuTask.html#ea23c57ffecb54f397089de1f3b0ad20">00315</a>     <a class="code" href="group__foundation.html#gcb03347b642a2a5bdea1f9b305a6fbec">PX_INLINE</a> <span class="keywordtype">void</span> <a class="code" href="classphysx_1_1PxLightCpuTask.html#ea23c57ffecb54f397089de1f3b0ad20" title="called by CpuDispatcher after run method has completed">release</a>()
<a name="l00316"></a>00316     {
<a name="l00317"></a>00317         <span class="keywordflow">if</span>( <a class="code" href="classphysx_1_1PxLightCpuTask.html#7e5dbe5f98e11385d0e0a921d3af8243" title="Continuation task, can be NULL.">mCont</a> )
<a name="l00318"></a>00318         {
<a name="l00319"></a>00319             <a class="code" href="classphysx_1_1PxLightCpuTask.html#7e5dbe5f98e11385d0e0a921d3af8243" title="Continuation task, can be NULL.">mCont</a>-&gt;<a class="code" href="classphysx_1_1PxBaseTask.html#78f9b745c6fb4114350cb1a26f3461d3" title="Implemented by derived implementation classes.">removeReference</a>();
<a name="l00320"></a>00320         }
<a name="l00321"></a>00321     }
<a name="l00322"></a>00322 
<a name="l00323"></a>00323 <span class="keyword">protected</span>:
<a name="l00324"></a>00324 
<a name="l00325"></a><a class="code" href="classphysx_1_1PxLightCpuTask.html#7e5dbe5f98e11385d0e0a921d3af8243">00325</a>     <a class="code" href="classphysx_1_1PxBaseTask.html" title="Base class of all task types.">PxBaseTask</a>*         <a class="code" href="classphysx_1_1PxLightCpuTask.html#7e5dbe5f98e11385d0e0a921d3af8243" title="Continuation task, can be NULL.">mCont</a>;          
<a name="l00326"></a><a class="code" href="classphysx_1_1PxLightCpuTask.html#04e7bde817081eb377f129e7de7e285a">00326</a>     <span class="keyword">volatile</span> int32_t    <a class="code" href="classphysx_1_1PxLightCpuTask.html#04e7bde817081eb377f129e7de7e285a" title="PxTask is dispatched when reaches 0.">mRefCount</a>;      
<a name="l00327"></a>00327 
<a name="l00328"></a><a class="code" href="classphysx_1_1PxLightCpuTask.html#c4a43ca8ae513a20c1d61bc9aecfce89">00328</a>     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classphysx_1_1PxLightCpuTask.html#c4a43ca8ae513a20c1d61bc9aecfce89">PxTaskMgr</a>;
<a name="l00329"></a>00329 };
<a name="l00330"></a>00330 
<a name="l00331"></a>00331 
<a name="l00332"></a>00332 }<span class="comment">// end physx namespace</span>
<a name="l00333"></a>00333 
<a name="l00334"></a>00334 
<a name="l00335"></a>00335 <span class="preprocessor">#endif // PXTASK_PXTASK_H</span>
</pre></div></div>

<hr style="width: 100%; height: 2px;"><br>
Copyright &copy; 2008-2018 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. <a href="http://www.nvidia.com ">www.nvidia.com</a>
</body>
</html>