nv50_stateobj.h revision ddcb90248fb491a3a9e2ada8c595f94b0bd95515
1f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller
2f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller#ifndef __NV50_STATEOBJ_H__
3f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller#define __NV50_STATEOBJ_H__
4f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller
5f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller#include "pipe/p_state.h"
6f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller
7f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller#define NV50_SCISSORS_CLIPPING
8f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller
9f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller#define SB_BEGIN_3D(so, m, s)                                                  \
10f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller   (so)->state[(so)->size++] =                                                 \
11f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller      ((s) << 18) | (NV50_SUBCH_3D << 13) | NV50_3D_##m
12f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller
13ddcb90248fb491a3a9e2ada8c595f94b0bd95515Christoph Bumiller#define SB_BEGIN_3D_(so, m, s)                                                 \
14ddcb90248fb491a3a9e2ada8c595f94b0bd95515Christoph Bumiller   (so)->state[(so)->size++] =                                                 \
15ddcb90248fb491a3a9e2ada8c595f94b0bd95515Christoph Bumiller      ((s) << 18) | (NV50_SUBCH_3D << 13) | m
16ddcb90248fb491a3a9e2ada8c595f94b0bd95515Christoph Bumiller
17f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller#define SB_DATA(so, u) (so)->state[(so)->size++] = (u)
18f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller
19f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumillerstruct nv50_blend_stateobj {
20f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller   struct pipe_blend_state pipe;
21f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller   int size;
22ddcb90248fb491a3a9e2ada8c595f94b0bd95515Christoph Bumiller   uint32_t state[78];
23f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller};
24f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller
25f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumillerstruct nv50_tsc_entry {
26f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller   int id;
27f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller   uint32_t tsc[8];
28f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller};
29f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller
30f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumillerstatic INLINE struct nv50_tsc_entry *
31f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumillernv50_tsc_entry(void *hwcso)
32f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller{
33f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller   return (struct nv50_tsc_entry *)hwcso;
34f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller}
35f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller
36f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumillerstruct nv50_tic_entry {
37f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller   struct pipe_sampler_view pipe;
38f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller   int id;
39f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller   uint32_t tic[8];
40f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller};
41f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller
42f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumillerstatic INLINE struct nv50_tic_entry *
43f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumillernv50_tic_entry(struct pipe_sampler_view *view)
44f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller{
45f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller   return (struct nv50_tic_entry *)view;
46f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller}
47f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller
48f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumillerstruct nv50_rasterizer_stateobj {
49f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller   struct pipe_rasterizer_state pipe;
50f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller   int size;
51f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller   uint32_t state[40];
52f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller};
53f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller
54f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumillerstruct nv50_zsa_stateobj {
55f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller   struct pipe_depth_stencil_alpha_state pipe;
56f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller   int size;
57f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller   uint32_t state[29];
58f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller};
59f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller
60f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumillerstruct nv50_vertex_element {
61f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller   struct pipe_vertex_element pipe;
62f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller   uint32_t state;
63f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller};
64f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller
65f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumillerstruct nv50_vertex_stateobj {
66f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller   struct translate *translate;
67f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller   unsigned num_elements;
68f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller   uint32_t instance_elts;
69f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller   uint32_t instance_bufs;
70f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller   boolean need_conversion;
71f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller   unsigned vertex_size;
72f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller   unsigned packet_vertex_limit;
73f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller   struct nv50_vertex_element element[1];
74f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller};
75f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller
76f80c03e1875fe96ff2f4c022e3cb76357828140dChristoph Bumiller#endif
77