rsScript.h revision 98e10fd7438f2e925e7fb5c2ec97c1f8cc583634
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#ifndef ANDROID_RS_SCRIPT_H
18#define ANDROID_RS_SCRIPT_H
19
20#include "rsAllocation.h"
21
22
23// ---------------------------------------------------------------------------
24namespace android {
25namespace renderscript {
26
27class ProgramVertex;
28class ProgramFragment;
29class ProgramRaster;
30class ProgramFragmentStore;
31
32class Script : public ObjectBase
33{
34public:
35
36    Script();
37    virtual ~Script();
38
39
40    struct Enviroment_t {
41        bool mIsRoot;
42        float mClearColor[4];
43        float mClearDepth;
44        uint32_t mClearStencil;
45
46        uint32_t mStartTimeMillis;
47        const char* mTimeZone;
48
49        ObjectBaseRef<ProgramVertex> mVertex;
50        ObjectBaseRef<ProgramFragment> mFragment;
51        //ObjectBaseRef<ProgramRaster> mRaster;
52        ObjectBaseRef<ProgramFragmentStore> mFragmentStore;
53
54    };
55    Enviroment_t mEnviroment;
56
57    const Type * mConstantBufferTypes;
58    uint32_t mCounstantBufferCount;
59
60    ObjectBaseRef<Allocation> mSlots[16];
61
62    virtual bool run(Context *, uint32_t launchID) = 0;
63};
64
65
66
67}
68}
69#endif
70
71