1 #ifndef __NV30_STATE_H__
2 #define __NV30_STATE_H__
4 #include "pipe/p_state.h"
5 #include "tgsi/tgsi_scan.h"
6 #include "util/u_dynarray.h"
8 #define NV30_QUERY_ZCULL_0 (PIPE_QUERY_TYPES + 0)
9 #define NV30_QUERY_ZCULL_1 (PIPE_QUERY_TYPES + 1)
10 #define NV30_QUERY_ZCULL_2 (PIPE_QUERY_TYPES + 2)
11 #define NV30_QUERY_ZCULL_3 (PIPE_QUERY_TYPES + 3)
13 #define SB_DATA(so, u) (so)->data[(so)->size++] = (u)
14 #define SB_MTHD30(so, mthd, size) \
15 SB_DATA((so), ((size) << 18) | (7 << 13) | NV30_3D_##mthd)
16 #define SB_MTHD35(so, mthd, size) \
17 SB_DATA((so), ((size) << 18) | (7 << 13) | NV35_3D_##mthd)
18 #define SB_MTHD40(so, mthd, size) \
19 SB_DATA((so), ((size) << 18) | (7 << 13) | NV40_3D_##mthd)
21 struct nv30_blend_stateobj
{
22 struct pipe_blend_state pipe
;
27 struct nv30_rasterizer_stateobj
{
28 struct pipe_rasterizer_state pipe
;
33 struct nv30_zsa_stateobj
{
34 struct pipe_depth_stencil_alpha_state pipe
;
39 struct nv30_sampler_state
{
40 struct pipe_sampler_state pipe
;
51 struct nv30_sampler_view
{
52 struct pipe_sampler_view pipe
;
66 struct nv30_shader_reloc
{
71 struct nv30_vertprog_exec
{
75 struct nv30_vertprog_data
{
76 int index
; /* immediates == -1 */
80 struct nv30_vertprog
{
81 struct pipe_shader_state pipe
;
82 struct tgsi_shader_info info
;
84 struct draw_vertex_shader
*draw
;
86 unsigned enabled_ucps
;
87 uint16_t texcoord
[10];
89 struct util_dynarray branch_relocs
;
90 struct nv30_vertprog_exec
*insns
;
93 struct util_dynarray const_relocs
;
94 struct nv30_vertprog_data
*consts
;
97 struct nouveau_heap
*exec
;
98 struct nouveau_heap
*data
;
104 struct nv30_fragprog_data
{
109 struct nv30_fragprog
{
110 struct pipe_shader_state pipe
;
111 struct tgsi_shader_info info
;
113 struct draw_fragment_shader
*draw
;
119 uint16_t texcoord
[10];
120 struct nv30_fragprog_data
*consts
;
123 struct pipe_resource
*buffer
;
124 uint32_t vp_or
; /* appended to VP_RESULT_EN */
126 uint32_t point_sprite_control
;
127 uint32_t coord_conventions
;
132 struct nv30_vertex_element
{
136 struct nv30_vertex_stateobj
{
137 struct pipe_vertex_element pipe
[PIPE_MAX_ATTRIBS
];
138 struct translate
*translate
;
139 bool need_conversion
;
140 unsigned num_elements
;
142 unsigned vtx_per_packet_max
;
143 struct nv30_vertex_element element
[];