st/mesa: expose conservative_depth if GLSL 1.3 is supported
[mesa.git] / src / mesa / state_tracker / st_atom_clip.c
index 8ccad637d5f83a26a7e56488bf4df106fa07c65a..1330db843a666b8e59046aab7faf765a503ba240 100644 (file)
 #include "pipe/p_context.h"
 #include "st_atom.h"
 
+#include "cso_cache/cso_context.h"
+
 
 /* Second state atom for user clip planes:
  */
 static void update_clip( struct st_context *st )
 {
    struct pipe_clip_state clip;
+   const struct gl_context *ctx = st->ctx;
    GLuint i;
 
    memset(&clip, 0, sizeof(clip));
 
    for (i = 0; i < PIPE_MAX_CLIP_PLANES; i++) {
-      if (st->ctx->Transform.ClipPlanesEnabled & (1 << i)) {
+      if (ctx->Transform.ClipPlanesEnabled & (1 << i)) {
         memcpy(clip.ucp[clip.nr], 
-               st->ctx->Transform._ClipUserPlane[i], 
+               ctx->Transform._ClipUserPlane[i], 
                sizeof(clip.ucp[0]));
         clip.nr++;
       }
    }
+
+   clip.depth_clamp = ctx->Transform.DepthClamp != GL_FALSE;
       
    if (memcmp(&clip, &st->state.clip, sizeof(clip)) != 0) {
       st->state.clip = clip;
-      st->pipe->set_clip_state(st->pipe, &clip);
+      cso_set_clip(st->cso_context, &clip);
    }
 }
 
 
 const struct st_tracked_state st_update_clip = {
-   .dirty = {
-      .mesa = (_NEW_TRANSFORM),
-      .st  = 0,
+   "st_update_clip",                                   /* name */
+   {                                                   /* dirty */
+      (_NEW_TRANSFORM),                                        /* mesa */
+      0,                                               /* st */
    },
-   .update = update_clip
+   update_clip                                         /* update */
 };
-
-
-
-
-