ac/llvm: add support for texturing with clamped LOD
[mesa.git] / src / amd / llvm / ac_llvm_build.h
index 8f6d56ab687ae9cbdb3cc7b748ac689adef6cfc6..703f7ea31ccd2411d7204488e13711fb61dec408 100644 (file)
@@ -73,6 +73,7 @@ struct ac_llvm_context {
        LLVMTypeRef i16;
        LLVMTypeRef i32;
        LLVMTypeRef i64;
+       LLVMTypeRef i128;
        LLVMTypeRef intptr;
        LLVMTypeRef f16;
        LLVMTypeRef f32;
@@ -96,6 +97,8 @@ struct ac_llvm_context {
        LLVMValueRef i32_1;
        LLVMValueRef i64_0;
        LLVMValueRef i64_1;
+       LLVMValueRef i128_0;
+       LLVMValueRef i128_1;
        LLVMValueRef f16_0;
        LLVMValueRef f16_1;
        LLVMValueRef f32_0;
@@ -105,6 +108,12 @@ struct ac_llvm_context {
        LLVMValueRef i1true;
        LLVMValueRef i1false;
 
+       /* Temporary helper to implement demote_to_helper:
+         * True = live lanes
+         * False = demoted lanes
+         */
+       LLVMValueRef postponed_kill;
+
        /* Since ac_nir_translate makes a local copy of ac_llvm_context, there
         * are two ac_llvm_contexts. Declare a pointer here, so that the control
         * flow stack is shared by both ac_llvm_contexts.
@@ -114,8 +123,6 @@ struct ac_llvm_context {
        unsigned range_md_kind;
        unsigned invariant_load_md_kind;
        unsigned uniform_md_kind;
-       unsigned fpmath_md_kind;
-       LLVMValueRef fpmath_md_2p5_ulp;
        LLVMValueRef empty_md;
 
        enum chip_class chip_class;
@@ -554,6 +561,7 @@ struct ac_image_args {
        LLVMValueRef derivs[6];
        LLVMValueRef coords[4];
        LLVMValueRef lod; // also used by ac_image_get_resinfo
+       LLVMValueRef min_lod;
 };
 
 LLVMValueRef ac_build_image_opcode(struct ac_llvm_context *ctx,
@@ -604,6 +612,7 @@ void ac_optimize_vs_outputs(struct ac_llvm_context *ac,
                            LLVMValueRef main_fn,
                            uint8_t *vs_output_param_offset,
                            uint32_t num_outputs,
+                           uint32_t skip_output_mask,
                            uint8_t *num_param_exports);
 void ac_init_exec_full_mask(struct ac_llvm_context *ctx);
 
@@ -652,6 +661,9 @@ void ac_apply_fmask_to_sample(struct ac_llvm_context *ac, LLVMValueRef fmask,
 LLVMValueRef
 ac_build_ds_swizzle(struct ac_llvm_context *ctx, LLVMValueRef src, unsigned mask);
 
+LLVMValueRef ac_build_readlane_no_opt_barrier(struct ac_llvm_context *ctx,
+                                             LLVMValueRef src, LLVMValueRef lane);
+
 LLVMValueRef
 ac_build_readlane(struct ac_llvm_context *ctx, LLVMValueRef src, LLVMValueRef lane);
 
@@ -731,6 +743,9 @@ ac_build_ddxy_interp(struct ac_llvm_context *ctx, LLVMValueRef interp_ij);
 LLVMValueRef
 ac_build_load_helper_invocation(struct ac_llvm_context *ctx);
 
+LLVMValueRef
+ac_build_is_helper_invocation(struct ac_llvm_context *ctx);
+
 LLVMValueRef ac_build_call(struct ac_llvm_context *ctx, LLVMValueRef func,
                           LLVMValueRef *args, unsigned num_args);
 
@@ -747,6 +762,22 @@ ac_export_mrt_z(struct ac_llvm_context *ctx, LLVMValueRef depth,
                LLVMValueRef stencil, LLVMValueRef samplemask,
                struct ac_export_args *args);
 
+void ac_build_sendmsg_gs_alloc_req(struct ac_llvm_context *ctx, LLVMValueRef wave_id,
+                                  LLVMValueRef vtx_cnt, LLVMValueRef prim_cnt);
+
+struct ac_ngg_prim {
+       unsigned num_vertices;
+       LLVMValueRef isnull;
+       LLVMValueRef index[3];
+       LLVMValueRef edgeflag[3];
+       LLVMValueRef passthrough;
+};
+
+LLVMValueRef ac_pack_prim_export(struct ac_llvm_context *ctx,
+                                const struct ac_ngg_prim *prim);
+void ac_build_export_prim(struct ac_llvm_context *ctx,
+                         const struct ac_ngg_prim *prim);
+
 static inline LLVMValueRef
 ac_get_arg(struct ac_llvm_context *ctx, struct ac_arg arg)
 {
@@ -767,6 +798,16 @@ LLVMValueRef ac_build_main(const struct ac_shader_args *args,
                           enum ac_llvm_calling_convention convention,
                           const char *name, LLVMTypeRef ret_type,
                           LLVMModuleRef module);
+void ac_build_s_endpgm(struct ac_llvm_context *ctx);
+
+LLVMValueRef ac_prefix_bitcount(struct ac_llvm_context *ctx,
+                               LLVMValueRef mask, LLVMValueRef index);
+LLVMValueRef ac_prefix_bitcount_2x64(struct ac_llvm_context *ctx,
+                                    LLVMValueRef mask[2], LLVMValueRef index);
+void ac_build_triangle_strip_indices_to_triangle(struct ac_llvm_context *ctx,
+                                                LLVMValueRef is_odd,
+                                                LLVMValueRef flatshade_first,
+                                                LLVMValueRef index[3]);
 
 #ifdef __cplusplus
 }