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