Methods
allocationAdapterCreate
allocationAdapterCreate (Type type, Allocation baseAlloc)
generates (AllocationAdapter subAlloc)
TODO:Do we need to define "selectors"? It may be a property of the "adapted allocation" that's returned.
Creates an arbitrary window into the base allocation.The type describes the shape of the window.Any dimensions present in the type must be equal to or smaller than the dimensions in the source allocation.A dimension present in the allocation that is not present in the type must be constrained away with the selectors.If a dimension is present in both the type and allocation, one of two things must happen.If the type is smaller than the allocation, a window must be created, the selected value in the adapter for that dimension must act as the base address, and the type must describe the size of the view starting at that point.If the type and allocation dimension are of the same size, then setting the selector for the dimension must be an error.
Details |
Parameters |
type
|
Type describing data layout
|
baseAlloc
|
Allocation
|
|
Generates |
subAlloc
|
AllocationAdapter
|
|
Annotations |
|
allocationAdapterOffset
allocationAdapterOffset (AllocationAdapter alloc, vec<uint32_t> offsets)
TODO:Need to relate "offset" back to the terminology in allocationAdapterCreate() -- the latter uses the terms "selector" and "selected value".Can we use consistent terminology? Are "offset" and "selector" actually two different things?
TODO:Explain the flattened layout in the offsets vec
Sets the offsets for an Allocation Adapter.
Details |
Parameters |
alloc
|
AllocationAdapter
|
offsets
|
Collection of offsets
|
|
Annotations |
|
allocationGetType
allocationGetType (Allocation allocation)
generates (Type type)
TODO:add more explanation here.
Returns the Type of the Allocation.
Details |
Parameters |
|
Generates |
|
Annotations |
|
allocationCreateTyped
allocationCreateTyped (Type type, AllocationMipmapControl mips, bitfield<AllocationUsageType> usage, Ptr ptr)
generates (Allocation allocation)
TODO:more clarification needed describing if the pointer can be aliased or if the data can outlive the allocation.
Creates an Allocation for use by scripts with a given Type and a backing pointer.For use with ALLOCATION_USAGE_SHARED.
Details |
Parameters |
type
|
Type describing data layout
|
mips
|
AllocationMipmapControl specifies desired mipmap behavior for the allocation
|
usage
|
Bit field specifying how the Allocation is utilized
|
ptr
|
Pointer to client-side data
|
|
Generates |
allocation
|
Created Allocation
|
|
Annotations |
|
allocationCreateFromBitmap
allocationCreateFromBitmap (Type type, AllocationMipmapControl mips, vec<uint8_t> bitmap, bitfield<AllocationUsageType> usage)
generates (Allocation allocation)
Creates an Allocation from a Bitmap.
Details |
Parameters |
type
|
Type describing data layout
|
mips
|
AllocationMipmapControl specifies desired mipmap behavior for the allocation
|
bitmap
|
Bitmap source for the allocation data
|
usage
|
Bit field specifying how the Allocation is utilized
|
|
Generates |
allocation
|
Created Allocation containing bitmap data
|
|
Annotations |
|
allocationCubeCreateFromBitmap
allocationCubeCreateFromBitmap (Type type, AllocationMipmapControl mips, vec<uint8_t> bitmap, bitfield<AllocationUsageType> usage)
generates (Allocation allocation)
Creates a Cubemapped Allocation from a Bitmap.
Details |
Parameters |
type
|
Type describing data layout
|
mips
|
AllocationMipmapControl specifies desired mipmap behavior for the allocation
|
bitmap
|
Bitmap with cubemap faces layed out in the following format:right, left, top, bottom, front, back
|
usage
|
Bit field specifying how the Allocation is used
|
|
Generates |
allocation
|
Created Allocation containing cubemap data
|
|
Annotations |
|
allocationGetNativeWindow
allocationGetNativeWindow (Allocation allocation)
generates (NativeWindow nativeWindow)
Returns the handle to a raw buffer that is being managed by the screen compositor.This operation is only valid for Allocations with USAGE_IO_INPUT.
Details |
Parameters |
|
Generates |
nativeWindow
|
NativeWindow object associated with allocation
|
|
Annotations |
|
allocationSetNativeWindow
allocationSetNativeWindow (Allocation allocation, NativeWindow nativewindow)
TODO:more clarification needed
Sets the NativeWindow of an Allocation.This operation is only valid for Allocations with USAGE_IO_INPUT.
Details |
Parameters |
allocation
|
Allocation to be modified
|
nativewindow
|
NativeWindow to associate with allocation
|
|
Annotations |
|
allocationSetupBufferQueue
allocationSetupBufferQueue (Allocation alloc, uint32_t numBuffer)
Initialize BufferQueue with specified max number of buffers.
Details |
Parameters |
alloc
|
Allocation
|
numBuffer
|
Maximum number of buffers
|
|
Annotations |
|
allocationShareBufferQueue
allocationShareBufferQueue (Allocation baseAlloc, Allocation subAlloc)
TODO:clearly define baseAlloc vs subAlloc
Shares the BufferQueue with another Allocation.Both must be USAGE_IO_INPUT Allocations.
Details |
Parameters |
baseAlloc
|
Base Allocation
|
subAlloc
|
Allocation to use the same buffer queue as the Base Allocation
|
|
Annotations |
|
allocationCopyToBitmap
allocationCopyToBitmap (Allocation allocation, Ptr data, Size sizeBytes)
Copies from the Allocation into a Bitmap.The bitmap must match the dimensions of the Allocation.
HIDL is always running in Passthrough mode for RenderScript, so the buffer is modified directly by the driver.
Details |
Parameters |
allocation
|
Allocation
|
data
|
Buffer to be copied into
|
sizeBytes
|
Size of the buffer pointed to by "data"
|
|
Annotations |
|
allocation1DWrite
allocation1DWrite (Allocation allocation, uint32_t offset, uint32_t lod, uint32_t count, vec<uint8_t> data)
TODO:should we consolidate all[123]DWrite functions or[123]DRead functions into the same API call? Our current plan is to be very similar to the dispatch table API.How much should we deviate from the original API? TODO:better description on Vec3/Vec4 and padding.
Copies data into a 1D region of this Allocation.
When this HAL entry is executed, all Vec3 elements have been explicitly padded as Vec4 elements.
The size of the region is:count * Element's size.
Details |
Parameters |
allocation
|
Allocation to be modified
|
offset
|
The offset of the first element to be copied
|
lod
|
Selected mipmap level of detail
|
count
|
Number of elements to be copied
|
data
|
Source data to be copied to Allocation
|
|
Annotations |
|
allocationElementWrite
allocationElementWrite (Allocation allocation, uint32_t x, uint32_t y, uint32_t z, uint32_t lod, vec<uint8_t> data, Size compIdx)
Copies a value into a single sub-Element of this Allocation.
Details |
Parameters |
allocation
|
Allocation to be updated
|
x
|
X position of the first element in the Allocation to be updated
|
y
|
Y position of the first element in the Allocation to be updated;for a 1D Allocation, this value must be 0
|
z
|
Z position of the first element in the Allocation to be updated;for a 1D or 2D Allocation, this value must be 0
|
lod
|
Selected mipmap level of detail
|
data
|
Data to be copied from
|
compIdx
|
Component number to identify which sub-Element is updated
|
|
Annotations |
|
allocation2DWrite
allocation2DWrite (Allocation allocation, uint32_t xoff, uint32_t yoff, uint32_t lod, AllocationCubemapFace face, uint32_t w, uint32_t h, vec<uint8_t> data, Size stride)
Copies from an array into a rectangular region in this Allocation.
When this HAL entry is executed, all Vec3 elements have been explicitly padded as Vec4 elements.
The size of the region is:w * h * Element's size.
Details |
Parameters |
allocation
|
Allocation to be modified
|
xoff
|
X offset of the region to update in this Allocation
|
yoff
|
Y offset of the region to update in this Allocation
|
lod
|
Selected mipmap level of detail
|
face
|
AllocationCubemapFace
|
w
|
Width of the region to update
|
h
|
Height of the region to update
|
data
|
Data to be placed into the Allocation
|
stride
|
For 1D Allocation, the stride must be the number of bytes of this Allocation.For 2D and 3D Allocations, the stride must be the stride in X dimension measuring in bytes.
|
|
Annotations |
|
allocation3DWrite
allocation3DWrite (Allocation allocation, uint32_t xoff, uint32_t yoff, uint32_t zoff, uint32_t lod, uint32_t w, uint32_t h, uint32_t d, vec<uint8_t> data, Size stride)
Copies from an array into a 3D region in this Allocation.
When this HAL entry is executed, all Vec3 elements have been explicitly padded as Vec4 elements.
The size of the region is:w * h * d * Element's size.
Details |
Parameters |
allocation
|
Allocation to be modified
|
xoff
|
X offset of the region to update in this Allocation
|
yoff
|
Y offset of the region to update in this Allocation
|
zoff
|
Z offset of the region to update in this Allocation
|
lod
|
Selected mipmap level of detail
|
w
|
Width of the region to update
|
h
|
Height of the region to update
|
d
|
Depth of the region to update
|
data
|
Data to be placed in the Allocation
|
stride
|
For 1D Allocation, the stride must be the number of bytes of this Allocation.For 2D and 3D Allocations, the stride must be the stride in X dimension measuring in bytes.
|
|
Annotations |
|
allocationGenerateMipmaps
allocationGenerateMipmaps (Allocation allocation)
Generates a mipmap chain.This is only valid if the Type of the Allocation includes mipmaps.
This function generates a complete set of mipmaps from the top level LOD.
If the Allocation is also using other memory spaces, a call to allocationSyncAll(context, allocation, usage)is required.
Details |
Parameters |
allocation
|
Allocation which has its top LOD read and lower LOD written to
|
|
Annotations |
|
allocationRead
allocationRead (Allocation allocation, Ptr data, Size sizeBytes)
Copies all of an Allocation's data into an array.
All Vec3 elements of an Allocation are padded to be Vec4, so the data returned by this function automatically includes padding.
HIDL is always running in Passthrough mode for RenderScript, so the buffer is modified directly by the driver.
Details |
Parameters |
allocation
|
Allocation to be read
|
data
|
Buffer to be copied into
|
sizeBytes
|
Size of the buffer pointed to by "data"
|
|
Annotations |
|
allocation1DRead
allocation1DRead (Allocation allocation, uint32_t xoff, uint32_t lod, uint32_t count, Ptr data, Size sizeBytes)
Copies a 1D region of this Allocation into an array.
All Vec3 elements of an Allocation are padded to be Vec4, so the data returned by this function automatically includes padding.
The size of the region is:count * Element's size.
HIDL is always running in Passthrough mode for RenderScript, so the buffer is modified directly by the driver.
Details |
Parameters |
allocation
|
Allocation to be read
|
xoff
|
X offset of the first element to be copied
|
lod
|
Mipmap level of detail
|
count
|
The number of elements to be copied
|
data
|
Buffer to be copied into
|
sizeBytes
|
Size of the buffer pointed to by "data"
|
|
Annotations |
|
allocationElementRead
allocationElementRead (Allocation allocation, uint32_t x, uint32_t y, uint32_t z, uint32_t lod, Ptr data, Size sizeBytes, Size compIdx)
Returns the value of a single sub-Element of this Allocation.
HIDL is always running in Passthrough mode for RenderScript, so the buffer is modified directly by the driver.
Details |
Parameters |
allocation
|
Allocation to be read
|
x
|
X position of the first element in the Allocation to be read
|
y
|
Y position of the first element in the Allocation to be read
|
z
|
Z position of the first element in the Allocation to be read
|
lod
|
Mipmap level of detail
|
data
|
Buffer to be copied into
|
sizeBytes
|
Size of the buffer pointed to by "data"
|
compIdx
|
Component number to identify which sub-Element is updated
|
|
Annotations |
|
allocation2DRead
allocation2DRead (Allocation allocation, uint32_t xoff, uint32_t yoff, uint32_t lod, AllocationCubemapFace face, uint32_t w, uint32_t h, Ptr data, Size sizeBytes, Size stride)
Copies from a rectangular region in this Allocation to an array.
All Vec3 elements of an Allocation are padded to be Vec4, so the data returned by this function automatically includes padding.
The size of the region is:w * h * Element's size.
HIDL is always running in Passthrough mode for RenderScript, so the buffer is modified directly by the driver.
Details |
Parameters |
allocation
|
Allocation to be read
|
xoff
|
X offset of the region to copy in this array
|
yoff
|
Y offset of the region to copy in this array
|
lod
|
Mipmap level of detail
|
face
|
AllocationCubemapFace
|
w
|
Width of the region to copy
|
h
|
Height of the region to copy
|
data
|
Buffer to be copied into
|
sizeBytes
|
Size of the buffer pointed to by "data"
|
stride
|
For 1D Allocation, the stride must be the number of bytes of this Allocation.For 2D and 3D Allocations, the stride must be the stride in X dimension measuring in bytes.
|
|
Annotations |
|
allocation3DRead
allocation3DRead (Allocation allocation, uint32_t xoff, uint32_t yoff, uint32_t zoff, uint32_t lod, uint32_t w, uint32_t h, uint32_t d, Ptr data, Size sizeBytes, Size stride)
Copies from a rectangular cuboid region in this Allocation to an array.
All Vec3 elements of an Allocation are padded to be Vec4, so the data returned by this function automatically includes padding.
The size of the region is:w * h * d * Element's size.
HIDL is always running in Passthrough mode for RenderScript, so the buffer is modified directly by the driver.
Details |
Parameters |
allocation
|
Allocation to be read
|
xoff
|
X offset of the region to copy in this array
|
yoff
|
Y offset of the region to copy in this array
|
zoff
|
Z offset of the region to copy in this array
|
lod
|
Mipmap level of detail
|
w
|
Width of the region to copy
|
h
|
Height of the region to copy
|
d
|
Depth of the region to copy
|
data
|
Buffer to be copied into
|
sizeBytes
|
Size of the buffer pointed to by "data"
|
stride
|
For 1D Allocation, the stride must be the number of bytes of this Allocation.For 2D and 3D Allocations, the stride must be the stride in X dimension measuring in bytes.
|
|
Annotations |
|
allocationSyncAll
allocationSyncAll (Allocation allocation, AllocationUsageType usageType)
Propagates changes from one usage of the Allocation to the other usages of the Allocation.
Details |
Parameters |
allocation
|
First usage of the Allocation
|
usageType
|
Allocation usage type
|
|
Annotations |
|
allocationResize1D
allocationResize1D (Allocation allocation, uint32_t dimX)
TODO:describe the functionality of resize1D better TODO:original Java Doc description seems to contradict itself("with null contents and the region is otherwise undefined")TODO:should "new elements" be "new cells"? TODO:what does "objects are created" mean? TODO:what does "new dimension" mean? IS the type of the resized allocation different than the type before resizing?
Resizes a 1D allocation.The contents of the allocation are preserved.If new elements are allocated, objects are created with null contents and the new region is otherwise undefined.
If the new region is smaller, the references of any object outside the new region must be released.
A new type must be created with the new dimension.
Details |
Parameters |
allocation
|
Allocation to be resized
|
dimX
|
New size along the x dimension of the Allocation
|
|
Annotations |
|
allocationCopy2DRange
allocationCopy2DRange (Allocation dstAlloc, uint32_t dstXoff, uint32_t dstYoff, uint32_t dstMip, AllocationCubemapFace dstFace, uint32_t width, uint32_t height, Allocation srcAlloc, uint32_t srcXoff, uint32_t srcYoff, uint32_t srcMip, AllocationCubemapFace srcFace)
TODO:There are allocationCopy2DRange and 3DRange, but no 1DRange.Should the interface be cleaned up more?
Copies a rectangular region from an Allocation into a rectangular region in this Allocation.
Details |
Parameters |
dstAlloc
|
Allocation to be updated
|
dstXoff
|
X offset of the region to update
|
dstYoff
|
Y offset of the region to update
|
dstMip
|
Selected mipmap level of the Allocation to update
|
dstFace
|
Destination AllocationCubemapFace
|
width
|
Width of the region to update
|
height
|
Height of the region to update
|
srcAlloc
|
Source Allocation, to be read
|
srcXoff
|
X offset of the region in the source Allocation
|
srcYoff
|
Y offset of the region in the source Allocation
|
srcMip
|
Selected mipmap level of the source Allocation
|
srcFace
|
Source AllocationCubemapFace
|
|
Annotations |
|
allocationCopy3DRange
allocationCopy3DRange (Allocation dstAlloc, uint32_t dstXoff, uint32_t dstYoff, uint32_t dstZoff, uint32_t dstMip, uint32_t width, uint32_t height, uint32_t depth, Allocation srcAlloc, uint32_t srcXoff, uint32_t srcYoff, uint32_t srcZoff, uint32_t srcMip)
Copies a rectangular cuboid region into the allocation from another Allocation.
Details |
Parameters |
dstAlloc
|
Allocation to be updated
|
dstXoff
|
X offset of the region to update
|
dstYoff
|
Y offset of the region to update
|
dstZoff
|
Z offset of the region to update
|
dstMip
|
Selected mipmap level of the Allocation to update
|
width
|
Width of the region to update
|
height
|
Height of the region to update
|
depth
|
Depth of the region to update
|
srcAlloc
|
Source Allocation, to be read
|
srcXoff
|
Source X offset of the region in the source Allocation
|
srcYoff
|
Source Y offset of the region in the source Allocation
|
srcZoff
|
Source Z offset of the region in the souce Allocation
|
srcMip
|
Selected mipmap level of the Allocation to read
|
|
Annotations |
|
allocationIoSend
allocationIoSend (Allocation allocation)
TODO:define buffer and output stream
Sends a buffer to the output stream.The contents of the Allocation may be undefined after this operation.This operation is only valid if USAGE_IO_OUTPUT is set on the Allocation.
Details |
Parameters |
allocation
|
Allocation to be sent
|
|
Annotations |
|
allocationIoReceive
allocationIoReceive (Allocation allocation)
Receives the latest input into the Allocation.This operation is only valid if USAGE_IO_INPUT is set on the Allocation, otherwise an error must be reported and no operations may be executed.
Details |
Parameters |
allocation
|
Allocation to be updated
|
|
Annotations |
|
allocationGetPointer
allocationGetPointer (Allocation allocation, uint32_t lod, AllocationCubemapFace face, uint32_t z)
generates (Ptr dataPtr, Size stride)
TODO:describe default values for lod, face, and z better.TODO:what cases can invalidate the pointer? Resize? It should be clarified that this method should always return a valid pointer, but the returned pointer might become invalid later.
Retrieves the pointer to the actual data an Allocation contains as well as the data's stride.
If Allocation lacks the corresponding dimension for lod, face, or z, an error message must be sent to the message queue and nullptr must be returned for dataPtr and 0 for stride.All missing values must be 0 or NONE in the corresponding enum.
Details |
Parameters |
allocation
|
Allocation
|
lod
|
Mipmap level of detail
|
face
|
AllocationCubemapFace
|
z
|
Z position
|
|
Generates |
dataPtr
|
Pointer to the server-side data;if this points to an invalid location in memory(because the buffer was freed), this may result in undefined behavior
|
stride
|
For 1D Allocation, the stride must be the number of bytes of this Allocation.For 2D and 3D Allocations, the stride must be the stride in X dimension measuring in bytes.
|
|
Annotations |
|
elementGetNativeMetadata
elementGetNativeMetadata (Element element)
generates (vec<uint32_t> elemData)
Retrieves an Element's metadata from native code.
Details |
Parameters |
element
|
Element to be read
|
|
Generates |
|
Annotations |
|
elementGetSubElements
elementGetSubElements (Element element, Size numSubElem)
generates (vec<Element> ids, vec<string> names, vec<Size> arraySizes)
TODO:define Sub-Element handles better.
Retrieves an Element's sub Elements, specifically their identifiers, names, and sizes.
Details |
Parameters |
element
|
Element to be read
|
numSubElem
|
Number of sub-Elements
|
|
Generates |
ids
|
Sub-Element handles
|
names
|
Sub-Element Names
|
arraySizes
|
Sizes of sub-Element arrays
|
|
Annotations |
|
elementCreate
elementCreate (DataType dt, DataKind dk, bool norm, uint32_t size)
generates (Element element)
TODO:can normalization flag be removed?
Creates an Element.
Details |
Parameters |
dt
|
Data type
|
dk
|
Data kind
|
norm
|
Flag for normalization
|
size
|
Vector length, with scalar = 1
|
|
Generates |
|
Annotations |
|
elementComplexCreate
elementComplexCreate (vec<Element> einsPtr, vec<string> names, vec<Size> arraySizesPtr)
generates (Element element)
Creates a complex Element.
Details |
Parameters |
einsPtr
|
Container of input Elements
|
names
|
Container of input names
|
arraySizesPtr
|
Container of array sizes
|
|
Generates |
|
Annotations |
|
typeGetNativeMetadata
typeGetNativeMetadata (Type type)
generates (vec<OpaqueHandle> metadata)
Retrives a Type's metadata from native code.
Details |
Parameters |
type
|
Type describing data layout
|
|
Generates |
metadata
|
Type's native metadata
|
|
Annotations |
|
typeCreate
typeCreate (Element element, uint32_t dimX, uint32_t dimY, uint32_t dimZ, bool mipmaps, bool faces, YuvFormat yuv)
generates (Type type)
Creates a new Type.
If Type is 1D, Y and Z must be 0.If Type is 2D, Z must be 0.
Details |
Parameters |
element
|
Element of the Type
|
dimX
|
X dimension
|
dimY
|
Y dimension
|
dimZ
|
Z dimension
|
mipmaps
|
Flag indicating whether Type has mipmaps
|
faces
|
Flag indicating whether Type has faces
|
yuv
|
Enumeration specifying which type of YUV format, if any, Type uses
|
|
Generates |
|
Annotations |
|
contextDestroy
contextDestroy ()
Destroys provided RenderScript context, including all objects created in this context.
contextGetMessage
contextGetMessage (Ptr data, Size size)
generates (MessageToClientType messageType, Size receiveLen)
TODO:provide overview of messaging model and figure out if this should be part of HAL or not.TODO:what is the "client" for purposes of this interface? TODO:consider using send/receive to be more similar to other calls TODO:define the purpose of size more
Fills the provided buffer with message data."size" should be at least as large as the message size.Returns the MessageType and size of the message are returned.
Details |
Parameters |
data
|
A pointer to a buffer to be filled with a message
|
size
|
Size in bytes of the buffer pointed to by "data"
|
|
Generates |
messageType
|
Type of message sent to the client
|
receiveLen
|
Length of the message in bytes
|
|
Annotations |
|
contextPeekMessage
contextPeekMessage ()
generates (MessageToClientType messageType, Size receiveLen, uint32_t subID)
TODO:define subID better.
Gets the metadata of a message to ensure entire message can be properly received.Can be used to determine size of data to allocate when calling contextGetMessage.
Details |
Generates |
messageType
|
Type of message sent to the client
|
receiveLen
|
Length of message
|
subID
|
Message sub identifier
|
|
Annotations |
|
contextSendMessage
contextSendMessage (uint32_t id, vec<uint8_t> data)
TODO:Define "previous commands" better TODO:Is the message identifier the same as subID?
Places a message into the message queue to be sent back to the message handler once all previous commands have been executed.The message data is copied into the queue and can be discarded by the client after this call.
Details |
Parameters |
id
|
Message identifier
|
data
|
Message data
|
|
Annotations |
|
contextInitToClient
contextInitToClient ()
TODO:Can this be done automatically as part of context creation? What happens if we perform message operations before doing this?
Initializes the messaging thread, so that the front-end API can receive messages from the driver.This call also waits for the messaging FIFO to start up.
contextDeinitToClient
contextDeinitToClient ()
TODO:Why doesn't this happen automatically as part of context destruction? What happens if the FIFO is not empty?
Deinitializes a the messaging thread.Shuts down the FIFO.
contextFinish
contextFinish ()
TODO:do we need to mark asynchronous operations in this interface definition?
Waits for any pending asynchronous operations(such as copies to a RS allocation or RS script executions)to complete.
contextLog
contextLog ()
Prints the currently available debugging information about the state of the RS context to the logcat.
contextSetCacheDir
contextSetCacheDir (string cacheDir)
TODO:full path? relative path? Investigate further.
Sets the cache directory of the context.
Details |
Parameters |
cacheDir
|
Name of the application's cache directory
|
|
Annotations |
|
contextSetPriority
contextSetPriority (ThreadPriorities priority)
TODO:does this apply to the GPU as well?
Changes the priority of the cpu worker threads for this context.
Details |
Parameters |
priority
|
Priority of the thread
|
|
Annotations |
|
assignName
assignName (ObjectBase obj, string name)
TODO:does this need to be part of the HAL? What if the object already has a name?
Assigns a name to a base object.
Details |
Parameters |
obj
|
Object to be named
|
name
|
Assigned name
|
|
Annotations |
|
getName
getName (ObjectBase obj)
generates (string name)
TODO:what if the object has no name?
Returns the name of an object.
Details |
Parameters |
|
Generates |
|
Annotations |
|
closureCreate
closureCreate (ScriptKernelID kernelID, Allocation returnValue, vec<ScriptFieldID> fieldIDS, vec<int64_t> values, vec<int32_t> sizes, vec<Closure> depClosures, vec<ScriptFieldID> depFieldIDS)
generates (Closure closure)
TODO:starting here we have a set of interfaces for use with ScriptGroups.At the very least we should indicate for each one that's what it's for.Should we include ScriptGroup in the interface names? TODO:sweep whole file and remove prefix "v" from all parameter names TODO:there are some places where we use Size for size, and others where we use int32_t.Is there a reason it's int32_t? In some cases, it requires a negative value.
Creates a Closure which represents a function call to a ForEach Kernel combined with arguments and values for global variables.
Details |
Parameters |
kernelID
|
Kernel identifier
|
returnValue
|
Allocation used in output of Closure
|
fieldIDS
|
Collection of Script's Field identifiers
|
values
|
Collection of Script's data values
|
sizes
|
Collection of Script's data sizes
|
depClosures
|
Collection of Closures
|
depFieldIDS
|
Collection of Script's dependent Field identifiers
|
|
Generates |
|
Annotations |
|
invokeClosureCreate
invokeClosureCreate (ScriptInvokeID invokeID, vec<uint8_t> params, vec<ScriptFieldID> fieldIDS, vec<int64_t> values, vec<int32_t> sizes)
generates (Closure closure)
Creates a Closure which represents a function call to a invocable function, combined with arguments and values for global variables.
Details |
Parameters |
invokeID
|
Invokable function identifier
|
params
|
Collection of Invoke script parameters
|
fieldIDS
|
Collection of Script Field identifiers
|
values
|
Collection of values
|
sizes
|
Collection of sizes
|
|
Generates |
|
Annotations |
|
closureSetArg
closureSetArg (Closure closure, uint32_t index, Ptr value, int32_t size)
Sets the argument of a Closure at specified index and size to provided value.
Details |
Parameters |
closure
|
Closure to be modified
|
index
|
Index
|
value
|
Value
|
size
|
Size
|
|
Annotations |
|
closureSetGlobal
closureSetGlobal (Closure closure, ScriptFieldID fieldID, int64_t value, int32_t size)
Sets a global variable in a Closure.
Details |
Parameters |
closure
|
Closure
|
fieldID
|
Global's Field identifier
|
value
|
Value
|
size
|
Size
|
|
Annotations |
|
scriptKernelIDCreate
scriptKernelIDCreate (Script script, int32_t slot, bitfield<MetadataSignatureBitval> sig)
generates (ScriptKernelID scriptKernelID)
TODO:should slot be unsigned?(applies to other two ID interfaces, too)
Creates a Script Kernel ID.
Details |
Parameters |
script
|
Script
|
slot
|
Slot
|
sig
|
Bitfield describing Kernel signature and operation
|
|
Generates |
scriptKernelID
|
Script's Kernel identifier
|
|
Annotations |
|
scriptInvokeIDCreate
scriptInvokeIDCreate (Script script, int32_t slot)
generates (ScriptInvokeID scriptInvokeID)
Creates a Script Invoke ID.
Details |
Parameters |
|
Generates |
scriptInvokeID
|
Invoke Script's identifier
|
|
Annotations |
|
scriptFieldIDCreate
scriptFieldIDCreate (Script script, int32_t slot)
generates (ScriptFieldID scriptFieldID)
TODO:describe the return value better.What is it?
Creates a Script Field ID.
Details |
Parameters |
|
Generates |
scriptFieldID
|
Script's Field identifier
|
|
Annotations |
|
scriptGroupCreate
scriptGroupCreate (vec<ScriptKernelID> kernels, vec<ScriptKernelID> srcK, vec<ScriptKernelID> dstK, vec<ScriptFieldID> dstF, vec<Type> types)
generates (ScriptGroup scriptGroup)
TODO:add more description
Creates a Script Group.
Details |
Parameters |
kernels
|
Collection of Scripts' Kernel identifiers
|
srcK
|
Source Kernel identifiers
|
dstK
|
Destination Kernel identifiers
|
dstF
|
Destination Script Field identifiers
|
types
|
Collection of Types describing data layout
|
|
Generates |
scriptGroup
|
Created Script Group
|
|
Annotations |
|
scriptGroup2Create
scriptGroup2Create (string name, string cacheDir, vec<Closure> closures)
generates (ScriptGroup2 scriptGroup2)
Details |
Parameters |
name
|
Name
|
cacheDir
|
Cache directory
|
closures
|
Collection of Closures
|
|
Generates |
scriptGroup2
|
Created Script Group
|
|
Annotations |
|
scriptGroupSetOutput
scriptGroupSetOutput (ScriptGroup sg, ScriptKernelID kid, Allocation alloc)
TODO:if SetInput/Output corresponds to the Java API setInput() and setOutput(), which are documented as deprecated in API 23, do we need to support them? Or can we fallback to the CPU when they're used? Or can't we tell whether they're used early enough to do fallback?
Sets an output of the ScriptGroup.This specifies an Allocation to be used for the kernels that require an output Allocation visible after the ScriptGroup is executed.
Details |
Parameters |
sg
|
Script Group
|
kid
|
Script's Kernel identifier to be changed
|
alloc
|
Allocation to be filled by output
|
|
Annotations |
|
scriptGroupSetInput
scriptGroupSetInput (ScriptGroup sg, ScriptKernelID kid, Allocation alloc)
Sets an input of the Script Group.This specifies an Allocation to be used for kernels that require an input Allocation provided from outside of the Script Group.
Details |
Parameters |
sg
|
Script Group
|
kid
|
Script's Kernel identifier to be changed
|
alloc
|
Allocation to be read as input
|
|
Annotations |
|
scriptGroupExecute
scriptGroupExecute (ScriptGroup sg)
Details |
Parameters |
sg
|
Script Group to be executed.
|
|
Annotations |
|
objDestroy
objDestroy (ObjectBase obj)
Frees any native resources associated with this object.The primary use is to force immediate cleanup of resources when it is believed the GC may not respond quickly enough.
Details |
Parameters |
obj
|
Opaque handle to the server-side object to be destroyed
|
|
Annotations |
|
samplerCreate
samplerCreate (SamplerValue magFilter, SamplerValue minFilter, SamplerValue wrapS, SamplerValue wrapT, SamplerValue wrapR, float aniso)
generates (Sampler sampler)
Details |
Parameters |
magFilter
|
Magnification value for the filter
|
minFilter
|
Minification value for the filter
|
wrapS
|
S wrapping mode for the sampler
|
wrapT
|
T wrapping mode for the sampler
|
wrapR
|
R wrapping mode for the sampler
|
aniso
|
Anisotropy setting for the sampler
|
|
Generates |
|
Annotations |
|
scriptBindAllocation
scriptBindAllocation (Script script, Allocation allocation, uint32_t slot)
Binds an Allocation to a global pointer in the Script.
Details |
Parameters |
script
|
Script to be bound to
|
allocation
|
Allocation to be bound
|
slot
|
Slot of a global variable
|
|
Annotations |
|
scriptSetTimeZone
scriptSetTimeZone (Script script, string timeZone)
TODO:is this necessary?
Sets the timezone of a Script.
Details |
Parameters |
script
|
Script to be altered
|
timeZone
|
Time Zone value as text
|
|
Annotations |
|
scriptInvoke
scriptInvoke (Script vs, uint32_t slot)
TODO:can scriptInvoke be combined with scriptInvokeV?
Launches an invokable function.
Details |
Parameters |
vs
|
Script to be invoked
|
slot
|
Slot of invokable function
|
|
Annotations |
|
scriptInvokeV
scriptInvokeV (Script vs, uint32_t slot, vec<uint8_t> data)
Invokes a Script with values.
Details |
Parameters |
vs
|
Script to be invoked
|
slot
|
Slot
|
data
|
Data buffer of packed arguments
|
|
Annotations |
|
scriptForEach
scriptForEach (Script vs, uint32_t slot, vec<Allocation> vains, Allocation vaout, vec<uint8_t> params, Ptr sc)
TODO:add documentation for params TODO:Should we rename "ScriptCall" to "LaunchOptions"?
Launches a ForEach kernel.
Details |
Parameters |
vs
|
Script
|
slot
|
Slot of ForEach Kernel
|
vains
|
Collection of input Allocations or null
|
vaout
|
Output Allocation or null
|
params
|
Collection of parameters
|
sc
|
Pointer to a ScriptCall, nullptr if unused
|
|
Annotations |
|
scriptReduce
scriptReduce (Script vs, uint32_t slot, vec<Allocation> vains, Allocation vaout, Ptr sc)
Launches a Reduction kernel.
Details |
Parameters |
vs
|
Script
|
slot
|
Slot of Reduction Kernel
|
vains
|
Collection of input Allocations
|
vaout
|
Output Allocation
|
sc
|
Pointer to a ScriptCall, nullptr if unused
|
|
Annotations |
|
scriptSetVarI
scriptSetVarI (Script vs, uint32_t slot, int32_t value)
Sets a Script's integer variable to a value.
Details |
Parameters |
vs
|
RenderScript Script
|
slot
|
Slot number of variable to be updated
|
value
|
Value to be pushed to variable
|
|
Annotations |
|
scriptSetVarObj
scriptSetVarObj (Script vs, uint32_t slot, ObjectBase obj)
Sets a Script's Object variable to a value
Details |
Parameters |
vs
|
RenderScript Script
|
slot
|
Slot number of variable to be updated
|
obj
|
ObjectBase
|
|
Annotations |
|
scriptSetVarJ
scriptSetVarJ (Script vs, uint32_t slot, int64_t value)
Sets a Script's long variable to a value.
Details |
Parameters |
vs
|
RenderScript Script
|
slot
|
Slot number of variable to be updated
|
value
|
Value to be pushed to variable
|
|
Annotations |
|
scriptSetVarF
scriptSetVarF (Script vs, uint32_t slot, float value)
Sets a Script's float variable to a value.
Details |
Parameters |
vs
|
RenderScript Script
|
slot
|
Slot number of variable to be updated
|
value
|
Value to be pushed to variable
|
|
Annotations |
|
scriptSetVarD
scriptSetVarD (Script vs, uint32_t slot, double value)
Sets a Script's double variable to a value.
Details |
Parameters |
vs
|
RenderScript Script
|
slot
|
Slot number of variable to be updated
|
value
|
Value to be pushed to variable
|
|
Annotations |
|
scriptSetVarV
scriptSetVarV (Script vs, uint32_t slot, vec<uint8_t> data)
Sets a Script's struct variable to a value.
Details |
Parameters |
vs
|
RenderScript Script
|
slot
|
Slot number of variable to be updated
|
data
|
Data to be pushed to variable
|
|
Annotations |
|
scriptGetVarV
scriptGetVarV (Script vs, uint32_t slot, Size len)
generates (vec<uint8_t> data)
TODO:Why do we have typed setters but only untyped getter?
Retrieves the value from a global variable in a script.
Details |
Parameters |
vs
|
RenderScript Script
|
slot
|
Slot number of variable to be read
|
len
|
Size of data to be filled
|
|
Generates |
|
Annotations |
|
scriptSetVarVE
scriptSetVarVE (Script vs, uint32_t slot, vec<uint8_t> data, Element ve, vec<uint32_t> dims)
TODO:Is this a value to be replicated for each member of the array? Or is there a representation for each separate member?
Sets the value of a global array of structs, given the Element and dimension.
Details |
Parameters |
vs
|
RenderScript Script
|
slot
|
Slot number of variable to be updated
|
data
|
Data
|
ve
|
Element
|
dims
|
Collection of dimensions
|
|
Annotations |
|
scriptCCreate
scriptCCreate (string resName, string cacheDir, vec<uint8_t> text)
generates (Script script)
TODO:is cacheDir redundant with createCache() function? Can we remove it? TODO:define resName more clearly
Creates a RenderScript C99 kernel script.
Details |
Parameters |
resName
|
Resource name of the bitcode
|
cacheDir
|
Cache directory name
|
text
|
The kernel's bitcode as a uint8_t vector
|
|
Generates |
|
Annotations |
|
scriptIntrinsicCreate
scriptIntrinsicCreate (ScriptIntrinsicID id, Element elem)
generates (Script script)
Creates a RenderScript Intrinsic script.
Details |
Parameters |
id
|
Intrinsic Script identifier
|
elem
|
Element
|
|
Generates |
|
Annotations |
|