Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  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[43];
  27. };
  28.  
  29. struct nvc0_zsa_stateobj {
  30.    struct pipe_depth_stencil_alpha_state pipe;
  31.    int size;
  32.    uint32_t state[26];
  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.    boolean 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.    boolean shared_slots;
  59.    boolean 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_so_target {
  65.    struct pipe_stream_output_target pipe;
  66.    struct pipe_query *pq;
  67.    unsigned stride;
  68.    boolean clean;
  69. };
  70.  
  71. static INLINE struct nvc0_so_target *
  72. nvc0_so_target(struct pipe_stream_output_target *ptarg)
  73. {
  74.    return (struct nvc0_so_target *)ptarg;
  75. }
  76.  
  77. #endif
  78.