Path: blob/21.2-virgl/src/gallium/drivers/nouveau/nv30/nv30_state.h
4574 views
#ifndef __NV30_STATE_H__1#define __NV30_STATE_H__23#include "pipe/p_state.h"4#include "tgsi/tgsi_scan.h"5#include "util/u_dynarray.h"67#define NV30_QUERY_ZCULL_0 (PIPE_QUERY_TYPES + 0)8#define NV30_QUERY_ZCULL_1 (PIPE_QUERY_TYPES + 1)9#define NV30_QUERY_ZCULL_2 (PIPE_QUERY_TYPES + 2)10#define NV30_QUERY_ZCULL_3 (PIPE_QUERY_TYPES + 3)1112#define SB_DATA(so, u) (so)->data[(so)->size++] = (u)13#define SB_MTHD30(so, mthd, size) \14SB_DATA((so), ((size) << 18) | (7 << 13) | NV30_3D_##mthd)15#define SB_MTHD35(so, mthd, size) \16SB_DATA((so), ((size) << 18) | (7 << 13) | NV35_3D_##mthd)17#define SB_MTHD40(so, mthd, size) \18SB_DATA((so), ((size) << 18) | (7 << 13) | NV40_3D_##mthd)1920struct nv30_blend_stateobj {21struct pipe_blend_state pipe;22unsigned data[16];23unsigned size;24};2526struct nv30_rasterizer_stateobj {27struct pipe_rasterizer_state pipe;28unsigned data[32];29unsigned size;30};3132struct nv30_zsa_stateobj {33struct pipe_depth_stencil_alpha_state pipe;34unsigned data[36];35unsigned size;36};3738struct nv30_sampler_state {39struct pipe_sampler_state pipe;40unsigned fmt;41unsigned wrap;42unsigned en;43unsigned filt;44unsigned bcol;45/* 4.8 */46unsigned min_lod;47unsigned max_lod;48};4950struct nv30_sampler_view {51struct pipe_sampler_view pipe;52unsigned fmt;53unsigned swz;54unsigned filt;55unsigned filt_mask;56unsigned wrap;57unsigned wrap_mask;58unsigned npot_size0;59unsigned npot_size1;60/* 4.8 */61unsigned base_lod;62unsigned high_lod;63};6465struct nv30_shader_reloc {66unsigned location;67int target;68};6970struct nv30_vertprog_exec {71uint32_t data[4];72};7374struct nv30_vertprog_data {75int index; /* immediates == -1 */76float value[4];77};7879struct nv30_vertprog {80struct pipe_shader_state pipe;81struct tgsi_shader_info info;8283struct draw_vertex_shader *draw;84bool translated;85unsigned enabled_ucps;86uint16_t texcoord[10];8788struct util_dynarray branch_relocs;89struct nv30_vertprog_exec *insns;90unsigned nr_insns;9192struct util_dynarray const_relocs;93struct nv30_vertprog_data *consts;94unsigned nr_consts;9596struct nouveau_heap *exec;97struct nouveau_heap *data;98uint32_t ir;99uint32_t or;100void *nvfx;101};102103struct nv30_fragprog_data {104unsigned offset;105unsigned index;106};107108struct nv30_fragprog {109struct pipe_shader_state pipe;110struct tgsi_shader_info info;111112struct draw_fragment_shader *draw;113bool translated;114115uint32_t *insn;116unsigned insn_len;117118uint16_t texcoord[10];119struct nv30_fragprog_data *consts;120unsigned nr_consts;121122struct pipe_resource *buffer;123uint32_t vp_or; /* appended to VP_RESULT_EN */124uint32_t fp_control;125uint32_t point_sprite_control;126uint32_t coord_conventions;127uint32_t texcoords;128uint32_t rt_enable;129};130131struct nv30_vertex_element {132unsigned state;133};134135struct nv30_vertex_stateobj {136struct pipe_vertex_element pipe[PIPE_MAX_ATTRIBS];137struct translate *translate;138bool need_conversion;139unsigned num_elements;140unsigned vtx_size;141unsigned vtx_per_packet_max;142struct nv30_vertex_element element[];143};144145#endif146147148