summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_llvm.h
diff options
context:
space:
mode:
authorZack Rusin <zackr@vmware.com>2010-04-06 16:28:48 -0400
committerZack Rusin <zackr@vmware.com>2010-04-06 16:28:48 -0400
commit323fdd8ae5baf16df6c57754e58adc8e22d28e10 (patch)
treebd3630fbf00ec0d086712e4e76091894b66a6d83 /src/gallium/auxiliary/draw/draw_llvm.h
parent1e0bf24139f6047f505b138392fc0f1d6584d6bc (diff)
downloadexternal_mesa3d-323fdd8ae5baf16df6c57754e58adc8e22d28e10.zip
external_mesa3d-323fdd8ae5baf16df6c57754e58adc8e22d28e10.tar.gz
external_mesa3d-323fdd8ae5baf16df6c57754e58adc8e22d28e10.tar.bz2
draw llvm: implement simple pipeline caching using variants
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_llvm.h')
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm.h27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm.h b/src/gallium/auxiliary/draw/draw_llvm.h
index afafa15..774eb16 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.h
+++ b/src/gallium/auxiliary/draw/draw_llvm.h
@@ -136,8 +136,6 @@ struct draw_llvm {
struct draw_jit_context jit_context;
- draw_jit_vert_func jit_func;
-
LLVMModuleRef module;
LLVMExecutionEngineRef engine;
LLVMModuleProviderRef provider;
@@ -150,22 +148,39 @@ struct draw_llvm {
};
+struct draw_llvm_variant_key
+{
+ struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS];
+ unsigned nr_vertex_buffers;
+ struct pipe_vertex_element vertex_element[PIPE_MAX_ATTRIBS];
+ unsigned nr_vertex_elements;
+ struct pipe_shader_state vs;
+};
+
+struct draw_llvm_variant
+{
+ struct draw_llvm_variant_key key;
+ LLVMValueRef function;
+ draw_jit_vert_func jit_func;
+
+ struct draw_llvm_variant *next;
+};
+
struct draw_llvm *
draw_llvm_create(struct draw_context *draw);
void
draw_llvm_destroy(struct draw_llvm *llvm);
-void
+struct draw_llvm_variant *
draw_llvm_prepare(struct draw_llvm *llvm, int num_inputs);
-/* generates the draw jit function */
void
-draw_llvm_generate(struct draw_llvm *llvm);
+draw_llvm_make_variant_key(struct draw_llvm *llvm,
+ struct draw_llvm_variant_key *key);
LLVMValueRef
draw_llvm_translate_from(LLVMBuilderRef builder,
LLVMValueRef vbuffer,
enum pipe_format from_format);
-
#endif