summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_jit.h
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-08-23 06:35:09 +0100
committerJosé Fonseca <jfonseca@vmware.com>2009-08-29 09:21:41 +0100
commitc022e15d1e56ba3a9c6b74eef6556d6063e2e322 (patch)
tree86d4db84ea403791b5eba29ebc2f336bab07e305 /src/gallium/drivers/llvmpipe/lp_jit.h
parent8c7c108d712f17a5f307b9c8914b4abc4d5f148e (diff)
llvmpipe: Pass fragment context to generated function in a single structure.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_jit.h')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_jit.h38
1 files changed, 33 insertions, 5 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_jit.h b/src/gallium/drivers/llvmpipe/lp_jit.h
index 03ab268d0c..fe36b60921 100644
--- a/src/gallium/drivers/llvmpipe/lp_jit.h
+++ b/src/gallium/drivers/llvmpipe/lp_jit.h
@@ -36,24 +36,52 @@
#define LP_JIT_H
-#include <llvm-c/Core.h>
+#include "lp_bld_struct.h"
struct tgsi_sampler;
struct llvmpipe_screen;
+/**
+ * This structure is passed directly to the generated fragment shader.
+ *
+ * It contains the derived state.
+ *
+ * Changes here must be reflected in the lp_jit_context_* macros and
+ * lp_jit_init_types function. Changes to the ordering should be avoided.
+ *
+ * Only use types with a clear size and padding here, in particular prefer the
+ * stdint.h types to the basic integer types.
+ */
+struct lp_jit_context
+{
+ const float *constants;
+
+ struct tgsi_sampler **samplers;
+
+ /* TODO: alpha reference value */
+ /* TODO: blend constant color */
+};
+
+
+#define lp_jit_context_constants(_builder, _ptr) \
+ lp_build_struct_get(_builder, _ptr, 0, "context.constants")
+
+#define lp_jit_context_samplers(_builder, _ptr) \
+ lp_build_struct_get(_builder, _ptr, 1, "context.samplers")
+
+
typedef void
-(*lp_jit_frag_func)(uint32_t x,
+(*lp_jit_frag_func)(struct lp_jit_context *context,
+ uint32_t x,
uint32_t y,
const void *a0,
const void *dadx,
const void *dady,
- const void *consts,
uint32_t *mask,
void *color,
- void *depth,
- struct tgsi_sampler **samplers);
+ void *depth);
void