2 * Copyright (C) 2008-2009 Advanced Micro Devices, Inc.
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:
11 * The above copyright notice and this permission notice shall be included
12 * in all copies or substantial portions of the Software.
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.
24 * Richard Li <RichardZ.Li@amd.com>, <richardradeon@gmail.com>
28 #ifndef _R700_VERTPROG_H_
29 #define _R700_VERTPROG_H_
31 #include "main/glheader.h"
32 #include "main/mtypes.h"
34 #include "r700_shader.h"
35 #include "r700_assembler.h"
37 typedef struct ArrayDesc
//TEMP
39 GLint size
; //number of data element
40 GLenum type
; //data element type
42 GLenum format
; //GL_RGBA or GL_BGRA
45 struct r700_vertex_program
47 struct gl_vertex_program
*mesa_program
; /* Must be first */
49 struct r700_vertex_program
*next
;
51 r700_AssemblerBase r700AsmCode
;
52 R700_Shader r700Shader
;
62 ArrayDesc aos_desc
[VERT_ATTRIB_MAX
];
65 struct r700_vertex_program_cont
67 struct gl_vertex_program mesa_program
;
69 struct r700_vertex_program
*progs
;
73 unsigned int Map_Vertex_Output(r700_AssemblerBase
*pAsm
,
74 struct gl_vertex_program
*mesa_vp
,
75 unsigned int unStart
);
76 unsigned int Map_Vertex_Input(r700_AssemblerBase
*pAsm
,
77 struct gl_vertex_program
*mesa_vp
,
78 unsigned int unStart
);
79 GLboolean
Process_Vertex_Program_Vfetch_Instructions(
80 struct r700_vertex_program
*vp
,
81 struct gl_vertex_program
*mesa_vp
);
82 GLboolean
Process_Vertex_Program_Vfetch_Instructions2(
83 struct gl_context
*ctx
,
84 struct r700_vertex_program
*vp
,
85 struct gl_vertex_program
*mesa_vp
);
86 void Map_Vertex_Program(struct gl_context
*ctx
,
87 struct r700_vertex_program
*vp
,
88 struct gl_vertex_program
*mesa_vp
);
89 GLboolean
Find_Instruction_Dependencies_vp(struct r700_vertex_program
*vp
,
90 struct gl_vertex_program
*mesa_vp
);
92 struct r700_vertex_program
* r700TranslateVertexShader(struct gl_context
*ctx
,
93 struct gl_vertex_program
*mesa_vp
);
96 extern void r700SelectVertexShader(struct gl_context
*ctx
);
97 extern void r700SetVertexFormat(struct gl_context
*ctx
, const struct gl_client_array
*arrays
[], int count
);
99 extern GLboolean
r700SetupVertexProgram(struct gl_context
* ctx
);
101 extern void * r700GetActiveVpShaderBo(struct gl_context
* ctx
);
103 extern void * r700GetActiveVpShaderConstBo(struct gl_context
* ctx
);
105 extern int getTypeSize(GLenum type
);
107 #endif /* _R700_VERTPROG_H_ */