aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2020-03-21 07:11:39 +1000
committerMarge Bot <[email protected]>2020-05-06 06:20:38 +0000
commit88851c4798a5ee57441cc5ad71d439a5b6f1a609 (patch)
treed3c880007d8c99841926f92059989affb2d6a5e6
parent78b7f2283879d1f952cd13534f4c666447b5b3ea (diff)
llvmpipe: add fixed point sample positions to scene.
These will be used in the rasterizer to generate the coverage masks Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
-rw-r--r--src/gallium/drivers/llvmpipe/lp_scene.c6
-rw-r--r--src/gallium/drivers/llvmpipe/lp_scene.h3
2 files changed, 9 insertions, 0 deletions
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;