blob: 60f83a63c6964f7e25fc2fdb24cd6f444d6ded8d [file] [log] [blame]
Jason Sams326e0dd2009-05-22 14:03:28 -07001/*
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
Jason Samsa0a1b6f2009-06-10 15:04:38 -070022
Jason Sams326e0dd2009-05-22 14:03:28 -070023// ---------------------------------------------------------------------------
24namespace android {
25namespace renderscript {
26
Jason Samsa0a1b6f2009-06-10 15:04:38 -070027class ProgramVertex;
28class ProgramFragment;
29class ProgramRaster;
30class ProgramFragmentStore;
Jason Sams326e0dd2009-05-22 14:03:28 -070031
Jason Sams8b2c0652009-08-12 17:54:11 -070032#define MAX_SCRIPT_BANKS 16
33
Jason Sams326e0dd2009-05-22 14:03:28 -070034class Script : public ObjectBase
35{
36public:
37
38 Script();
39 virtual ~Script();
40
41
Jason Sams928b7342009-06-08 18:50:13 -070042 struct Enviroment_t {
43 bool mIsRoot;
Jason Sams928b7342009-06-08 18:50:13 -070044 float mClearColor[4];
45 float mClearDepth;
46 uint32_t mClearStencil;
Jason Sams326e0dd2009-05-22 14:03:28 -070047
Romain Guy98e10fd2009-07-30 18:45:01 -070048 uint32_t mStartTimeMillis;
49 const char* mTimeZone;
50
Jason Samsa0a1b6f2009-06-10 15:04:38 -070051 ObjectBaseRef<ProgramVertex> mVertex;
52 ObjectBaseRef<ProgramFragment> mFragment;
53 //ObjectBaseRef<ProgramRaster> mRaster;
54 ObjectBaseRef<ProgramFragmentStore> mFragmentStore;
Jason Sams10308932009-06-09 12:15:30 -070055
Jason Sams928b7342009-06-08 18:50:13 -070056 };
57 Enviroment_t mEnviroment;
Jason Sams326e0dd2009-05-22 14:03:28 -070058
Jason Sams326e0dd2009-05-22 14:03:28 -070059 uint32_t mCounstantBufferCount;
60
Jason Sams8b2c0652009-08-12 17:54:11 -070061 ObjectBaseRef<Allocation> mSlots[MAX_SCRIPT_BANKS];
Jason Samsfa517192009-08-13 12:59:04 -070062 ObjectBaseRef<const Type> mTypes[MAX_SCRIPT_BANKS];
63 String8 mSlotNames[MAX_SCRIPT_BANKS];
Jason Sams90b36a82009-08-17 13:56:09 -070064 bool mSlotWritable[MAX_SCRIPT_BANKS];
Jason Sams326e0dd2009-05-22 14:03:28 -070065
Jason Samsa44cb292009-06-04 17:58:03 -070066 virtual bool run(Context *, uint32_t launchID) = 0;
Jason Sams326e0dd2009-05-22 14:03:28 -070067};
68
69
70
71}
72}
73#endif
74