From: Dave Airlie Date: Fri, 20 Mar 2020 21:11:39 +0000 (+1000) Subject: llvmpipe: add fixed point sample positions to scene. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=88851c4798a5ee57441cc5ad71d439a5b6f1a609;p=mesa.git llvmpipe: add fixed point sample positions to scene. These will be used in the rasterizer to generate the coverage masks Reviewed-by: Roland Scheidegger Part-of: --- diff --git a/src/gallium/drivers/llvmpipe/lp_scene.c b/src/gallium/drivers/llvmpipe/lp_scene.c index 129f5e0b1a2..ddb8af1a89d 100644 --- a/src/gallium/drivers/llvmpipe/lp_scene.c +++ b/src/gallium/drivers/llvmpipe/lp_scene.c @@ -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); + } + } } diff --git a/src/gallium/drivers/llvmpipe/lp_scene.h b/src/gallium/drivers/llvmpipe/lp_scene.h index 41322baf14d..9f90dbbb02a 100644 --- a/src/gallium/drivers/llvmpipe/lp_scene.h +++ b/src/gallium/drivers/llvmpipe/lp_scene.h @@ -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;