Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 1 | /* |
Stephen Hines | 2980f07 | 2012-04-09 18:26:29 -0700 | [diff] [blame] | 2 | * Copyright (C) 2011-2012 The Android Open Source Project |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 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 RS_HAL_H |
| 18 | #define RS_HAL_H |
| 19 | |
Jason Sams | 3715b00 | 2012-02-16 16:07:49 -0800 | [diff] [blame] | 20 | #include <rsDefines.h> |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 21 | |
Jason Sams | 7ac2a4d | 2012-02-15 12:04:24 -0800 | [diff] [blame] | 22 | struct ANativeWindow; |
| 23 | |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 24 | namespace android { |
| 25 | namespace renderscript { |
| 26 | |
| 27 | class Context; |
| 28 | class ObjectBase; |
| 29 | class Element; |
| 30 | class Type; |
| 31 | class Allocation; |
| 32 | class Script; |
Jason Sams | dbe66d6 | 2012-09-17 13:54:41 -0700 | [diff] [blame] | 33 | class ScriptKernelID; |
| 34 | class ScriptFieldID; |
| 35 | class ScriptMethodID; |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 36 | class ScriptC; |
Jason Sams | dbe66d6 | 2012-09-17 13:54:41 -0700 | [diff] [blame] | 37 | class ScriptGroup; |
Jason Sams | 9e0afb5 | 2011-10-31 13:23:43 -0700 | [diff] [blame] | 38 | class Path; |
Alex Sakhartchouk | 7f126c7 | 2011-05-05 16:56:27 -0700 | [diff] [blame] | 39 | class Program; |
Jason Sams | 8feea4e | 2011-03-18 15:03:25 -0700 | [diff] [blame] | 40 | class ProgramStore; |
Jason Sams | 721acc4 | 2011-04-06 11:23:54 -0700 | [diff] [blame] | 41 | class ProgramRaster; |
Alex Sakhartchouk | a04e30d | 2011-04-29 16:49:08 -0700 | [diff] [blame] | 42 | class ProgramVertex; |
| 43 | class ProgramFragment; |
| 44 | class Mesh; |
Alex Sakhartchouk | 7f126c7 | 2011-05-05 16:56:27 -0700 | [diff] [blame] | 45 | class Sampler; |
Alex Sakhartchouk | da6d34a | 2011-05-13 14:53:34 -0700 | [diff] [blame] | 46 | class FBOCache; |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 47 | |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 48 | typedef void *(*RsHalSymbolLookupFunc)(void *usrptr, char const *symbolName); |
| 49 | |
Jason Sams | 451cf2e | 2011-08-17 13:46:46 -0700 | [diff] [blame] | 50 | typedef struct { |
| 51 | const void *in; |
| 52 | void *out; |
| 53 | const void *usr; |
Jason Sams | 8eaba4f | 2012-08-14 14:38:05 -0700 | [diff] [blame] | 54 | size_t usrLen; |
Jason Sams | 451cf2e | 2011-08-17 13:46:46 -0700 | [diff] [blame] | 55 | uint32_t x; |
| 56 | uint32_t y; |
| 57 | uint32_t z; |
| 58 | uint32_t lod; |
| 59 | RsAllocationCubemapFace face; |
| 60 | uint32_t ar[16]; |
Jason Sams | bee28c6 | 2012-10-25 18:15:54 -0700 | [diff] [blame] | 61 | uint32_t lid; |
Jason Sams | 8eaba4f | 2012-08-14 14:38:05 -0700 | [diff] [blame] | 62 | |
| 63 | uint32_t dimX; |
| 64 | uint32_t dimY; |
| 65 | uint32_t dimZ; |
| 66 | uint32_t dimArray; |
| 67 | |
| 68 | const uint8_t *ptrIn; |
| 69 | uint8_t *ptrOut; |
| 70 | uint32_t eStrideIn; |
| 71 | uint32_t eStrideOut; |
| 72 | uint32_t yStrideIn; |
| 73 | uint32_t yStrideOut; |
Jason Sams | cf9ea9f | 2012-09-23 17:00:54 -0700 | [diff] [blame] | 74 | uint32_t slot; |
Jason Sams | 451cf2e | 2011-08-17 13:46:46 -0700 | [diff] [blame] | 75 | } RsForEachStubParamStruct; |
| 76 | |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 77 | /** |
| 78 | * Script management functions |
| 79 | */ |
| 80 | typedef struct { |
Jason Sams | 4b3de47 | 2011-04-06 17:52:23 -0700 | [diff] [blame] | 81 | bool (*initGraphics)(const Context *); |
| 82 | void (*shutdownGraphics)(const Context *); |
Alex Sakhartchouk | 7257c7e | 2011-05-17 12:32:47 -0700 | [diff] [blame] | 83 | bool (*setSurface)(const Context *, uint32_t w, uint32_t h, RsNativeWindow); |
Jason Sams | 4b3de47 | 2011-04-06 17:52:23 -0700 | [diff] [blame] | 84 | void (*swap)(const Context *); |
| 85 | |
Jason Sams | cdfdb8f | 2011-03-17 16:12:47 -0700 | [diff] [blame] | 86 | void (*shutdownDriver)(Context *); |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 87 | void (*getVersion)(unsigned int *major, unsigned int *minor); |
Jason Sams | cdfdb8f | 2011-03-17 16:12:47 -0700 | [diff] [blame] | 88 | void (*setPriority)(const Context *, int32_t priority); |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 89 | |
Tim Murray | 3468938 | 2013-03-11 12:12:03 -0700 | [diff] [blame] | 90 | void* (*allocRuntimeMem)(size_t size, uint32_t flags); |
| 91 | void (*freeRuntimeMem)(void* ptr); |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 92 | |
| 93 | struct { |
Jason Sams | 8feea4e | 2011-03-18 15:03:25 -0700 | [diff] [blame] | 94 | bool (*init)(const Context *rsc, ScriptC *s, |
| 95 | char const *resName, |
| 96 | char const *cacheDir, |
| 97 | uint8_t const *bitcode, |
| 98 | size_t bitcodeSize, |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 99 | uint32_t flags); |
Jason Sams | 8eaba4f | 2012-08-14 14:38:05 -0700 | [diff] [blame] | 100 | bool (*initIntrinsic)(const Context *rsc, Script *s, |
Stephen Hines | 41d6c76 | 2012-08-21 17:07:38 -0700 | [diff] [blame] | 101 | RsScriptIntrinsicID iid, |
Jason Sams | 8eaba4f | 2012-08-14 14:38:05 -0700 | [diff] [blame] | 102 | Element *e); |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 103 | |
Jason Sams | cdfdb8f | 2011-03-17 16:12:47 -0700 | [diff] [blame] | 104 | void (*invokeFunction)(const Context *rsc, Script *s, |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 105 | uint32_t slot, |
| 106 | const void *params, |
| 107 | size_t paramLength); |
Jason Sams | cdfdb8f | 2011-03-17 16:12:47 -0700 | [diff] [blame] | 108 | int (*invokeRoot)(const Context *rsc, Script *s); |
| 109 | void (*invokeForEach)(const Context *rsc, |
| 110 | Script *s, |
Jason Sams | 35e429e | 2011-07-13 11:26:26 -0700 | [diff] [blame] | 111 | uint32_t slot, |
Jason Sams | cdfdb8f | 2011-03-17 16:12:47 -0700 | [diff] [blame] | 112 | const Allocation * ain, |
| 113 | Allocation * aout, |
| 114 | const void * usr, |
Tim Murray | 099bc26 | 2013-03-20 16:54:03 -0700 | [diff] [blame] | 115 | size_t usrLen, |
Jason Sams | cdfdb8f | 2011-03-17 16:12:47 -0700 | [diff] [blame] | 116 | const RsScriptCall *sc); |
| 117 | void (*invokeInit)(const Context *rsc, Script *s); |
Stephen Hines | 4ee16ff | 2011-08-31 17:41:39 -0700 | [diff] [blame] | 118 | void (*invokeFreeChildren)(const Context *rsc, Script *s); |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 119 | |
| 120 | void (*setGlobalVar)(const Context *rsc, const Script *s, |
| 121 | uint32_t slot, |
| 122 | void *data, |
| 123 | size_t dataLength); |
Tim Murray | 9c64239 | 2013-04-11 13:29:59 -0700 | [diff] [blame] | 124 | void (*getGlobalVar)(const Context *rsc, const Script *s, |
| 125 | uint32_t slot, |
| 126 | void *data, |
| 127 | size_t dataLength); |
Stephen Hines | 2980f07 | 2012-04-09 18:26:29 -0700 | [diff] [blame] | 128 | void (*setGlobalVarWithElemDims)(const Context *rsc, const Script *s, |
| 129 | uint32_t slot, |
| 130 | void *data, |
| 131 | size_t dataLength, |
| 132 | const Element *e, |
| 133 | const size_t *dims, |
| 134 | size_t dimLength); |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 135 | void (*setGlobalBind)(const Context *rsc, const Script *s, |
| 136 | uint32_t slot, |
Jason Sams | 807fdc4 | 2012-07-25 17:55:39 -0700 | [diff] [blame] | 137 | Allocation *data); |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 138 | void (*setGlobalObj)(const Context *rsc, const Script *s, |
| 139 | uint32_t slot, |
| 140 | ObjectBase *data); |
| 141 | |
| 142 | void (*destroy)(const Context *rsc, Script *s); |
| 143 | } script; |
| 144 | |
Jason Sams | 8feea4e | 2011-03-18 15:03:25 -0700 | [diff] [blame] | 145 | struct { |
Jason Sams | eb4fe18 | 2011-05-26 16:33:01 -0700 | [diff] [blame] | 146 | bool (*init)(const Context *rsc, Allocation *alloc, bool forceZero); |
| 147 | void (*destroy)(const Context *rsc, Allocation *alloc); |
Jason Sams | ddceab9 | 2013-08-07 13:02:32 -0700 | [diff] [blame] | 148 | uint32_t (*grallocBits)(const Context *rsc, Allocation *alloc); |
Jason Sams | eb4fe18 | 2011-05-26 16:33:01 -0700 | [diff] [blame] | 149 | |
| 150 | void (*resize)(const Context *rsc, const Allocation *alloc, const Type *newType, |
| 151 | bool zeroNew); |
| 152 | void (*syncAll)(const Context *rsc, const Allocation *alloc, RsAllocationUsageType src); |
| 153 | void (*markDirty)(const Context *rsc, const Allocation *alloc); |
Jason Sams | 7ac2a4d | 2012-02-15 12:04:24 -0800 | [diff] [blame] | 154 | |
Jason Sams | 733396b | 2013-02-22 12:46:18 -0800 | [diff] [blame] | 155 | void (*setSurface)(const Context *rsc, Allocation *alloc, ANativeWindow *sur); |
Jason Sams | 7ac2a4d | 2012-02-15 12:04:24 -0800 | [diff] [blame] | 156 | void (*ioSend)(const Context *rsc, Allocation *alloc); |
Jason Sams | ddceab9 | 2013-08-07 13:02:32 -0700 | [diff] [blame] | 157 | |
| 158 | /** |
| 159 | * A new gralloc buffer is in use. The pointers and strides in |
| 160 | * mHal.drvState.lod[0-2] will be updated with the new values. |
| 161 | * |
| 162 | * The new gralloc handle is provided in mHal.state.nativeBuffer |
| 163 | * |
| 164 | */ |
Jason Sams | 7ac2a4d | 2012-02-15 12:04:24 -0800 | [diff] [blame] | 165 | void (*ioReceive)(const Context *rsc, Allocation *alloc); |
Jason Sams | eb4fe18 | 2011-05-26 16:33:01 -0700 | [diff] [blame] | 166 | |
| 167 | void (*data1D)(const Context *rsc, const Allocation *alloc, |
Tim Murray | 099bc26 | 2013-03-20 16:54:03 -0700 | [diff] [blame] | 168 | uint32_t xoff, uint32_t lod, size_t count, |
Alex Sakhartchouk | c794cd5 | 2012-02-13 11:57:32 -0800 | [diff] [blame] | 169 | const void *data, size_t sizeBytes); |
Jason Sams | eb4fe18 | 2011-05-26 16:33:01 -0700 | [diff] [blame] | 170 | void (*data2D)(const Context *rsc, const Allocation *alloc, |
| 171 | uint32_t xoff, uint32_t yoff, uint32_t lod, |
| 172 | RsAllocationCubemapFace face, uint32_t w, uint32_t h, |
Tim Murray | 358747a | 2012-11-26 13:52:04 -0800 | [diff] [blame] | 173 | const void *data, size_t sizeBytes, size_t stride); |
Jason Sams | eb4fe18 | 2011-05-26 16:33:01 -0700 | [diff] [blame] | 174 | void (*data3D)(const Context *rsc, const Allocation *alloc, |
Jason Sams | 3bbc0fd | 2013-04-09 14:16:13 -0700 | [diff] [blame] | 175 | uint32_t xoff, uint32_t yoff, uint32_t zoff, uint32_t lod, |
| 176 | uint32_t w, uint32_t h, uint32_t d, const void *data, size_t sizeBytes, |
| 177 | size_t stride); |
Jason Sams | eb4fe18 | 2011-05-26 16:33:01 -0700 | [diff] [blame] | 178 | |
Jason Sams | 807fdc4 | 2012-07-25 17:55:39 -0700 | [diff] [blame] | 179 | void (*read1D)(const Context *rsc, const Allocation *alloc, |
Tim Murray | 099bc26 | 2013-03-20 16:54:03 -0700 | [diff] [blame] | 180 | uint32_t xoff, uint32_t lod, size_t count, |
Jason Sams | 807fdc4 | 2012-07-25 17:55:39 -0700 | [diff] [blame] | 181 | void *data, size_t sizeBytes); |
| 182 | void (*read2D)(const Context *rsc, const Allocation *alloc, |
| 183 | uint32_t xoff, uint32_t yoff, uint32_t lod, |
| 184 | RsAllocationCubemapFace face, uint32_t w, uint32_t h, |
Tim Murray | 358747a | 2012-11-26 13:52:04 -0800 | [diff] [blame] | 185 | void *data, size_t sizeBytes, size_t stride); |
Jason Sams | 807fdc4 | 2012-07-25 17:55:39 -0700 | [diff] [blame] | 186 | void (*read3D)(const Context *rsc, const Allocation *alloc, |
Jason Sams | 3bbc0fd | 2013-04-09 14:16:13 -0700 | [diff] [blame] | 187 | uint32_t xoff, uint32_t yoff, uint32_t zoff, uint32_t lod, |
| 188 | uint32_t w, uint32_t h, uint32_t d, void *data, size_t sizeBytes, |
| 189 | size_t stride); |
Jason Sams | 807fdc4 | 2012-07-25 17:55:39 -0700 | [diff] [blame] | 190 | |
| 191 | // Lock and unlock make a 1D region of memory available to the CPU |
| 192 | // for direct access by pointer. Once unlock is called control is |
| 193 | // returned to the SOC driver. |
| 194 | void * (*lock1D)(const Context *rsc, const Allocation *alloc); |
| 195 | void (*unlock1D)(const Context *rsc, const Allocation *alloc); |
| 196 | |
Alex Sakhartchouk | 74a8279 | 2011-06-14 11:13:19 -0700 | [diff] [blame] | 197 | // Allocation to allocation copies |
| 198 | void (*allocData1D)(const Context *rsc, |
| 199 | const Allocation *dstAlloc, |
Tim Murray | 099bc26 | 2013-03-20 16:54:03 -0700 | [diff] [blame] | 200 | uint32_t dstXoff, uint32_t dstLod, size_t count, |
Alex Sakhartchouk | 74a8279 | 2011-06-14 11:13:19 -0700 | [diff] [blame] | 201 | const Allocation *srcAlloc, uint32_t srcXoff, uint32_t srcLod); |
| 202 | void (*allocData2D)(const Context *rsc, |
| 203 | const Allocation *dstAlloc, |
| 204 | uint32_t dstXoff, uint32_t dstYoff, uint32_t dstLod, |
| 205 | RsAllocationCubemapFace dstFace, uint32_t w, uint32_t h, |
| 206 | const Allocation *srcAlloc, |
| 207 | uint32_t srcXoff, uint32_t srcYoff, uint32_t srcLod, |
| 208 | RsAllocationCubemapFace srcFace); |
| 209 | void (*allocData3D)(const Context *rsc, |
| 210 | const Allocation *dstAlloc, |
| 211 | uint32_t dstXoff, uint32_t dstYoff, uint32_t dstZoff, |
Jason Sams | 3bbc0fd | 2013-04-09 14:16:13 -0700 | [diff] [blame] | 212 | uint32_t dstLod, |
Alex Sakhartchouk | 74a8279 | 2011-06-14 11:13:19 -0700 | [diff] [blame] | 213 | uint32_t w, uint32_t h, uint32_t d, |
| 214 | const Allocation *srcAlloc, |
| 215 | uint32_t srcXoff, uint32_t srcYoff, uint32_t srcZoff, |
Jason Sams | 3bbc0fd | 2013-04-09 14:16:13 -0700 | [diff] [blame] | 216 | uint32_t srcLod); |
Alex Sakhartchouk | 74a8279 | 2011-06-14 11:13:19 -0700 | [diff] [blame] | 217 | |
Jason Sams | eb4fe18 | 2011-05-26 16:33:01 -0700 | [diff] [blame] | 218 | void (*elementData1D)(const Context *rsc, const Allocation *alloc, uint32_t x, |
Alex Sakhartchouk | c794cd5 | 2012-02-13 11:57:32 -0800 | [diff] [blame] | 219 | const void *data, uint32_t elementOff, size_t sizeBytes); |
Jason Sams | eb4fe18 | 2011-05-26 16:33:01 -0700 | [diff] [blame] | 220 | void (*elementData2D)(const Context *rsc, const Allocation *alloc, uint32_t x, uint32_t y, |
Alex Sakhartchouk | c794cd5 | 2012-02-13 11:57:32 -0800 | [diff] [blame] | 221 | const void *data, uint32_t elementOff, size_t sizeBytes); |
Jason Sams | eb4fe18 | 2011-05-26 16:33:01 -0700 | [diff] [blame] | 222 | |
Jason Sams | 61a4bb7 | 2012-07-25 19:33:43 -0700 | [diff] [blame] | 223 | void (*generateMipmaps)(const Context *rsc, const Allocation *alloc); |
Jason Sams | eb4fe18 | 2011-05-26 16:33:01 -0700 | [diff] [blame] | 224 | } allocation; |
| 225 | |
| 226 | struct { |
Jason Sams | 8feea4e | 2011-03-18 15:03:25 -0700 | [diff] [blame] | 227 | bool (*init)(const Context *rsc, const ProgramStore *ps); |
| 228 | void (*setActive)(const Context *rsc, const ProgramStore *ps); |
| 229 | void (*destroy)(const Context *rsc, const ProgramStore *ps); |
| 230 | } store; |
| 231 | |
Jason Sams | 721acc4 | 2011-04-06 11:23:54 -0700 | [diff] [blame] | 232 | struct { |
| 233 | bool (*init)(const Context *rsc, const ProgramRaster *ps); |
| 234 | void (*setActive)(const Context *rsc, const ProgramRaster *ps); |
| 235 | void (*destroy)(const Context *rsc, const ProgramRaster *ps); |
| 236 | } raster; |
Jason Sams | 8feea4e | 2011-03-18 15:03:25 -0700 | [diff] [blame] | 237 | |
Alex Sakhartchouk | a04e30d | 2011-04-29 16:49:08 -0700 | [diff] [blame] | 238 | struct { |
| 239 | bool (*init)(const Context *rsc, const ProgramVertex *pv, |
Alex Sakhartchouk | 748eb07 | 2012-02-15 16:21:46 -0800 | [diff] [blame] | 240 | const char* shader, size_t shaderLen, |
| 241 | const char** textureNames, size_t textureNamesCount, |
| 242 | const size_t *textureNamesLength); |
Alex Sakhartchouk | a04e30d | 2011-04-29 16:49:08 -0700 | [diff] [blame] | 243 | void (*setActive)(const Context *rsc, const ProgramVertex *pv); |
| 244 | void (*destroy)(const Context *rsc, const ProgramVertex *pv); |
| 245 | } vertex; |
| 246 | |
| 247 | struct { |
| 248 | bool (*init)(const Context *rsc, const ProgramFragment *pf, |
Alex Sakhartchouk | 748eb07 | 2012-02-15 16:21:46 -0800 | [diff] [blame] | 249 | const char* shader, size_t shaderLen, |
| 250 | const char** textureNames, size_t textureNamesCount, |
| 251 | const size_t *textureNamesLength); |
Alex Sakhartchouk | a04e30d | 2011-04-29 16:49:08 -0700 | [diff] [blame] | 252 | void (*setActive)(const Context *rsc, const ProgramFragment *pf); |
| 253 | void (*destroy)(const Context *rsc, const ProgramFragment *pf); |
| 254 | } fragment; |
| 255 | |
| 256 | struct { |
| 257 | bool (*init)(const Context *rsc, const Mesh *m); |
| 258 | void (*draw)(const Context *rsc, const Mesh *m, uint32_t primIndex, uint32_t start, uint32_t len); |
| 259 | void (*destroy)(const Context *rsc, const Mesh *m); |
| 260 | } mesh; |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 261 | |
Alex Sakhartchouk | 7f126c7 | 2011-05-05 16:56:27 -0700 | [diff] [blame] | 262 | struct { |
Jason Sams | 9e0afb5 | 2011-10-31 13:23:43 -0700 | [diff] [blame] | 263 | bool (*initStatic)(const Context *rsc, const Path *m, const Allocation *vtx, const Allocation *loops); |
| 264 | bool (*initDynamic)(const Context *rsc, const Path *m); |
| 265 | void (*draw)(const Context *rsc, const Path *m); |
| 266 | void (*destroy)(const Context *rsc, const Path *m); |
| 267 | } path; |
| 268 | |
| 269 | struct { |
Alex Sakhartchouk | 7f126c7 | 2011-05-05 16:56:27 -0700 | [diff] [blame] | 270 | bool (*init)(const Context *rsc, const Sampler *m); |
| 271 | void (*destroy)(const Context *rsc, const Sampler *m); |
| 272 | } sampler; |
| 273 | |
Alex Sakhartchouk | da6d34a | 2011-05-13 14:53:34 -0700 | [diff] [blame] | 274 | struct { |
| 275 | bool (*init)(const Context *rsc, const FBOCache *fb); |
| 276 | void (*setActive)(const Context *rsc, const FBOCache *fb); |
| 277 | void (*destroy)(const Context *rsc, const FBOCache *fb); |
| 278 | } framebuffer; |
| 279 | |
Jason Sams | dbe66d6 | 2012-09-17 13:54:41 -0700 | [diff] [blame] | 280 | struct { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 281 | bool (*init)(const Context *rsc, ScriptGroup *sg); |
Jason Sams | dbe66d6 | 2012-09-17 13:54:41 -0700 | [diff] [blame] | 282 | void (*setInput)(const Context *rsc, const ScriptGroup *sg, |
| 283 | const ScriptKernelID *kid, Allocation *); |
| 284 | void (*setOutput)(const Context *rsc, const ScriptGroup *sg, |
| 285 | const ScriptKernelID *kid, Allocation *); |
| 286 | void (*execute)(const Context *rsc, const ScriptGroup *sg); |
| 287 | void (*destroy)(const Context *rsc, const ScriptGroup *sg); |
| 288 | } scriptgroup; |
| 289 | |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 290 | } RsdHalFunctions; |
| 291 | |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 292 | |
| 293 | } |
| 294 | } |
| 295 | |
Stephen Hines | 414a461 | 2012-09-05 18:05:08 -0700 | [diff] [blame] | 296 | #ifdef __cplusplus |
| 297 | extern "C" { |
| 298 | #endif |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 299 | |
Stephen Hines | 414a461 | 2012-09-05 18:05:08 -0700 | [diff] [blame] | 300 | bool rsdHalInit(RsContext, uint32_t version_major, uint32_t version_minor); |
| 301 | |
| 302 | #ifdef __cplusplus |
| 303 | } |
| 304 | #endif |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 305 | |
| 306 | #endif |
| 307 | |