~mmach/netext73/mesa-haswell

« back to all changes in this revision

Viewing changes to src/gallium/drivers/nouveau/nvc0/nvc0_stateobj.h

  • Committer: mmach
  • Date: 2022-09-22 19:56:13 UTC
  • Revision ID: netbit73@gmail.com-20220922195613-wtik9mmy20tmor0i
2022-09-22 21:17:09

Show diffs side-by-side

added added

removed removed

Lines of Context:
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++] = NVC0_FIFO_PKHDR_SQ(NVC0_3D(m), s)
9
 
 
10
 
#define SB_IMMED_3D(so, m, d)                                                  \
11
 
   (so)->state[(so)->size++] = NVC0_FIFO_PKHDR_IL(NVC0_3D(m), d)
12
 
 
13
 
#define SB_DATA(so, u) (so)->state[(so)->size++] = (u)
14
 
 
15
 
#include "nv50/nv50_stateobj_tex.h"
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_rasterizer_stateobj {
24
 
   struct pipe_rasterizer_state pipe;
25
 
   int size;
26
 
   uint32_t state[44];
27
 
};
28
 
 
29
 
struct nvc0_zsa_stateobj {
30
 
   struct pipe_depth_stencil_alpha_state pipe;
31
 
   int size;
32
 
   uint32_t state[30];
33
 
};
34
 
 
35
 
struct nvc0_constbuf {
36
 
   union {
37
 
      struct pipe_resource *buf;
38
 
      const void *data;
39
 
   } u;
40
 
   uint32_t size;
41
 
   uint32_t offset;
42
 
   bool user; /* should only be true if u.data is valid and non-NULL */
43
 
};
44
 
 
45
 
struct nvc0_vertex_element {
46
 
   struct pipe_vertex_element pipe;
47
 
   uint32_t state;
48
 
   uint32_t state_alt; /* buffer 0 and with source offset (for translate) */
49
 
};
50
 
 
51
 
struct nvc0_vertex_stateobj {
52
 
   uint32_t min_instance_div[PIPE_MAX_ATTRIBS];
53
 
   uint16_t vb_access_size[PIPE_MAX_ATTRIBS];
54
 
   struct translate *translate;
55
 
   unsigned num_elements;
56
 
   uint32_t instance_elts;
57
 
   uint32_t instance_bufs;
58
 
   bool shared_slots;
59
 
   bool need_conversion; /* e.g. VFETCH cannot convert f64 to f32 */
60
 
   unsigned size; /* size of vertex in bytes (when packed) */
61
 
   struct nvc0_vertex_element element[0];
62
 
};
63
 
 
64
 
struct nvc0_window_rect_stateobj {
65
 
   bool inclusive;
66
 
   unsigned rects;
67
 
   struct pipe_scissor_state rect[PIPE_MAX_WINDOW_RECTANGLES];
68
 
};
69
 
 
70
 
struct nvc0_so_target {
71
 
   struct pipe_stream_output_target pipe;
72
 
   struct pipe_query *pq;
73
 
   unsigned stride;
74
 
   bool clean;
75
 
};
76
 
 
77
 
static inline struct nvc0_so_target *
78
 
nvc0_so_target(struct pipe_stream_output_target *ptarg)
79
 
{
80
 
   return (struct nvc0_so_target *)ptarg;
81
 
}
82
 
 
83
 
#endif