1be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet# 2be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet# Copyright (C) 2015 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 17be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletheader: 1820b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletsummary: Kernel Invocation Functions and Types 19be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletdescription: 2020b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet The @rsForEach() function can be used to invoke the root kernel of a script. 2120b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet 2220b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet The other functions are used to get the characteristics of the invocation of 23ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet an executing kernel, like dimensions and current indices. These functions take 2420b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet a @rs_kernel_context as argument. 25be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend: 26be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 27be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettype: rs_for_each_strategy_t 28be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletenum: rs_for_each_strategy 2920b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletvalue: RS_FOR_EACH_STRATEGY_SERIAL = 0, "Prefer contiguous memory regions." 3020b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletvalue: RS_FOR_EACH_STRATEGY_DONT_CARE = 1, "No prefrences." 3120b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet#TODO explain this better 3220b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletvalue: RS_FOR_EACH_STRATEGY_DST_LINEAR = 2, "Prefer DST." 3320b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletvalue: RS_FOR_EACH_STRATEGY_TILE_SMALL = 3, "Prefer processing small rectangular regions." 3420b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletvalue: RS_FOR_EACH_STRATEGY_TILE_MEDIUM = 4, "Prefer processing medium rectangular regions." 3520b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletvalue: RS_FOR_EACH_STRATEGY_TILE_LARGE = 5, "Prefer processing large rectangular regions." 3620b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletsummary: Suggested cell processing order 37be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletdescription: 3820b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet This type is used to suggest how the invoked kernel should iterate over the cells of the 3920b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet allocations. This is a hint only. Implementations may not follow the suggestion. 40be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 4120b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet This specification can help the caching behavior of the running kernel, e.g. the cache 4220b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet locality when the processing is distributed over multiple cores. 43be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend: 44be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 45be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettype: rs_kernel_context 46be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletversion: 23 47be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletsimple: const struct rs_kernel_context_t * 4820b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletsummary: Handle to a kernel invocation context 49be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletdescription: 5020b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet The kernel context contains common characteristics of the allocations being iterated 51ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet over, like dimensions. It also contains rarely used indices of the currently processed 52ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet cell, like the Array0 index or the current level of detail. 5320b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet 54ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet You can access the kernel context by adding a special parameter named "context" of type 554324eec445c6882dce89a24765482293ed31914eJean-Luc Brouillet rs_kernel_context to your kernel function. See @rsGetDimX() and @rsGetArray0() for examples. 56be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend: 57be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 58be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettype: rs_script_call_t 59be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletstruct: rs_script_call 6020b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletfield: rs_for_each_strategy_t strategy, "Currently ignored. In the future, will be suggested cell iteration strategy." 6120b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletfield: uint32_t xStart, "Starting index in the X dimension." 6220b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletfield: uint32_t xEnd, "Ending index (exclusive) in the X dimension." 6320b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletfield: uint32_t yStart, "Starting index in the Y dimension." 6420b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletfield: uint32_t yEnd, "Ending index (exclusive) in the Y dimension." 6520b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletfield: uint32_t zStart, "Starting index in the Z dimension." 6620b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletfield: uint32_t zEnd, "Ending index (exclusive) in the Z dimension." 6720b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletfield: uint32_t arrayStart, "Starting index in the Array0 dimension." 6820b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletfield: uint32_t arrayEnd, "Ending index (exclusive) in the Array0 dimension." 6957b768bce0a0de33a1b75153e5ab2edd1a9dcca5Jean-Luc Brouilletfield: uint32_t array1Start, "Starting index in the Array1 dimension." 7057b768bce0a0de33a1b75153e5ab2edd1a9dcca5Jean-Luc Brouilletfield: uint32_t array1End, "Ending index (exclusive) in the Array1 dimension." 7157b768bce0a0de33a1b75153e5ab2edd1a9dcca5Jean-Luc Brouilletfield: uint32_t array2Start, "Starting index in the Array2 dimension." 7257b768bce0a0de33a1b75153e5ab2edd1a9dcca5Jean-Luc Brouilletfield: uint32_t array2End, "Ending index (exclusive) in the Array2 dimension." 7357b768bce0a0de33a1b75153e5ab2edd1a9dcca5Jean-Luc Brouilletfield: uint32_t array3Start, "Starting index in the Array3 dimension." 7457b768bce0a0de33a1b75153e5ab2edd1a9dcca5Jean-Luc Brouilletfield: uint32_t array3End, "Ending index (exclusive) in the Array3 dimension." 7520b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletsummary: Cell iteration information 76be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletdescription: 7720b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet This structure is used to provide iteration information to a rsForEach call. 7820b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet It is currently used to restrict processing to a subset of cells. In future 7920b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet versions, it will also be used to provide hint on how to best iterate over 8020b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet the cells. 8120b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet 8220b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet The Start fields are inclusive and the End fields are exclusive. E.g. to iterate 8320b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet over cells 4, 5, 6, and 7 in the X dimension, set xStart to 4 and xEnd to 8. 84be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend: 85be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 86dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Nitype: rs_kernel 87fba00d3fa4c59b71640506b40d9e9ef0af8bccc7Yang Niversion: 24 88dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Nisimple: void* 89dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Nisummary: Handle to a kernel function 90dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Nidescription: 91dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni An opaque type for a function that is defined with the kernel attribute. A value 92dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni of this type can be used in a @rsForEach call to launch a kernel. 93dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Niend: 94dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni 95be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletfunction: rsForEach 96be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletversion: 9 13 97be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletret: void 9820b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: rs_script script, "Script to call." 9920b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: rs_allocation input, "Allocation to source data from." 10020b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: rs_allocation output, "Allocation to write date into." 10120b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: const void* usrData, "User defined data to pass to the script. May be NULL." 10220b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: const rs_script_call_t* sc, "Extra control information used to select a sub-region of the allocation to be processed or suggest a walking strategy. May be NULL." 103dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Nisummary: Launches a kernel 104be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletdescription: 105dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni Runs the kernel over zero or more input allocations. They are passed after the 106dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni @rs_kernel argument. If the specified kernel returns a value, an output allocation 107dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni must be specified as the last argument. All input allocations, 108dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni and the output allocation if it exists, must have the same dimensions. 109dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni 110dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni This is a synchronous function. A call to this function only returns after all 111dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni the work has completed for all cells of the input allocations. If the kernel 112dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni function returns any value, the call waits until all results have been written 113dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni to the output allocation. 114dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni 115dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni Up to API level 23, the kernel is implicitly specified as the kernel named 116dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni "root" in the specified script, and only a single input allocation can be used. 117fba00d3fa4c59b71640506b40d9e9ef0af8bccc7Yang Ni Starting in API level 24, an arbitrary kernel function can be used, 118dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni as specified by the kernel argument. The script argument is removed. 119dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni The kernel must be defined in the current script. In addition, more than one 12079b75b7ba646cebabe83c68f0ff72a8018f6b3eaYang Ni input can be used. 121dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni 122fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni E.g.<code><br/> 123dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni float __attribute__((kernel)) square(float a) {<br/> 124dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni return a * a;<br/> 125dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni }<br/> 126fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni <br/> 127dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni void compute(rs_allocation ain, rs_allocation aout) {<br/> 128dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni rsForEach(square, ain, aout);<br/> 129dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni }<br/> 130fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni <br/></code> 131be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettest: none 132be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend: 133be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 134be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletfunction: rsForEach 135be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletversion: 9 13 136be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletret: void 137be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletarg: rs_script script 138be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletarg: rs_allocation input 139be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletarg: rs_allocation output 140be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletarg: const void* usrData 141be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettest: none 142be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend: 143be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 144be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletfunction: rsForEach 145be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletversion: 14 20 146be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletret: void 147be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletarg: rs_script script 148be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletarg: rs_allocation input 149be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletarg: rs_allocation output 150be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletarg: const void* usrData 1516386ceb3bf25e442513224aaa45691dfe49562d9Jean-Luc Brouilletarg: size_t usrDataLen, "Size of the userData structure. This will be used to perform a shallow copy of the data if necessary." 152be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletarg: const rs_script_call_t* sc 153be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettest: none 154be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend: 155be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 156be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletfunction: rsForEach 157be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletversion: 14 20 158be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletret: void 159be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletarg: rs_script script 160be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletarg: rs_allocation input 161be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletarg: rs_allocation output 162be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletarg: const void* usrData 163be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletarg: size_t usrDataLen 164be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettest: none 165be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend: 166be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 167be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletfunction: rsForEach 168dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Niversion: 14 23 169be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletret: void 170be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletarg: rs_script script 171be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletarg: rs_allocation input 172be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletarg: rs_allocation output 173be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettest: none 174be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend: 175be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 176dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Nifunction: rsForEach 177fba00d3fa4c59b71640506b40d9e9ef0af8bccc7Yang Niversion: 24 178dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Niintrinsic: true 179fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni# Not overloadable 180fab6947a18e00964f79e6c802dc70bbaed981730Yang Niattrib: = 181dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Niret: void 182dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Niarg: rs_kernel kernel, "Function designator to a function that is defined with the kernel attribute." 183dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Niarg: ..., "Input and output allocations" 184dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Nitest: none 18512398d81f32e5e0479d02b8608a83c75cd991bb3Yang Niend: 18612398d81f32e5e0479d02b8608a83c75cd991bb3Yang Ni 187dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Nifunction: rsForEachWithOptions 188fba00d3fa4c59b71640506b40d9e9ef0af8bccc7Yang Niversion: 24 18912398d81f32e5e0479d02b8608a83c75cd991bb3Yang Niintrinsic: true 190fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni# Not overloadable 191fab6947a18e00964f79e6c802dc70bbaed981730Yang Niattrib: = 19212398d81f32e5e0479d02b8608a83c75cd991bb3Yang Niret: void 19312398d81f32e5e0479d02b8608a83c75cd991bb3Yang Niarg: rs_kernel kernel, "Function designator to a function that is defined with the kernel attribute." 194dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Niarg: rs_script_call_t* options, "Launch options" 19512398d81f32e5e0479d02b8608a83c75cd991bb3Yang Niarg: ..., "Input and output allocations" 196dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Nisummary: Launches a kernel with options 19712398d81f32e5e0479d02b8608a83c75cd991bb3Yang Nidescription: 198dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni Launches kernel in a way similar to @rsForEach. However, instead of processing 199dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni all cells in the input, this function only processes cells in the subspace of 200dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni the index space specified in options. With the index space explicitly specified 201dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni by options, no input or output allocation is required for a kernel launch using 202dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni this API. If allocations are passed in, they must match the number of arguments 203dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni and return value expected by the kernel function. The output allocation is 204dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni present if and only if the kernel has a non-void return value. 205dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni 206fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni E.g.,<code><br/> 207dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni rs_script_call_t opts = {0};<br/> 208dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni opts.xStart = 0;<br/> 209dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni opts.xEnd = dimX;<br/> 210dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni opts.yStart = 0;<br/> 211dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni opts.yEnd = dimY / 2;<br/> 212dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Ni rsForEachWithOptions(foo, &opts, out, out);<br/> 213fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni </code> 21412398d81f32e5e0479d02b8608a83c75cd991bb3Yang Nitest: none 21512398d81f32e5e0479d02b8608a83c75cd991bb3Yang Niend: 21612398d81f32e5e0479d02b8608a83c75cd991bb3Yang Ni 21712398d81f32e5e0479d02b8608a83c75cd991bb3Yang Nifunction: rsForEachInternal 218fba00d3fa4c59b71640506b40d9e9ef0af8bccc7Yang Niversion: 24 21912398d81f32e5e0479d02b8608a83c75cd991bb3Yang Niinternal: true 22012398d81f32e5e0479d02b8608a83c75cd991bb3Yang Niret: void 22112398d81f32e5e0479d02b8608a83c75cd991bb3Yang Niarg: int slot 222dda5cb5b59ae02ec03001ea12c374413714f3d38Yang Niarg: rs_script_call_t* options 223fab6947a18e00964f79e6c802dc70bbaed981730Yang Niarg: int hasOutput, "Indicates whether the kernel generates output" 224fab6947a18e00964f79e6c802dc70bbaed981730Yang Niarg: int numInputs, "Number of input allocations" 22579b75b7ba646cebabe83c68f0ff72a8018f6b3eaYang Niarg: rs_allocation* allocs, "Input and output allocations" 22612398d81f32e5e0479d02b8608a83c75cd991bb3Yang Nisummary: (Internal API) Launch a kernel in the current Script (with the slot number) 22712398d81f32e5e0479d02b8608a83c75cd991bb3Yang Nidescription: 228fab6947a18e00964f79e6c802dc70bbaed981730Yang Ni Internal API to launch a kernel. 22912398d81f32e5e0479d02b8608a83c75cd991bb3Yang Nitest: none 23012398d81f32e5e0479d02b8608a83c75cd991bb3Yang Niend: 23112398d81f32e5e0479d02b8608a83c75cd991bb3Yang Ni 232be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletfunction: rsGetArray0 233be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletversion: 23 234be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletret: uint32_t 2354324eec445c6882dce89a24765482293ed31914eJean-Luc Brouilletarg: rs_kernel_context context 236ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouilletsummary: Index in the Array0 dimension for the specified kernel context 237be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletdescription: 2386386ceb3bf25e442513224aaa45691dfe49562d9Jean-Luc Brouillet Returns the index in the Array0 dimension of the cell being processed, as specified 239ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet by the supplied kernel context. 240be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 241ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet The kernel context contains common characteristics of the allocations being iterated 242ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet over and rarely used indices, like the Array0 index. 243be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 244ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet You can access the kernel context by adding a special parameter named "context" of 2454324eec445c6882dce89a24765482293ed31914eJean-Luc Brouillet type rs_kernel_context to your kernel function. E.g.<br/> 246be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet <code>short RS_KERNEL myKernel(short value, uint32_t x, rs_kernel_context context) {<br/> 247ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet // The current index in the common x, y, z dimensions are accessed by<br/> 248ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet // adding these variables as arguments. For the more rarely used indices<br/> 249ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet // to the other dimensions, extract them from the kernel context:<br/> 250be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet uint32_t index_a0 = rsGetArray0(context);<br/> 251be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet //...<br/> 252be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet }<br/></code> 253be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 254be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet This function returns 0 if the Array0 dimension is not present. 255be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettest: none 256be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend: 257be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 258be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletfunction: rsGetArray1 259be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletversion: 23 260be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletret: uint32_t 2614324eec445c6882dce89a24765482293ed31914eJean-Luc Brouilletarg: rs_kernel_context context 262ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouilletsummary: Index in the Array1 dimension for the specified kernel context 263be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletdescription: 2646386ceb3bf25e442513224aaa45691dfe49562d9Jean-Luc Brouillet Returns the index in the Array1 dimension of the cell being processed, as specified 265ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet by the supplied kernel context. See @rsGetArray0() for an explanation of the context. 266be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 267be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet Returns 0 if the Array1 dimension is not present. 268be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettest: none 269be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend: 270be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 271be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletfunction: rsGetArray2 272be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletversion: 23 273be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletret: uint32_t 2744324eec445c6882dce89a24765482293ed31914eJean-Luc Brouilletarg: rs_kernel_context context 275ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouilletsummary: Index in the Array2 dimension for the specified kernel context 276be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletdescription: 277be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet Returns the index in the Array2 dimension of the cell being processed, 278ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet as specified by the supplied kernel context. See @rsGetArray0() for an explanation 279be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet of the context. 280be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 281be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet Returns 0 if the Array2 dimension is not present. 282be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettest: none 283be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend: 284be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 285be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletfunction: rsGetArray3 286be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletversion: 23 287be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletret: uint32_t 2884324eec445c6882dce89a24765482293ed31914eJean-Luc Brouilletarg: rs_kernel_context context 289ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouilletsummary: Index in the Array3 dimension for the specified kernel context 290be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletdescription: 2916386ceb3bf25e442513224aaa45691dfe49562d9Jean-Luc Brouillet Returns the index in the Array3 dimension of the cell being processed, as specified 292ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet by the supplied kernel context. See @rsGetArray0() for an explanation of the context. 293be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 294be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet Returns 0 if the Array3 dimension is not present. 295be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettest: none 296be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend: 297be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 298be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletfunction: rsGetDimArray0 299be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletversion: 23 300be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletret: uint32_t 3014324eec445c6882dce89a24765482293ed31914eJean-Luc Brouilletarg: rs_kernel_context context 302ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouilletsummary: Size of the Array0 dimension for the specified kernel context 303be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletdescription: 304ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet Returns the size of the Array0 dimension for the specified kernel context. 305be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet See @rsGetDimX() for an explanation of the context. 306be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 307be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet Returns 0 if the Array0 dimension is not present. 308be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet#TODO Add an hyperlink to something that explains Array0/1/2/3 309be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet# for the relevant functions. 310be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettest: none 311be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend: 312be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 313be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletfunction: rsGetDimArray1 314be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletversion: 23 315be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletret: uint32_t 3164324eec445c6882dce89a24765482293ed31914eJean-Luc Brouilletarg: rs_kernel_context context 317ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouilletsummary: Size of the Array1 dimension for the specified kernel context 318be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletdescription: 319ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet Returns the size of the Array1 dimension for the specified kernel context. 320be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet See @rsGetDimX() for an explanation of the context. 321be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 322be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet Returns 0 if the Array1 dimension is not present. 323be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettest: none 324be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend: 325be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 326be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletfunction: rsGetDimArray2 327be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletversion: 23 328be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletret: uint32_t 3294324eec445c6882dce89a24765482293ed31914eJean-Luc Brouilletarg: rs_kernel_context context 330ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouilletsummary: Size of the Array2 dimension for the specified kernel context 331be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletdescription: 332ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet Returns the size of the Array2 dimension for the specified kernel context. 333be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet See @rsGetDimX() for an explanation of the context. 334be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 335be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet Returns 0 if the Array2 dimension is not present. 336be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettest: none 337be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend: 338be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 339be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletfunction: rsGetDimArray3 340be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletversion: 23 341be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletret: uint32_t 3424324eec445c6882dce89a24765482293ed31914eJean-Luc Brouilletarg: rs_kernel_context context 343ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouilletsummary: Size of the Array3 dimension for the specified kernel context 344be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletdescription: 345ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet Returns the size of the Array3 dimension for the specified kernel context. 346be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet See @rsGetDimX() for an explanation of the context. 347be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 348be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet Returns 0 if the Array3 dimension is not present. 349be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettest: none 350be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend: 351be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 352be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletfunction: rsGetDimHasFaces 353be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletversion: 23 354be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletret: bool, "Returns true if more than one face is present, false otherwise." 3554324eec445c6882dce89a24765482293ed31914eJean-Luc Brouilletarg: rs_kernel_context context 356ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouilletsummary: Presence of more than one face for the specified kernel context 357be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletdescription: 358ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet If the kernel is iterating over a cubemap, this function returns true if there's more 359ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet than one face present. In all other cases, it returns false. See @rsGetDimX() for an 3606386ceb3bf25e442513224aaa45691dfe49562d9Jean-Luc Brouillet explanation of the context. 361be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 362be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet @rsAllocationGetDimFaces() is similar but returns 0 or 1 instead of a bool. 363be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettest: none 364be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend: 365be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 366be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletfunction: rsGetDimLod 367be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletversion: 23 368be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletret: uint32_t 3694324eec445c6882dce89a24765482293ed31914eJean-Luc Brouilletarg: rs_kernel_context context 370ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouilletsummary: Number of levels of detail for the specified kernel context 371be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletdescription: 372ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet Returns the number of levels of detail for the specified kernel context. This is useful 3736386ceb3bf25e442513224aaa45691dfe49562d9Jean-Luc Brouillet for mipmaps. See @rsGetDimX() for an explanation of the context. 3746386ceb3bf25e442513224aaa45691dfe49562d9Jean-Luc Brouillet 375be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet Returns 0 if Level of Detail is not used. 376be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 377be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet @rsAllocationGetDimLOD() is similar but returns 0 or 1 instead the actual 378be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet number of levels. 379be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettest: none 380be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend: 381be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 382be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletfunction: rsGetDimX 383be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletversion: 23 384be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletret: uint32_t 3854324eec445c6882dce89a24765482293ed31914eJean-Luc Brouilletarg: rs_kernel_context context 386ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouilletsummary: Size of the X dimension for the specified kernel context 387be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletdescription: 388ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet Returns the size of the X dimension for the specified kernel context. 389be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 390ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet The kernel context contains common characteristics of the allocations being iterated 391ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet over and rarely used indices, like the Array0 index. 392be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 393ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet You can access it by adding a special parameter named "context" of 3944324eec445c6882dce89a24765482293ed31914eJean-Luc Brouillet type rs_kernel_context to your kernel function. E.g.<br/> 395be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet <code>int4 RS_KERNEL myKernel(int4 value, rs_kernel_context context) {<br/> 396be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet uint32_t size = rsGetDimX(context); //...<br/></code> 39720b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet 39820b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet To get the dimension of specific allocation, use @rsAllocationGetDimX(). 399be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettest: none 400be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend: 401be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 402be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletfunction: rsGetDimY 403be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletversion: 23 404be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletret: uint32_t 4054324eec445c6882dce89a24765482293ed31914eJean-Luc Brouilletarg: rs_kernel_context context 406ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouilletsummary: Size of the Y dimension for the specified kernel context 407be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletdescription: 408ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet Returns the size of the X dimension for the specified kernel context. 409be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet See @rsGetDimX() for an explanation of the context. 410be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 411be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet Returns 0 if the Y dimension is not present. 41220b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet 41320b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet To get the dimension of specific allocation, use @rsAllocationGetDimY(). 414be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettest: none 415be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend: 416be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 417be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletfunction: rsGetDimZ 418be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletversion: 23 419be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletret: uint32_t 4204324eec445c6882dce89a24765482293ed31914eJean-Luc Brouilletarg: rs_kernel_context context 421ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouilletsummary: Size of the Z dimension for the specified kernel context 422be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletdescription: 423ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet Returns the size of the Z dimension for the specified kernel context. 424be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet See @rsGetDimX() for an explanation of the context. 425be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 426be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet Returns 0 if the Z dimension is not present. 42720b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet 42820b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet To get the dimension of specific allocation, use @rsAllocationGetDimZ(). 429be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettest: none 430be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend: 431be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 432be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletfunction: rsGetFace 433be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletversion: 23 434be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletret: rs_allocation_cubemap_face 4354324eec445c6882dce89a24765482293ed31914eJean-Luc Brouilletarg: rs_kernel_context context 436ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouilletsummary: Coordinate of the Face for the specified kernel context 437be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletdescription: 4386386ceb3bf25e442513224aaa45691dfe49562d9Jean-Luc Brouillet Returns the face on which the cell being processed is found, as specified by the 439ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet supplied kernel context. See @rsGetArray0() for an explanation of the context. 440be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 441be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet Returns RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X if the face dimension is not 442be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet present. 443be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettest: none 444be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend: 445be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 446be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletfunction: rsGetLod 447be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletversion: 23 448be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletret: uint32_t 4494324eec445c6882dce89a24765482293ed31914eJean-Luc Brouilletarg: rs_kernel_context context 450ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouilletsummary: Index in the Levels of Detail dimension for the specified kernel context 451be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletdescription: 4526386ceb3bf25e442513224aaa45691dfe49562d9Jean-Luc Brouillet Returns the index in the Levels of Detail dimension of the cell being processed, 453ffc1710c382168e74386ef87d0101de65aca91b0Jean-Luc Brouillet as specified by the supplied kernel context. See @rsGetArray0() for an explanation of 4546386ceb3bf25e442513224aaa45691dfe49562d9Jean-Luc Brouillet the context. 455be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet 456be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillet Returns 0 if the Levels of Detail dimension is not present. 457be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouillettest: none 458be2163801c33d6849ae580d42b919b8803d55095Jean-Luc Brouilletend: 459