blob: 614f5a45a978c5ca1353e3cbc6c0b6699a7c1dd5 [file] [log] [blame]
Tim Murraya4230962013-07-17 16:50:10 -07001/*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ANDROID_RSDISPATCH_H
18#define ANDROID_RSDISPATCH_H
19
20#include "rsDefines.h"
21
22typedef const void* (*AllocationGetTypeFnPtr)(RsContext con, RsAllocation va);
Ashok Bhat6c59e3c2014-02-11 11:36:45 +000023typedef void (*TypeGetNativeDataFnPtr)(RsContext, RsType, uintptr_t *typeData, uint32_t typeDataSize);
24typedef void (*ElementGetNativeDataFnPtr)(RsContext, RsElement, uintptr_t *elemData, uint32_t elemDataSize);
25typedef void (*ElementGetSubElementsFnPtr)(RsContext, RsElement, uintptr_t *ids, const char **names, uint32_t *arraySizes, uint32_t dataSize);
Tim Murraya4230962013-07-17 16:50:10 -070026typedef RsDevice (*DeviceCreateFnPtr) ();
27typedef void (*DeviceDestroyFnPtr) (RsDevice dev);
28typedef void (*DeviceSetConfigFnPtr) (RsDevice dev, RsDeviceParam p, int32_t value);
Tim Murray84e3dea2013-09-09 16:12:51 -070029typedef RsContext (*ContextCreateFnPtr)(RsDevice vdev, uint32_t version, uint32_t sdkVersion, RsContextType ct, uint32_t flags);
Tim Murray4a92d122013-07-22 10:56:18 -070030typedef void (*GetNameFnPtr)(RsContext, void * obj, const char **name);
31
Tim Murraya4230962013-07-17 16:50:10 -070032typedef void (*ContextDestroyFnPtr) (RsContext);
33typedef RsMessageToClientType (*ContextGetMessageFnPtr) (RsContext, void*, size_t, size_t*, size_t, uint32_t*, size_t);
34typedef RsMessageToClientType (*ContextPeekMessageFnPtr) (RsContext, size_t*, size_t, uint32_t*, size_t);
35typedef void (*ContextSendMessageFnPtr) (RsContext, uint32_t, const uint8_t*, size_t);
36typedef void (*ContextInitToClientFnPtr) (RsContext);
37typedef void (*ContextDeinitToClientFnPtr) (RsContext);
38typedef RsType (*TypeCreateFnPtr) (RsContext, RsElement, uint32_t, uint32_t, uint32_t, bool, bool, uint32_t);
39typedef RsAllocation (*AllocationCreateTypedFnPtr) (RsContext, RsType, RsAllocationMipmapControl, uint32_t, uintptr_t);
40typedef RsAllocation (*AllocationCreateFromBitmapFnPtr) (RsContext, RsType, RsAllocationMipmapControl, const void*, size_t, uint32_t);
41typedef RsAllocation (*AllocationCubeCreateFromBitmapFnPtr) (RsContext, RsType, RsAllocationMipmapControl, const void*, size_t, uint32_t);
42typedef RsNativeWindow (*AllocationGetSurfaceFnPtr) (RsContext, RsAllocation);
43typedef void (*AllocationSetSurfaceFnPtr) (RsContext, RsAllocation, RsNativeWindow);
44typedef void (*ContextFinishFnPtr) (RsContext);
45typedef void (*ContextDumpFnPtr) (RsContext, int32_t);
46typedef void (*ContextSetPriorityFnPtr) (RsContext, int32_t);
47typedef void (*AssignNameFnPtr) (RsContext, RsObjectBase, const char*, size_t);
48typedef void (*ObjDestroyFnPtr) (RsContext, RsAsyncVoidPtr);
49typedef RsElement (*ElementCreateFnPtr) (RsContext, RsDataType, RsDataKind, bool, uint32_t);
50typedef RsElement (*ElementCreate2FnPtr) (RsContext, const RsElement*, size_t, const char**, size_t, const size_t*, const uint32_t*, size_t);
51typedef void (*AllocationCopyToBitmapFnPtr) (RsContext, RsAllocation, void*, size_t);
52typedef void (*Allocation1DDataFnPtr) (RsContext, RsAllocation, uint32_t, uint32_t, uint32_t, const void*, size_t);
53typedef void (*Allocation1DElementDataFnPtr) (RsContext, RsAllocation, uint32_t, uint32_t, const void*, size_t, size_t);
54typedef void (*Allocation2DDataFnPtr) (RsContext, RsAllocation, uint32_t, uint32_t, uint32_t, RsAllocationCubemapFace, uint32_t, uint32_t, const void*, size_t, size_t);
55typedef void (*Allocation3DDataFnPtr) (RsContext, RsAllocation, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, const void*, size_t, size_t);
56typedef void (*AllocationGenerateMipmapsFnPtr) (RsContext, RsAllocation);
57typedef void (*AllocationReadFnPtr) (RsContext, RsAllocation, void*, size_t);
58typedef void (*Allocation1DReadFnPtr) (RsContext, RsAllocation, uint32_t, uint32_t, uint32_t, void*, size_t);
59typedef void (*Allocation2DReadFnPtr) (RsContext, RsAllocation, uint32_t, uint32_t, uint32_t, RsAllocationCubemapFace, uint32_t, uint32_t, void*, size_t, size_t);
60typedef void (*AllocationSyncAllFnPtr) (RsContext, RsAllocation, RsAllocationUsageType);
61typedef void (*AllocationResize1DFnPtr) (RsContext, RsAllocation, uint32_t);
62typedef void (*AllocationCopy2DRangeFnPtr) (RsContext, RsAllocation, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, RsAllocation, uint32_t, uint32_t, uint32_t, uint32_t);
63typedef void (*AllocationCopy3DRangeFnPtr) (RsContext, RsAllocation, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, RsAllocation, uint32_t, uint32_t, uint32_t, uint32_t);
64typedef RsSampler (*SamplerCreateFnPtr) (RsContext, RsSamplerValue, RsSamplerValue, RsSamplerValue, RsSamplerValue, RsSamplerValue, float);
65typedef void (*ScriptBindAllocationFnPtr) (RsContext, RsScript, RsAllocation, uint32_t);
66typedef void (*ScriptSetTimeZoneFnPtr) (RsContext, RsScript, const char*, size_t);
67typedef void (*ScriptInvokeFnPtr) (RsContext, RsScript, uint32_t);
68typedef void (*ScriptInvokeVFnPtr) (RsContext, RsScript, uint32_t, const void*, size_t);
69typedef void (*ScriptForEachFnPtr) (RsContext, RsScript, uint32_t, RsAllocation, RsAllocation, const void*, size_t, const RsScriptCall*, size_t);
70typedef void (*ScriptSetVarIFnPtr) (RsContext, RsScript, uint32_t, int);
71typedef void (*ScriptSetVarObjFnPtr) (RsContext, RsScript, uint32_t, RsObjectBase);
72typedef void (*ScriptSetVarJFnPtr) (RsContext, RsScript, uint32_t, int64_t);
73typedef void (*ScriptSetVarFFnPtr) (RsContext, RsScript, uint32_t, float);
74typedef void (*ScriptSetVarDFnPtr) (RsContext, RsScript, uint32_t, double);
75typedef void (*ScriptSetVarVFnPtr) (RsContext, RsScript, uint32_t, const void*, size_t);
76typedef void (*ScriptGetVarVFnPtr) (RsContext, RsScript, uint32_t, void*, size_t);
Stephen Hinesac8d1462014-06-25 00:01:23 -070077typedef void (*ScriptSetVarVEFnPtr) (RsContext, RsScript, uint32_t, const void*, size_t, RsElement, const uint32_t*, size_t);
Tim Murraya4230962013-07-17 16:50:10 -070078typedef RsScript (*ScriptCCreateFnPtr) (RsContext, const char*, size_t, const char*, size_t, const char*, size_t);
79typedef RsScript (*ScriptIntrinsicCreateFnPtr) (RsContext, uint32_t id, RsElement);
80typedef RsScriptKernelID (*ScriptKernelIDCreateFnPtr) (RsContext, RsScript, int, int);
81typedef RsScriptFieldID (*ScriptFieldIDCreateFnPtr) (RsContext, RsScript, int);
82typedef RsScriptGroup (*ScriptGroupCreateFnPtr) (RsContext, RsScriptKernelID*, size_t, RsScriptKernelID*, size_t, RsScriptKernelID*, size_t, RsScriptFieldID*, size_t, const RsType*, size_t);
83typedef void (*ScriptGroupSetOutputFnPtr) (RsContext, RsScriptGroup, RsScriptKernelID, RsAllocation);
84typedef void (*ScriptGroupSetInputFnPtr) (RsContext, RsScriptGroup, RsScriptKernelID, RsAllocation);
85typedef void (*ScriptGroupExecuteFnPtr) (RsContext, RsScriptGroup);
86typedef void (*AllocationIoSendFnPtr) (RsContext, RsAllocation);
87typedef void (*AllocationIoReceiveFnPtr) (RsContext, RsAllocation);
Jason Samsb8a94e22014-02-24 17:52:32 -080088typedef void * (*AllocationGetPointerFnPtr) (RsContext, RsAllocation, uint32_t lod, RsAllocationCubemapFace face, uint32_t z, uint32_t array, size_t *stride);
Tim Murraya4230962013-07-17 16:50:10 -070089
90typedef struct {
91 // inserted by hand from rs.h
92 AllocationGetTypeFnPtr AllocationGetType;
93 TypeGetNativeDataFnPtr TypeGetNativeData;
94 ElementGetNativeDataFnPtr ElementGetNativeData;
95 ElementGetSubElementsFnPtr ElementGetSubElements;
96
Tim Murraya4230962013-07-17 16:50:10 -070097 DeviceCreateFnPtr DeviceCreate;
98 DeviceDestroyFnPtr DeviceDestroy;
99 DeviceSetConfigFnPtr DeviceSetConfig;
100 ContextCreateFnPtr ContextCreate;
Tim Murray4a92d122013-07-22 10:56:18 -0700101 GetNameFnPtr GetName;
Tim Murraya4230962013-07-17 16:50:10 -0700102
103 // generated from rs.spec
104 ContextDestroyFnPtr ContextDestroy;
105 ContextGetMessageFnPtr ContextGetMessage;
106 ContextPeekMessageFnPtr ContextPeekMessage;
107 ContextSendMessageFnPtr ContextSendMessage;
108 ContextInitToClientFnPtr ContextInitToClient;
109 ContextDeinitToClientFnPtr ContextDeinitToClient;
110 TypeCreateFnPtr TypeCreate;
111 AllocationCreateTypedFnPtr AllocationCreateTyped;
112 AllocationCreateFromBitmapFnPtr AllocationCreateFromBitmap;
113 AllocationCubeCreateFromBitmapFnPtr AllocationCubeCreateFromBitmap;
114 AllocationGetSurfaceFnPtr AllocationGetSurface;
115 AllocationSetSurfaceFnPtr AllocationSetSurface;
116 ContextFinishFnPtr ContextFinish;
117 ContextDumpFnPtr ContextDump;
118 ContextSetPriorityFnPtr ContextSetPriority;
119 AssignNameFnPtr AssignName;
120 ObjDestroyFnPtr ObjDestroy;
121 ElementCreateFnPtr ElementCreate;
122 ElementCreate2FnPtr ElementCreate2;
123 AllocationCopyToBitmapFnPtr AllocationCopyToBitmap;
124 Allocation1DDataFnPtr Allocation1DData;
125 Allocation1DElementDataFnPtr Allocation1DElementData;
126 Allocation2DDataFnPtr Allocation2DData;
127 Allocation3DDataFnPtr Allocation3DData;
128 AllocationGenerateMipmapsFnPtr AllocationGenerateMipmaps;
129 AllocationReadFnPtr AllocationRead;
130 Allocation1DReadFnPtr Allocation1DRead;
131 Allocation2DReadFnPtr Allocation2DRead;
132 AllocationSyncAllFnPtr AllocationSyncAll;
133 AllocationResize1DFnPtr AllocationResize1D;
134 AllocationCopy2DRangeFnPtr AllocationCopy2DRange;
135 AllocationCopy3DRangeFnPtr AllocationCopy3DRange;
136 SamplerCreateFnPtr SamplerCreate;
137 ScriptBindAllocationFnPtr ScriptBindAllocation;
138 ScriptSetTimeZoneFnPtr ScriptSetTimeZone;
139 ScriptInvokeFnPtr ScriptInvoke;
140 ScriptInvokeVFnPtr ScriptInvokeV;
141 ScriptForEachFnPtr ScriptForEach;
142 ScriptSetVarIFnPtr ScriptSetVarI;
143 ScriptSetVarObjFnPtr ScriptSetVarObj;
144 ScriptSetVarJFnPtr ScriptSetVarJ;
145 ScriptSetVarFFnPtr ScriptSetVarF;
146 ScriptSetVarDFnPtr ScriptSetVarD;
147 ScriptSetVarVFnPtr ScriptSetVarV;
148 ScriptGetVarVFnPtr ScriptGetVarV;
149 ScriptSetVarVEFnPtr ScriptSetVarVE;
150 ScriptCCreateFnPtr ScriptCCreate;
151 ScriptIntrinsicCreateFnPtr ScriptIntrinsicCreate;
152 ScriptKernelIDCreateFnPtr ScriptKernelIDCreate;
153 ScriptFieldIDCreateFnPtr ScriptFieldIDCreate;
154 ScriptGroupCreateFnPtr ScriptGroupCreate;
155 ScriptGroupSetOutputFnPtr ScriptGroupSetOutput;
156 ScriptGroupSetInputFnPtr ScriptGroupSetInput;
157 ScriptGroupExecuteFnPtr ScriptGroupExecute;
158 AllocationIoSendFnPtr AllocationIoSend;
159 AllocationIoReceiveFnPtr AllocationIoReceive;
Jason Samsb8a94e22014-02-24 17:52:32 -0800160 AllocationGetPointerFnPtr AllocationGetPointer;
Tim Murraya4230962013-07-17 16:50:10 -0700161} dispatchTable;
162
163#endif