diff options
author | Erik Faye-Lund <erik.faye-lund@collabora.com> | 2019-04-30 13:41:39 +0200 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2019-05-08 16:40:18 -0700 |
commit | 5bebe2a00deb4d8463c8ee6df5c86e56c7aa2163 (patch) | |
tree | 7a5dea7a6c2547b1f3c14dbb35ef232e644b5cb6 | |
parent | 4b0f0599388561da98ddcfd684018f39641061fe (diff) |
softpipe: setup pixel_offset for all primitive types
If we don't update this for all primitive-types, we end up rendering
slightly offset points and lines up until the point where the first
triangle gets drawn. This is obviously not correct, and violates
OpenGL's repeatability rule.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Fixes: ca9c413647b ("softpipe: Respect gl_rasterization_rules in
primitive setup.")
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
(cherry picked from commit f753ac355e5bbd1129755224c54a73339da97cb1)
-rw-r--r-- | src/gallium/drivers/softpipe/sp_setup.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/gallium/drivers/softpipe/sp_setup.c b/src/gallium/drivers/softpipe/sp_setup.c index ffe49260b9a..a91e4f588c8 100644 --- a/src/gallium/drivers/softpipe/sp_setup.c +++ b/src/gallium/drivers/softpipe/sp_setup.c @@ -390,17 +390,6 @@ setup_sort_vertices(struct setup_context *setup, return FALSE; } - - /* Prepare pixel offset for rasterisation: - * - pixel center (0.5, 0.5) for GL, or - * - assume (0.0, 0.0) for other APIs. - */ - if (setup->softpipe->rasterizer->half_pixel_center) { - setup->pixel_offset = 0.5f; - } else { - setup->pixel_offset = 0.0f; - } - return TRUE; } @@ -1476,6 +1465,16 @@ sp_setup_prepare(struct setup_context *setup) } } + /* Prepare pixel offset for rasterisation: + * - pixel center (0.5, 0.5) for GL, or + * - assume (0.0, 0.0) for other APIs. + */ + if (setup->softpipe->rasterizer->half_pixel_center) { + setup->pixel_offset = 0.5f; + } else { + setup->pixel_offset = 0.0f; + } + setup->max_layer = max_layer; sp->quad.first->begin( sp->quad.first ); |