mesa/formats: add more MESA_FORMAT_LAYOUTs
[mesa.git] / src / mesa / state_tracker / st_atom_msaa.c
index 2f3a42e0248f62334c3d67b9283c5d47766e222e..703cb5e755cd9e12219714542b0c90108d6eb634 100644 (file)
 
 
 #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 */
+};