blob: 5b79b90d3b2cf172d5b09d04a9a8e93bc3f81e03 [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_C_H
18#define ANDROID_RS_SCRIPT_C_H
19
20#include "rsScript.h"
21
22#include "RenderScriptEnv.h"
23
Jack Palevich1ef8b802009-05-28 15:53:04 -070024struct ACCscript;
25
Jason Sams326e0dd2009-05-22 14:03:28 -070026// ---------------------------------------------------------------------------
27namespace android {
28namespace renderscript {
29
Jack Palevich1ef8b802009-05-28 15:53:04 -070030
Jason Sams326e0dd2009-05-22 14:03:28 -070031
32class ScriptC : public Script
33{
34public:
35
36 ScriptC();
37 virtual ~ScriptC();
38
Jason Samsefb8de12009-06-08 15:20:31 -070039 struct Program_t {
40 const char * mScriptText;
41 uint32_t mScriptTextLength;
Jason Sams326e0dd2009-05-22 14:03:28 -070042
Jason Samsefb8de12009-06-08 15:20:31 -070043 bool useStateVertex;
44 bool useStateRaster;
45 bool useStateFragment;
46 bool useStateStore;
Jason Sams326e0dd2009-05-22 14:03:28 -070047
Jason Samsefb8de12009-06-08 15:20:31 -070048 rsc_RunScript mScript;
49 };
50
51 struct Enviroment_t {
52 bool mIsRoot;
53 bool mIsOrtho;
54 float mClearColor[4];
55 float mClearDepth;
56 uint32_t mClearStencil;
57 };
58
59 Program_t mProgram;
60 Enviroment_t mEnviroment;
Jason Sams326e0dd2009-05-22 14:03:28 -070061
Jack Palevich1ef8b802009-05-28 15:53:04 -070062 ACCscript* mAccScript;
Jason Sams326e0dd2009-05-22 14:03:28 -070063
Jason Samsefb8de12009-06-08 15:20:31 -070064 virtual bool run(Context *, uint32_t launchID);
Jason Sams326e0dd2009-05-22 14:03:28 -070065
66 struct Env {
67 Context *mContext;
68 ScriptC *mScript;
69 };
70
71};
72
Jack Palevich1ef8b802009-05-28 15:53:04 -070073class ScriptCState
Jason Sams326e0dd2009-05-22 14:03:28 -070074{
75public:
76 ScriptCState();
77 ~ScriptCState();
78
Jason Sams1f526332009-06-05 17:35:09 -070079 ACCscript* mAccScript;
Jason Samsefb8de12009-06-08 15:20:31 -070080
81 ScriptC::Program_t mProgram;
82 ScriptC::Enviroment_t mEnviroment;
Jason Sams326e0dd2009-05-22 14:03:28 -070083
84 Vector<const Type *> mConstantBufferTypes;
85
86 void clear();
Jason Sams1f526332009-06-05 17:35:09 -070087 void runCompiler();
Jason Sams326e0dd2009-05-22 14:03:28 -070088};
89
90
91}
92}
93#endif
94
95
96