Path: blob/21.2-virgl/src/gallium/drivers/nouveau/nv50/nv50_stateobj.h
4574 views
1#ifndef __NV50_STATEOBJ_H__2#define __NV50_STATEOBJ_H__34#include "pipe/p_state.h"56#define NV50_SCISSORS_CLIPPING78#define SB_BEGIN_3D(so, m, s) \9(so)->state[(so)->size++] = NV50_FIFO_PKHDR(NV50_3D(m), s)1011#define SB_BEGIN_3D_(so, m, s) \12(so)->state[(so)->size++] = NV50_FIFO_PKHDR(SUBC_3D(m), s)1314#define SB_DATA(so, u) (so)->state[(so)->size++] = (u)1516#include "nv50/nv50_stateobj_tex.h"1718struct nv50_blend_stateobj {19struct pipe_blend_state pipe;20int size;21uint32_t state[84]; // TODO: allocate less if !independent_blend_enable22};2324struct nv50_rasterizer_stateobj {25struct pipe_rasterizer_state pipe;26int size;27uint32_t state[49];28};2930struct nv50_zsa_stateobj {31struct pipe_depth_stencil_alpha_state pipe;32int size;33uint32_t state[38];34};3536struct nv50_constbuf {37union {38struct pipe_resource *buf;39const uint8_t *data;40} u;41uint32_t size; /* max 65536 */42uint32_t offset;43bool user; /* should only be true if u.data is valid and non-NULL */44};4546struct nv50_vertex_element {47struct pipe_vertex_element pipe;48uint32_t state;49};5051struct nv50_vertex_stateobj {52uint32_t min_instance_div[PIPE_MAX_ATTRIBS];53uint16_t vb_access_size[PIPE_MAX_ATTRIBS];54struct translate *translate;55unsigned num_elements;56uint32_t instance_elts;57uint32_t instance_bufs;58bool need_conversion;59unsigned vertex_size;60unsigned packet_vertex_limit;61struct nv50_vertex_element element[0];62};6364struct nv50_window_rect_stateobj {65bool inclusive;66unsigned rects;67struct pipe_scissor_state rect[PIPE_MAX_WINDOW_RECTANGLES];68};6970struct nv50_so_target {71struct pipe_stream_output_target pipe;72struct pipe_query *pq;73unsigned stride;74bool clean;75};7677static inline struct nv50_so_target *78nv50_so_target(struct pipe_stream_output_target *ptarg)79{80return (struct nv50_so_target *)ptarg;81}8283#endif848586