[Mesa-dev] [PATCH 10/17] mesa/st: update MSAA enable
Edward O'Callaghan
eocallaghan at alterapraxis.com
Sat Mar 19 06:41:23 UTC 2016
From: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
The rasterizer state used Multisample._Enable to enable msaa. However
that gets updated in core mesa before any st validation happens.
Setting it depends on _NumSamples which happens during st validation.
To break this cyclic dependency I replicated the check at the place
we change _NumSamples.
Signed-off-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
---
src/mesa/state_tracker/st_atom.c | 2 +-
src/mesa/state_tracker/st_atom_framebuffer.c | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c
index fc80adf..d909f24 100644
--- a/src/mesa/state_tracker/st_atom.c
+++ b/src/mesa/state_tracker/st_atom.c
@@ -51,7 +51,6 @@ static const struct st_tracked_state *render_atoms[] =
&st_update_tcp,
&st_update_vp,
- &st_update_rasterizer,
&st_update_polygon_stipple,
&st_update_viewport,
&st_update_scissor,
@@ -68,6 +67,7 @@ static const struct st_tracked_state *render_atoms[] =
&st_bind_gs_images,
&st_bind_fs_images,
&st_update_framebuffer, /* depends on update_*_texture and bind_*_images */
+ &st_update_rasterizer, /* depends on st_update_framebuffer */
&st_update_msaa,
&st_update_sample_shading,
&st_update_vs_constants,
diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c
index 7ca6d57..797032c 100644
--- a/src/mesa/state_tracker/st_atom_framebuffer.c
+++ b/src/mesa/state_tracker/st_atom_framebuffer.c
@@ -116,6 +116,9 @@ update_framebuffer_state( struct st_context *st )
fb->DefaultGeometry._NumSamples =
framebuffer_quantize_num_samples(supported_msaa_modes, fb->DefaultGeometry.NumSamples);
+ st->ctx->Multisample._Enabled = st->ctx->Multisample.Enabled &&
+ _mesa_geometric_samples(fb) > 0;
+
framebuffer->width = _mesa_geometric_width(fb);
framebuffer->height = _mesa_geometric_height(fb);
framebuffer->samples = _mesa_geometric_samples(fb);
--
2.5.0
More information about the mesa-dev
mailing list