1 #ifndef __NVFX_STATE_H__
2 #define __NVFX_STATE_H__
4 #include "pipe/p_state.h"
5 #include "tgsi/tgsi_scan.h"
6 #include "nouveau/nouveau_statebuf.h"
7 #include "util/u_dynarray.h"
8 #include "util/u_linkage.h"
10 struct nvfx_vertex_program_exec
{
14 struct nvfx_vertex_program_data
{
15 int index
; /* immediates == -1 */
19 struct nvfx_vertex_program
{
20 struct pipe_shader_state pipe
;
21 unsigned long long id
;
23 struct draw_vertex_shader
*draw
;
27 struct pipe_clip_state ucp
;
29 struct nvfx_vertex_program_exec
*insns
;
31 struct nvfx_vertex_program_data
*consts
;
34 char generic_to_fp_input
[256];
37 struct nouveau_resource
*exec
;
39 struct nouveau_resource
*data
;
41 unsigned data_start_min
;
47 struct util_dynarray branch_relocs
;
48 struct util_dynarray const_relocs
;
51 struct nvfx_fragment_program_data
{
56 struct nvfx_fragment_program_bo
{
57 struct nvfx_fragment_program_bo
* next
;
58 struct nouveau_bo
* bo
;
60 char insn
[] __attribute__((aligned(16)));
63 struct nvfx_fragment_program
{
65 unsigned point_sprite_control
;
71 struct nvfx_fragment_program_data
*consts
;
74 unsigned num_slots
; /* how many input semantics? */
75 unsigned char slot_to_generic
[8]; /* semantics */
76 unsigned char slot_to_fp_input
[8]; /* current assignment of slots for each used semantic */
77 struct util_dynarray slot_relocations
[8];
79 /* This is reset to progs on any relocation update, and decreases every time we
80 * move to a new prog due to a constant update
81 * When this is the same as progs, applying relocations is no longer necessary.
83 unsigned progs_left_with_obsolete_slot_assignments
;
85 unsigned long long last_vp_id
;
86 unsigned last_sprite_coord_enable
;
92 unsigned progs_per_bo
;
95 struct nvfx_fragment_program_bo
* fpbo
;
98 struct nvfx_pipe_fragment_program
{
99 struct pipe_shader_state pipe
;
100 struct tgsi_shader_info info
;
102 struct nvfx_fragment_program
* fps
[1];