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 unsigned long long id
;
22 struct nvfx_vertex_program_exec
*insns
;
24 struct nvfx_vertex_program_data
*consts
;
27 char generic_to_fp_input
[256];
30 struct nouveau_resource
*exec
;
32 struct nouveau_resource
*data
;
34 unsigned data_start_min
;
40 struct util_dynarray branch_relocs
;
41 struct util_dynarray const_relocs
;
44 #define NVFX_VP_FAILED ((struct nvfx_vertex_program*)-1)
46 struct nvfx_pipe_vertex_program
{
47 struct pipe_shader_state pipe
;
48 struct tgsi_shader_info info
;
50 unsigned draw_elements
;
51 boolean draw_no_elements
;
52 struct draw_vertex_shader
*draw_vs
;
53 struct nvfx_vertex_program
* draw_vp
;
55 struct nvfx_vertex_program
* vp
;
58 struct nvfx_fragment_program_data
{
63 struct nvfx_fragment_program_bo
{
64 struct nvfx_fragment_program_bo
* next
;
65 struct nouveau_bo
* bo
;
67 char insn
[] __attribute__((aligned(16)));
70 struct nvfx_fragment_program
{
72 unsigned point_sprite_control
;
74 unsigned coord_conventions
;
79 struct nvfx_fragment_program_data
*consts
;
82 /* the slot at num_slots is for the sprite coordinate, if any */
83 unsigned num_slots
; /* how many input semantics? */
84 unsigned char slot_to_generic
[10]; /* semantics */
85 unsigned char slot_to_fp_input
[11]; /* current assignment of slots for each used semantic */
86 struct util_dynarray slot_relocations
[11];
88 /* This is reset to progs on any relocation update, and decreases every time we
89 * move to a new prog due to a constant update
90 * When this is the same as progs, applying relocations is no longer necessary.
92 unsigned progs_left_with_obsolete_slot_assignments
;
94 unsigned long long last_vp_id
;
95 unsigned last_sprite_coord_enable
;
101 unsigned progs_per_bo
;
104 struct nvfx_fragment_program_bo
* fpbo
;
107 struct nvfx_pipe_fragment_program
{
108 struct pipe_shader_state pipe
;
109 struct tgsi_shader_info info
;
111 struct nvfx_fragment_program
* fps
[2];