dc5771a03aa5adf07fa599d5b1d32559a73619c9
[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_IMMED_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 #include "nv50/nv50_stateobj_tex.h"
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_rasterizer_stateobj {
26 struct pipe_rasterizer_state pipe;
27 int size;
28 uint32_t state[43];
29 };
30
31 struct nvc0_zsa_stateobj {
32 struct pipe_depth_stencil_alpha_state pipe;
33 int size;
34 uint32_t state[26];
35 };
36
37 struct nvc0_vertex_element {
38 struct pipe_vertex_element pipe;
39 uint32_t state;
40 };
41
42 struct nvc0_vertex_stateobj {
43 struct translate *translate;
44 unsigned num_elements;
45 uint32_t instance_elts;
46 uint32_t instance_bufs;
47 boolean need_conversion; /* e.g. VFETCH cannot convert f64 to f32 */
48 unsigned vtx_size;
49 unsigned vtx_per_packet_max;
50 struct nvc0_vertex_element element[0];
51 };
52
53 struct nvc0_so_target {
54 struct pipe_stream_output_target pipe;
55 struct pipe_query *pq;
56 unsigned stride;
57 boolean clean;
58 };
59
60 static INLINE struct nvc0_so_target *
61 nvc0_so_target(struct pipe_stream_output_target *ptarg)
62 {
63 return (struct nvc0_so_target *)ptarg;
64 }
65
66 #endif