2 Copyright (C) Intel Corp. 2006. All Rights Reserved.
3 Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to
4 develop this 3D driver.
6 Permission is hereby granted, free of charge, to any person obtaining
7 a copy of this software and associated documentation files (the
8 "Software"), to deal in the Software without restriction, including
9 without limitation the rights to use, copy, modify, merge, publish,
10 distribute, sublicense, and/or sell copies of the Software, and to
11 permit persons to whom the Software is furnished to do so, subject to
12 the following conditions:
14 The above copyright notice and this permission notice (including the
15 next paragraph) shall be included in all copies or substantial
16 portions of the Software.
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
22 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **********************************************************************/
29 * Keith Whitwell <keith@tungstengraphics.com>
37 #include "brw_context.h"
39 #include "program/program.h"
42 struct brw_vs_prog_key
{
43 GLuint program_string_id
;
45 * Number of channels of the vertex attribute that need GL_FIXED rescaling
47 uint8_t gl_fixed_input_size
[VERT_ATTRIB_MAX
];
50 * True if at least one clip flag is enabled, regardless of whether the
51 * shader uses clip planes or gl_ClipDistance.
53 GLuint userclip_active
:1;
56 * Number of user clip planes active. Zero if the shader uses
59 GLuint nr_userclip_planes
:4;
62 * True if the shader uses gl_ClipDistance, regardless of whether any clip
65 GLuint uses_clip_distance
:1;
68 * Which user clip planes are active. Zero if the shader uses
71 GLuint userclip_planes_enabled
:MAX_CLIP_PLANES
;
73 GLuint copy_edgeflag
:1;
74 GLuint point_coord_replace
:8;
75 GLuint clamp_vertex_color
:1;
79 struct brw_vs_compile
{
80 struct brw_compile func
;
81 struct brw_vs_prog_key key
;
82 struct brw_vs_prog_data prog_data
;
83 int8_t constant_map
[1024];
85 struct brw_vertex_program
*vp
;
89 struct brw_vue_map vue_map
;
98 struct brw_reg regs
[PROGRAM_ADDRESS
+1][128];
100 struct brw_reg stack
;
103 GLboolean used_in_src
;
107 struct brw_reg userplane
[MAX_CLIP_PLANES
];
109 /** we may need up to 3 constants per instruction (if use_const_buffer) */
115 GLboolean needs_stack
;
118 bool brw_vs_emit(struct gl_shader_program
*prog
, struct brw_vs_compile
*c
);
119 void brw_old_vs_emit(struct brw_vs_compile
*c
);
120 bool brw_vs_precompile(struct gl_context
*ctx
, struct gl_shader_program
*prog
);