aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_atom_msaa.c
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2014-03-30 18:21:50 -0400
committerIlia Mirkin <[email protected]>2014-04-26 11:52:52 -0400
commitc5d822dad902b19f06c9be3c6863a51e1881ec5b (patch)
tree4d2f07f9cb6f0aad08c594759b2a631bdda54b8e /src/mesa/state_tracker/st_atom_msaa.c
parent88d8d88d8c151ca1e8ec3af0caba16a4e34ca281 (diff)
mesa/st: add support for ARB_sample_shading
Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_atom_msaa.c')
-rw-r--r--src/mesa/state_tracker/st_atom_msaa.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_atom_msaa.c b/src/mesa/state_tracker/st_atom_msaa.c
index 2f3a42e0248..703cb5e755c 100644
--- a/src/mesa/state_tracker/st_atom_msaa.c
+++ b/src/mesa/state_tracker/st_atom_msaa.c
@@ -27,8 +27,10 @@
#include "st_context.h"
+#include "pipe/p_screen.h"
#include "pipe/p_context.h"
#include "st_atom.h"
+#include "st_program.h"
#include "cso_cache/cso_context.h"
#include "util/u_framebuffer.h"
@@ -70,6 +72,18 @@ static void update_sample_mask( struct st_context *st )
}
}
+static void update_sample_shading( struct st_context *st )
+{
+ if (!st->fp)
+ return;
+
+ if (!st->ctx->Extensions.ARB_sample_shading)
+ return;
+
+ cso_set_min_samples(
+ st->cso_context,
+ _mesa_get_min_invocations_per_fragment(st->ctx, &st->fp->Base, false));
+}
const struct st_tracked_state st_update_msaa = {
"st_update_msaa", /* name */
@@ -79,3 +93,12 @@ const struct st_tracked_state st_update_msaa = {
},
update_sample_mask /* update */
};
+
+const struct st_tracked_state st_update_sample_shading = {
+ "st_update_sample_shading", /* name */
+ { /* dirty */
+ (_NEW_MULTISAMPLE | _NEW_PROGRAM | _NEW_BUFFERS), /* mesa */
+ ST_NEW_FRAGMENT_PROGRAM | ST_NEW_FRAMEBUFFER, /* st */
+ },
+ update_sample_shading /* update */
+};