nvc0: use most defs/decls from nouveau_pushbuf.h
[mesa.git] / src / gallium / drivers / nvc0 / nvc0_stateobj.h
1
2 #ifndef __NVC0_STATEOBJ_H__
3 #define __NVC0_STATEOBJ_H__
4
5 #include "pipe/p_state.h"
6
7 #define NVC0_SCISSORS_CLIPPING
8
9 #define SB_BEGIN_3D(so, m, s) \
10 (so)->state[(so)->size++] = \
11 (0x2 << 28) | ((s) << 16) | (NVC0_SUBCH_3D << 13) | ((NVC0_3D_##m) >> 2)
12
13 #define SB_IMMED_3D(so, m, d) \
14 (so)->state[(so)->size++] = \
15 (0x8 << 28) | ((d) << 16) | (NVC0_SUBCH_3D << 13) | ((NVC0_3D_##m) >> 2)
16
17 #define SB_DATA(so, u) (so)->state[(so)->size++] = (u)
18
19 struct nvc0_blend_stateobj {
20 struct pipe_blend_state pipe;
21 int size;
22 uint32_t state[72];
23 };
24
25 struct nvc0_tsc_entry {
26 int id;
27 uint32_t tsc[8];
28 };
29
30 static INLINE struct nvc0_tsc_entry *
31 nvc0_tsc_entry(void *hwcso)
32 {
33 return (struct nvc0_tsc_entry *)hwcso;
34 }
35
36 struct nvc0_tic_entry {
37 struct pipe_sampler_view pipe;
38 int id;
39 uint32_t tic[8];
40 };
41
42 static INLINE struct nvc0_tic_entry *
43 nvc0_tic_entry(struct pipe_sampler_view *view)
44 {
45 return (struct nvc0_tic_entry *)view;
46 }
47
48 struct nvc0_rasterizer_stateobj {
49 struct pipe_rasterizer_state pipe;
50 int size;
51 uint32_t state[43];
52 };
53
54 struct nvc0_zsa_stateobj {
55 struct pipe_depth_stencil_alpha_state pipe;
56 int size;
57 uint32_t state[29];
58 };
59
60 struct nvc0_vertex_element {
61 struct pipe_vertex_element pipe;
62 uint32_t state;
63 };
64
65 struct nvc0_vertex_stateobj {
66 struct translate *translate;
67 unsigned num_elements;
68 uint32_t instance_bits;
69 unsigned vtx_size;
70 unsigned vtx_per_packet_max;
71 struct nvc0_vertex_element element[1];
72 };
73
74 /* will have to lookup index -> location qualifier from nvc0_program */
75 struct nvc0_tfb_state {
76 uint8_t varying_count[4];
77 uint32_t stride[4];
78 uint8_t varying_indices[1];
79 };
80
81 #endif