Merge remote branch 'origin/7.8'
[mesa.git] / src / gallium / drivers / r300 / r300_vs.h
1 /*
2 * Copyright 2009 Corbin Simpson <MostAwesomeDude@gmail.com>
3 * Copyright 2009 Marek Olšák <maraeo@gmail.com>
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * on the rights to use, copy, modify, merge, publish, distribute, sub
9 * license, and/or sell copies of the Software, and to permit persons to whom
10 * the Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
14 * Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
20 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
22 * USE OR OTHER DEALINGS IN THE SOFTWARE. */
23
24 #ifndef R300_VS_H
25 #define R300_VS_H
26
27 #include "pipe/p_state.h"
28 #include "tgsi/tgsi_scan.h"
29 #include "radeon_code.h"
30
31 #include "r300_context.h"
32 #include "r300_shader_semantics.h"
33
34 struct r300_context;
35
36 struct r300_vertex_shader {
37 /* Parent class */
38 struct pipe_shader_state state;
39
40 struct tgsi_shader_info info;
41 struct r300_shader_semantics outputs;
42 struct r300_vap_output_state vap_out;
43
44 /* Whether the shader was replaced by a dummy one due to a shader
45 * compilation failure. */
46 boolean dummy;
47
48 /* Numbers of constants for each type. */
49 unsigned externals_count;
50 unsigned immediates_count;
51
52 /* Stream locations for SWTCL or if TCL is bypassed. */
53 int stream_loc_notcl[16];
54
55 /* Output stream location for WPOS. */
56 int wpos_tex_output;
57
58 /* HWTCL-specific. */
59 /* Machine code (if translated) */
60 struct r300_vertex_program_code code;
61
62 /* SWTCL-specific. */
63 void *draw_vs;
64 };
65
66 void r300_translate_vertex_shader(struct r300_context* r300,
67 struct r300_vertex_shader* vs,
68 const struct tgsi_token *tokens);
69
70 /* Return TRUE if VAP (hwfmt) needs to be re-emitted. */
71 boolean r300_vertex_shader_setup_wpos(struct r300_context* r300);
72
73 #endif /* R300_VS_H */