xref: /aosp_15_r20/frameworks/rs/cpp/rsDispatch.cpp (revision e1eccf28f96817838ad6867f7f39d2351ec11f56)
1*e1eccf28SAndroid Build Coastguard Worker /*
2*e1eccf28SAndroid Build Coastguard Worker  * Copyright (C) 2011-2012 The Android Open Source Project
3*e1eccf28SAndroid Build Coastguard Worker  *
4*e1eccf28SAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
5*e1eccf28SAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
6*e1eccf28SAndroid Build Coastguard Worker  * You may obtain a copy of the License at
7*e1eccf28SAndroid Build Coastguard Worker  *
8*e1eccf28SAndroid Build Coastguard Worker  *      http://www.apache.org/licenses/LICENSE-2.0
9*e1eccf28SAndroid Build Coastguard Worker  *
10*e1eccf28SAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
11*e1eccf28SAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
12*e1eccf28SAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*e1eccf28SAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
14*e1eccf28SAndroid Build Coastguard Worker  * limitations under the License.
15*e1eccf28SAndroid Build Coastguard Worker  */
16*e1eccf28SAndroid Build Coastguard Worker #define LOG_TAG "libDispatch"
17*e1eccf28SAndroid Build Coastguard Worker #include <android/log.h>
18*e1eccf28SAndroid Build Coastguard Worker 
19*e1eccf28SAndroid Build Coastguard Worker #include "rsDispatch.h"
20*e1eccf28SAndroid Build Coastguard Worker #include <dlfcn.h>
21*e1eccf28SAndroid Build Coastguard Worker #include <limits.h>
22*e1eccf28SAndroid Build Coastguard Worker 
23*e1eccf28SAndroid Build Coastguard Worker #define LOG_ERR(...) __android_log_print(ANDROID_LOG_ERROR, "RS Dispatch", __VA_ARGS__);
24*e1eccf28SAndroid Build Coastguard Worker #define REDUCE_API_LEVEL 24
25*e1eccf28SAndroid Build Coastguard Worker 
loadSymbols(void * handle,dispatchTable & dispatchTab,int targetApiLevel)26*e1eccf28SAndroid Build Coastguard Worker bool loadSymbols(void* handle, dispatchTable& dispatchTab, int targetApiLevel) {
27*e1eccf28SAndroid Build Coastguard Worker #ifdef __LP64__
28*e1eccf28SAndroid Build Coastguard Worker     // Function to set the native lib path for 64bit compat lib.
29*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.SetNativeLibDir = (SetNativeLibDirFnPtr)dlsym(handle, "rsaContextSetNativeLibDir");
30*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.SetNativeLibDir == nullptr) {
31*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.SetNativeLibDir");
32*e1eccf28SAndroid Build Coastguard Worker         return false;
33*e1eccf28SAndroid Build Coastguard Worker     }
34*e1eccf28SAndroid Build Coastguard Worker #endif
35*e1eccf28SAndroid Build Coastguard Worker 
36*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.Allocation1DData = (Allocation1DDataFnPtr)dlsym(handle, "rsAllocation1DData");
37*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.Allocation1DElementData = (Allocation1DElementDataFnPtr)dlsym(handle, "rsAllocation1DElementData");
38*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.Allocation1DRead = (Allocation1DReadFnPtr)dlsym(handle, "rsAllocation1DRead");
39*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.Allocation2DData = (Allocation2DDataFnPtr)dlsym(handle, "rsAllocation2DData");
40*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.Allocation2DRead = (Allocation2DReadFnPtr)dlsym(handle, "rsAllocation2DRead");
41*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.Allocation3DData = (Allocation3DDataFnPtr)dlsym(handle, "rsAllocation3DData");
42*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.Allocation3DRead = (Allocation3DReadFnPtr)dlsym(handle, "rsAllocation3DRead");
43*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.AllocationAdapterCreate = (AllocationAdapterCreateFnPtr)dlsym(handle, "rsAllocationAdapterCreate");
44*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.AllocationAdapterOffset = (AllocationAdapterOffsetFnPtr)dlsym(handle, "rsAllocationAdapterOffset");
45*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.AllocationCopy2DRange = (AllocationCopy2DRangeFnPtr)dlsym(handle, "rsAllocationCopy2DRange");
46*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.AllocationCopy3DRange = (AllocationCopy3DRangeFnPtr)dlsym(handle, "rsAllocationCopy3DRange");
47*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.AllocationCopyToBitmap = (AllocationCopyToBitmapFnPtr)dlsym(handle, "rsAllocationCopyToBitmap");
48*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.AllocationCreateFromBitmap = (AllocationCreateFromBitmapFnPtr)dlsym(handle, "rsAllocationCreateFromBitmap");
49*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.AllocationCreateTyped = (AllocationCreateTypedFnPtr)dlsym(handle, "rsAllocationCreateTyped");
50*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.AllocationCubeCreateFromBitmap = (AllocationCubeCreateFromBitmapFnPtr)dlsym(handle, "rsAllocationCubeCreateFromBitmap");
51*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.AllocationElementData = (AllocationElementDataFnPtr)dlsym(handle, "rsAllocationElementData");
52*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.AllocationElementRead = (AllocationElementReadFnPtr)dlsym(handle, "rsAllocationElementRead");
53*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.AllocationGenerateMipmaps = (AllocationGenerateMipmapsFnPtr)dlsym(handle, "rsAllocationGenerateMipmaps");
54*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.AllocationGetPointer = (AllocationGetPointerFnPtr)dlsym(handle, "rsAllocationGetPointer");
55*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.AllocationGetSurface = (AllocationGetSurfaceFnPtr)dlsym(handle, "rsAllocationGetSurface");
56*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.AllocationGetType = (AllocationGetTypeFnPtr)dlsym(handle, "rsaAllocationGetType");
57*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.AllocationIoReceive = (AllocationIoReceiveFnPtr)dlsym(handle, "rsAllocationIoReceive");
58*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.AllocationIoSend = (AllocationIoSendFnPtr)dlsym(handle, "rsAllocationIoSend");
59*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.AllocationRead = (AllocationReadFnPtr)dlsym(handle, "rsAllocationRead");
60*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.AllocationResize1D = (AllocationResize1DFnPtr)dlsym(handle, "rsAllocationResize1D");
61*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.AllocationSetSurface = (AllocationSetSurfaceFnPtr)dlsym(handle, "rsAllocationSetSurface");
62*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.AllocationSetupBufferQueue = (AllocationSetupBufferQueueFnPtr)dlsym(handle, "rsAllocationSetupBufferQueue");
63*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.AllocationShareBufferQueue = (AllocationShareBufferQueueFnPtr)dlsym(handle, "rsAllocationShareBufferQueue");
64*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.AllocationSyncAll = (AllocationSyncAllFnPtr)dlsym(handle, "rsAllocationSyncAll");
65*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.AssignName = (AssignNameFnPtr)dlsym(handle, "rsAssignName");
66*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ClosureCreate = (ClosureCreateFnPtr)dlsym(handle, "rsClosureCreate");
67*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ClosureSetArg = (ClosureSetArgFnPtr)dlsym(handle, "rsClosureSetArg");
68*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ClosureSetGlobal = (ClosureSetGlobalFnPtr)dlsym(handle, "rsClosureSetGlobal");
69*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ContextCreate = (ContextCreateFnPtr)dlsym(handle, "rsContextCreate");;
70*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ContextDeinitToClient = (ContextDeinitToClientFnPtr)dlsym(handle, "rsContextDeinitToClient");
71*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ContextDestroy = (ContextDestroyFnPtr)dlsym(handle, "rsContextDestroy");
72*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ContextDump = (ContextDumpFnPtr)dlsym(handle, "rsContextDump");
73*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ContextFinish = (ContextFinishFnPtr)dlsym(handle, "rsContextFinish");
74*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ContextGetMessage = (ContextGetMessageFnPtr)dlsym(handle, "rsContextGetMessage");
75*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ContextInitToClient = (ContextInitToClientFnPtr)dlsym(handle, "rsContextInitToClient");
76*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ContextPeekMessage = (ContextPeekMessageFnPtr)dlsym(handle, "rsContextPeekMessage");
77*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ContextSendMessage = (ContextSendMessageFnPtr)dlsym(handle, "rsContextSendMessage");
78*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ContextSetPriority = (ContextSetPriorityFnPtr)dlsym(handle, "rsContextSetPriority");
79*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ContextSetCacheDir = (ContextSetCacheDirFnPtr)dlsym(handle, "rsContextSetCacheDir");
80*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.DeviceCreate = (DeviceCreateFnPtr)dlsym(handle, "rsDeviceCreate");
81*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.DeviceDestroy = (DeviceDestroyFnPtr)dlsym(handle, "rsDeviceDestroy");
82*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.DeviceSetConfig = (DeviceSetConfigFnPtr)dlsym(handle, "rsDeviceSetConfig");
83*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ElementCreate = (ElementCreateFnPtr)dlsym(handle, "rsElementCreate");
84*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ElementCreate2 = (ElementCreate2FnPtr)dlsym(handle, "rsElementCreate2");
85*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ElementGetNativeData = (ElementGetNativeDataFnPtr)dlsym(handle, "rsaElementGetNativeData");
86*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ElementGetSubElements = (ElementGetSubElementsFnPtr)dlsym(handle, "rsaElementGetSubElements");
87*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.GetName = (GetNameFnPtr)dlsym(handle, "rsaGetName");;
88*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.InvokeClosureCreate = (InvokeClosureCreateFnPtr)dlsym(handle, "rsInvokeClosureCreate");
89*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ObjDestroy = (ObjDestroyFnPtr)dlsym(handle, "rsObjDestroy");
90*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.SamplerCreate = (SamplerCreateFnPtr)dlsym(handle, "rsSamplerCreate");
91*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ScriptBindAllocation = (ScriptBindAllocationFnPtr)dlsym(handle, "rsScriptBindAllocation");
92*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ScriptCCreate = (ScriptCCreateFnPtr)dlsym(handle, "rsScriptCCreate");
93*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ScriptFieldIDCreate = (ScriptFieldIDCreateFnPtr)dlsym(handle, "rsScriptFieldIDCreate");
94*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ScriptForEach = (ScriptForEachFnPtr)dlsym(handle, "rsScriptForEach");
95*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ScriptForEachMulti = (ScriptForEachMultiFnPtr)dlsym(handle, "rsScriptForEachMulti");
96*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ScriptGetVarV = (ScriptGetVarVFnPtr)dlsym(handle, "rsScriptGetVarV");
97*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ScriptGroup2Create = (ScriptGroup2CreateFnPtr)dlsym(handle, "rsScriptGroup2Create");
98*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ScriptGroupCreate = (ScriptGroupCreateFnPtr)dlsym(handle, "rsScriptGroupCreate");
99*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ScriptGroupExecute = (ScriptGroupExecuteFnPtr)dlsym(handle, "rsScriptGroupExecute");
100*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ScriptGroupSetInput = (ScriptGroupSetInputFnPtr)dlsym(handle, "rsScriptGroupSetInput");
101*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ScriptGroupSetOutput = (ScriptGroupSetOutputFnPtr)dlsym(handle, "rsScriptGroupSetOutput");
102*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ScriptIntrinsicCreate = (ScriptIntrinsicCreateFnPtr)dlsym(handle, "rsScriptIntrinsicCreate");
103*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ScriptInvoke = (ScriptInvokeFnPtr)dlsym(handle, "rsScriptInvoke");
104*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ScriptInvokeIDCreate = (ScriptInvokeIDCreateFnPtr)dlsym(handle, "rsScriptInvokeIDCreate");
105*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ScriptInvokeV = (ScriptInvokeVFnPtr)dlsym(handle, "rsScriptInvokeV");
106*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ScriptKernelIDCreate = (ScriptKernelIDCreateFnPtr)dlsym(handle, "rsScriptKernelIDCreate");
107*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ScriptReduce = (ScriptReduceFnPtr)dlsym(handle, "rsScriptReduce");
108*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ScriptSetTimeZone = (ScriptSetTimeZoneFnPtr)dlsym(handle, "rsScriptSetTimeZone");
109*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ScriptSetVarD = (ScriptSetVarDFnPtr)dlsym(handle, "rsScriptSetVarD");
110*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ScriptSetVarF = (ScriptSetVarFFnPtr)dlsym(handle, "rsScriptSetVarF");
111*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ScriptSetVarI = (ScriptSetVarIFnPtr)dlsym(handle, "rsScriptSetVarI");
112*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ScriptSetVarJ = (ScriptSetVarJFnPtr)dlsym(handle, "rsScriptSetVarJ");
113*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ScriptSetVarObj = (ScriptSetVarObjFnPtr)dlsym(handle, "rsScriptSetVarObj");
114*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ScriptSetVarV = (ScriptSetVarVFnPtr)dlsym(handle, "rsScriptSetVarV");
115*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ScriptSetVarVE = (ScriptSetVarVEFnPtr)dlsym(handle, "rsScriptSetVarVE");
116*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.TypeCreate = (TypeCreateFnPtr)dlsym(handle, "rsTypeCreate");
117*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.TypeGetNativeData = (TypeGetNativeDataFnPtr)dlsym(handle, "rsaTypeGetNativeData");
118*e1eccf28SAndroid Build Coastguard Worker 
119*e1eccf28SAndroid Build Coastguard Worker     // Load graphics APIs
120*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ContextCreateGL = (ContextCreateGLFnPtr)dlsym(handle, "rsContextCreateGL");
121*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ContextSetSurface = (ContextSetSurfaceFnPtr)dlsym(handle, "rsContextSetSurface");
122*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ContextPause = (ContextPauseFnPtr)dlsym(handle, "rsContextPause");
123*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ContextResume = (ContextResumeFnPtr)dlsym(handle, "rsContextResume");
124*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ContextBindProgramStore = (ContextBindProgramStoreFnPtr)dlsym(handle, "rsContextBindProgramStore");
125*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ContextBindProgramFragment = (ContextBindProgramFragmentFnPtr)dlsym(handle, "rsContextBindProgramFragment");
126*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ContextBindProgramVertex = (ContextBindProgramVertexFnPtr)dlsym(handle, "rsContextBindProgramVertex");
127*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ContextBindProgramRaster = (ContextBindProgramRasterFnPtr)dlsym(handle, "rsContextBindProgramRaster");
128*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ContextBindFont = (ContextBindFontFnPtr)dlsym(handle, "rsContextBindFont");
129*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ContextBindRootScript = (ContextBindRootScriptFnPtr)dlsym(handle, "rsContextBindRootScript");
130*e1eccf28SAndroid Build Coastguard Worker 
131*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ProgramStoreCreate = (ProgramStoreCreateFnPtr)dlsym(handle, "rsProgramStoreCreate");
132*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ProgramRasterCreate = (ProgramRasterCreateFnPtr)dlsym(handle, "rsProgramRasterCreate");
133*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ProgramBindConstants = (ProgramBindConstantsFnPtr)dlsym(handle, "rsProgramBindConstants");
134*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ProgramBindTexture = (ProgramBindTextureFnPtr)dlsym(handle, "rsProgramBindTexture");
135*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ProgramBindSampler = (ProgramBindSamplerFnPtr)dlsym(handle, "rsProgramBindSampler");
136*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ProgramFragmentCreate = (ProgramFragmentCreateFnPtr)dlsym(handle, "rsProgramFragmentCreate");
137*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.ProgramVertexCreate = (ProgramVertexCreateFnPtr)dlsym(handle, "rsProgramVertexCreate");
138*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.FontCreateFromFile = (FontCreateFromFileFnPtr)dlsym(handle, "rsFontCreateFromFile");
139*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.FontCreateFromMemory = (FontCreateFromMemoryFnPtr)dlsym(handle, "rsFontCreateFromMemory");
140*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.MeshCreate = (MeshCreateFnPtr)dlsym(handle, "rsMeshCreate");
141*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.MeshGetVertexBufferCount = (MeshGetVertexBufferCountFnPtr)dlsym(handle, "rsaMeshGetVertexBufferCount");
142*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.MeshGetIndexCount = (MeshGetIndexCountFnPtr)dlsym(handle, "rsaMeshGetIndexCount");
143*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.MeshGetVertices = (MeshGetVerticesFnPtr)dlsym(handle, "rsaMeshGetVertices");
144*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.MeshGetIndices = (MeshGetIndicesFnPtr)dlsym(handle, "rsaMeshGetIndices");
145*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.FileA3DGetEntryByIndex = (FileA3DGetEntryByIndexFnPtr)dlsym(handle, "rsaFileA3DGetEntryByIndex");
146*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.FileA3DGetNumIndexEntries = (FileA3DGetNumIndexEntriesFnPtr)dlsym(handle, "rsaFileA3DGetNumIndexEntries");
147*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.FileA3DGetIndexEntries = (FileA3DGetIndexEntriesFnPtr)dlsym(handle, "rsaFileA3DGetIndexEntries");
148*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.FileA3DCreateFromMemory = (FileA3DCreateFromMemoryFnPtr)dlsym(handle, "rsaFileA3DCreateFromMemory");
149*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.FileA3DCreateFromAsset = (FileA3DCreateFromAssetFnPtr)dlsym(handle, "rsaFileA3DCreateFromAsset");
150*e1eccf28SAndroid Build Coastguard Worker     dispatchTab.FileA3DCreateFromFile = (FileA3DCreateFromFileFnPtr)dlsym(handle, "rsaFileA3DCreateFromFile");
151*e1eccf28SAndroid Build Coastguard Worker 
152*e1eccf28SAndroid Build Coastguard Worker     // Clear error buffer for later operations.
153*e1eccf28SAndroid Build Coastguard Worker     dlerror();
154*e1eccf28SAndroid Build Coastguard Worker 
155*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.AllocationGetType == nullptr) {
156*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.AllocationGetType");
157*e1eccf28SAndroid Build Coastguard Worker         return false;
158*e1eccf28SAndroid Build Coastguard Worker     }
159*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.TypeGetNativeData == nullptr) {
160*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.TypeGetNativeData");
161*e1eccf28SAndroid Build Coastguard Worker         return false;
162*e1eccf28SAndroid Build Coastguard Worker     }
163*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ElementGetNativeData == nullptr) {
164*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ElementGetNativeData");
165*e1eccf28SAndroid Build Coastguard Worker         return false;
166*e1eccf28SAndroid Build Coastguard Worker     }
167*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ElementGetSubElements == nullptr) {
168*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ElementGetSubElements");
169*e1eccf28SAndroid Build Coastguard Worker         return false;
170*e1eccf28SAndroid Build Coastguard Worker     }
171*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.DeviceCreate == nullptr) {
172*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.DeviceCreate");
173*e1eccf28SAndroid Build Coastguard Worker         return false;
174*e1eccf28SAndroid Build Coastguard Worker     }
175*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.DeviceDestroy == nullptr) {
176*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.DeviceDestroy");
177*e1eccf28SAndroid Build Coastguard Worker         return false;
178*e1eccf28SAndroid Build Coastguard Worker     }
179*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.DeviceSetConfig == nullptr) {
180*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.DeviceSetConfig");
181*e1eccf28SAndroid Build Coastguard Worker         return false;
182*e1eccf28SAndroid Build Coastguard Worker     }
183*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ContextCreate == nullptr) {
184*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ContextCreate");
185*e1eccf28SAndroid Build Coastguard Worker         return false;
186*e1eccf28SAndroid Build Coastguard Worker     }
187*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.GetName == nullptr) {
188*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.GetName");
189*e1eccf28SAndroid Build Coastguard Worker         return false;
190*e1eccf28SAndroid Build Coastguard Worker     }
191*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ContextDestroy == nullptr) {
192*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ContextDestroy");
193*e1eccf28SAndroid Build Coastguard Worker         return false;
194*e1eccf28SAndroid Build Coastguard Worker     }
195*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ContextGetMessage == nullptr) {
196*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ContextGetMessage");
197*e1eccf28SAndroid Build Coastguard Worker         return false;
198*e1eccf28SAndroid Build Coastguard Worker     }
199*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ContextPeekMessage == nullptr) {
200*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ContextPeekMessage");
201*e1eccf28SAndroid Build Coastguard Worker         return false;
202*e1eccf28SAndroid Build Coastguard Worker     }
203*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ContextSendMessage == nullptr) {
204*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ContextSendMessage");
205*e1eccf28SAndroid Build Coastguard Worker         return false;
206*e1eccf28SAndroid Build Coastguard Worker     }
207*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ContextInitToClient == nullptr) {
208*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ContextInitToClient");
209*e1eccf28SAndroid Build Coastguard Worker         return false;
210*e1eccf28SAndroid Build Coastguard Worker     }
211*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ContextDeinitToClient == nullptr) {
212*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ContextDeinitToClient");
213*e1eccf28SAndroid Build Coastguard Worker         return false;
214*e1eccf28SAndroid Build Coastguard Worker     }
215*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.TypeCreate == nullptr) {
216*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.TypeCreate");
217*e1eccf28SAndroid Build Coastguard Worker         return false;
218*e1eccf28SAndroid Build Coastguard Worker     }
219*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.AllocationCreateTyped == nullptr) {
220*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.AllocationCreateTyped");
221*e1eccf28SAndroid Build Coastguard Worker         return false;
222*e1eccf28SAndroid Build Coastguard Worker     }
223*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.AllocationCreateFromBitmap == nullptr) {
224*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.AllocationCreateFromBitmap");
225*e1eccf28SAndroid Build Coastguard Worker         return false;
226*e1eccf28SAndroid Build Coastguard Worker     }
227*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.AllocationCubeCreateFromBitmap == nullptr) {
228*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.AllocationCubeCreateFromBitmap");
229*e1eccf28SAndroid Build Coastguard Worker         return false;
230*e1eccf28SAndroid Build Coastguard Worker     }
231*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.AllocationGetSurface == nullptr) {
232*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.AllocationGetSurface");
233*e1eccf28SAndroid Build Coastguard Worker         return false;
234*e1eccf28SAndroid Build Coastguard Worker     }
235*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.AllocationSetSurface == nullptr) {
236*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.AllocationSetSurface");
237*e1eccf28SAndroid Build Coastguard Worker         return false;
238*e1eccf28SAndroid Build Coastguard Worker     }
239*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ContextFinish == nullptr) {
240*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ContextFinish");
241*e1eccf28SAndroid Build Coastguard Worker         return false;
242*e1eccf28SAndroid Build Coastguard Worker     }
243*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ContextDump == nullptr) {
244*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ContextDump");
245*e1eccf28SAndroid Build Coastguard Worker         return false;
246*e1eccf28SAndroid Build Coastguard Worker     }
247*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ContextSetPriority == nullptr) {
248*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ContextSetPriority");
249*e1eccf28SAndroid Build Coastguard Worker         return false;
250*e1eccf28SAndroid Build Coastguard Worker     }
251*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.AssignName == nullptr) {
252*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.AssignName");
253*e1eccf28SAndroid Build Coastguard Worker         return false;
254*e1eccf28SAndroid Build Coastguard Worker     }
255*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ObjDestroy == nullptr) {
256*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ObjDestroy");
257*e1eccf28SAndroid Build Coastguard Worker         return false;
258*e1eccf28SAndroid Build Coastguard Worker     }
259*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ElementCreate == nullptr) {
260*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ElementCreate");
261*e1eccf28SAndroid Build Coastguard Worker         return false;
262*e1eccf28SAndroid Build Coastguard Worker     }
263*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ElementCreate2 == nullptr) {
264*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ElementCreate2");
265*e1eccf28SAndroid Build Coastguard Worker         return false;
266*e1eccf28SAndroid Build Coastguard Worker     }
267*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.AllocationCopyToBitmap == nullptr) {
268*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.AllocationCopyToBitmap");
269*e1eccf28SAndroid Build Coastguard Worker         return false;
270*e1eccf28SAndroid Build Coastguard Worker     }
271*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.Allocation1DData == nullptr) {
272*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.Allocation1DData");
273*e1eccf28SAndroid Build Coastguard Worker         return false;
274*e1eccf28SAndroid Build Coastguard Worker     }
275*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.Allocation1DElementData == nullptr) {
276*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.Allocation1DElementData");
277*e1eccf28SAndroid Build Coastguard Worker         return false;
278*e1eccf28SAndroid Build Coastguard Worker     }
279*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.Allocation2DData == nullptr) {
280*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.Allocation2DData");
281*e1eccf28SAndroid Build Coastguard Worker         return false;
282*e1eccf28SAndroid Build Coastguard Worker     }
283*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.Allocation3DData == nullptr) {
284*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.Allocation3DData");
285*e1eccf28SAndroid Build Coastguard Worker         return false;
286*e1eccf28SAndroid Build Coastguard Worker     }
287*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.AllocationGenerateMipmaps == nullptr) {
288*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.AllocationGenerateMipmaps");
289*e1eccf28SAndroid Build Coastguard Worker         return false;
290*e1eccf28SAndroid Build Coastguard Worker     }
291*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.AllocationRead == nullptr) {
292*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.AllocationRead");
293*e1eccf28SAndroid Build Coastguard Worker         return false;
294*e1eccf28SAndroid Build Coastguard Worker     }
295*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.Allocation1DRead == nullptr) {
296*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.Allocation1DRead");
297*e1eccf28SAndroid Build Coastguard Worker         return false;
298*e1eccf28SAndroid Build Coastguard Worker     }
299*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.Allocation2DRead == nullptr) {
300*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.Allocation2DRead");
301*e1eccf28SAndroid Build Coastguard Worker         return false;
302*e1eccf28SAndroid Build Coastguard Worker     }
303*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.AllocationSyncAll == nullptr) {
304*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.AllocationSyncAll");
305*e1eccf28SAndroid Build Coastguard Worker         return false;
306*e1eccf28SAndroid Build Coastguard Worker     }
307*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.AllocationResize1D == nullptr) {
308*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.AllocationResize1D");
309*e1eccf28SAndroid Build Coastguard Worker         return false;
310*e1eccf28SAndroid Build Coastguard Worker     }
311*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.AllocationCopy2DRange == nullptr) {
312*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.AllocationCopy2DRange");
313*e1eccf28SAndroid Build Coastguard Worker         return false;
314*e1eccf28SAndroid Build Coastguard Worker     }
315*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.AllocationCopy3DRange == nullptr) {
316*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.AllocationCopy3DRange");
317*e1eccf28SAndroid Build Coastguard Worker         return false;
318*e1eccf28SAndroid Build Coastguard Worker     }
319*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.SamplerCreate == nullptr) {
320*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.SamplerCreate");
321*e1eccf28SAndroid Build Coastguard Worker         return false;
322*e1eccf28SAndroid Build Coastguard Worker     }
323*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ScriptBindAllocation == nullptr) {
324*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ScriptBindAllocation");
325*e1eccf28SAndroid Build Coastguard Worker         return false;
326*e1eccf28SAndroid Build Coastguard Worker     }
327*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ScriptSetTimeZone == nullptr) {
328*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ScriptSetTimeZone");
329*e1eccf28SAndroid Build Coastguard Worker         return false;
330*e1eccf28SAndroid Build Coastguard Worker     }
331*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ScriptInvoke == nullptr) {
332*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ScriptInvoke");
333*e1eccf28SAndroid Build Coastguard Worker         return false;
334*e1eccf28SAndroid Build Coastguard Worker     }
335*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ScriptInvokeV == nullptr) {
336*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ScriptInvokeV");
337*e1eccf28SAndroid Build Coastguard Worker         return false;
338*e1eccf28SAndroid Build Coastguard Worker     }
339*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ScriptForEach == nullptr) {
340*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ScriptForEach");
341*e1eccf28SAndroid Build Coastguard Worker         return false;
342*e1eccf28SAndroid Build Coastguard Worker     }
343*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ScriptSetVarI == nullptr) {
344*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ScriptSetVarI");
345*e1eccf28SAndroid Build Coastguard Worker         return false;
346*e1eccf28SAndroid Build Coastguard Worker     }
347*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ScriptSetVarObj == nullptr) {
348*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ScriptSetVarObj");
349*e1eccf28SAndroid Build Coastguard Worker         return false;
350*e1eccf28SAndroid Build Coastguard Worker     }
351*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ScriptSetVarJ == nullptr) {
352*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ScriptSetVarJ");
353*e1eccf28SAndroid Build Coastguard Worker         return false;
354*e1eccf28SAndroid Build Coastguard Worker     }
355*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ScriptSetVarF == nullptr) {
356*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ScriptSetVarF");
357*e1eccf28SAndroid Build Coastguard Worker         return false;
358*e1eccf28SAndroid Build Coastguard Worker     }
359*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ScriptSetVarD == nullptr) {
360*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ScriptSetVarD");
361*e1eccf28SAndroid Build Coastguard Worker         return false;
362*e1eccf28SAndroid Build Coastguard Worker     }
363*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ScriptSetVarV == nullptr) {
364*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ScriptSetVarV");
365*e1eccf28SAndroid Build Coastguard Worker         return false;
366*e1eccf28SAndroid Build Coastguard Worker     }
367*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ScriptGetVarV == nullptr) {
368*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ScriptGetVarV");
369*e1eccf28SAndroid Build Coastguard Worker         return false;
370*e1eccf28SAndroid Build Coastguard Worker     }
371*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ScriptSetVarVE == nullptr) {
372*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ScriptSetVarVE");
373*e1eccf28SAndroid Build Coastguard Worker         return false;
374*e1eccf28SAndroid Build Coastguard Worker     }
375*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ScriptCCreate == nullptr) {
376*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ScriptCCreate");
377*e1eccf28SAndroid Build Coastguard Worker         return false;
378*e1eccf28SAndroid Build Coastguard Worker     }
379*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ScriptIntrinsicCreate == nullptr) {
380*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ScriptIntrinsicCreate");
381*e1eccf28SAndroid Build Coastguard Worker         return false;
382*e1eccf28SAndroid Build Coastguard Worker     }
383*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ScriptKernelIDCreate == nullptr) {
384*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ScriptKernelIDCreate");
385*e1eccf28SAndroid Build Coastguard Worker         return false;
386*e1eccf28SAndroid Build Coastguard Worker     }
387*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ScriptFieldIDCreate == nullptr) {
388*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ScriptFieldIDCreate");
389*e1eccf28SAndroid Build Coastguard Worker         return false;
390*e1eccf28SAndroid Build Coastguard Worker     }
391*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ScriptGroupCreate == nullptr) {
392*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ScriptGroupCreate");
393*e1eccf28SAndroid Build Coastguard Worker         return false;
394*e1eccf28SAndroid Build Coastguard Worker     }
395*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ScriptGroupSetOutput == nullptr) {
396*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ScriptGroupSetOutput");
397*e1eccf28SAndroid Build Coastguard Worker         return false;
398*e1eccf28SAndroid Build Coastguard Worker     }
399*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ScriptGroupSetInput == nullptr) {
400*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ScriptGroupSetInput");
401*e1eccf28SAndroid Build Coastguard Worker         return false;
402*e1eccf28SAndroid Build Coastguard Worker     }
403*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.ScriptGroupExecute == nullptr) {
404*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.ScriptGroupExecute");
405*e1eccf28SAndroid Build Coastguard Worker         return false;
406*e1eccf28SAndroid Build Coastguard Worker     }
407*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.AllocationIoSend == nullptr) {
408*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.AllocationIoSend");
409*e1eccf28SAndroid Build Coastguard Worker         return false;
410*e1eccf28SAndroid Build Coastguard Worker     }
411*e1eccf28SAndroid Build Coastguard Worker     if (dispatchTab.AllocationIoReceive == nullptr) {
412*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize dispatchTab.AllocationIoReceive");
413*e1eccf28SAndroid Build Coastguard Worker         return false;
414*e1eccf28SAndroid Build Coastguard Worker     }
415*e1eccf28SAndroid Build Coastguard Worker     // API_21 functions
416*e1eccf28SAndroid Build Coastguard Worker     if (targetApiLevel >= 21) {
417*e1eccf28SAndroid Build Coastguard Worker         if (dispatchTab.AllocationGetPointer == nullptr) {
418*e1eccf28SAndroid Build Coastguard Worker             LOG_ERR("Couldn't initialize dispatchTab.AllocationGetPointer");
419*e1eccf28SAndroid Build Coastguard Worker             return false;
420*e1eccf28SAndroid Build Coastguard Worker         }
421*e1eccf28SAndroid Build Coastguard Worker     }
422*e1eccf28SAndroid Build Coastguard Worker     // API_23 functions
423*e1eccf28SAndroid Build Coastguard Worker     if (targetApiLevel >= 23) {
424*e1eccf28SAndroid Build Coastguard Worker         // ScriptGroup V2 functions
425*e1eccf28SAndroid Build Coastguard Worker         if (dispatchTab.ScriptInvokeIDCreate == nullptr) {
426*e1eccf28SAndroid Build Coastguard Worker             LOG_ERR("Couldn't initialize dispatchTab.ScriptInvokeIDCreate");
427*e1eccf28SAndroid Build Coastguard Worker             return false;
428*e1eccf28SAndroid Build Coastguard Worker         }
429*e1eccf28SAndroid Build Coastguard Worker         if (dispatchTab.ClosureCreate == nullptr) {
430*e1eccf28SAndroid Build Coastguard Worker             LOG_ERR("Couldn't initialize dispatchTab.ClosureCreate");
431*e1eccf28SAndroid Build Coastguard Worker             return false;
432*e1eccf28SAndroid Build Coastguard Worker         }
433*e1eccf28SAndroid Build Coastguard Worker         if (dispatchTab.InvokeClosureCreate == nullptr) {
434*e1eccf28SAndroid Build Coastguard Worker             LOG_ERR("Couldn't initialize dispatchTab.InvokeClosureCreate");
435*e1eccf28SAndroid Build Coastguard Worker             return false;
436*e1eccf28SAndroid Build Coastguard Worker         }
437*e1eccf28SAndroid Build Coastguard Worker         if (dispatchTab.ClosureSetArg == nullptr) {
438*e1eccf28SAndroid Build Coastguard Worker             LOG_ERR("Couldn't initialize dispatchTab.ClosureSetArg");
439*e1eccf28SAndroid Build Coastguard Worker             return false;
440*e1eccf28SAndroid Build Coastguard Worker         }
441*e1eccf28SAndroid Build Coastguard Worker         if (dispatchTab.ClosureSetGlobal == nullptr) {
442*e1eccf28SAndroid Build Coastguard Worker             LOG_ERR("Couldn't initialize dispatchTab.ClosureSetGlobal");
443*e1eccf28SAndroid Build Coastguard Worker             return false;
444*e1eccf28SAndroid Build Coastguard Worker         }
445*e1eccf28SAndroid Build Coastguard Worker         if (dispatchTab.ScriptGroup2Create == nullptr) {
446*e1eccf28SAndroid Build Coastguard Worker             LOG_ERR("Couldn't initialize dispatchTab.ScriptGroup2Create");
447*e1eccf28SAndroid Build Coastguard Worker             return false;
448*e1eccf28SAndroid Build Coastguard Worker         }
449*e1eccf28SAndroid Build Coastguard Worker         if (dispatchTab.AllocationElementData == nullptr) {
450*e1eccf28SAndroid Build Coastguard Worker             LOG_ERR("Couldn't initialize dispatchTab.AllocationElementData");
451*e1eccf28SAndroid Build Coastguard Worker             return false;
452*e1eccf28SAndroid Build Coastguard Worker         }
453*e1eccf28SAndroid Build Coastguard Worker         if (dispatchTab.AllocationElementRead == nullptr) {
454*e1eccf28SAndroid Build Coastguard Worker             LOG_ERR("Couldn't initialize dispatchTab.AllocationElementRead");
455*e1eccf28SAndroid Build Coastguard Worker             return false;
456*e1eccf28SAndroid Build Coastguard Worker         }
457*e1eccf28SAndroid Build Coastguard Worker         if (dispatchTab.Allocation3DRead == nullptr) {
458*e1eccf28SAndroid Build Coastguard Worker             LOG_ERR("Couldn't initialize dispatchTab.Allocation3DRead");
459*e1eccf28SAndroid Build Coastguard Worker             return false;
460*e1eccf28SAndroid Build Coastguard Worker         }
461*e1eccf28SAndroid Build Coastguard Worker         if (dispatchTab.ScriptForEachMulti == nullptr) {
462*e1eccf28SAndroid Build Coastguard Worker             LOG_ERR("Couldn't initialize dispatchTab.ScriptForEachMulti");
463*e1eccf28SAndroid Build Coastguard Worker             return false;
464*e1eccf28SAndroid Build Coastguard Worker         }
465*e1eccf28SAndroid Build Coastguard Worker     }
466*e1eccf28SAndroid Build Coastguard Worker 
467*e1eccf28SAndroid Build Coastguard Worker     if (targetApiLevel >= REDUCE_API_LEVEL) {
468*e1eccf28SAndroid Build Coastguard Worker         if (dispatchTab.ScriptReduce == nullptr) {
469*e1eccf28SAndroid Build Coastguard Worker             LOG_ERR("Couldn't initialize dispatchTab.ScriptReduce");
470*e1eccf28SAndroid Build Coastguard Worker             return false;
471*e1eccf28SAndroid Build Coastguard Worker         }
472*e1eccf28SAndroid Build Coastguard Worker     }
473*e1eccf28SAndroid Build Coastguard Worker 
474*e1eccf28SAndroid Build Coastguard Worker     return true;
475*e1eccf28SAndroid Build Coastguard Worker 
476*e1eccf28SAndroid Build Coastguard Worker }
477*e1eccf28SAndroid Build Coastguard Worker 
478*e1eccf28SAndroid Build Coastguard Worker 
loadIOSuppSyms(void * handleIO,ioSuppDT & ioDispatch)479*e1eccf28SAndroid Build Coastguard Worker bool loadIOSuppSyms(void* handleIO, ioSuppDT& ioDispatch){
480*e1eccf28SAndroid Build Coastguard Worker     ioDispatch.sAllocationSetSurface = (sAllocationSetSurfaceFnPtr)dlsym(handleIO, "AllocationSetSurface");
481*e1eccf28SAndroid Build Coastguard Worker     if (ioDispatch.sAllocationSetSurface == nullptr) {
482*e1eccf28SAndroid Build Coastguard Worker         LOG_ERR("Couldn't initialize ioDispatch.sAllocationSetSurface");
483*e1eccf28SAndroid Build Coastguard Worker         return false;
484*e1eccf28SAndroid Build Coastguard Worker     }
485*e1eccf28SAndroid Build Coastguard Worker     return true;
486*e1eccf28SAndroid Build Coastguard Worker }