#include "pipe/p_state.h"
#include "tgsi/tgsi_scan.h"
+#include "lp_jit.h"
#define LP_NEW_VIEWPORT 0x1
struct tgsi_sampler;
-struct tgsi_exec_machine;
struct vertex_info;
+struct lp_fragment_shader;
+
+
+struct lp_fragment_shader_variant_key
+{
+ struct pipe_depth_state depth;
+ struct pipe_alpha_state alpha;
+ struct pipe_blend_state blend;
+};
+
+
+struct lp_fragment_shader_variant
+{
+ struct lp_fragment_shader *shader;
+
+ struct lp_fragment_shader_variant_key key;
+
+ LLVMValueRef function;
+
+ lp_jit_frag_func jit_function;
+
+ struct lp_fragment_shader_variant *next;
+};
+
+
/**
* Subclass of pipe_shader_state (though it doesn't really need to be).
*
* This is starting to look an awful lot like a quad pipeline stage...
*/
-struct lp_fragment_shader {
- struct pipe_shader_state shader;
+struct lp_fragment_shader
+{
+ struct pipe_shader_state base;
struct tgsi_shader_info info;
- void (*prepare)( const struct lp_fragment_shader *shader,
- struct tgsi_exec_machine *machine,
- struct tgsi_sampler **samplers);
-
- /* Run the shader - this interface will get cleaned up in the
- * future:
- */
- unsigned (*run)( const struct lp_fragment_shader *shader,
- struct tgsi_exec_machine *machine,
- struct quad_header *quad );
+ struct lp_fragment_shader_variant *variants;
-
- void (*delete)( struct lp_fragment_shader * );
+ struct lp_fragment_shader_variant *current;
};
};
-typedef void
-(*lp_blend_func)(uint8_t src[][16],
- uint8_t dst[][16],
- uint8_t con[][16],
- uint8_t res[][16]);
-
-
-struct lp_blend_state
-{
- struct pipe_blend_state base;
-
- LLVMValueRef function;
-
- lp_blend_func jit_function;
-};
-
-
void *
llvmpipe_create_blend_state(struct pipe_context *,
unsigned count,
const struct pipe_vertex_buffer *);
+void llvmpipe_update_fs(struct llvmpipe_context *lp);
void llvmpipe_update_derived( struct llvmpipe_context *llvmpipe );