Home | History | Annotate | Download | only in driver
      1 /*
      2  * Copyright (C) 2011-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 RSD_BCC_H
     18 #define RSD_BCC_H
     19 
     20 #include <rs_hal.h>
     21 #include <rsRuntime.h>
     22 
     23 bool rsdScriptInit(const android::renderscript::Context *, android::renderscript::ScriptC *,
     24                    char const *resName, char const *cacheDir,
     25                    uint8_t const *bitcode, size_t bitcodeSize, uint32_t flags);
     26 bool rsdInitIntrinsic(const android::renderscript::Context *rsc,
     27                       android::renderscript::Script *s,
     28                       RsScriptIntrinsicID iid,
     29                       android::renderscript::Element *e);
     30 
     31 void rsdScriptInvokeFunction(const android::renderscript::Context *dc,
     32                              android::renderscript::Script *script,
     33                              uint32_t slot,
     34                              const void *params,
     35                              size_t paramLength);
     36 
     37 void rsdScriptInvokeForEach(const android::renderscript::Context *rsc,
     38                             android::renderscript::Script *s,
     39                             uint32_t slot,
     40                             const android::renderscript::Allocation * ain,
     41                             android::renderscript::Allocation * aout,
     42                             const void * usr,
     43                             size_t usrLen,
     44                             const RsScriptCall *sc);
     45 
     46 void rsdScriptInvokeReduce(const android::renderscript::Context *rsc,
     47                            android::renderscript::Script *s,
     48                            uint32_t slot,
     49                            const android::renderscript::Allocation ** ains,
     50                            size_t inLen,
     51                            android::renderscript::Allocation *aout,
     52                            const RsScriptCall *sc);
     53 
     54 void rsdScriptInvokeForEachMulti(const android::renderscript::Context *rsc,
     55                                  android::renderscript::Script *s,
     56                                  uint32_t slot,
     57                                  const android::renderscript::Allocation ** ains,
     58                                  size_t inLen,
     59                                  android::renderscript::Allocation * aout,
     60                                  const void * usr,
     61                                  size_t usrLen,
     62                                  const RsScriptCall *sc);
     63 
     64 int rsdScriptInvokeRoot(const android::renderscript::Context *dc,
     65                         android::renderscript::Script *script);
     66 void rsdScriptInvokeInit(const android::renderscript::Context *dc,
     67                          android::renderscript::Script *script);
     68 void rsdScriptInvokeFreeChildren(const android::renderscript::Context *dc,
     69                                  android::renderscript::Script *script);
     70 
     71 void rsdScriptSetGlobalVar(const android::renderscript::Context *,
     72                            const android::renderscript::Script *,
     73                            uint32_t slot, void *data, size_t dataLen);
     74 void rsdScriptGetGlobalVar(const android::renderscript::Context *,
     75                            const android::renderscript::Script *,
     76                            uint32_t slot, void *data, size_t dataLen);
     77 void rsdScriptSetGlobalVarWithElemDims(const android::renderscript::Context *,
     78                                        const android::renderscript::Script *,
     79                                        uint32_t slot, void *data,
     80                                        size_t dataLength,
     81                                        const android::renderscript::Element *,
     82                                        const uint32_t *dims,
     83                                        size_t dimLength);
     84 void rsdScriptSetGlobalBind(const android::renderscript::Context *,
     85                             const android::renderscript::Script *,
     86                             uint32_t slot, android::renderscript::Allocation *data);
     87 void rsdScriptSetGlobalObj(const android::renderscript::Context *,
     88                            const android::renderscript::Script *,
     89                            uint32_t slot, android::renderscript::ObjectBase *data);
     90 
     91 void rsdScriptSetGlobal(const android::renderscript::Context *dc,
     92                         const android::renderscript::Script *script,
     93                         uint32_t slot,
     94                         void *data,
     95                         size_t dataLength);
     96 void rsdScriptGetGlobal(const android::renderscript::Context *dc,
     97                         const android::renderscript::Script *script,
     98                         uint32_t slot,
     99                         void *data,
    100                         size_t dataLength);
    101 void rsdScriptDestroy(const android::renderscript::Context *dc,
    102                       android::renderscript::Script *script);
    103 
    104 android::renderscript::Allocation * rsdScriptGetAllocationForPointer(
    105                         const android::renderscript::Context *dc,
    106                         const android::renderscript::Script *script,
    107                         const void *);
    108 
    109 void rsdScriptUpdateCachedObject(const android::renderscript::Context *rsc,
    110                                  const android::renderscript::Script *script,
    111                                  android::renderscript::rs_script *obj);
    112 
    113 
    114 
    115 #endif
    116