blob: d32f116a7f85d2d66726c245cb87f5e1c31c7e10 [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
32class Script : public ObjectBase
33{
34public:
35
36 Script();
37 virtual ~Script();
38
39
Jason Sams928b7342009-06-08 18:50:13 -070040 struct Enviroment_t {
41 bool mIsRoot;
42 bool mIsOrtho;
43 float mClearColor[4];
44 float mClearDepth;
45 uint32_t mClearStencil;
Jason Sams326e0dd2009-05-22 14:03:28 -070046
Jason Samsa0a1b6f2009-06-10 15:04:38 -070047 ObjectBaseRef<ProgramVertex> mVertex;
48 ObjectBaseRef<ProgramFragment> mFragment;
49 //ObjectBaseRef<ProgramRaster> mRaster;
50 ObjectBaseRef<ProgramFragmentStore> mFragmentStore;
Jason Sams10308932009-06-09 12:15:30 -070051
Jason Sams928b7342009-06-08 18:50:13 -070052 };
53 Enviroment_t mEnviroment;
Jason Sams326e0dd2009-05-22 14:03:28 -070054
55 const Type * mConstantBufferTypes;
56 uint32_t mCounstantBufferCount;
57
58 ObjectBaseRef<Allocation> mSlots[16];
59
Jason Samsa44cb292009-06-04 17:58:03 -070060 virtual bool run(Context *, uint32_t launchID) = 0;
Jason Sams326e0dd2009-05-22 14:03:28 -070061};
62
63
64
65}
66}
67#endif
68