From 7898978377cfee74d69180d73118dc6b8b2d3579 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sat, 21 Mar 2020 07:38:13 +1000 Subject: [PATCH] llvmpipe: don't choose pixel centers for multisample Don't pick the pixel centers for multisample rendering, fix the setup program. Reviewed-by: Roland Scheidegger Part-of: --- src/gallium/drivers/llvmpipe/lp_state_setup.c | 3 ++- src/gallium/drivers/llvmpipe/lp_state_setup.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_state_setup.c b/src/gallium/drivers/llvmpipe/lp_state_setup.c index 915e21db52c..8e46013a028 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_state_setup.c @@ -652,7 +652,7 @@ init_args(struct gallivm_state *gallivm, load_attribute(gallivm, args, key, 0, attr_pos); pixel_center = lp_build_const_vec(gallivm, typef4, - key->pixel_center_half ? 0.5 : 0.0); + (!key->multisample && key->pixel_center_half) ? 0.5 : 0.0); /* * xy are first two elems in v0a/v1a/v2a but just use vec4 arit @@ -843,6 +843,7 @@ lp_make_setup_variant_key(struct llvmpipe_context *lp, key->num_inputs = fs->info.base.num_inputs; key->flatshade_first = lp->rasterizer->flatshade_first; key->pixel_center_half = lp->rasterizer->half_pixel_center; + key->multisample = lp->rasterizer->multisample; key->twoside = lp->rasterizer->light_twoside; key->size = Offset(struct lp_setup_variant_key, inputs[key->num_inputs]); diff --git a/src/gallium/drivers/llvmpipe/lp_state_setup.h b/src/gallium/drivers/llvmpipe/lp_state_setup.h index 9ad244482de..18e0ea8f08e 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_setup.h +++ b/src/gallium/drivers/llvmpipe/lp_state_setup.h @@ -25,7 +25,8 @@ struct lp_setup_variant_key { unsigned pixel_center_half:1; unsigned twoside:1; unsigned floating_point_depth:1; - unsigned pad:4; + unsigned multisample:1; + unsigned pad:3; /* TODO: get those floats out of the key and use a jit_context for setup */ float pgon_offset_units; -- 2.30.2