diff options
Diffstat (limited to 'lib/mesa/src/gallium/auxiliary/gallivm')
8 files changed, 33 insertions, 7 deletions
diff --git a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_arit.c b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_arit.c index 1c71c0508..9cff0162b 100644 --- a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_arit.c +++ b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_arit.c @@ -1887,6 +1887,8 @@ arch_rounding_available(const struct lp_type type) return TRUE; else if (util_get_cpu_caps()->has_neon) return TRUE; + else if (util_get_cpu_caps()->family == CPU_S390X) + return TRUE; return FALSE; } @@ -1994,7 +1996,8 @@ lp_build_round_arch(struct lp_build_context *bld, LLVMValueRef a, enum lp_build_round_mode mode) { - if (util_get_cpu_caps()->has_sse4_1 || util_get_cpu_caps()->has_neon) { + if (util_get_cpu_caps()->has_sse4_1 || util_get_cpu_caps()->has_neon || + util_get_cpu_caps()->family == CPU_S390X) { LLVMBuilderRef builder = bld->gallivm->builder; const struct lp_type type = bld->type; const char *intrinsic_root; diff --git a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_format_soa.c b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_format_soa.c index bedc8f87b..8e57a5e34 100644 --- a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_format_soa.c +++ b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_format_soa.c @@ -987,6 +987,7 @@ lp_build_pack_rgba_soa(struct gallivm_state *gallivm, { unsigned chan; struct lp_build_context bld; + LLVMValueRef rgba_swiz[4]; assert(format_desc->layout == UTIL_FORMAT_LAYOUT_PLAIN); assert(format_desc->block.width == 1); assert(format_desc->block.height == 1); @@ -995,13 +996,16 @@ lp_build_pack_rgba_soa(struct gallivm_state *gallivm, assert(type.width == 32); lp_build_context_init(&bld, gallivm, type); + + lp_build_format_swizzle_soa(format_desc, &bld, rgba_in, rgba_swiz); + for (chan = 0; chan < format_desc->nr_channels; ++chan) { struct util_format_channel_description chan_desc = format_desc->channel[chan]; lp_build_insert_soa_chan(&bld, format_desc->block.bits, chan_desc, packed, - rgba_in[chan]); + rgba_swiz[chan]); } } diff --git a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_format_yuv.c b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_format_yuv.c index 97deffe1d..3b346f37d 100644 --- a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_format_yuv.c +++ b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_format_yuv.c @@ -335,7 +335,6 @@ rgb_to_rgba_aos(struct gallivm_state *gallivm, */ #if UTIL_ARCH_LITTLE_ENDIAN - r = r; g = LLVMBuildShl(builder, g, lp_build_const_int_vec(gallivm, type, 8), ""); b = LLVMBuildShl(builder, b, lp_build_const_int_vec(gallivm, type, 16), ""); a = lp_build_const_int_vec(gallivm, type, 0xff000000); diff --git a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_limits.h b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_limits.h index 55778f2b6..0e3af4e40 100644 --- a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_limits.h +++ b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_limits.h @@ -59,7 +59,7 @@ #define LP_MAX_TGSI_SHADER_BUFFER_SIZE (1 << 27) -#define LP_MAX_TGSI_SHADER_IMAGES 16 +#define LP_MAX_TGSI_SHADER_IMAGES 32 /* * For quick access we cache registers in statically diff --git a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp index be288ab02..016a0c78a 100644 --- a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +++ b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp @@ -64,6 +64,9 @@ #include <llvm/Support/PrettyStackTrace.h> #include <llvm/ExecutionEngine/ObjectCache.h> #include <llvm/Support/TargetSelect.h> +#if LLVM_VERSION_MAJOR >= 15 +#include <llvm/Support/MemoryBuffer.h> +#endif #if LLVM_VERSION_MAJOR < 11 #include <llvm/IR/CallSite.h> diff --git a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_sample.c b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_sample.c index 19bd8463d..f04b69220 100644 --- a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_sample.c +++ b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_sample.c @@ -445,6 +445,10 @@ lp_build_rho(struct lp_build_sample_context *bld, } } } + + LLVMValueRef rho_is_inf = lp_build_is_inf_or_nan(gallivm, coord_bld->type, rho); + rho = lp_build_select(coord_bld, rho_is_inf, coord_bld->zero, rho); + if (rho_per_quad) { /* * rho_vec contains per-pixel rho, convert to scalar per quad. diff --git a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c index ce58db67e..940a51d4e 100644 --- a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c +++ b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c @@ -2390,10 +2390,11 @@ lp_build_sample_aniso(struct lp_build_sample_context *bld, wnz = LLVMBuildSExt(builder, wnz, bld->int_coord_bld.vec_type, ""); wnz = lp_build_any_true_range(&bld->coord_bld, bld->coord_bld.type.length, wnz); lp_build_if(&noloadw0, gallivm, wnz); - LLVMValueRef new_coords[3]; + LLVMValueRef new_coords[4]; new_coords[0] = lp_build_div(coord_bld, lp_build_int_to_float(coord_bld, u_val), width_dim); new_coords[1] = lp_build_div(coord_bld, lp_build_int_to_float(coord_bld, v_val), height_dim); new_coords[2] = coords[2]; + new_coords[3] = coords[3]; /* lookup q in filter table */ LLVMValueRef temp_colors[4]; @@ -3200,9 +3201,16 @@ lp_build_fetch_texel(struct lp_build_sample_context *bld, * Could use min/max above instead of out-of-bounds comparisons * if we don't care about the result returned for out-of-bounds. */ + LLVMValueRef oob[4] = { + bld->texel_bld.zero, + bld->texel_bld.zero, + bld->texel_bld.zero, + bld->texel_bld.zero, + }; + lp_build_format_swizzle_soa(bld->format_desc, &bld->texel_bld, oob, oob); for (chan = 0; chan < 4; chan++) { colors_out[chan] = lp_build_select(&bld->texel_bld, out_of_bounds, - bld->texel_bld.zero, colors_out[chan]); + oob[chan], colors_out[chan]); } } } @@ -4660,7 +4668,7 @@ lp_build_img_op_soa(const struct lp_static_texture_state *static_texture_state, out1 = lp_build_cmp(&int_coord_bld, PIPE_FUNC_GEQUAL, y, height); out_of_bounds = lp_build_or(&int_coord_bld, out_of_bounds, out1); } - if (dims >= 3) { + if (dims >= 3 || layer_coord) { out1 = lp_build_cmp(&int_coord_bld, PIPE_FUNC_GEQUAL, z, depth); out_of_bounds = lp_build_or(&int_coord_bld, out_of_bounds, out1); } diff --git a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index 31aacef74..afaf35e5b 100644 --- a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c +++ b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c @@ -1562,6 +1562,11 @@ emit_fetch_system_value( atype = TGSI_TYPE_UNSIGNED; break; + case TGSI_SEMANTIC_SAMPLEID: + res = lp_build_broadcast_scalar(&bld_base->uint_bld, bld->system_values.sample_id); + atype = TGSI_TYPE_UNSIGNED; + break; + case TGSI_SEMANTIC_TESSOUTER: res = lp_build_extract_broadcast(gallivm, lp_type_float_vec(32, 128), bld_base->base.type, bld->system_values.tess_outer, |