From 39a938ecf41b7629623217fc056572b1adad750a Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Fri, 7 May 2021 14:04:14 +0200 Subject: [PATCH] lavapipe: fix fsum with swizzle We can do stuff like this: vec1 32 ssa_207 = fsum3 ssa_209.xxx In this case, we'd end up not swizzling in get_alu_src, and reading components out-of-bounds, which LLVM isn't very happy about, and thus takes punitive actions, in the form of a segfault. We don't want that, and we already know from the opcode what the component counts should be here. Reviewed-By: Mike Blumenkrantz Part-of: --- src/gallium/auxiliary/gallivm/lp_bld_nir.c | 2 +- src/gallium/drivers/zink/ci/piglit-zink-lvp-fails.txt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir.c b/src/gallium/auxiliary/gallivm/lp_bld_nir.c index 5ac3e76..51c6ecb 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_nir.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_nir.c @@ -1004,7 +1004,7 @@ static void visit_alu(struct lp_build_nir_context *bld_base, const nir_alu_instr case nir_op_fsum2: case nir_op_fsum3: case nir_op_fsum4: - src_components = nir_src_num_components(instr->src[0].src); + src_components = nir_op_infos[instr->op].input_sizes[0]; break; default: src_components = num_components; diff --git a/src/gallium/drivers/zink/ci/piglit-zink-lvp-fails.txt b/src/gallium/drivers/zink/ci/piglit-zink-lvp-fails.txt index 5b6ec47..46dc88d 100644 --- a/src/gallium/drivers/zink/ci/piglit-zink-lvp-fails.txt +++ b/src/gallium/drivers/zink/ci/piglit-zink-lvp-fails.txt @@ -64,7 +64,6 @@ spec@!opengl 3.2@gl-3.2-adj-prims pv-first,Fail spec@!opengl es 2.0@glsl-fs-pointcoord,Fail spec@!opengl es 3.0@gles-3.0-transform-feedback-uniform-buffer-object,Fail spec@arb_depth_texture@depth-tex-modes,Fail -spec@arb_fragment_program@fp-abs-01,Crash spec@arb_framebuffer_object@fbo-blit-scaled-linear,Fail spec@arb_framebuffer_object@fbo-gl_pointcoord,Fail spec@arb_get_program_binary@restore-sso-program,Fail -- 2.7.4