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
{
64 struct pipe_shader_state pipe
;
65 struct tgsi_shader_info info
;
69 unsigned point_sprite_control
;
75 struct nvfx_fragment_program_data
*consts
;
78 unsigned num_slots
; /* how many input semantics? */
79 unsigned char slot_to_generic
[8]; /* semantics */
80 unsigned char slot_to_fp_input
[8]; /* current assignment of slots for each used semantic */
81 struct util_dynarray slot_relocations
[8];
83 /* This is reset to progs on any relocation update, and decreases every time we
84 * move to a new prog due to a constant update
85 * When this is the same as progs, applying relocations is no longer necessary.
87 unsigned progs_left_with_obsolete_slot_assignments
;
89 unsigned long long last_vp_id
;
90 unsigned last_sprite_coord_enable
;
96 unsigned progs_per_bo
;
99 struct nvfx_fragment_program_bo
* fpbo
;