gallivm,draw,llvmpipe: Support wider native registers.
[mesa.git] / src / gallium / auxiliary / gallivm / lp_bld_tgsi.h
index 773c679a4d838d94848a70395e89fa20bd87ac77..e292420a61a6c67e467fd21f82065a0510ee7dcf 100644 (file)
@@ -60,6 +60,7 @@ struct tgsi_token;
 struct tgsi_shader_info;
 struct lp_build_mask_context;
 struct gallivm_state;
+struct lp_derivatives;
 
 
 enum lp_build_tex_modifier {
@@ -145,6 +146,15 @@ struct lp_tgsi_info
    const struct lp_tgsi_channel_info *cbuf[PIPE_MAX_COLOR_BUFS];
 };
 
+/**
+ * Reference to system values.
+ */
+struct lp_bld_tgsi_system_values {
+   LLVMValueRef instance_id;
+   LLVMValueRef vertex_id;
+};
+
+
 /**
  * Sampler code generation interface.
  *
@@ -165,11 +175,18 @@ struct lp_build_sampler_soa
                         unsigned unit,
                         unsigned num_coords,
                         const LLVMValueRef *coords,
-                        const LLVMValueRef *ddx,
-                        const LLVMValueRef *ddy,
+                        const struct lp_derivatives *derivs,
                         LLVMValueRef lod_bias, /* optional */
                         LLVMValueRef explicit_lod, /* optional */
                         LLVMValueRef *texel);
+
+   void
+   (*emit_size_query)( const struct lp_build_sampler_soa *sampler,
+                       struct gallivm_state *gallivm,
+                       struct lp_type type,
+                       unsigned unit,
+                       LLVMValueRef explicit_lod, /* optional */
+                       LLVMValueRef *sizes_out);
 };
 
 
@@ -181,8 +198,7 @@ struct lp_build_sampler_aos
                         unsigned target, /* TGSI_TEXTURE_* */
                         unsigned unit,
                         LLVMValueRef coords,
-                        LLVMValueRef ddx,
-                        LLVMValueRef ddy,
+                        const struct lp_derivatives derivs,
                         enum lp_build_tex_modifier modifier);
 };
 
@@ -198,7 +214,7 @@ lp_build_tgsi_soa(struct gallivm_state *gallivm,
                   struct lp_type type,
                   struct lp_build_mask_context *mask,
                   LLVMValueRef consts_ptr,
-                  LLVMValueRef system_values_array,
+                  const struct lp_bld_tgsi_system_values *system_values,
                   const LLVMValueRef *pos,
                   const LLVMValueRef (*inputs)[4],
                   LLVMValueRef (*outputs)[4],
@@ -218,13 +234,6 @@ lp_build_tgsi_aos(struct gallivm_state *gallivm,
                   const struct tgsi_shader_info *info);
 
 
-LLVMValueRef
-lp_build_system_values_array(struct gallivm_state *gallivm,
-                             const struct tgsi_shader_info *info,
-                             LLVMValueRef instance_id,
-                             LLVMValueRef facing);
-
-
 struct lp_exec_mask {
    struct lp_build_context *bld;
 
@@ -381,7 +390,7 @@ struct lp_build_tgsi_soa_context
     */
    LLVMValueRef inputs_array;
 
-   LLVMValueRef system_values_array;
+   struct lp_bld_tgsi_system_values system_values;
 
    /** bitmask indicating which register files are accessed indirectly */
    unsigned indirect_files;