llvmpipe: add fixed point sample positions to scene.
authorDave Airlie <airlied@redhat.com>
Fri, 20 Mar 2020 21:11:39 +0000 (07:11 +1000)
committerMarge Bot <eric+marge@anholt.net>
Wed, 6 May 2020 06:20:38 +0000 (06:20 +0000)
These will be used in the rasterizer to generate the coverage masks

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

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

index 129f5e0b1a246cefa0eb9eb420805b6556dc4634..ddb8af1a89dd974b5c87b88e0ae24e84ed253109 100644 (file)
@@ -553,6 +553,12 @@ void lp_scene_begin_binning(struct lp_scene *scene,
    }
    scene->fb_max_layer = max_layer;
    scene->fb_max_samples = util_framebuffer_get_num_samples(fb);
+   if (scene->fb_max_samples == 4) {
+      for (unsigned i = 0; i < 4; i++) {
+         scene->fixed_sample_pos[i][0] = util_iround(lp_sample_pos_4x[i][0] * FIXED_ONE);
+         scene->fixed_sample_pos[i][1] = util_iround(lp_sample_pos_4x[i][1] * FIXED_ONE);
+      }
+   }
 }
 
 
index 41322baf14d07247217e3cc466795da48f803f79..9f90dbbb02a6682e5ce865aaff3481013888a32d 100644 (file)
@@ -150,6 +150,9 @@ struct lp_scene {
    /* The amount of layers in the fb (minimum of all attachments) */
    unsigned fb_max_layer;
 
+   /* fixed point sample positions. */
+   int32_t fixed_sample_pos[LP_MAX_SAMPLES][2];
+
    /* max samples for bound framebuffer */
    unsigned fb_max_samples;