1 #ifndef LP_STATE_SETUP_H
2 #define LP_STATE_SETUP_H
4 #include "lp_bld_interp.h"
7 struct llvmpipe_context
;
8 struct lp_setup_variant
;
10 struct lp_setup_variant_list_item
12 struct lp_setup_variant
*base
;
13 struct lp_setup_variant_list_item
*next
, *prev
;
17 struct lp_setup_variant_key
{
18 unsigned num_inputs
:8;
19 unsigned flatshade_first
:1;
20 unsigned pixel_center_half
:1;
23 struct lp_shader_input inputs
[PIPE_MAX_SHADER_INPUTS
];
27 typedef void (*lp_jit_setup_triangle
)( const float (*v0
)[4],
38 /* At this stage, for a given variant key, we create a
39 * draw_vertex_info struct telling the draw module how to format the
40 * vertices, and an llvm-generated function which calculates the
41 * attribute interpolants (a0, dadx, dady) from three of those
44 struct lp_setup_variant
{
45 struct lp_setup_variant_key key
;
47 struct lp_setup_variant_list_item list_item_global
;
49 /* XXX: this is a pointer to the LLVM IR. Once jit_function is
50 * generated, we never need to use the IR again - need to find a
51 * way to release this data without destroying the generated
54 LLVMValueRef function
;
56 /* The actual generated setup function:
58 lp_jit_setup_triangle jit_function
;
63 void lp_setup_tri_fallback( const float (*v0
)[4],
70 const struct lp_setup_variant_key
*key
);
72 void lp_delete_setup_variants(struct llvmpipe_context
*lp
);
75 lp_dump_setup_coef( const struct lp_setup_variant_key
*key
,
76 const float (*sa0
)[4],
77 const float (*sdadx
)[4],
78 const float (*sdady
)[4]);