Merge branch 'mesa_7_6_branch'
[mesa.git] / src / gallium / drivers / llvmpipe / lp_jit.h
index fe36b6092120122115eb4170a7a847832f07254f..58f716ede292dfbbd08be894c813d87787c010b0 100644 (file)
 
 #include "lp_bld_struct.h"
 
+#include "pipe/p_state.h"
+
 
 struct tgsi_sampler;
 struct llvmpipe_screen;
 
 
+struct lp_jit_texture
+{
+   uint32_t width;
+   uint32_t height;
+   uint32_t stride;
+   const void *data;
+};
+
+
+enum {
+   LP_JIT_TEXTURE_WIDTH = 0,
+   LP_JIT_TEXTURE_HEIGHT,
+   LP_JIT_TEXTURE_STRIDE,
+   LP_JIT_TEXTURE_DATA
+};
+
+
+
 /**
  * This structure is passed directly to the generated fragment shader.
  *
@@ -60,16 +80,31 @@ struct lp_jit_context
 
    struct tgsi_sampler **samplers;
 
-   /* TODO: alpha reference value */
-   /* TODO: blend constant color */
+   float alpha_ref_value;
+
+   /* FIXME: store (also?) in floats */
+   uint8_t *blend_color;
+
+   struct lp_jit_texture textures[PIPE_MAX_SAMPLERS];
 };
 
 
 #define lp_jit_context_constants(_builder, _ptr) \
-   lp_build_struct_get(_builder, _ptr, 0, "context.constants")
+   lp_build_struct_get(_builder, _ptr, 0, "constants")
 
 #define lp_jit_context_samplers(_builder, _ptr) \
-   lp_build_struct_get(_builder, _ptr, 1, "context.samplers")
+   lp_build_struct_get(_builder, _ptr, 1, "samplers")
+
+#define lp_jit_context_alpha_ref_value(_builder, _ptr) \
+   lp_build_struct_get(_builder, _ptr, 2, "alpha_ref_value")
+
+#define lp_jit_context_blend_color(_builder, _ptr) \
+   lp_build_struct_get(_builder, _ptr, 3, "blend_color")
+
+#define LP_JIT_CONTEXT_TEXTURES_INDEX 4
+
+#define lp_jit_context_textures(_builder, _ptr) \
+   lp_build_struct_get_ptr(_builder, _ptr, LP_JIT_CONTEXT_TEXTURES_INDEX, "textures")
 
 
 typedef void
@@ -83,6 +118,11 @@ typedef void
                     void *color,
                     void *depth);
 
+void PIPE_CDECL
+lp_fetch_texel_soa( struct tgsi_sampler **samplers,
+                    uint32_t unit,
+                    float *store );
+
 
 void
 lp_jit_screen_cleanup(struct llvmpipe_screen *screen);