Merge branch 'mesa_7_5_branch'
[mesa.git] / src / mesa / drivers / dri / r600 / r700_vertprog.h
1 /*
2 * Copyright (C) 2008-2009 Advanced Micro Devices, Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included
12 * in all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 */
21
22 /*
23 * Authors:
24 * Richard Li <RichardZ.Li@amd.com>, <richardradeon@gmail.com>
25 */
26
27
28 #ifndef _R700_VERTPROG_H_
29 #define _R700_VERTPROG_H_
30
31 #include "main/glheader.h"
32 #include "main/mtypes.h"
33
34 #include "r700_shader.h"
35 #include "r700_assembler.h"
36
37 typedef struct ArrayDesc //TEMP
38 {
39 GLint size; //number of data element
40 GLenum type; //data element type
41 GLsizei stride;
42 } ArrayDesc;
43
44 struct r700_vertex_program
45 {
46 struct gl_vertex_program mesa_program; /* Must be first */
47
48 struct r700_vertex_program *next;
49
50 r700_AssemblerBase r700AsmCode;
51 R700_Shader r700Shader;
52
53 GLboolean translated;
54 GLboolean loaded;
55
56 /* ... */
57
58 void * shaderbo;
59
60 ArrayDesc aos_desc[VERT_ATTRIB_MAX];
61 };
62
63 //Internal
64 unsigned int Map_Vertex_Output(r700_AssemblerBase *pAsm,
65 struct gl_vertex_program *mesa_vp,
66 unsigned int unStart);
67 unsigned int Map_Vertex_Input(r700_AssemblerBase *pAsm,
68 struct gl_vertex_program *mesa_vp,
69 unsigned int unStart);
70 GLboolean Process_Vertex_Program_Vfetch_Instructions(
71 struct r700_vertex_program *vp,
72 struct gl_vertex_program *mesa_vp);
73 void Map_Vertex_Program(struct r700_vertex_program *vp,
74 struct gl_vertex_program *mesa_vp);
75 GLboolean Find_Instruction_Dependencies_vp(struct r700_vertex_program *vp,
76 struct gl_vertex_program *mesa_vp);
77
78 /* Interface */
79 extern GLboolean r700TranslateVertexShader(struct r700_vertex_program *vp,
80 struct gl_vertex_program *mesa_vp);
81
82 extern void r700SelectVertexShader(GLcontext *ctx);
83
84 extern GLboolean r700SetupVertexProgram(GLcontext * ctx);
85
86 extern void * r700GetActiveVpShaderBo(GLcontext * ctx);
87
88 #endif /* _R700_VERTPROG_H_ */