blob: c79f445a2359c90212d1353212b957780f73cca0 [file] [log] [blame]
Jason Samsbad80742011-03-16 16:29:28 -07001/*
Stephen Hines2980f072012-04-09 18:26:29 -07002 * Copyright (C) 2011-2012 The Android Open Source Project
Jason Samsbad80742011-03-16 16:29:28 -07003 *
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>
Jason Sams87fe59a2011-04-20 15:09:01 -070021#include <rsRuntime.h>
Jason Samsbad80742011-03-16 16:29:28 -070022
Jason Samsbad80742011-03-16 16:29:28 -070023bool rsdScriptInit(const android::renderscript::Context *, android::renderscript::ScriptC *,
24 char const *resName, char const *cacheDir,
Jason Sams87fe59a2011-04-20 15:09:01 -070025 uint8_t const *bitcode, size_t bitcodeSize, uint32_t flags);
Jason Sams8eaba4f2012-08-14 14:38:05 -070026bool rsdInitIntrinsic(const android::renderscript::Context *rsc,
27 android::renderscript::Script *s,
Stephen Hines41d6c762012-08-21 17:07:38 -070028 RsScriptIntrinsicID iid,
Jason Sams8eaba4f2012-08-14 14:38:05 -070029 android::renderscript::Element *e);
30
Jason Samsbad80742011-03-16 16:29:28 -070031void rsdScriptInvokeFunction(const android::renderscript::Context *dc,
Jason Samscdfdb8f2011-03-17 16:12:47 -070032 android::renderscript::Script *script,
Jason Samsbad80742011-03-16 16:29:28 -070033 uint32_t slot,
34 const void *params,
35 size_t paramLength);
Jason Samscdfdb8f2011-03-17 16:12:47 -070036
37void rsdScriptInvokeForEach(const android::renderscript::Context *rsc,
38 android::renderscript::Script *s,
Jason Sams35e429e2011-07-13 11:26:26 -070039 uint32_t slot,
Jason Samscdfdb8f2011-03-17 16:12:47 -070040 const android::renderscript::Allocation * ain,
41 android::renderscript::Allocation * aout,
42 const void * usr,
Tim Murray099bc262013-03-20 16:54:03 -070043 size_t usrLen,
Jason Samscdfdb8f2011-03-17 16:12:47 -070044 const RsScriptCall *sc);
45
Matt Wala14ce0072015-07-30 17:30:25 -070046void rsdScriptInvokeReduce(const android::renderscript::Context *rsc,
47 android::renderscript::Script *s,
48 uint32_t slot,
David Grossae2ec3f2016-06-01 14:45:47 -070049 const android::renderscript::Allocation ** ains,
50 size_t inLen,
Matt Wala14ce0072015-07-30 17:30:25 -070051 android::renderscript::Allocation *aout,
52 const RsScriptCall *sc);
53
Chris Wailes4b3c34e2014-06-11 12:00:29 -070054void 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
Jason Samsbad80742011-03-16 16:29:28 -070064int rsdScriptInvokeRoot(const android::renderscript::Context *dc,
Jason Samscdfdb8f2011-03-17 16:12:47 -070065 android::renderscript::Script *script);
Jason Samsbad80742011-03-16 16:29:28 -070066void rsdScriptInvokeInit(const android::renderscript::Context *dc,
Jason Samscdfdb8f2011-03-17 16:12:47 -070067 android::renderscript::Script *script);
Stephen Hines4ee16ff2011-08-31 17:41:39 -070068void rsdScriptInvokeFreeChildren(const android::renderscript::Context *dc,
69 android::renderscript::Script *script);
Jason Samsbad80742011-03-16 16:29:28 -070070
71void rsdScriptSetGlobalVar(const android::renderscript::Context *,
72 const android::renderscript::Script *,
73 uint32_t slot, void *data, size_t dataLen);
Tim Murray9c642392013-04-11 13:29:59 -070074void rsdScriptGetGlobalVar(const android::renderscript::Context *,
75 const android::renderscript::Script *,
76 uint32_t slot, void *data, size_t dataLen);
Stephen Hines2980f072012-04-09 18:26:29 -070077void 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 *,
Stephen Hinesac8d1462014-06-25 00:01:23 -070082 const uint32_t *dims,
Stephen Hines2980f072012-04-09 18:26:29 -070083 size_t dimLength);
Jason Samsbad80742011-03-16 16:29:28 -070084void rsdScriptSetGlobalBind(const android::renderscript::Context *,
85 const android::renderscript::Script *,
Jason Sams807fdc42012-07-25 17:55:39 -070086 uint32_t slot, android::renderscript::Allocation *data);
Jason Samsbad80742011-03-16 16:29:28 -070087void rsdScriptSetGlobalObj(const android::renderscript::Context *,
88 const android::renderscript::Script *,
89 uint32_t slot, android::renderscript::ObjectBase *data);
90
91void rsdScriptSetGlobal(const android::renderscript::Context *dc,
92 const android::renderscript::Script *script,
93 uint32_t slot,
94 void *data,
95 size_t dataLength);
96void rsdScriptGetGlobal(const android::renderscript::Context *dc,
97 const android::renderscript::Script *script,
98 uint32_t slot,
99 void *data,
100 size_t dataLength);
101void rsdScriptDestroy(const android::renderscript::Context *dc,
102 android::renderscript::Script *script);
103
Jason Sams807fdc42012-07-25 17:55:39 -0700104android::renderscript::Allocation * rsdScriptGetAllocationForPointer(
105 const android::renderscript::Context *dc,
106 const android::renderscript::Script *script,
107 const void *);
Jason Samsbad80742011-03-16 16:29:28 -0700108
Jason Samsa36c50a2014-06-17 12:06:06 -0700109void rsdScriptUpdateCachedObject(const android::renderscript::Context *rsc,
110 const android::renderscript::Script *script,
111 android::renderscript::rs_script *obj);
112
113
Jason Samsdbe66d62012-09-17 13:54:41 -0700114
Jason Samsbad80742011-03-16 16:29:28 -0700115#endif