nv50/ir: Add convenience method for calculating the live sets of a function.
[mesa.git] / src / gallium / drivers / nv50 / nv50_stateobj.h
index f4e458b0c05068012a262e961aa8011dbf062f0e..188406da6008d07e8022accc07c3e1b8f7375ce0 100644 (file)
@@ -6,49 +6,26 @@
 
 #define NV50_SCISSORS_CLIPPING
 
-#define SB_BEGIN_3D(so, m, s)                                                  \
-   (so)->state[(so)->size++] =                                                 \
-      ((s) << 18) | (NV50_SUBCH_3D << 13) | NV50_3D_##m
+#define SB_BEGIN_3D(so, m, s) \
+   (so)->state[(so)->size++] = NV50_FIFO_PKHDR(NV50_3D(m), s)
 
-#define SB_BEGIN_3D_(so, m, s)                                                 \
-   (so)->state[(so)->size++] =                                                 \
-      ((s) << 18) | (NV50_SUBCH_3D << 13) | m
+#define SB_BEGIN_3D_(so, m, s) \
+   (so)->state[(so)->size++] = NV50_FIFO_PKHDR(SUBC_3D(m), s)
 
 #define SB_DATA(so, u) (so)->state[(so)->size++] = (u)
 
+#include "nv50_stateobj_tex.h"
+
 struct nv50_blend_stateobj {
    struct pipe_blend_state pipe;
    int size;
-   uint32_t state[78];
-};
-
-struct nv50_tsc_entry {
-   int id;
-   uint32_t tsc[8];
+   uint32_t state[84]; // TODO: allocate less if !independent_blend_enable
 };
 
-static INLINE struct nv50_tsc_entry *
-nv50_tsc_entry(void *hwcso)
-{
-   return (struct nv50_tsc_entry *)hwcso;
-}
-
-struct nv50_tic_entry {
-   struct pipe_sampler_view pipe;
-   int id;
-   uint32_t tic[8];
-};
-
-static INLINE struct nv50_tic_entry *
-nv50_tic_entry(struct pipe_sampler_view *view)
-{
-   return (struct nv50_tic_entry *)view;
-}
-
 struct nv50_rasterizer_stateobj {
    struct pipe_rasterizer_state pipe;
    int size;
-   uint32_t state[40];
+   uint32_t state[48];
 };
 
 struct nv50_zsa_stateobj {
@@ -67,10 +44,11 @@ struct nv50_vertex_stateobj {
    unsigned num_elements;
    uint32_t instance_elts;
    uint32_t instance_bufs;
+   uint16_t vb_access_size[PIPE_MAX_ATTRIBS];
    boolean need_conversion;
    unsigned vertex_size;
    unsigned packet_vertex_limit;
-   struct nv50_vertex_element element[1];
+   struct nv50_vertex_element element[0];
 };
 
 #endif