llvmpipe: don't choose pixel centers for multisample
authorDave Airlie <airlied@redhat.com>
Fri, 20 Mar 2020 21:38:13 +0000 (07:38 +1000)
committerMarge Bot <eric+marge@anholt.net>
Wed, 6 May 2020 06:20:38 +0000 (06:20 +0000)
Don't pick the pixel centers for multisample rendering, fix
the setup program.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>

src/gallium/drivers/llvmpipe/lp_state_setup.c
src/gallium/drivers/llvmpipe/lp_state_setup.h

index 915e21db52cfc9a0993d74fdd8e32782f1ab0981..8e46013a028634c2178d54b4aadb2eacf3cfb105 100644 (file)
@@ -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]);
index 9ad244482de62f4c6fbe219ed02ad06a0f0c3b76..18e0ea8f08e515123878dbfb6d37b12acf6fe8f6 100644 (file)
@@ -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;