1 #ifndef __NVFX_STATE_H__
2 #define __NVFX_STATE_H__
4 #include "pipe/p_state.h"
5 #include "pipe/p_video_state.h"
6 #include "tgsi/tgsi_scan.h"
7 #include "nouveau/nouveau_statebuf.h"
8 #include "util/u_dynarray.h"
9 #include "util/u_linkage.h"
11 struct nvfx_vertex_program_exec
{
15 struct nvfx_vertex_program_data
{
16 int index
; /* immediates == -1 */
20 struct nvfx_vertex_program
{
21 unsigned long long id
;
23 struct nvfx_vertex_program_exec
*insns
;
25 struct nvfx_vertex_program_data
*consts
;
28 char generic_to_fp_input
[256];
31 struct nouveau_resource
*exec
;
33 struct nouveau_resource
*data
;
35 unsigned data_start_min
;
41 struct util_dynarray branch_relocs
;
42 struct util_dynarray const_relocs
;
45 #define NVFX_VP_FAILED ((struct nvfx_vertex_program*)-1)
47 struct nvfx_pipe_vertex_program
{
48 struct pipe_shader_state pipe
;
49 struct tgsi_shader_info info
;
51 unsigned draw_elements
;
52 boolean draw_no_elements
;
53 struct draw_vertex_shader
*draw_vs
;
54 struct nvfx_vertex_program
* draw_vp
;
56 struct nvfx_vertex_program
* vp
;
59 struct nvfx_fragment_program_data
{
64 struct nvfx_fragment_program_bo
{
65 struct nvfx_fragment_program_bo
* next
;
66 struct nouveau_bo
* bo
;
68 char insn
[] __attribute__((aligned(16)));
71 struct nvfx_fragment_program
{
73 unsigned point_sprite_control
;
75 unsigned coord_conventions
;
80 struct nvfx_fragment_program_data
*consts
;
83 /* the slot at num_slots is for the sprite coordinate, if any */
84 unsigned num_slots
; /* how many input semantics? */
85 unsigned char slot_to_generic
[10]; /* semantics */
86 unsigned char slot_to_fp_input
[11]; /* current assignment of slots for each used semantic */
87 struct util_dynarray slot_relocations
[11];
89 /* This is reset to progs on any relocation update, and decreases every time we
90 * move to a new prog due to a constant update
91 * When this is the same as progs, applying relocations is no longer necessary.
93 unsigned progs_left_with_obsolete_slot_assignments
;
95 unsigned long long last_vp_id
;
96 unsigned last_sprite_coord_enable
;
100 unsigned bo_prog_idx
;
102 unsigned progs_per_bo
;
105 struct nvfx_fragment_program_bo
* fpbo
;
108 struct nvfx_pipe_fragment_program
{
109 struct pipe_shader_state pipe
;
110 struct tgsi_shader_info info
;
112 struct nvfx_fragment_program
* fps
[2];