#ifndef LP_STATE_H
#define LP_STATE_H
+#include <llvm-c/Core.h>
+
#include "pipe/p_state.h"
#include "tgsi/tgsi_scan.h"
+#include "lp_jit.h"
+#include "lp_bld_sample.h" /* for struct lp_sampler_static_state */
#define LP_NEW_VIEWPORT 0x1
struct tgsi_sampler;
-struct tgsi_exec_machine;
struct vertex_info;
+struct pipe_context;
+struct llvmpipe_context;
+
+struct lp_fragment_shader;
+
+
+struct lp_fragment_shader_variant_key
+{
+ enum pipe_format zsbuf_format;
+ struct pipe_depth_state depth;
+ struct pipe_alpha_state alpha;
+ struct pipe_blend_state blend;
+
+ struct lp_sampler_static_state sampler[PIPE_MAX_SAMPLERS];
+};
+
+
+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;
+};
/**
*
* 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);
+ struct lp_fragment_shader_variant *variants;
- /* 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 );
-
-
- void (*delete)( struct lp_fragment_shader * );
+ struct lp_fragment_shader_variant *current;
};
llvmpipe_create_sampler_state(struct pipe_context *,
const struct pipe_sampler_state *);
void llvmpipe_bind_sampler_states(struct pipe_context *, unsigned, void **);
+void
+llvmpipe_bind_vertex_sampler_states(struct pipe_context *,
+ unsigned num_samplers,
+ void **samplers);
void llvmpipe_delete_sampler_state(struct pipe_context *, void *);
void *
void llvmpipe_set_constant_buffer(struct pipe_context *,
uint shader, uint index,
- const struct pipe_constant_buffer *buf);
+ const struct pipe_buffer *buf);
void *llvmpipe_create_fs_state(struct pipe_context *,
const struct pipe_shader_state *);
unsigned num,
struct pipe_texture ** );
+void
+llvmpipe_set_vertex_sampler_textures(struct pipe_context *,
+ unsigned num_textures,
+ struct pipe_texture **);
+
void llvmpipe_set_viewport_state( struct pipe_context *,
const struct pipe_viewport_state * );
unsigned count,
const struct pipe_vertex_buffer *);
+void llvmpipe_update_fs(struct llvmpipe_context *lp);
void llvmpipe_update_derived( struct llvmpipe_context *llvmpipe );
unsigned max_index,
unsigned mode, unsigned start, unsigned count);
-void
-llvmpipe_set_edgeflags(struct pipe_context *pipe, const unsigned *edgeflags);
-
-
void
llvmpipe_map_transfers(struct llvmpipe_context *lp);