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_MTHD40(so, mthd, size) \
17 SB_DATA((so), ((size) << 18) | (7 << 13) | NV40_3D_##mthd)
19 struct nv30_blend_stateobj
{
20 struct pipe_blend_state pipe
;
25 struct nv30_rasterizer_stateobj
{
26 struct pipe_rasterizer_state pipe
;
31 struct nv30_zsa_stateobj
{
32 struct pipe_depth_stencil_alpha_state pipe
;
37 struct nv30_sampler_state
{
38 struct pipe_sampler_state pipe
;
49 struct nv30_sampler_view
{
50 struct pipe_sampler_view pipe
;
64 struct nv30_shader_reloc
{
69 struct nv30_vertprog_exec
{
73 struct nv30_vertprog_data
{
74 int index
; /* immediates == -1 */
78 struct nv30_vertprog
{
79 struct pipe_shader_state pipe
;
80 struct tgsi_shader_info info
;
82 struct draw_vertex_shader
*draw
;
84 unsigned enabled_ucps
;
85 uint16_t texcoord
[10];
87 struct util_dynarray branch_relocs
;
88 struct nv30_vertprog_exec
*insns
;
91 struct util_dynarray const_relocs
;
92 struct nv30_vertprog_data
*consts
;
95 struct nouveau_heap
*exec
;
96 struct nouveau_heap
*data
;
102 struct nv30_fragprog_data
{
107 struct nv30_fragprog
{
108 struct pipe_shader_state pipe
;
109 struct tgsi_shader_info info
;
111 struct draw_fragment_shader
*draw
;
117 uint16_t texcoord
[10];
118 struct nv30_fragprog_data
*consts
;
121 struct pipe_resource
*buffer
;
122 uint32_t vp_or
; /* appended to VP_RESULT_EN */
124 uint32_t point_sprite_control
;
125 uint32_t coord_conventions
;
130 struct nv30_vertex_element
{
134 struct nv30_vertex_stateobj
{
135 struct pipe_vertex_element pipe
[PIPE_MAX_ATTRIBS
];
136 struct translate
*translate
;
137 bool need_conversion
;
138 unsigned num_elements
;
140 unsigned vtx_per_packet_max
;
141 struct nv30_vertex_element element
[];