blob: a16da5f38c2b9e6cc294931b5ee8e7cddcfd3540 [file] [log] [blame]
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001#
2# Copyright (C) 2015 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17header:
18summary: TODO Add documentation
19description:
20 TODO Add documentation
21end:
22
23type: rs_for_each_strategy_t
24enum: rs_for_each_strategy
25value: RS_FOR_EACH_STRATEGY_SERIAL = 0
26value: RS_FOR_EACH_STRATEGY_DONT_CARE = 1
27value: RS_FOR_EACH_STRATEGY_DST_LINEAR = 2
28value: RS_FOR_EACH_STRATEGY_TILE_SMALL = 3
29value: RS_FOR_EACH_STRATEGY_TILE_MEDIUM = 4
30value: RS_FOR_EACH_STRATEGY_TILE_LARGE = 5
31summary: Launch order hint for rsForEach calls
32description:
33 Launch order hint for rsForEach calls. This provides a hint to the system to
34 determine in which order the root function of the target is called with each
35 cell of the allocation.
36
37 This is a hint and implementations may not obey the order.
38end:
39
40type: rs_kernel_context
41version: 23
42simple: const struct rs_kernel_context_t *
43summary: Opaque handle to RenderScript kernel invocation context
44description:
45 TODO
46end:
47
48type: rs_script_call_t
49struct: rs_script_call
50field: rs_for_each_strategy_t strategy
51field: uint32_t xStart
52field: uint32_t xEnd
53field: uint32_t yStart
54field: uint32_t yEnd
55field: uint32_t zStart
56field: uint32_t zEnd
57field: uint32_t arrayStart
58field: uint32_t arrayEnd
59summary: Provides extra information to a rsForEach call
60description:
61 Structure to provide extra information to a rsForEach call. Primarly used to
62 restrict the call to a subset of cells in the allocation.
63end:
64
65function: rsForEach
66version: 9 13
67ret: void
68arg: rs_script script, "The target script to call"
69arg: rs_allocation input, "The allocation to source data from"
70arg: rs_allocation output, "the allocation to write date into"
71arg: const void* usrData, "The user defined params to pass to the root script. May be NULL."
72arg: const rs_script_call_t* sc, "Extra control infomation used to select a sub-region of the allocation to be processed or suggest a walking strategy. May be NULL."
73summary:
74description:
75 Make a script to script call to launch work. One of the input or output is
76 required to be a valid object. The input and output must be of the same
77 dimensions.
78test: none
79end:
80
81function: rsForEach
82version: 9 13
83ret: void
84arg: rs_script script
85arg: rs_allocation input
86arg: rs_allocation output
87arg: const void* usrData
88test: none
89end:
90
91function: rsForEach
92version: 14 20
93ret: void
94arg: rs_script script
95arg: rs_allocation input
96arg: rs_allocation output
97arg: const void* usrData
98arg: size_t usrDataLen, "The size of the userData structure. This will be used to perform a shallow copy of the data if necessary."
99arg: const rs_script_call_t* sc
100test: none
101end:
102
103function: rsForEach
104version: 14 20
105ret: void
106arg: rs_script script
107arg: rs_allocation input
108arg: rs_allocation output
109arg: const void* usrData
110arg: size_t usrDataLen
111test: none
112end:
113
114function: rsForEach
115version: 14
116ret: void
117arg: rs_script script
118arg: rs_allocation input
119arg: rs_allocation output
120test: none
121end:
122
123function: rsGetArray0
124version: 23
125ret: uint32_t
126arg: rs_kernel_context ctxt
127summary: Index in the Array0 dimension for the specified context
128description:
129 Returns the index in the Array0 dimension of the cell being processed,
130 as specified by the supplied context.
131
132 This context is created when a kernel is launched and updated at each
133 iteration. It contains common characteristics of the allocations being
134 iterated over and rarely used indexes, like the Array0 index.
135
136 You can access the context by adding a rs_kernel_context argument to your
137 kernel function. E.g.<br/>
138 <code>short RS_KERNEL myKernel(short value, uint32_t x, rs_kernel_context context) {<br/>
139 &nbsp;&nbsp;// The current index in the common x, y, z, w dimensions are accessed by<br/>
140 &nbsp;&nbsp;// adding these variables as arguments. For the more rarely used indexes<br/>
141 &nbsp;&nbsp;// to the other dimensions, extract them from the context:<br/>
142 &nbsp;&nbsp;uint32_t index_a0 = rsGetArray0(context);<br/>
143 &nbsp;&nbsp;//...<br/>
144 }<br/></code>
145
146 This function returns 0 if the Array0 dimension is not present.
147test: none
148end:
149
150function: rsGetArray1
151version: 23
152ret: uint32_t
153arg: rs_kernel_context ctxt
154summary: Index in the Array1 dimension for the specified context
155description:
156 Returns the index in the Array1 dimension of the cell being processed,
157 as specified by the supplied context. See @rsGetArray0() for an explanation
158 of the context.
159
160 Returns 0 if the Array1 dimension is not present.
161test: none
162end:
163
164function: rsGetArray2
165version: 23
166ret: uint32_t
167arg: rs_kernel_context ctxt
168summary: Index in the Array2 dimension for the specified context
169description:
170 Returns the index in the Array2 dimension of the cell being processed,
171 as specified by the supplied context. See @rsGetArray0() for an explanation
172 of the context.
173
174 Returns 0 if the Array2 dimension is not present.
175test: none
176end:
177
178function: rsGetArray3
179version: 23
180ret: uint32_t
181arg: rs_kernel_context ctxt
182summary: Index in the Array3 dimension for the specified context
183description:
184 Returns the index in the Array3 dimension of the cell being processed,
185 as specified by the supplied context. See @rsGetArray0() for an explanation
186 of the context.
187
188 Returns 0 if the Array3 dimension is not present.
189test: none
190end:
191
192function: rsGetDimArray0
193version: 23
194ret: uint32_t
195arg: rs_kernel_context ctxt
196summary: Size of the Array0 dimension for the specified context
197description:
198 Returns the size of the Array0 dimension for the specified context.
199 See @rsGetDimX() for an explanation of the context.
200
201 Returns 0 if the Array0 dimension is not present.
202#TODO Add an hyperlink to something that explains Array0/1/2/3
203# for the relevant functions.
204test: none
205end:
206
207function: rsGetDimArray1
208version: 23
209ret: uint32_t
210arg: rs_kernel_context ctxt
211summary: Size of the Array1 dimension for the specified context
212description:
213 Returns the size of the Array1 dimension for the specified context.
214 See @rsGetDimX() for an explanation of the context.
215
216 Returns 0 if the Array1 dimension is not present.
217test: none
218end:
219
220function: rsGetDimArray2
221version: 23
222ret: uint32_t
223arg: rs_kernel_context ctxt
224summary: Size of the Array2 dimension for the specified context
225description:
226 Returns the size of the Array2 dimension for the specified context.
227 See @rsGetDimX() for an explanation of the context.
228
229 Returns 0 if the Array2 dimension is not present.
230test: none
231end:
232
233function: rsGetDimArray3
234version: 23
235ret: uint32_t
236arg: rs_kernel_context ctxt
237summary: Size of the Array3 dimension for the specified context
238description:
239 Returns the size of the Array3 dimension for the specified context.
240 See @rsGetDimX() for an explanation of the context.
241
242 Returns 0 if the Array3 dimension is not present.
243test: none
244end:
245
246function: rsGetDimHasFaces
247version: 23
248ret: bool, "Returns true if more than one face is present, false otherwise."
249arg: rs_kernel_context ctxt
250summary: Presence of more than one face for the specified context
251description:
252 If the context refers to a cubemap, this function returns true if there's
253 more than one face present. In all other cases, it returns false.
254 See @rsGetDimX() for an explanation of the context.
255
256 @rsAllocationGetDimFaces() is similar but returns 0 or 1 instead of a bool.
257test: none
258end:
259
260function: rsGetDimLod
261version: 23
262ret: uint32_t
263arg: rs_kernel_context ctxt
264summary: Number of levels of detail for the specified context
265description:
266 Returns the number of levels of detail for the specified context.
267 This is useful for mipmaps. See @rsGetDimX() for an explanation of the context.
268 Returns 0 if Level of Detail is not used.
269
270 @rsAllocationGetDimLOD() is similar but returns 0 or 1 instead the actual
271 number of levels.
272test: none
273end:
274
275function: rsGetDimX
276version: 23
277ret: uint32_t
278arg: rs_kernel_context ctxt
279summary: Size of the X dimension for the specified context
280description:
281 Returns the size of the X dimension for the specified context.
282
283 This context is created when a kernel is launched. It contains common
284 characteristics of the allocations being iterated over by the kernel in
285 a very efficient structure. It also contains rarely used indexes.
286
287 You can access it by adding a rs_kernel_context argument to your kernel
288 function. E.g.<br/>
289 <code>int4 RS_KERNEL myKernel(int4 value, rs_kernel_context context) {<br/>
290 &nbsp;&nbsp;uint32_t size = rsGetDimX(context); //...<br/></code>
291test: none
292end:
293
294function: rsGetDimY
295version: 23
296ret: uint32_t
297arg: rs_kernel_context ctxt
298summary: Size of the Y dimension for the specified context
299description:
300 Returns the size of the X dimension for the specified context.
301 See @rsGetDimX() for an explanation of the context.
302
303 Returns 0 if the Y dimension is not present.
304test: none
305end:
306
307function: rsGetDimZ
308version: 23
309ret: uint32_t
310arg: rs_kernel_context ctxt
311summary: Size of the Z dimension for the specified context
312description:
313 Returns the size of the Z dimension for the specified context.
314 See @rsGetDimX() for an explanation of the context.
315
316 Returns 0 if the Z dimension is not present.
317test: none
318end:
319
320function: rsGetFace
321version: 23
322ret: rs_allocation_cubemap_face
323arg: rs_kernel_context ctxt
324summary: Coordinate of the Face for the specified context
325description:
326 Returns the face on which the cell being processed is found, as specified
327 by the supplied context. See @rsGetArray0() for an explanation of the context.
328
329 Returns RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X if the face dimension is not
330 present.
331test: none
332end:
333
334function: rsGetLod
335version: 23
336ret: uint32_t
337arg: rs_kernel_context ctxt
338summary: Index in the Levels of Detail dimension for the specified context.
339description:
340 Returns the index in the Levels of Detail dimension of the cell being
341 processed, as specified by the supplied context. See @rsGetArray0() for
342 an explanation of the context.
343
344 Returns 0 if the Levels of Detail dimension is not present.
345test: none
346end: