Delete code made dead by previous uniform related patches
[mesa.git] / src / mesa / state_tracker / st_atom_rasterizer.c
index 451299cef0cefcd7c79ba5cd5367b195f8d1fc6f..250cbb2260c9425528b24b4d005b6a48409911c2 100644 (file)
@@ -70,14 +70,16 @@ static void update_raster_state( struct st_context *st )
    {
       raster->front_ccw = (ctx->Polygon.FrontFace == GL_CCW);
 
-      /* XXX
-       * I think the intention here is that user-created framebuffer objects
-       * use Y=0=TOP layout instead of OpenGL's normal Y=0=bottom layout.
-       * Flipping Y changes CW to CCW and vice-versa.
-       * But this is an implementation/driver-specific artifact - remove...
+      /*
+       * Gallium's surfaces are Y=0=TOP orientation.  OpenGL is the
+       * opposite.  Window system surfaces are Y=0=TOP.  Mesa's FBOs
+       * must match OpenGL conventions so FBOs use Y=0=BOTTOM.  In that
+       * case, we must invert Y and flip the notion of front vs. back.
        */
-      if (ctx->DrawBuffer && ctx->DrawBuffer->Name != 0)
+      if (st_fb_orientation(ctx->DrawBuffer) == Y_0_BOTTOM) {
+         /* Drawing to an FBO.  The viewport will be inverted. */
          raster->front_ccw ^= 1;
+      }
    }
 
    /* _NEW_LIGHT
@@ -96,9 +98,8 @@ static void update_raster_state( struct st_context *st )
     */
    if (ctx->VertexProgram._Current) {
       if (ctx->VertexProgram._Enabled ||
-          (ctx->Shader.CurrentProgram &&
-           ctx->Shader.CurrentProgram->VertexProgram &&
-           ctx->Shader.CurrentProgram->LinkStatus)) {
+          (ctx->Shader.CurrentVertexProgram &&
+           ctx->Shader.CurrentVertexProgram->LinkStatus)) {
          /* user-defined vertex program or shader */
          raster->light_twoside = ctx->VertexProgram.TwoSideEnabled;
       }
@@ -111,6 +112,8 @@ static void update_raster_state( struct st_context *st )
       raster->light_twoside = 1;
    }
 
+   raster->clamp_vertex_color = ctx->Light._ClampVertexColor;
+
    /* _NEW_POLYGON
     */
    if (ctx->Polygon.CullFlag) {
@@ -251,6 +254,9 @@ static void update_raster_state( struct st_context *st )
    if (ctx->Scissor.Enabled)
       raster->scissor = 1;
 
+   /* _NEW_FRAG_CLAMP */
+   raster->clamp_fragment_color = ctx->Color._ClampFragmentColor;
+
    raster->gl_rasterization_rules = 1;
 
    cso_set_rasterizer(st->cso_context, raster);
@@ -266,7 +272,8 @@ const struct st_tracked_state st_update_rasterizer = {
        _NEW_POINT |
        _NEW_POLYGON |
        _NEW_PROGRAM |
-       _NEW_SCISSOR),      /* mesa state dependencies*/
+       _NEW_SCISSOR |
+       _NEW_FRAG_CLAMP),      /* mesa state dependencies*/
       ST_NEW_VERTEX_PROGRAM,  /* state tracker dependencies */
    },
    update_raster_state     /* update function */