X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fnv30%2Fnv30_state.h;h=e27e16fae824648c3dd894392461972cf5c26210;hb=5bbeae7a3d3be17d44b1bc851872a107a75c393b;hp=e42e872de757257f3c2998b8e25e09b24d87a95e;hpb=25024d948298a9f3f3210a0b91486f79a3917b0f;p=mesa.git diff --git a/src/gallium/drivers/nv30/nv30_state.h b/src/gallium/drivers/nv30/nv30_state.h index e42e872de75..e27e16fae82 100644 --- a/src/gallium/drivers/nv30/nv30_state.h +++ b/src/gallium/drivers/nv30/nv30_state.h @@ -3,84 +3,142 @@ #include "pipe/p_state.h" #include "tgsi/tgsi_scan.h" +#include "util/u_dynarray.h" + +#define NV30_QUERY_ZCULL_0 (PIPE_QUERY_TYPES + 0) +#define NV30_QUERY_ZCULL_1 (PIPE_QUERY_TYPES + 1) +#define NV30_QUERY_ZCULL_2 (PIPE_QUERY_TYPES + 2) +#define NV30_QUERY_ZCULL_3 (PIPE_QUERY_TYPES + 3) + +#define SB_DATA(so, u) (so)->data[(so)->size++] = (u) +#define SB_MTHD30(so, mthd, size) \ + SB_DATA((so), ((size) << 18) | (7 << 13) | NV30_3D_##mthd) +#define SB_MTHD40(so, mthd, size) \ + SB_DATA((so), ((size) << 18) | (7 << 13) | NV40_3D_##mthd) + +struct nv30_blend_stateobj { + struct pipe_blend_state pipe; + unsigned data[16]; + unsigned size; +}; + +struct nv30_rasterizer_stateobj { + struct pipe_rasterizer_state pipe; + unsigned data[32]; + unsigned size; +}; + +struct nv30_zsa_stateobj { + struct pipe_depth_stencil_alpha_state pipe; + unsigned data[32]; + unsigned size; +}; struct nv30_sampler_state { - uint32_t fmt; - uint32_t wrap; - uint32_t en; - uint32_t filt; - uint32_t bcol; + struct pipe_sampler_state pipe; + unsigned fmt; + unsigned wrap; + unsigned en; + unsigned filt; + unsigned bcol; + /* 4.8 */ + unsigned min_lod; + unsigned max_lod; +}; + +struct nv30_sampler_view { + struct pipe_sampler_view pipe; + unsigned fmt; + unsigned swz; + unsigned filt; + unsigned filt_mask; + unsigned wrap; + unsigned wrap_mask; + unsigned npot_size0; + unsigned npot_size1; + /* 4.8 */ + unsigned base_lod; + unsigned high_lod; }; -struct nv30_vertex_program_exec { - uint32_t data[4]; - boolean has_branch_offset; - int const_index; +struct nv30_shader_reloc { + unsigned location; + int target; }; -struct nv30_vertex_program_data { - int index; /* immediates == -1 */ - float value[4]; +struct nv30_vertprog_exec { + uint32_t data[4]; }; -struct nv30_vertex_program { - struct pipe_shader_state pipe; +struct nv30_vertprog_data { + int index; /* immediates == -1 */ + float value[4]; +}; - boolean translated; +struct nv30_vertprog { + struct pipe_shader_state pipe; + struct tgsi_shader_info info; - struct nv30_vertex_program_exec *insns; - unsigned nr_insns; - struct nv30_vertex_program_data *consts; - unsigned nr_consts; + struct draw_vertex_shader *draw; + boolean translated; + unsigned enabled_ucps; + uint16_t texcoord[10]; - struct nouveau_resource *exec; - unsigned exec_start; - struct nouveau_resource *data; - unsigned data_start; - unsigned data_start_min; + struct util_dynarray branch_relocs; + struct nv30_vertprog_exec *insns; + unsigned nr_insns; - uint32_t ir; - uint32_t or; - struct nouveau_stateobj *so; -}; + struct util_dynarray const_relocs; + struct nv30_vertprog_data *consts; + unsigned nr_consts; -struct nv30_fragment_program_data { - unsigned offset; - unsigned index; + struct nouveau_heap *exec; + struct nouveau_heap *data; + uint32_t ir; + uint32_t or; + void *nvfx; }; -struct nv30_fragment_program { - struct pipe_shader_state pipe; - struct tgsi_shader_info info; +struct nv30_fragprog_data { + unsigned offset; + unsigned index; +}; - boolean translated; - boolean on_hw; - unsigned samplers; +struct nv30_fragprog { + struct pipe_shader_state pipe; + struct tgsi_shader_info info; - uint32_t *insn; - int insn_len; + struct draw_fragment_shader *draw; + boolean translated; - struct nv30_fragment_program_data *consts; - unsigned nr_consts; + uint32_t *insn; + unsigned insn_len; - struct pipe_buffer *buffer; + uint16_t texcoord[10]; + struct nv30_fragprog_data *consts; + unsigned nr_consts; - uint32_t fp_control; - uint32_t fp_reg_control; - struct nouveau_stateobj *so; + struct pipe_resource *buffer; + uint32_t vp_or; /* appended to VP_RESULT_EN */ + uint32_t fp_control; + uint32_t point_sprite_control; + uint32_t coord_conventions; + uint32_t texcoords; + uint32_t rt_enable; }; -struct nv30_miptree { - struct pipe_texture base; - struct nouveau_bo *bo; - - struct pipe_buffer *buffer; - uint total_size; +struct nv30_vertex_element { + unsigned state; +}; - struct { - uint pitch; - uint *image_offset; - } level[PIPE_MAX_TEXTURE_LEVELS]; +struct nv30_vertex_stateobj { + struct pipe_vertex_element pipe[PIPE_MAX_ATTRIBS]; + struct translate *translate; + bool need_conversion; + unsigned num_elements; + unsigned vtx_size; + unsigned vtx_per_packet_max; + struct nv30_vertex_element element[]; }; #endif