Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2009 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 | #include "rsDevice.h" |
| 18 | #include "rsContext.h" |
| 19 | #include "rsThreadIO.h" |
Jason Sams | a4a54e4 | 2009-06-10 18:39:40 -0700 | [diff] [blame] | 20 | #include "utils/String8.h" |
Mathias Agopian | 5ae678f | 2009-06-22 18:01:09 -0700 | [diff] [blame] | 21 | #include <ui/FramebufferNativeWindow.h> |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 22 | |
Jason Sams | 1aa5a4e | 2009-06-22 17:15:15 -0700 | [diff] [blame] | 23 | #include <GLES/gl.h> |
| 24 | #include <GLES/glext.h> |
| 25 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 26 | using namespace android; |
| 27 | using namespace android::renderscript; |
| 28 | |
| 29 | Context * Context::gCon = NULL; |
Jason Sams | e576910 | 2009-06-19 16:03:18 -0700 | [diff] [blame] | 30 | pthread_key_t Context::gThreadTLSKey = 0; |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 31 | |
| 32 | void Context::initEGL() |
| 33 | { |
| 34 | mNumConfigs = -1; |
| 35 | |
| 36 | EGLint s_configAttribs[] = { |
| 37 | EGL_SURFACE_TYPE, EGL_WINDOW_BIT, |
Jason Sams | b80dfa7 | 2009-07-10 17:32:40 -0700 | [diff] [blame^] | 38 | #if 1 |
| 39 | EGL_RED_SIZE, 8, |
| 40 | EGL_GREEN_SIZE, 8, |
| 41 | EGL_BLUE_SIZE, 8, |
| 42 | EGL_ALPHA_SIZE, 8, |
| 43 | #else |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 44 | EGL_RED_SIZE, 5, |
| 45 | EGL_GREEN_SIZE, 6, |
| 46 | EGL_BLUE_SIZE, 5, |
Jason Sams | b80dfa7 | 2009-07-10 17:32:40 -0700 | [diff] [blame^] | 47 | #endif |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 48 | EGL_DEPTH_SIZE, 16, |
| 49 | EGL_NONE |
| 50 | }; |
| 51 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 52 | mDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 53 | eglInitialize(mDisplay, &mMajorVersion, &mMinorVersion); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 54 | eglChooseConfig(mDisplay, s_configAttribs, &mConfig, 1, &mNumConfigs); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 55 | |
| 56 | if (mWndSurface) { |
Mathias Agopian | 5ae678f | 2009-06-22 18:01:09 -0700 | [diff] [blame] | 57 | mSurface = eglCreateWindowSurface(mDisplay, mConfig, mWndSurface, |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 58 | NULL); |
| 59 | } else { |
| 60 | mSurface = eglCreateWindowSurface(mDisplay, mConfig, |
| 61 | android_createDisplaySurface(), |
| 62 | NULL); |
| 63 | } |
| 64 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 65 | mContext = eglCreateContext(mDisplay, mConfig, NULL, NULL); |
Jason Sams | a44cb29 | 2009-06-04 17:58:03 -0700 | [diff] [blame] | 66 | eglMakeCurrent(mDisplay, mSurface, mSurface, mContext); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 67 | eglQuerySurface(mDisplay, mSurface, EGL_WIDTH, &mWidth); |
| 68 | eglQuerySurface(mDisplay, mSurface, EGL_HEIGHT, &mHeight); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 69 | } |
| 70 | |
Jason Sams | a0a1b6f | 2009-06-10 15:04:38 -0700 | [diff] [blame] | 71 | bool Context::runScript(Script *s, uint32_t launchID) |
Jason Sams | 1030893 | 2009-06-09 12:15:30 -0700 | [diff] [blame] | 72 | { |
| 73 | ObjectBaseRef<ProgramFragment> frag(mFragment); |
| 74 | ObjectBaseRef<ProgramVertex> vtx(mVertex); |
| 75 | ObjectBaseRef<ProgramFragmentStore> store(mFragmentStore); |
| 76 | |
Jason Sams | a0a1b6f | 2009-06-10 15:04:38 -0700 | [diff] [blame] | 77 | bool ret = s->run(this, launchID); |
Jason Sams | 1030893 | 2009-06-09 12:15:30 -0700 | [diff] [blame] | 78 | |
Jason Sams | a0a1b6f | 2009-06-10 15:04:38 -0700 | [diff] [blame] | 79 | mFragment.set(frag); |
| 80 | mVertex.set(vtx); |
| 81 | mFragmentStore.set(store); |
Jason Sams | 1030893 | 2009-06-09 12:15:30 -0700 | [diff] [blame] | 82 | return true; |
| 83 | |
| 84 | } |
| 85 | |
| 86 | |
Jason Sams | a44cb29 | 2009-06-04 17:58:03 -0700 | [diff] [blame] | 87 | bool Context::runRootScript() |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 88 | { |
Jason Sams | 1030893 | 2009-06-09 12:15:30 -0700 | [diff] [blame] | 89 | rsAssert(mRootScript->mEnviroment.mIsRoot); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 90 | |
Jason Sams | a44cb29 | 2009-06-04 17:58:03 -0700 | [diff] [blame] | 91 | glColor4f(1,1,1,1); |
| 92 | glEnable(GL_LIGHT0); |
Jason Sams | 1030893 | 2009-06-09 12:15:30 -0700 | [diff] [blame] | 93 | glViewport(0, 0, mWidth, mHeight); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 94 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 95 | glDepthMask(GL_TRUE); |
| 96 | glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); |
| 97 | |
Jason Sams | 928b734 | 2009-06-08 18:50:13 -0700 | [diff] [blame] | 98 | glClearColor(mRootScript->mEnviroment.mClearColor[0], |
| 99 | mRootScript->mEnviroment.mClearColor[1], |
| 100 | mRootScript->mEnviroment.mClearColor[2], |
| 101 | mRootScript->mEnviroment.mClearColor[3]); |
| 102 | glClearDepthf(mRootScript->mEnviroment.mClearDepth); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 103 | glClear(GL_COLOR_BUFFER_BIT); |
| 104 | glClear(GL_DEPTH_BUFFER_BIT); |
| 105 | |
Jason Sams | a0a1b6f | 2009-06-10 15:04:38 -0700 | [diff] [blame] | 106 | return runScript(mRootScript.get(), 0); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 107 | } |
| 108 | |
| 109 | void Context::setupCheck() |
| 110 | { |
| 111 | if (mFragmentStore.get()) { |
| 112 | mFragmentStore->setupGL(); |
| 113 | } |
| 114 | if (mFragment.get()) { |
| 115 | mFragment->setupGL(); |
| 116 | } |
| 117 | if (mVertex.get()) { |
| 118 | mVertex->setupGL(); |
| 119 | } |
| 120 | |
| 121 | } |
| 122 | |
| 123 | |
| 124 | void * Context::threadProc(void *vrsc) |
| 125 | { |
| 126 | Context *rsc = static_cast<Context *>(vrsc); |
| 127 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 128 | gIO = new ThreadIO(); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 129 | rsc->initEGL(); |
Jason Sams | 8ce125b | 2009-06-17 16:52:59 -0700 | [diff] [blame] | 130 | |
Jason Sams | e576910 | 2009-06-19 16:03:18 -0700 | [diff] [blame] | 131 | ScriptTLSStruct *tlsStruct = new ScriptTLSStruct; |
| 132 | if (!tlsStruct) { |
| 133 | LOGE("Error allocating tls storage"); |
| 134 | return NULL; |
| 135 | } |
| 136 | tlsStruct->mContext = rsc; |
| 137 | tlsStruct->mScript = NULL; |
| 138 | int status = pthread_setspecific(rsc->gThreadTLSKey, tlsStruct); |
| 139 | if (status) { |
| 140 | LOGE("pthread_setspecific %i", status); |
| 141 | } |
| 142 | |
Jason Sams | 8ce125b | 2009-06-17 16:52:59 -0700 | [diff] [blame] | 143 | rsc->mStateVertex.init(rsc, rsc->mWidth, rsc->mHeight); |
| 144 | rsc->setVertex(NULL); |
| 145 | rsc->mStateFragment.init(rsc, rsc->mWidth, rsc->mHeight); |
| 146 | rsc->setFragment(NULL); |
| 147 | rsc->mStateFragmentStore.init(rsc, rsc->mWidth, rsc->mHeight); |
| 148 | rsc->setFragmentStore(NULL); |
| 149 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 150 | rsc->mRunning = true; |
Jason Sams | a44cb29 | 2009-06-04 17:58:03 -0700 | [diff] [blame] | 151 | bool mDraw = true; |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 152 | while (!rsc->mExit) { |
Jason Sams | 732f1c0 | 2009-06-18 16:58:42 -0700 | [diff] [blame] | 153 | mDraw |= gIO->playCoreCommands(rsc, !mDraw); |
| 154 | mDraw &= (rsc->mRootScript.get() != NULL); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 155 | |
Jason Sams | 732f1c0 | 2009-06-18 16:58:42 -0700 | [diff] [blame] | 156 | if (mDraw) { |
Jason Sams | a44cb29 | 2009-06-04 17:58:03 -0700 | [diff] [blame] | 157 | mDraw = rsc->runRootScript(); |
| 158 | eglSwapBuffers(rsc->mDisplay, rsc->mSurface); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 159 | } |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 160 | } |
| 161 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 162 | glClearColor(0,0,0,0); |
| 163 | glClear(GL_COLOR_BUFFER_BIT); |
| 164 | eglSwapBuffers(rsc->mDisplay, rsc->mSurface); |
| 165 | eglTerminate(rsc->mDisplay); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 166 | return NULL; |
| 167 | } |
| 168 | |
| 169 | Context::Context(Device *dev, Surface *sur) |
| 170 | { |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 171 | dev->addContext(this); |
| 172 | mDev = dev; |
| 173 | mRunning = false; |
| 174 | mExit = false; |
| 175 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 176 | // see comment in header |
| 177 | gCon = this; |
| 178 | |
Jason Sams | a658e90 | 2009-06-04 14:35:01 -0700 | [diff] [blame] | 179 | int status; |
| 180 | pthread_attr_t threadAttr; |
| 181 | |
Jason Sams | e576910 | 2009-06-19 16:03:18 -0700 | [diff] [blame] | 182 | status = pthread_key_create(&gThreadTLSKey, NULL); |
| 183 | if (status) { |
| 184 | LOGE("Failed to init thread tls key."); |
| 185 | return; |
| 186 | } |
| 187 | |
Jason Sams | a658e90 | 2009-06-04 14:35:01 -0700 | [diff] [blame] | 188 | status = pthread_attr_init(&threadAttr); |
| 189 | if (status) { |
| 190 | LOGE("Failed to init thread attribute."); |
| 191 | return; |
| 192 | } |
| 193 | |
| 194 | sched_param sparam; |
| 195 | sparam.sched_priority = ANDROID_PRIORITY_DISPLAY; |
| 196 | pthread_attr_setschedparam(&threadAttr, &sparam); |
| 197 | |
Jason Sams | 992a0b7 | 2009-06-23 12:22:47 -0700 | [diff] [blame] | 198 | mWndSurface = sur; |
| 199 | |
| 200 | LOGV("RS Launching thread"); |
Jason Sams | a658e90 | 2009-06-04 14:35:01 -0700 | [diff] [blame] | 201 | status = pthread_create(&mThreadId, &threadAttr, threadProc, this); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 202 | if (status) { |
| 203 | LOGE("Failed to start rs context thread."); |
| 204 | } |
| 205 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 206 | while(!mRunning) { |
| 207 | sleep(1); |
| 208 | } |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 209 | |
Jason Sams | a658e90 | 2009-06-04 14:35:01 -0700 | [diff] [blame] | 210 | pthread_attr_destroy(&threadAttr); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 211 | } |
| 212 | |
| 213 | Context::~Context() |
| 214 | { |
| 215 | mExit = true; |
| 216 | void *res; |
| 217 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 218 | int status = pthread_join(mThreadId, &res); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 219 | |
| 220 | if (mDev) { |
| 221 | mDev->removeContext(this); |
Jason Sams | e576910 | 2009-06-19 16:03:18 -0700 | [diff] [blame] | 222 | pthread_key_delete(gThreadTLSKey); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 223 | } |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 224 | } |
| 225 | |
| 226 | void Context::swapBuffers() |
| 227 | { |
| 228 | eglSwapBuffers(mDisplay, mSurface); |
| 229 | } |
| 230 | |
| 231 | void rsContextSwap(RsContext vrsc) |
| 232 | { |
| 233 | Context *rsc = static_cast<Context *>(vrsc); |
| 234 | rsc->swapBuffers(); |
| 235 | } |
| 236 | |
| 237 | void Context::setRootScript(Script *s) |
| 238 | { |
| 239 | mRootScript.set(s); |
| 240 | } |
| 241 | |
| 242 | void Context::setFragmentStore(ProgramFragmentStore *pfs) |
| 243 | { |
Jason Sams | 8ce125b | 2009-06-17 16:52:59 -0700 | [diff] [blame] | 244 | if (pfs == NULL) { |
| 245 | mFragmentStore.set(mStateFragmentStore.mDefault); |
| 246 | } else { |
| 247 | mFragmentStore.set(pfs); |
| 248 | } |
| 249 | mFragmentStore->setupGL(); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 250 | } |
| 251 | |
| 252 | void Context::setFragment(ProgramFragment *pf) |
| 253 | { |
Jason Sams | 8ce125b | 2009-06-17 16:52:59 -0700 | [diff] [blame] | 254 | if (pf == NULL) { |
| 255 | mFragment.set(mStateFragment.mDefault); |
| 256 | } else { |
| 257 | mFragment.set(pf); |
| 258 | } |
| 259 | mFragment->setupGL(); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 260 | } |
| 261 | |
| 262 | void Context::setVertex(ProgramVertex *pv) |
| 263 | { |
Jason Sams | 8ce125b | 2009-06-17 16:52:59 -0700 | [diff] [blame] | 264 | if (pv == NULL) { |
| 265 | mVertex.set(mStateVertex.mDefault); |
| 266 | } else { |
| 267 | mVertex.set(pv); |
| 268 | } |
| 269 | mVertex->setupGL(); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 270 | } |
| 271 | |
Jason Sams | a4a54e4 | 2009-06-10 18:39:40 -0700 | [diff] [blame] | 272 | void Context::assignName(ObjectBase *obj, const char *name, uint32_t len) |
Jason Sams | a0a1b6f | 2009-06-10 15:04:38 -0700 | [diff] [blame] | 273 | { |
| 274 | rsAssert(!obj->getName()); |
Jason Sams | a4a54e4 | 2009-06-10 18:39:40 -0700 | [diff] [blame] | 275 | obj->setName(name, len); |
Jason Sams | a0a1b6f | 2009-06-10 15:04:38 -0700 | [diff] [blame] | 276 | mNames.add(obj); |
| 277 | } |
| 278 | |
| 279 | void Context::removeName(ObjectBase *obj) |
| 280 | { |
| 281 | for(size_t ct=0; ct < mNames.size(); ct++) { |
| 282 | if (obj == mNames[ct]) { |
| 283 | mNames.removeAt(ct); |
| 284 | return; |
| 285 | } |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | ObjectBase * Context::lookupName(const char *name) const |
| 290 | { |
| 291 | for(size_t ct=0; ct < mNames.size(); ct++) { |
| 292 | if (!strcmp(name, mNames[ct]->getName())) { |
| 293 | return mNames[ct]; |
| 294 | } |
| 295 | } |
| 296 | return NULL; |
| 297 | } |
| 298 | |
Jason Sams | a4a54e4 | 2009-06-10 18:39:40 -0700 | [diff] [blame] | 299 | void Context::appendNameDefines(String8 *str) const |
| 300 | { |
| 301 | char buf[256]; |
| 302 | for (size_t ct=0; ct < mNames.size(); ct++) { |
| 303 | str->append("#define NAMED_"); |
| 304 | str->append(mNames[ct]->getName()); |
| 305 | str->append(" "); |
| 306 | sprintf(buf, "%i\n", (int)mNames[ct]); |
| 307 | str->append(buf); |
| 308 | } |
| 309 | } |
| 310 | |
| 311 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 312 | /////////////////////////////////////////////////////////////////////////////////////////// |
Jason Sams | a44cb29 | 2009-06-04 17:58:03 -0700 | [diff] [blame] | 313 | // |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 314 | |
| 315 | namespace android { |
| 316 | namespace renderscript { |
| 317 | |
| 318 | |
| 319 | void rsi_ContextBindRootScript(Context *rsc, RsScript vs) |
| 320 | { |
| 321 | Script *s = static_cast<Script *>(vs); |
| 322 | rsc->setRootScript(s); |
| 323 | } |
| 324 | |
| 325 | void rsi_ContextBindSampler(Context *rsc, uint32_t slot, RsSampler vs) |
| 326 | { |
| 327 | Sampler *s = static_cast<Sampler *>(vs); |
| 328 | |
| 329 | if (slot > RS_MAX_SAMPLER_SLOT) { |
| 330 | LOGE("Invalid sampler slot"); |
| 331 | return; |
| 332 | } |
| 333 | |
| 334 | s->bindToContext(&rsc->mStateSampler, slot); |
| 335 | } |
| 336 | |
| 337 | void rsi_ContextBindProgramFragmentStore(Context *rsc, RsProgramFragmentStore vpfs) |
| 338 | { |
| 339 | ProgramFragmentStore *pfs = static_cast<ProgramFragmentStore *>(vpfs); |
| 340 | rsc->setFragmentStore(pfs); |
| 341 | } |
| 342 | |
| 343 | void rsi_ContextBindProgramFragment(Context *rsc, RsProgramFragment vpf) |
| 344 | { |
| 345 | ProgramFragment *pf = static_cast<ProgramFragment *>(vpf); |
| 346 | rsc->setFragment(pf); |
| 347 | } |
| 348 | |
| 349 | void rsi_ContextBindProgramVertex(Context *rsc, RsProgramVertex vpv) |
| 350 | { |
| 351 | ProgramVertex *pv = static_cast<ProgramVertex *>(vpv); |
| 352 | rsc->setVertex(pv); |
| 353 | } |
| 354 | |
Jason Sams | a4a54e4 | 2009-06-10 18:39:40 -0700 | [diff] [blame] | 355 | void rsi_AssignName(Context *rsc, void * obj, const char *name, uint32_t len) |
Jason Sams | a0a1b6f | 2009-06-10 15:04:38 -0700 | [diff] [blame] | 356 | { |
| 357 | ObjectBase *ob = static_cast<ObjectBase *>(obj); |
Jason Sams | a4a54e4 | 2009-06-10 18:39:40 -0700 | [diff] [blame] | 358 | rsc->assignName(ob, name, len); |
Jason Sams | a0a1b6f | 2009-06-10 15:04:38 -0700 | [diff] [blame] | 359 | } |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 360 | |
| 361 | |
| 362 | } |
| 363 | } |
| 364 | |
| 365 | |
| 366 | RsContext rsContextCreate(RsDevice vdev, void *sur, uint32_t version) |
| 367 | { |
| 368 | Device * dev = static_cast<Device *>(vdev); |
| 369 | Context *rsc = new Context(dev, (Surface *)sur); |
| 370 | return rsc; |
| 371 | } |
| 372 | |
| 373 | void rsContextDestroy(RsContext vrsc) |
| 374 | { |
| 375 | Context * rsc = static_cast<Context *>(vrsc); |
| 376 | delete rsc; |
| 377 | } |
| 378 | |