Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
Jason Sams | 66f0a16 | 2014-11-11 13:46:38 -0800 | [diff] [blame] | 20 | #include "rsInternalDefines.h" |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 21 | |
Miao Wang | f3213d7 | 2015-01-14 10:03:07 -0800 | [diff] [blame] | 22 | typedef void (*SetNativeLibDirFnPtr)(RsContext con, const char *nativeLibDir, size_t length); |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 23 | typedef const void* (*AllocationGetTypeFnPtr)(RsContext con, RsAllocation va); |
Ashok Bhat | 6c59e3c | 2014-02-11 11:36:45 +0000 | [diff] [blame] | 24 | typedef void (*TypeGetNativeDataFnPtr)(RsContext, RsType, uintptr_t *typeData, uint32_t typeDataSize); |
Miao Wang | c020bdd | 2017-02-16 11:36:50 -0800 | [diff] [blame] | 25 | typedef void (*ElementGetNativeDataFnPtr)(RsContext, RsElement, uint32_t *elemData, uint32_t elemDataSize); |
| 26 | typedef void (*ElementGetSubElementsFnPtr)(RsContext, RsElement, uintptr_t *ids, const char **names, size_t *arraySizes, uint32_t dataSize); |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 27 | typedef RsDevice (*DeviceCreateFnPtr) (); |
| 28 | typedef void (*DeviceDestroyFnPtr) (RsDevice dev); |
| 29 | typedef void (*DeviceSetConfigFnPtr) (RsDevice dev, RsDeviceParam p, int32_t value); |
Tim Murray | 84e3dea | 2013-09-09 16:12:51 -0700 | [diff] [blame] | 30 | typedef RsContext (*ContextCreateFnPtr)(RsDevice vdev, uint32_t version, uint32_t sdkVersion, RsContextType ct, uint32_t flags); |
Miao Wang | 5fccd07 | 2017-05-16 15:39:34 -0700 | [diff] [blame] | 31 | typedef RsContext (*ContextCreateVendorFnPtr)(RsDevice vdev, uint32_t version, uint32_t sdkVersion, RsContextType ct, uint32_t flags, const char* vendorDriverName); |
Tim Murray | 4a92d12 | 2013-07-22 10:56:18 -0700 | [diff] [blame] | 32 | typedef void (*GetNameFnPtr)(RsContext, void * obj, const char **name); |
Yang Ni | fef0cd4 | 2015-11-11 15:08:16 -0800 | [diff] [blame] | 33 | typedef RsClosure (*ClosureCreateFnPtr)(RsContext, RsScriptKernelID, RsAllocation, RsScriptFieldID*, size_t, int64_t*, size_t, int*, size_t, RsClosure*, size_t, RsScriptFieldID*, size_t); |
| 34 | typedef RsClosure (*InvokeClosureCreateFnPtr)(RsContext, RsScriptInvokeID, const void*, const size_t, const RsScriptFieldID*, const size_t, const int64_t*, const size_t, const int*, const size_t); |
| 35 | typedef void (*ClosureSetArgFnPtr)(RsContext, RsClosure, uint32_t, uintptr_t, int); |
| 36 | typedef void (*ClosureSetGlobalFnPtr)(RsContext, RsClosure, RsScriptFieldID, int64_t, int); |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 37 | typedef void (*ContextDestroyFnPtr) (RsContext); |
| 38 | typedef RsMessageToClientType (*ContextGetMessageFnPtr) (RsContext, void*, size_t, size_t*, size_t, uint32_t*, size_t); |
| 39 | typedef RsMessageToClientType (*ContextPeekMessageFnPtr) (RsContext, size_t*, size_t, uint32_t*, size_t); |
| 40 | typedef void (*ContextSendMessageFnPtr) (RsContext, uint32_t, const uint8_t*, size_t); |
| 41 | typedef void (*ContextInitToClientFnPtr) (RsContext); |
| 42 | typedef void (*ContextDeinitToClientFnPtr) (RsContext); |
Miao Wang | c020bdd | 2017-02-16 11:36:50 -0800 | [diff] [blame] | 43 | typedef void (*ContextSetCacheDirFnPtr) (RsContext rsc, const char *cacheDir, size_t cacheDir_length); |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 44 | typedef RsType (*TypeCreateFnPtr) (RsContext, RsElement, uint32_t, uint32_t, uint32_t, bool, bool, uint32_t); |
| 45 | typedef RsAllocation (*AllocationCreateTypedFnPtr) (RsContext, RsType, RsAllocationMipmapControl, uint32_t, uintptr_t); |
Miao Wang | 47a5881 | 2015-07-23 21:59:16 -0700 | [diff] [blame] | 46 | typedef RsAllocation (*AllocationCreateStridedFnPtr) (RsContext, RsType, RsAllocationMipmapControl, uint32_t, uintptr_t, size_t); |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 47 | typedef RsAllocation (*AllocationCreateFromBitmapFnPtr) (RsContext, RsType, RsAllocationMipmapControl, const void*, size_t, uint32_t); |
| 48 | typedef RsAllocation (*AllocationCubeCreateFromBitmapFnPtr) (RsContext, RsType, RsAllocationMipmapControl, const void*, size_t, uint32_t); |
| 49 | typedef RsNativeWindow (*AllocationGetSurfaceFnPtr) (RsContext, RsAllocation); |
| 50 | typedef void (*AllocationSetSurfaceFnPtr) (RsContext, RsAllocation, RsNativeWindow); |
| 51 | typedef void (*ContextFinishFnPtr) (RsContext); |
| 52 | typedef void (*ContextDumpFnPtr) (RsContext, int32_t); |
| 53 | typedef void (*ContextSetPriorityFnPtr) (RsContext, int32_t); |
| 54 | typedef void (*AssignNameFnPtr) (RsContext, RsObjectBase, const char*, size_t); |
| 55 | typedef void (*ObjDestroyFnPtr) (RsContext, RsAsyncVoidPtr); |
| 56 | typedef RsElement (*ElementCreateFnPtr) (RsContext, RsDataType, RsDataKind, bool, uint32_t); |
| 57 | typedef RsElement (*ElementCreate2FnPtr) (RsContext, const RsElement*, size_t, const char**, size_t, const size_t*, const uint32_t*, size_t); |
| 58 | typedef void (*AllocationCopyToBitmapFnPtr) (RsContext, RsAllocation, void*, size_t); |
| 59 | typedef void (*Allocation1DDataFnPtr) (RsContext, RsAllocation, uint32_t, uint32_t, uint32_t, const void*, size_t); |
| 60 | typedef void (*Allocation1DElementDataFnPtr) (RsContext, RsAllocation, uint32_t, uint32_t, const void*, size_t, size_t); |
Miao Wang | cc8cea7 | 2015-02-19 18:14:46 -0800 | [diff] [blame] | 61 | typedef void (*AllocationElementDataFnPtr) (RsContext, RsAllocation, uint32_t, uint32_t, uint32_t, uint32_t, const void*, size_t, size_t); |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 62 | typedef void (*Allocation2DDataFnPtr) (RsContext, RsAllocation, uint32_t, uint32_t, uint32_t, RsAllocationCubemapFace, uint32_t, uint32_t, const void*, size_t, size_t); |
| 63 | typedef void (*Allocation3DDataFnPtr) (RsContext, RsAllocation, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, const void*, size_t, size_t); |
| 64 | typedef void (*AllocationGenerateMipmapsFnPtr) (RsContext, RsAllocation); |
| 65 | typedef void (*AllocationReadFnPtr) (RsContext, RsAllocation, void*, size_t); |
| 66 | typedef void (*Allocation1DReadFnPtr) (RsContext, RsAllocation, uint32_t, uint32_t, uint32_t, void*, size_t); |
Miao Wang | cc8cea7 | 2015-02-19 18:14:46 -0800 | [diff] [blame] | 67 | typedef void (*AllocationElementReadFnPtr) (RsContext, RsAllocation, uint32_t, uint32_t, uint32_t, uint32_t, void*, size_t, size_t); |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 68 | typedef void (*Allocation2DReadFnPtr) (RsContext, RsAllocation, uint32_t, uint32_t, uint32_t, RsAllocationCubemapFace, uint32_t, uint32_t, void*, size_t, size_t); |
Miao Wang | cc8cea7 | 2015-02-19 18:14:46 -0800 | [diff] [blame] | 69 | typedef void (*Allocation3DReadFnPtr) (RsContext, RsAllocation, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, void*, size_t, size_t); |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 70 | typedef void (*AllocationSyncAllFnPtr) (RsContext, RsAllocation, RsAllocationUsageType); |
| 71 | typedef void (*AllocationResize1DFnPtr) (RsContext, RsAllocation, uint32_t); |
| 72 | typedef 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); |
| 73 | typedef 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); |
Miao Wang | c020bdd | 2017-02-16 11:36:50 -0800 | [diff] [blame] | 74 | typedef void (*AllocationSetupBufferQueueFnPtr) (RsContext context, RsAllocation valloc, uint32_t numAlloc); |
| 75 | typedef void (*AllocationShareBufferQueueFnPtr) (RsContext context, RsAllocation valloc1, RsAllocation valloc2); |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 76 | typedef RsSampler (*SamplerCreateFnPtr) (RsContext, RsSamplerValue, RsSamplerValue, RsSamplerValue, RsSamplerValue, RsSamplerValue, float); |
| 77 | typedef void (*ScriptBindAllocationFnPtr) (RsContext, RsScript, RsAllocation, uint32_t); |
| 78 | typedef void (*ScriptSetTimeZoneFnPtr) (RsContext, RsScript, const char*, size_t); |
| 79 | typedef void (*ScriptInvokeFnPtr) (RsContext, RsScript, uint32_t); |
| 80 | typedef void (*ScriptInvokeVFnPtr) (RsContext, RsScript, uint32_t, const void*, size_t); |
| 81 | typedef void (*ScriptForEachFnPtr) (RsContext, RsScript, uint32_t, RsAllocation, RsAllocation, const void*, size_t, const RsScriptCall*, size_t); |
Matt Wala | 394e9a6 | 2015-08-03 11:35:55 -0700 | [diff] [blame] | 82 | typedef void (*ScriptForEachMultiFnPtr) (RsContext, RsScript, uint32_t, RsAllocation*, size_t, RsAllocation, const void*, size_t, const RsScriptCall*, size_t); |
David Gross | ae2ec3f | 2016-06-01 14:45:47 -0700 | [diff] [blame] | 83 | typedef void (*ScriptReduceFnPtr) (RsContext, RsScript, uint32_t, RsAllocation*, size_t, RsAllocation, const RsScriptCall*, size_t); |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 84 | typedef void (*ScriptSetVarIFnPtr) (RsContext, RsScript, uint32_t, int); |
| 85 | typedef void (*ScriptSetVarObjFnPtr) (RsContext, RsScript, uint32_t, RsObjectBase); |
| 86 | typedef void (*ScriptSetVarJFnPtr) (RsContext, RsScript, uint32_t, int64_t); |
| 87 | typedef void (*ScriptSetVarFFnPtr) (RsContext, RsScript, uint32_t, float); |
| 88 | typedef void (*ScriptSetVarDFnPtr) (RsContext, RsScript, uint32_t, double); |
| 89 | typedef void (*ScriptSetVarVFnPtr) (RsContext, RsScript, uint32_t, const void*, size_t); |
| 90 | typedef void (*ScriptGetVarVFnPtr) (RsContext, RsScript, uint32_t, void*, size_t); |
Stephen Hines | ac8d146 | 2014-06-25 00:01:23 -0700 | [diff] [blame] | 91 | typedef void (*ScriptSetVarVEFnPtr) (RsContext, RsScript, uint32_t, const void*, size_t, RsElement, const uint32_t*, size_t); |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 92 | typedef RsScript (*ScriptCCreateFnPtr) (RsContext, const char*, size_t, const char*, size_t, const char*, size_t); |
| 93 | typedef RsScript (*ScriptIntrinsicCreateFnPtr) (RsContext, uint32_t id, RsElement); |
| 94 | typedef RsScriptKernelID (*ScriptKernelIDCreateFnPtr) (RsContext, RsScript, int, int); |
Yang Ni | eb9aa67 | 2015-01-27 14:32:25 -0800 | [diff] [blame] | 95 | typedef RsScriptInvokeID (*ScriptInvokeIDCreateFnPtr) (RsContext, RsScript, int); |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 96 | typedef RsScriptFieldID (*ScriptFieldIDCreateFnPtr) (RsContext, RsScript, int); |
| 97 | typedef RsScriptGroup (*ScriptGroupCreateFnPtr) (RsContext, RsScriptKernelID*, size_t, RsScriptKernelID*, size_t, RsScriptKernelID*, size_t, RsScriptFieldID*, size_t, const RsType*, size_t); |
Yang Ni | 8b94222 | 2015-04-02 17:48:28 -0700 | [diff] [blame] | 98 | typedef RsScriptGroup2 (*ScriptGroup2CreateFnPtr)(RsContext, const char*, size_t, const char*, size_t, RsClosure*, size_t); |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 99 | typedef void (*ScriptGroupSetOutputFnPtr) (RsContext, RsScriptGroup, RsScriptKernelID, RsAllocation); |
| 100 | typedef void (*ScriptGroupSetInputFnPtr) (RsContext, RsScriptGroup, RsScriptKernelID, RsAllocation); |
| 101 | typedef void (*ScriptGroupExecuteFnPtr) (RsContext, RsScriptGroup); |
| 102 | typedef void (*AllocationIoSendFnPtr) (RsContext, RsAllocation); |
Miao Wang | c020bdd | 2017-02-16 11:36:50 -0800 | [diff] [blame] | 103 | typedef int64_t (*AllocationIoReceiveFnPtr) (RsContext, RsAllocation); |
Miao Wang | 94280f8 | 2015-02-02 19:30:27 -0800 | [diff] [blame] | 104 | typedef void * (*AllocationGetPointerFnPtr) (RsContext, RsAllocation, uint32_t lod, RsAllocationCubemapFace face, uint32_t z, uint32_t array, size_t *stride, size_t stride_len); |
Miao Wang | c020bdd | 2017-02-16 11:36:50 -0800 | [diff] [blame] | 105 | typedef RsAllocation (*AllocationAdapterCreateFnPtr) (RsContext rsc, RsType vtype, RsAllocation baseAlloc); |
| 106 | typedef void (*AllocationAdapterOffsetFnPtr) (RsContext rsc, RsAllocation alloc, const uint32_t * offsets, size_t offsets_length); |
| 107 | |
| 108 | // Graphics APIs |
| 109 | typedef RsContext (*ContextCreateGLFnPtr) (RsDevice vdev, uint32_t version, uint32_t sdkVersion, RsSurfaceConfig sc, uint32_t dpi); |
| 110 | typedef RsProgramStore (*ProgramStoreCreateFnPtr) (RsContext rsc, bool colorMaskR, bool colorMaskG, bool colorMaskB, bool colorMaskA, bool depthMask, bool ditherEnable, RsBlendSrcFunc srcFunc, RsBlendDstFunc destFunc, RsDepthFunc depthFunc); |
| 111 | typedef RsProgramRaster (*ProgramRasterCreateFnPtr) (RsContext rsc, bool pointSprite, RsCullMode cull); |
| 112 | typedef void (*ProgramBindConstantsFnPtr) (RsContext rsc, RsProgram vp, uint32_t slot, RsAllocation constants); |
| 113 | typedef void (*ProgramBindTextureFnPtr) (RsContext rsc, RsProgramFragment pf, uint32_t slot, RsAllocation a); |
| 114 | typedef void (*ProgramBindSamplerFnPtr) (RsContext rsc, RsProgramFragment pf, uint32_t slot, RsSampler s); |
| 115 | typedef RsProgramFragment (*ProgramFragmentCreateFnPtr) (RsContext rsc, const char * shaderText, size_t shaderText_length, const char ** textureNames, size_t textureNames_length_length, const size_t * textureNames_length, const uintptr_t * params, size_t params_length); |
| 116 | typedef RsProgramVertex (*ProgramVertexCreateFnPtr) (RsContext rsc, const char * shaderText, size_t shaderText_length, const char ** textureNames, size_t textureNames_length_length, const size_t * textureNames_length, const uintptr_t * params, size_t params_length); |
| 117 | typedef RsFont (*FontCreateFromFileFnPtr) (RsContext rsc, const char * name, size_t name_length, float fontSize, uint32_t dpi); |
| 118 | typedef RsFont (*FontCreateFromMemoryFnPtr) (RsContext rsc, const char * name, size_t name_length, float fontSize, uint32_t dpi, const void * data, size_t data_length); |
| 119 | typedef RsMesh (*MeshCreateFnPtr) (RsContext rsc, RsAllocation * vtx, size_t vtx_length, RsAllocation * idx, size_t idx_length, uint32_t * primType, size_t primType_length); |
| 120 | typedef void (*ContextBindProgramStoreFnPtr) (RsContext rsc, RsProgramStore pgm); |
| 121 | typedef void (*ContextBindProgramFragmentFnPtr) (RsContext rsc, RsProgramFragment pgm); |
| 122 | typedef void (*ContextBindProgramVertexFnPtr) (RsContext rsc, RsProgramVertex pgm); |
| 123 | typedef void (*ContextBindProgramRasterFnPtr) (RsContext rsc, RsProgramRaster pgm); |
| 124 | typedef void (*ContextBindFontFnPtr) (RsContext rsc, RsFont pgm); |
| 125 | typedef void (*ContextSetSurfaceFnPtr) (RsContext rsc, uint32_t width, uint32_t height, RsNativeWindow sur); |
| 126 | typedef void (*ContextBindRootScriptFnPtr) (RsContext rsc, RsScript sampler); |
| 127 | typedef void (*ContextPauseFnPtr) (RsContext rsc); |
| 128 | typedef void (*ContextResumeFnPtr) (RsContext rsc); |
| 129 | typedef void (*MeshGetVertexBufferCountFnPtr) (RsContext con, RsMesh mv, int32_t *numVtx); |
| 130 | typedef void (*MeshGetIndexCountFnPtr) (RsContext con, RsMesh mv, int32_t *numIdx); |
| 131 | typedef void (*MeshGetVerticesFnPtr) (RsContext con, RsMesh mv, RsAllocation *vtxData, uint32_t vtxDataCount); |
| 132 | typedef void (*MeshGetIndicesFnPtr) (RsContext con, RsMesh mv, RsAllocation *va, uint32_t *primType, uint32_t idxDataCount); |
| 133 | typedef RsObjectBase (*FileA3DGetEntryByIndexFnPtr) (RsContext con, uint32_t index, RsFile file); |
| 134 | typedef void (*FileA3DGetNumIndexEntriesFnPtr) (RsContext con, int32_t *numEntries, RsFile file); |
| 135 | typedef void (*FileA3DGetIndexEntriesFnPtr) (RsContext con, RsFileIndexEntry *fileEntries, uint32_t numEntries, RsFile file); |
| 136 | typedef RsFile (*FileA3DCreateFromMemoryFnPtr) (RsContext con, const void *data, uint32_t len); |
| 137 | typedef RsFile (*FileA3DCreateFromAssetFnPtr) (RsContext con, void *_asset); |
| 138 | typedef RsFile (*FileA3DCreateFromFileFnPtr) (RsContext con, const char *path); |
| 139 | |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 140 | |
Jason Sams | 66f0a16 | 2014-11-11 13:46:38 -0800 | [diff] [blame] | 141 | struct dispatchTable { |
Miao Wang | f3213d7 | 2015-01-14 10:03:07 -0800 | [diff] [blame] | 142 | SetNativeLibDirFnPtr SetNativeLibDir; |
| 143 | |
Miao Wang | 5b042ca | 2016-02-23 15:35:51 -0800 | [diff] [blame] | 144 | // Inserted by hand based on rs.spec and rs.h |
| 145 | Allocation1DDataFnPtr Allocation1DData; |
| 146 | Allocation1DElementDataFnPtr Allocation1DElementData; |
| 147 | Allocation1DReadFnPtr Allocation1DRead; |
| 148 | Allocation2DDataFnPtr Allocation2DData; |
| 149 | Allocation2DReadFnPtr Allocation2DRead; |
| 150 | Allocation3DDataFnPtr Allocation3DData; |
| 151 | Allocation3DReadFnPtr Allocation3DRead; |
Miao Wang | c020bdd | 2017-02-16 11:36:50 -0800 | [diff] [blame] | 152 | AllocationAdapterCreateFnPtr AllocationAdapterCreate; |
| 153 | AllocationAdapterOffsetFnPtr AllocationAdapterOffset; |
Miao Wang | 5b042ca | 2016-02-23 15:35:51 -0800 | [diff] [blame] | 154 | AllocationCopy2DRangeFnPtr AllocationCopy2DRange; |
| 155 | AllocationCopy3DRangeFnPtr AllocationCopy3DRange; |
| 156 | AllocationCopyToBitmapFnPtr AllocationCopyToBitmap; |
| 157 | AllocationCreateFromBitmapFnPtr AllocationCreateFromBitmap; |
| 158 | AllocationCreateStridedFnPtr AllocationCreateStrided; |
| 159 | AllocationCreateTypedFnPtr AllocationCreateTyped; |
| 160 | AllocationCubeCreateFromBitmapFnPtr AllocationCubeCreateFromBitmap; |
| 161 | AllocationElementDataFnPtr AllocationElementData; |
| 162 | AllocationElementReadFnPtr AllocationElementRead; |
| 163 | AllocationGenerateMipmapsFnPtr AllocationGenerateMipmaps; |
| 164 | AllocationGetPointerFnPtr AllocationGetPointer; |
| 165 | AllocationGetSurfaceFnPtr AllocationGetSurface; |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 166 | AllocationGetTypeFnPtr AllocationGetType; |
Miao Wang | 5b042ca | 2016-02-23 15:35:51 -0800 | [diff] [blame] | 167 | AllocationIoReceiveFnPtr AllocationIoReceive; |
| 168 | AllocationIoSendFnPtr AllocationIoSend; |
| 169 | AllocationReadFnPtr AllocationRead; |
| 170 | AllocationResize1DFnPtr AllocationResize1D; |
| 171 | AllocationSetSurfaceFnPtr AllocationSetSurface; |
| 172 | AllocationSyncAllFnPtr AllocationSyncAll; |
Miao Wang | c020bdd | 2017-02-16 11:36:50 -0800 | [diff] [blame] | 173 | AllocationSetupBufferQueueFnPtr AllocationSetupBufferQueue; |
| 174 | AllocationShareBufferQueueFnPtr AllocationShareBufferQueue; |
Miao Wang | 5b042ca | 2016-02-23 15:35:51 -0800 | [diff] [blame] | 175 | AssignNameFnPtr AssignName; |
| 176 | ClosureCreateFnPtr ClosureCreate; |
| 177 | ClosureSetArgFnPtr ClosureSetArg; |
| 178 | ClosureSetGlobalFnPtr ClosureSetGlobal; |
| 179 | ContextCreateFnPtr ContextCreate; |
Miao Wang | 5fccd07 | 2017-05-16 15:39:34 -0700 | [diff] [blame] | 180 | ContextCreateVendorFnPtr ContextCreateVendor; |
Miao Wang | 5b042ca | 2016-02-23 15:35:51 -0800 | [diff] [blame] | 181 | ContextDeinitToClientFnPtr ContextDeinitToClient; |
| 182 | ContextDestroyFnPtr ContextDestroy; |
| 183 | ContextDumpFnPtr ContextDump; |
| 184 | ContextFinishFnPtr ContextFinish; |
| 185 | ContextGetMessageFnPtr ContextGetMessage; |
| 186 | ContextInitToClientFnPtr ContextInitToClient; |
| 187 | ContextPeekMessageFnPtr ContextPeekMessage; |
| 188 | ContextSendMessageFnPtr ContextSendMessage; |
| 189 | ContextSetPriorityFnPtr ContextSetPriority; |
Miao Wang | c020bdd | 2017-02-16 11:36:50 -0800 | [diff] [blame] | 190 | ContextSetCacheDirFnPtr ContextSetCacheDir; |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 191 | DeviceCreateFnPtr DeviceCreate; |
| 192 | DeviceDestroyFnPtr DeviceDestroy; |
| 193 | DeviceSetConfigFnPtr DeviceSetConfig; |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 194 | ElementCreate2FnPtr ElementCreate2; |
Miao Wang | 5b042ca | 2016-02-23 15:35:51 -0800 | [diff] [blame] | 195 | ElementCreateFnPtr ElementCreate; |
| 196 | ElementGetNativeDataFnPtr ElementGetNativeData; |
| 197 | ElementGetSubElementsFnPtr ElementGetSubElements; |
| 198 | GetNameFnPtr GetName; |
| 199 | InvokeClosureCreateFnPtr InvokeClosureCreate; |
| 200 | ObjDestroyFnPtr ObjDestroy; |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 201 | SamplerCreateFnPtr SamplerCreate; |
| 202 | ScriptBindAllocationFnPtr ScriptBindAllocation; |
Miao Wang | 5b042ca | 2016-02-23 15:35:51 -0800 | [diff] [blame] | 203 | ScriptCCreateFnPtr ScriptCCreate; |
| 204 | ScriptFieldIDCreateFnPtr ScriptFieldIDCreate; |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 205 | ScriptForEachFnPtr ScriptForEach; |
Matt Wala | 394e9a6 | 2015-08-03 11:35:55 -0700 | [diff] [blame] | 206 | ScriptForEachMultiFnPtr ScriptForEachMulti; |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 207 | ScriptGetVarVFnPtr ScriptGetVarV; |
Yang Ni | 1ffd86b | 2015-01-07 09:16:40 -0800 | [diff] [blame] | 208 | ScriptGroup2CreateFnPtr ScriptGroup2Create; |
Miao Wang | 5b042ca | 2016-02-23 15:35:51 -0800 | [diff] [blame] | 209 | ScriptGroupCreateFnPtr ScriptGroupCreate; |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 210 | ScriptGroupExecuteFnPtr ScriptGroupExecute; |
Miao Wang | 5b042ca | 2016-02-23 15:35:51 -0800 | [diff] [blame] | 211 | ScriptGroupSetInputFnPtr ScriptGroupSetInput; |
| 212 | ScriptGroupSetOutputFnPtr ScriptGroupSetOutput; |
| 213 | ScriptIntrinsicCreateFnPtr ScriptIntrinsicCreate; |
| 214 | ScriptInvokeFnPtr ScriptInvoke; |
| 215 | ScriptInvokeIDCreateFnPtr ScriptInvokeIDCreate; |
| 216 | ScriptInvokeVFnPtr ScriptInvokeV; |
| 217 | ScriptKernelIDCreateFnPtr ScriptKernelIDCreate; |
| 218 | ScriptReduceFnPtr ScriptReduce; |
| 219 | ScriptSetTimeZoneFnPtr ScriptSetTimeZone; |
| 220 | ScriptSetVarDFnPtr ScriptSetVarD; |
| 221 | ScriptSetVarFFnPtr ScriptSetVarF; |
| 222 | ScriptSetVarIFnPtr ScriptSetVarI; |
| 223 | ScriptSetVarJFnPtr ScriptSetVarJ; |
| 224 | ScriptSetVarObjFnPtr ScriptSetVarObj; |
| 225 | ScriptSetVarVEFnPtr ScriptSetVarVE; |
| 226 | ScriptSetVarVFnPtr ScriptSetVarV; |
| 227 | TypeCreateFnPtr TypeCreate; |
| 228 | TypeGetNativeDataFnPtr TypeGetNativeData; |
Miao Wang | c020bdd | 2017-02-16 11:36:50 -0800 | [diff] [blame] | 229 | |
| 230 | // Graphics API entries |
| 231 | ContextCreateGLFnPtr ContextCreateGL; |
| 232 | ContextPauseFnPtr ContextPause; |
| 233 | ContextResumeFnPtr ContextResume; |
| 234 | ContextBindProgramStoreFnPtr ContextBindProgramStore; |
| 235 | ContextBindProgramFragmentFnPtr ContextBindProgramFragment; |
| 236 | ContextBindProgramVertexFnPtr ContextBindProgramVertex; |
| 237 | ContextBindProgramRasterFnPtr ContextBindProgramRaster; |
| 238 | ContextBindFontFnPtr ContextBindFont; |
| 239 | ContextSetSurfaceFnPtr ContextSetSurface; |
| 240 | ContextBindRootScriptFnPtr ContextBindRootScript; |
| 241 | ProgramStoreCreateFnPtr ProgramStoreCreate; |
| 242 | ProgramRasterCreateFnPtr ProgramRasterCreate; |
| 243 | ProgramBindConstantsFnPtr ProgramBindConstants; |
| 244 | ProgramBindTextureFnPtr ProgramBindTexture; |
| 245 | ProgramBindSamplerFnPtr ProgramBindSampler; |
| 246 | ProgramFragmentCreateFnPtr ProgramFragmentCreate; |
| 247 | ProgramVertexCreateFnPtr ProgramVertexCreate; |
| 248 | FontCreateFromFileFnPtr FontCreateFromFile; |
| 249 | FontCreateFromMemoryFnPtr FontCreateFromMemory; |
| 250 | MeshCreateFnPtr MeshCreate; |
| 251 | MeshGetVertexBufferCountFnPtr MeshGetVertexBufferCount; |
| 252 | MeshGetIndexCountFnPtr MeshGetIndexCount; |
| 253 | MeshGetVerticesFnPtr MeshGetVertices; |
| 254 | MeshGetIndicesFnPtr MeshGetIndices; |
| 255 | FileA3DGetEntryByIndexFnPtr FileA3DGetEntryByIndex; |
| 256 | FileA3DGetNumIndexEntriesFnPtr FileA3DGetNumIndexEntries; |
| 257 | FileA3DGetIndexEntriesFnPtr FileA3DGetIndexEntries; |
| 258 | FileA3DCreateFromMemoryFnPtr FileA3DCreateFromMemory; |
| 259 | FileA3DCreateFromAssetFnPtr FileA3DCreateFromAsset; |
| 260 | FileA3DCreateFromFileFnPtr FileA3DCreateFromFile; |
Jason Sams | 66f0a16 | 2014-11-11 13:46:38 -0800 | [diff] [blame] | 261 | }; |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 262 | |
Miao Wang | 8a6a717 | 2015-02-09 18:41:14 -0800 | [diff] [blame] | 263 | bool loadSymbols(void* handle, dispatchTable& dispatchTab, int device_api = 0); |
Miao Wang | 2bd78f2 | 2014-11-20 10:49:43 -0800 | [diff] [blame] | 264 | |
Jiyong Park | bac72f8 | 2017-07-10 13:14:41 +0900 | [diff] [blame] | 265 | #ifdef RS_COMPATIBILITY_LIB |
| 266 | #include "jni.h" |
| 267 | |
Miao Wang | cf067b8 | 2015-09-14 18:27:17 -0700 | [diff] [blame] | 268 | // USAGE_IO for RS Support lib |
Miao Wang | 2bd78f2 | 2014-11-20 10:49:43 -0800 | [diff] [blame] | 269 | typedef void (*sAllocationSetSurfaceFnPtr) (JNIEnv *, jobject, RsContext, RsAllocation, RsNativeWindow, dispatchTable); |
| 270 | struct ioSuppDT { |
Miao Wang | cf067b8 | 2015-09-14 18:27:17 -0700 | [diff] [blame] | 271 | // USAGE_IO_OUTPUT |
Miao Wang | 2bd78f2 | 2014-11-20 10:49:43 -0800 | [diff] [blame] | 272 | sAllocationSetSurfaceFnPtr sAllocationSetSurface; |
| 273 | }; |
| 274 | |
| 275 | bool loadIOSuppSyms(void* handleIO, ioSuppDT& ioDispatch); |
Jiyong Park | bac72f8 | 2017-07-10 13:14:41 +0900 | [diff] [blame] | 276 | #endif // RS_COMPATIBILITY_LIB |
| 277 | |
| 278 | #endif |