1be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet/*
2291330fbaf7486a1cea33de7dd26c18e57c71391Stephen Hines * Copyright (C) 2016 The Android Open Source Project
3be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
4be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * Licensed under the Apache License, Version 2.0 (the "License");
5be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * you may not use this file except in compliance with the License.
6be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * You may obtain a copy of the License at
7be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
8be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *      http://www.apache.org/licenses/LICENSE-2.0
9be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
10be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * Unless required by applicable law or agreed to in writing, software
11be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * distributed under the License is distributed on an "AS IS" BASIS,
12be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * See the License for the specific language governing permissions and
14be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * limitations under the License.
15be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet */
16be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
174a73004df5231d188c41267fee17c566ae7c3631Jean-Luc Brouillet// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
18be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
19be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet/*
2020b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet * rs_for_each.rsh: Kernel Invocation Functions and Types
21be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
2220b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet * The rsForEach() function can be used to invoke the root kernel of a script.
2320b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet *
2420b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet * The other functions are used to get the characteristics of the invocation of
25ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * an executing kernel, like dimensions and current indices.  These functions take
2620b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet * a rs_kernel_context as argument.
27be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet */
284a73004df5231d188c41267fee17c566ae7c3631Jean-Luc Brouillet
29be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#ifndef RENDERSCRIPT_RS_FOR_EACH_RSH
30be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#define RENDERSCRIPT_RS_FOR_EACH_RSH
31be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
32be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet/*
3320b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet * rs_for_each_strategy_t: Suggested cell processing order
34be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
3520b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet * This type is used to suggest how the invoked kernel should iterate over the cells of the
3620b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet * allocations.  This is a hint only.  Implementations may not follow the suggestion.
37be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
3820b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet * This specification can help the caching behavior of the running kernel, e.g. the cache
3920b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet * locality when the processing is distributed over multiple cores.
40be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet */
41be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettypedef enum rs_for_each_strategy {
4220b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet    RS_FOR_EACH_STRATEGY_SERIAL = 0, // Prefer contiguous memory regions.
4320b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet    RS_FOR_EACH_STRATEGY_DONT_CARE = 1, // No prefrences.
4420b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet    RS_FOR_EACH_STRATEGY_DST_LINEAR = 2, // Prefer DST.
4520b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet    RS_FOR_EACH_STRATEGY_TILE_SMALL = 3, // Prefer processing small rectangular regions.
4620b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet    RS_FOR_EACH_STRATEGY_TILE_MEDIUM = 4, // Prefer processing medium rectangular regions.
4720b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet    RS_FOR_EACH_STRATEGY_TILE_LARGE = 5 // Prefer processing large rectangular regions.
48be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet} rs_for_each_strategy_t;
49be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
50be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet/*
5120b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet * rs_kernel_context: Handle to a kernel invocation context
5220b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet *
5320b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet * The kernel context contains common characteristics of the allocations being iterated
54ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * over, like dimensions.  It also contains rarely used indices of the currently processed
55ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * cell, like the Array0 index or the current level of detail.
56be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
57ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * You can access the kernel context by adding a special parameter named "context" of type
584324eec445c6882dce89a24765482293ed31914eJean-Luc Brouillet * rs_kernel_context to your kernel function.  See rsGetDimX() and rsGetArray0() for examples.
59be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet */
60be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#if (defined(RS_VERSION) && (RS_VERSION >= 23))
61be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettypedef const struct rs_kernel_context_t * rs_kernel_context;
62be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#endif
63be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
64be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet/*
6520b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet * rs_script_call_t: Cell iteration information
66be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
6720b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet * This structure is used to provide iteration information to a rsForEach call.
6820b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet * It is currently used to restrict processing to a subset of cells.  In future
6920b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet * versions, it will also be used to provide hint on how to best iterate over
7020b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet * the cells.
7120b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet *
7220b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet * The Start fields are inclusive and the End fields are exclusive.  E.g. to iterate
7320b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet * over cells 4, 5, 6, and 7 in the X dimension, set xStart to 4 and xEnd to 8.
74be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet */
75be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettypedef struct rs_script_call {
7620b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet    rs_for_each_strategy_t strategy; // Currently ignored.  In the future, will be suggested cell iteration strategy.
7720b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet    uint32_t xStart; // Starting index in the X dimension.
7820b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet    uint32_t xEnd; // Ending index (exclusive) in the X dimension.
7920b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet    uint32_t yStart; // Starting index in the Y dimension.
8020b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet    uint32_t yEnd; // Ending index (exclusive) in the Y dimension.
8120b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet    uint32_t zStart; // Starting index in the Z dimension.
8220b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet    uint32_t zEnd; // Ending index (exclusive) in the Z dimension.
8320b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet    uint32_t arrayStart; // Starting index in the Array0 dimension.
8420b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet    uint32_t arrayEnd; // Ending index (exclusive) in the Array0 dimension.
8557b768bce0a0de33a1b75153e5ab2edd1a9dcca5Jean-Luc Brouillet    uint32_t array1Start; // Starting index in the Array1 dimension.
8657b768bce0a0de33a1b75153e5ab2edd1a9dcca5Jean-Luc Brouillet    uint32_t array1End; // Ending index (exclusive) in the Array1 dimension.
8757b768bce0a0de33a1b75153e5ab2edd1a9dcca5Jean-Luc Brouillet    uint32_t array2Start; // Starting index in the Array2 dimension.
8857b768bce0a0de33a1b75153e5ab2edd1a9dcca5Jean-Luc Brouillet    uint32_t array2End; // Ending index (exclusive) in the Array2 dimension.
8957b768bce0a0de33a1b75153e5ab2edd1a9dcca5Jean-Luc Brouillet    uint32_t array3Start; // Starting index in the Array3 dimension.
9057b768bce0a0de33a1b75153e5ab2edd1a9dcca5Jean-Luc Brouillet    uint32_t array3End; // Ending index (exclusive) in the Array3 dimension.
91be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet} rs_script_call_t;
92be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
93be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet/*
9412398d81f32e5e0479d02b8608a83c75cd991bb3Yang Ni * rs_kernel: Handle to a kernel function
9512398d81f32e5e0479d02b8608a83c75cd991bb3Yang Ni *
9612398d81f32e5e0479d02b8608a83c75cd991bb3Yang Ni *  An opaque type for a function that is defined with the kernel attribute.  A value
97dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni *  of this type can be used in a rsForEach call to launch a kernel.
9812398d81f32e5e0479d02b8608a83c75cd991bb3Yang Ni */
99fba00d3fa4c59b71640506b40d9e9ef0af8bccc7Yang Ni#if (defined(RS_VERSION) && (RS_VERSION >= 24))
10012398d81f32e5e0479d02b8608a83c75cd991bb3Yang Nitypedef void* rs_kernel;
10112398d81f32e5e0479d02b8608a83c75cd991bb3Yang Ni#endif
10212398d81f32e5e0479d02b8608a83c75cd991bb3Yang Ni
10312398d81f32e5e0479d02b8608a83c75cd991bb3Yang Ni/*
104fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni * rsForEach: Launches a kernel
105fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni *
106fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni * Runs the kernel over zero or more input allocations. They are passed after the
107fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni * rs_kernel argument. If the specified kernel returns a value, an output allocation
108fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni * must be specified as the last argument. All input allocations,
109fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni * and the output allocation if it exists, must have the same dimensions.
110fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni *
111fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni * This is a synchronous function. A call to this function only returns after all
112fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni * the work has completed for all cells of the input allocations. If the kernel
113fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni * function returns any value, the call waits until all results have been written
114fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni * to the output allocation.
115fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni *
116fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni * Up to API level 23, the kernel is implicitly specified as the kernel named
117fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni * "root" in the specified script, and only a single input allocation can be used.
118fba00d3fa4c59b71640506b40d9e9ef0af8bccc7Yang Ni * Starting in API level 24, an arbitrary kernel function can be used,
119fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni * as specified by the kernel argument. The script argument is removed.
120fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni * The kernel must be defined in the current script. In addition, more than one
1216215b41e7c204c78a8c0f73863e7ae15e6ba1b55Yang Ni * input can be used.
122fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni *
123fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni * E.g.
124fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni * float __attribute__((kernel)) square(float a) {
125fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni *   return a * a;
126fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni * }
12720b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet *
128fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni * void compute(rs_allocation ain, rs_allocation aout) {
129fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni *   rsForEach(square, ain, aout);
13020b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet * }
13120b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet *
132be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
133be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * Parameters:
13420b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet *   script: Script to call.
13520b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet *   input: Allocation to source data from.
13620b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet *   output: Allocation to write date into.
13720b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet *   usrData: User defined data to pass to the script.  May be NULL.
13820b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet *   sc: Extra control information used to select a sub-region of the allocation to be processed or suggest a walking strategy.  May be NULL.
1396386ceb3bf25e442513224aaa45691dfe49562d9Jean-Luc Brouillet *   usrDataLen: Size of the userData structure.  This will be used to perform a shallow copy of the data if necessary.
140dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni *   kernel: Function designator to a function that is defined with the kernel attribute.
141dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni *   ...: Input and output allocations
142be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet */
143be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#if !defined(RS_VERSION) || (RS_VERSION <= 13)
144be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletextern void __attribute__((overloadable))
145be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet    rsForEach(rs_script script, rs_allocation input, rs_allocation output, const void* usrData,
146be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet              const rs_script_call_t* sc);
147be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#endif
148be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
149be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#if !defined(RS_VERSION) || (RS_VERSION <= 13)
150be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletextern void __attribute__((overloadable))
151be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet    rsForEach(rs_script script, rs_allocation input, rs_allocation output, const void* usrData);
152be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#endif
153be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
154be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#if (defined(RS_VERSION) && (RS_VERSION >= 14) && (RS_VERSION <= 20))
155be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletextern void __attribute__((overloadable))
156be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet    rsForEach(rs_script script, rs_allocation input, rs_allocation output, const void* usrData,
157be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet              size_t usrDataLen, const rs_script_call_t* sc);
158be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#endif
159be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
160be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#if (defined(RS_VERSION) && (RS_VERSION >= 14) && (RS_VERSION <= 20))
161be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletextern void __attribute__((overloadable))
162be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet    rsForEach(rs_script script, rs_allocation input, rs_allocation output, const void* usrData,
163be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet              size_t usrDataLen);
164be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#endif
165be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
166dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni#if (defined(RS_VERSION) && (RS_VERSION >= 14) && (RS_VERSION <= 23))
167be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletextern void __attribute__((overloadable))
168be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet    rsForEach(rs_script script, rs_allocation input, rs_allocation output);
169be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#endif
170be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
171fba00d3fa4c59b71640506b40d9e9ef0af8bccc7Yang Ni#if (defined(RS_VERSION) && (RS_VERSION >= 24))
172dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Niextern void
173fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni    rsForEach(rs_kernel kernel, ...);
174dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni#endif
175dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni
176be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet/*
177fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni * rsForEachWithOptions: Launches a kernel with options
178fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni *
179fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni * Launches kernel in a way similar to rsForEach. However, instead of processing
180fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni * all cells in the input, this function only processes cells in the subspace of
181fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni * the index space specified in options. With the index space explicitly specified
182fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni * by options, no input or output allocation is required for a kernel launch using
183fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni * this API. If allocations are passed in, they must match the number of arguments
184fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni * and return value expected by the kernel function. The output allocation is
185fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni * present if and only if the kernel has a non-void return value.
186fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni *
187fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni * E.g.,
188fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni *    rs_script_call_t opts = {0};
189fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni *    opts.xStart = 0;
190fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni *    opts.xEnd = dimX;
191fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni *    opts.yStart = 0;
192fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni *    opts.yEnd = dimY / 2;
193fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni *    rsForEachWithOptions(foo, &opts, out, out);
19412398d81f32e5e0479d02b8608a83c75cd991bb3Yang Ni *
19512398d81f32e5e0479d02b8608a83c75cd991bb3Yang Ni *
19612398d81f32e5e0479d02b8608a83c75cd991bb3Yang Ni * Parameters:
19712398d81f32e5e0479d02b8608a83c75cd991bb3Yang Ni *   kernel: Function designator to a function that is defined with the kernel attribute.
198dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni *   options: Launch options
19912398d81f32e5e0479d02b8608a83c75cd991bb3Yang Ni *   ...: Input and output allocations
20012398d81f32e5e0479d02b8608a83c75cd991bb3Yang Ni */
201fba00d3fa4c59b71640506b40d9e9ef0af8bccc7Yang Ni#if (defined(RS_VERSION) && (RS_VERSION >= 24))
20212398d81f32e5e0479d02b8608a83c75cd991bb3Yang Niextern void
203fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni    rsForEachWithOptions(rs_kernel kernel, rs_script_call_t* options, ...);
20412398d81f32e5e0479d02b8608a83c75cd991bb3Yang Ni#endif
20512398d81f32e5e0479d02b8608a83c75cd991bb3Yang Ni
20612398d81f32e5e0479d02b8608a83c75cd991bb3Yang Ni/*
207ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * rsGetArray0: Index in the Array0 dimension for the specified kernel context
208be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
2096386ceb3bf25e442513224aaa45691dfe49562d9Jean-Luc Brouillet * Returns the index in the Array0 dimension of the cell being processed, as specified
210ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * by the supplied kernel context.
211be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
212ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * The kernel context contains common characteristics of the allocations being iterated
213ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * over and rarely used indices, like the Array0 index.
214be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
215ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * You can access the kernel context by adding a special parameter named "context" of
2164324eec445c6882dce89a24765482293ed31914eJean-Luc Brouillet * type rs_kernel_context to your kernel function.  E.g.
217be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * short RS_KERNEL myKernel(short value, uint32_t x, rs_kernel_context context) {
218ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet *   // The current index in the common x, y, z dimensions are accessed by
219ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet *   // adding these variables as arguments.  For the more rarely used indices
220ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet *   // to the other dimensions, extract them from the kernel context:
221be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *   uint32_t index_a0 = rsGetArray0(context);
222be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *   //...
223be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * }
224be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
225be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * This function returns 0 if the Array0 dimension is not present.
226be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet */
227be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#if (defined(RS_VERSION) && (RS_VERSION >= 23))
228be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletextern uint32_t __attribute__((overloadable))
2294324eec445c6882dce89a24765482293ed31914eJean-Luc Brouillet    rsGetArray0(rs_kernel_context context);
230be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#endif
231be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
232be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet/*
233ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * rsGetArray1: Index in the Array1 dimension for the specified kernel context
234be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
2356386ceb3bf25e442513224aaa45691dfe49562d9Jean-Luc Brouillet * Returns the index in the Array1 dimension of the cell being processed, as specified
236ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * by the supplied kernel context.  See rsGetArray0() for an explanation of the context.
237be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
238be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * Returns 0 if the Array1 dimension is not present.
239be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet */
240be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#if (defined(RS_VERSION) && (RS_VERSION >= 23))
241be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletextern uint32_t __attribute__((overloadable))
2424324eec445c6882dce89a24765482293ed31914eJean-Luc Brouillet    rsGetArray1(rs_kernel_context context);
243be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#endif
244be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
245be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet/*
246ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * rsGetArray2: Index in the Array2 dimension for the specified kernel context
247be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
248be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * Returns the index in the Array2 dimension of the cell being processed,
249ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * as specified by the supplied kernel context.  See rsGetArray0() for an explanation
250be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * of the context.
251be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
252be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * Returns 0 if the Array2 dimension is not present.
253be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet */
254be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#if (defined(RS_VERSION) && (RS_VERSION >= 23))
255be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletextern uint32_t __attribute__((overloadable))
2564324eec445c6882dce89a24765482293ed31914eJean-Luc Brouillet    rsGetArray2(rs_kernel_context context);
257be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#endif
258be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
259be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet/*
260ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * rsGetArray3: Index in the Array3 dimension for the specified kernel context
261be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
2626386ceb3bf25e442513224aaa45691dfe49562d9Jean-Luc Brouillet * Returns the index in the Array3 dimension of the cell being processed, as specified
263ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * by the supplied kernel context.  See rsGetArray0() for an explanation of the context.
264be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
265be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * Returns 0 if the Array3 dimension is not present.
266be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet */
267be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#if (defined(RS_VERSION) && (RS_VERSION >= 23))
268be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletextern uint32_t __attribute__((overloadable))
2694324eec445c6882dce89a24765482293ed31914eJean-Luc Brouillet    rsGetArray3(rs_kernel_context context);
270be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#endif
271be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
272be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet/*
273ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * rsGetDimArray0: Size of the Array0 dimension for the specified kernel context
274be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
275ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * Returns the size of the Array0 dimension for the specified kernel context.
276be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * See rsGetDimX() for an explanation of the context.
277be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
278be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * Returns 0 if the Array0 dimension is not present.
279be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet */
280be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#if (defined(RS_VERSION) && (RS_VERSION >= 23))
281be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletextern uint32_t __attribute__((overloadable))
2824324eec445c6882dce89a24765482293ed31914eJean-Luc Brouillet    rsGetDimArray0(rs_kernel_context context);
283be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#endif
284be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
285be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet/*
286ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * rsGetDimArray1: Size of the Array1 dimension for the specified kernel context
287be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
288ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * Returns the size of the Array1 dimension for the specified kernel context.
289be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * See rsGetDimX() for an explanation of the context.
290be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
291be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * Returns 0 if the Array1 dimension is not present.
292be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet */
293be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#if (defined(RS_VERSION) && (RS_VERSION >= 23))
294be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletextern uint32_t __attribute__((overloadable))
2954324eec445c6882dce89a24765482293ed31914eJean-Luc Brouillet    rsGetDimArray1(rs_kernel_context context);
296be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#endif
297be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
298be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet/*
299ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * rsGetDimArray2: Size of the Array2 dimension for the specified kernel context
300be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
301ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * Returns the size of the Array2 dimension for the specified kernel context.
302be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * See rsGetDimX() for an explanation of the context.
303be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
304be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * Returns 0 if the Array2 dimension is not present.
305be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet */
306be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#if (defined(RS_VERSION) && (RS_VERSION >= 23))
307be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletextern uint32_t __attribute__((overloadable))
3084324eec445c6882dce89a24765482293ed31914eJean-Luc Brouillet    rsGetDimArray2(rs_kernel_context context);
309be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#endif
310be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
311be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet/*
312ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * rsGetDimArray3: Size of the Array3 dimension for the specified kernel context
313be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
314ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * Returns the size of the Array3 dimension for the specified kernel context.
315be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * See rsGetDimX() for an explanation of the context.
316be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
317be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * Returns 0 if the Array3 dimension is not present.
318be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet */
319be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#if (defined(RS_VERSION) && (RS_VERSION >= 23))
320be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletextern uint32_t __attribute__((overloadable))
3214324eec445c6882dce89a24765482293ed31914eJean-Luc Brouillet    rsGetDimArray3(rs_kernel_context context);
322be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#endif
323be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
324be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet/*
325ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * rsGetDimHasFaces: Presence of more than one face for the specified kernel context
326be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
327ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * If the kernel is iterating over a cubemap, this function returns true if there's more
328ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * than one face present.  In all other cases, it returns false.  See rsGetDimX() for an
3296386ceb3bf25e442513224aaa45691dfe49562d9Jean-Luc Brouillet * explanation of the context.
330be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
331be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * rsAllocationGetDimFaces() is similar but returns 0 or 1 instead of a bool.
332be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
333be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * Returns: Returns true if more than one face is present, false otherwise.
334be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet */
335be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#if (defined(RS_VERSION) && (RS_VERSION >= 23))
336be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletextern bool __attribute__((overloadable))
3374324eec445c6882dce89a24765482293ed31914eJean-Luc Brouillet    rsGetDimHasFaces(rs_kernel_context context);
338be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#endif
339be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
340be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet/*
341ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * rsGetDimLod: Number of levels of detail for the specified kernel context
342be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
343ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * Returns the number of levels of detail for the specified kernel context.  This is useful
3446386ceb3bf25e442513224aaa45691dfe49562d9Jean-Luc Brouillet * for mipmaps.  See rsGetDimX() for an explanation of the context.
3456386ceb3bf25e442513224aaa45691dfe49562d9Jean-Luc Brouillet *
346be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * Returns 0 if Level of Detail is not used.
347be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
348be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * rsAllocationGetDimLOD() is similar but returns 0 or 1 instead the actual
349be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * number of levels.
350be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet */
351be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#if (defined(RS_VERSION) && (RS_VERSION >= 23))
352be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletextern uint32_t __attribute__((overloadable))
3534324eec445c6882dce89a24765482293ed31914eJean-Luc Brouillet    rsGetDimLod(rs_kernel_context context);
354be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#endif
355be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
356be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet/*
357ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * rsGetDimX: Size of the X dimension for the specified kernel context
358be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
359ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * Returns the size of the X dimension for the specified kernel context.
360be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
361ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * The kernel context contains common characteristics of the allocations being iterated
362ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * over and rarely used indices, like the Array0 index.
363be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
364ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * You can access it by adding a special parameter named "context" of
3654324eec445c6882dce89a24765482293ed31914eJean-Luc Brouillet * type rs_kernel_context to your kernel function.  E.g.
366be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * int4 RS_KERNEL myKernel(int4 value, rs_kernel_context context) {
367be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *   uint32_t size = rsGetDimX(context); //...
36820b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet *
36920b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet * To get the dimension of specific allocation, use rsAllocationGetDimX().
370be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet */
371be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#if (defined(RS_VERSION) && (RS_VERSION >= 23))
372be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletextern uint32_t __attribute__((overloadable))
3734324eec445c6882dce89a24765482293ed31914eJean-Luc Brouillet    rsGetDimX(rs_kernel_context context);
374be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#endif
375be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
376be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet/*
377ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * rsGetDimY: Size of the Y dimension for the specified kernel context
378be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
379ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * Returns the size of the X dimension for the specified kernel context.
380be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * See rsGetDimX() for an explanation of the context.
381be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
382be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * Returns 0 if the Y dimension is not present.
38320b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet *
38420b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet * To get the dimension of specific allocation, use rsAllocationGetDimY().
385be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet */
386be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#if (defined(RS_VERSION) && (RS_VERSION >= 23))
387be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletextern uint32_t __attribute__((overloadable))
3884324eec445c6882dce89a24765482293ed31914eJean-Luc Brouillet    rsGetDimY(rs_kernel_context context);
389be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#endif
390be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
391be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet/*
392ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * rsGetDimZ: Size of the Z dimension for the specified kernel context
393be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
394ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * Returns the size of the Z dimension for the specified kernel context.
395be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * See rsGetDimX() for an explanation of the context.
396be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
397be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * Returns 0 if the Z dimension is not present.
39820b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet *
39920b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet * To get the dimension of specific allocation, use rsAllocationGetDimZ().
400be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet */
401be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#if (defined(RS_VERSION) && (RS_VERSION >= 23))
402be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletextern uint32_t __attribute__((overloadable))
4034324eec445c6882dce89a24765482293ed31914eJean-Luc Brouillet    rsGetDimZ(rs_kernel_context context);
404be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#endif
405be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
406be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet/*
407ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * rsGetFace: Coordinate of the Face for the specified kernel context
408be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
4096386ceb3bf25e442513224aaa45691dfe49562d9Jean-Luc Brouillet * Returns the face on which the cell being processed is found, as specified by the
410ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * supplied kernel context.  See rsGetArray0() for an explanation of the context.
411be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
412be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * Returns RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X if the face dimension is not
413be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * present.
414be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet */
415be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#if (defined(RS_VERSION) && (RS_VERSION >= 23))
416be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletextern rs_allocation_cubemap_face __attribute__((overloadable))
4174324eec445c6882dce89a24765482293ed31914eJean-Luc Brouillet    rsGetFace(rs_kernel_context context);
418be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#endif
419be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
420be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet/*
421ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * rsGetLod: Index in the Levels of Detail dimension for the specified kernel context
422be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
4236386ceb3bf25e442513224aaa45691dfe49562d9Jean-Luc Brouillet * Returns the index in the Levels of Detail dimension of the cell being processed,
424ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet * as specified by the supplied kernel context.  See rsGetArray0() for an explanation of
4256386ceb3bf25e442513224aaa45691dfe49562d9Jean-Luc Brouillet * the context.
426be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet *
427be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet * Returns 0 if the Levels of Detail dimension is not present.
428be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet */
429be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#if (defined(RS_VERSION) && (RS_VERSION >= 23))
430be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletextern uint32_t __attribute__((overloadable))
4314324eec445c6882dce89a24765482293ed31914eJean-Luc Brouillet    rsGetLod(rs_kernel_context context);
432be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#endif
433be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet
434be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#endif // RENDERSCRIPT_RS_FOR_EACH_RSH
435