+ * Helper struct holding all derivatives needed for sampling
+ */
+struct lp_derivatives
+{
+ LLVMValueRef ddx[3];
+ LLVMValueRef ddy[3];
+};
+
+
+enum lp_sampler_lod_property {
+ LP_SAMPLER_LOD_SCALAR,
+ LP_SAMPLER_LOD_PER_ELEMENT,
+ LP_SAMPLER_LOD_PER_QUAD
+};
+
+
+enum lp_sampler_lod_control {
+ LP_SAMPLER_LOD_IMPLICIT,
+ LP_SAMPLER_LOD_BIAS,
+ LP_SAMPLER_LOD_EXPLICIT,
+ LP_SAMPLER_LOD_DERIVATIVES,
+};
+
+
+enum lp_sampler_op_type {
+ LP_SAMPLER_OP_TEXTURE,
+ LP_SAMPLER_OP_FETCH,
+ LP_SAMPLER_OP_GATHER
+};
+
+
+#define LP_SAMPLER_SHADOW (1 << 0)
+#define LP_SAMPLER_OFFSETS (1 << 1)
+#define LP_SAMPLER_OP_TYPE_SHIFT 2
+#define LP_SAMPLER_OP_TYPE_MASK (3 << 2)
+#define LP_SAMPLER_LOD_CONTROL_SHIFT 4
+#define LP_SAMPLER_LOD_CONTROL_MASK (3 << 4)
+#define LP_SAMPLER_LOD_PROPERTY_SHIFT 6
+#define LP_SAMPLER_LOD_PROPERTY_MASK (3 << 6)
+
+struct lp_sampler_params
+{
+ struct lp_type type;
+ unsigned texture_index;
+ unsigned sampler_index;
+ unsigned sample_key;
+ LLVMValueRef context_ptr;
+ const LLVMValueRef *coords;
+ const LLVMValueRef *offsets;
+ LLVMValueRef lod;
+ const struct lp_derivatives *derivs;
+ LLVMValueRef *texel;
+};
+
+
+/**
+ * Texture static state.