• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 int rsdScriptInvokeRoot(const android::renderscript::Context *dc,
47                         android::renderscript::Script *script);
48 void rsdScriptInvokeInit(const android::renderscript::Context *dc,
49                          android::renderscript::Script *script);
50 void rsdScriptInvokeFreeChildren(const android::renderscript::Context *dc,
51                                  android::renderscript::Script *script);
52 
53 void rsdScriptSetGlobalVar(const android::renderscript::Context *,
54                            const android::renderscript::Script *,
55                            uint32_t slot, void *data, size_t dataLen);
56 void rsdScriptGetGlobalVar(const android::renderscript::Context *,
57                            const android::renderscript::Script *,
58                            uint32_t slot, void *data, size_t dataLen);
59 void rsdScriptSetGlobalVarWithElemDims(const android::renderscript::Context *,
60                                        const android::renderscript::Script *,
61                                        uint32_t slot, void *data,
62                                        size_t dataLength,
63                                        const android::renderscript::Element *,
64                                        const size_t *dims,
65                                        size_t dimLength);
66 void rsdScriptSetGlobalBind(const android::renderscript::Context *,
67                             const android::renderscript::Script *,
68                             uint32_t slot, android::renderscript::Allocation *data);
69 void rsdScriptSetGlobalObj(const android::renderscript::Context *,
70                            const android::renderscript::Script *,
71                            uint32_t slot, android::renderscript::ObjectBase *data);
72 
73 void rsdScriptSetGlobal(const android::renderscript::Context *dc,
74                         const android::renderscript::Script *script,
75                         uint32_t slot,
76                         void *data,
77                         size_t dataLength);
78 void rsdScriptGetGlobal(const android::renderscript::Context *dc,
79                         const android::renderscript::Script *script,
80                         uint32_t slot,
81                         void *data,
82                         size_t dataLength);
83 void rsdScriptDestroy(const android::renderscript::Context *dc,
84                       android::renderscript::Script *script);
85 
86 android::renderscript::Allocation * rsdScriptGetAllocationForPointer(
87                         const android::renderscript::Context *dc,
88                         const android::renderscript::Script *script,
89                         const void *);
90 
91 
92 #endif
93