nv20: set surface status in clear()
[mesa.git] / src / gallium / drivers / softpipe / sp_state_derived.c
index 82cb31ece73ea934bf2be6e44f155654be63270f..6b6a4c3ff3487a4fd9ab6becbafae0d959c80a5f 100644 (file)
@@ -25,7 +25,8 @@
  * 
  **************************************************************************/
 
-#include "pipe/p_util.h"
+#include "util/u_math.h"
+#include "util/u_memory.h"
 #include "pipe/p_shader_tokens.h"
 #include "draw/draw_context.h"
 #include "draw/draw_vertex.h"
@@ -71,25 +72,16 @@ softpipe_get_vertex_info(struct softpipe_context *softpipe)
           * simply emit the whole post-xform vertex as-is:
           */
          struct vertex_info *vinfo_vbuf = &softpipe->vertex_info_vbuf;
-#if 0
-         vinfo_vbuf->num_attribs = 0;
-         /* special-case to allow memcpy of whole vertex */
-         draw_emit_vertex_attr(vinfo_vbuf, EMIT_ALL, INTERP_NONE, 0);
-         /* size in dwords or floats */
-         vinfo_vbuf->size = 4 * draw_num_vs_outputs(softpipe->draw)
-                          + sizeof(struct vertex_header) / 4;
-#else
-         /* for pass-through mode, we need a more explicit list of attribs */
          const uint num = draw_num_vs_outputs(softpipe->draw);
          uint i;
 
+         /* No longer any need to try and emit draw vertex_header info.
+          */
          vinfo_vbuf->num_attribs = 0;
-         draw_emit_vertex_attr(vinfo_vbuf, EMIT_HEADER, INTERP_NONE, 0);
          for (i = 0; i < num; i++) {
             draw_emit_vertex_attr(vinfo_vbuf, EMIT_4F, INTERP_PERSPECTIVE, i);
          }
          draw_compute_vertex_size(vinfo_vbuf);
-#endif
       }
 
       /*
@@ -171,17 +163,8 @@ softpipe_get_vbuf_vertex_info(struct softpipe_context *softpipe)
 static void
 compute_cliprect(struct softpipe_context *sp)
 {
-   unsigned surfWidth, surfHeight;
-
-   if (sp->framebuffer.num_cbufs > 0) {
-      surfWidth = sp->framebuffer.cbufs[0]->width;
-      surfHeight = sp->framebuffer.cbufs[0]->height;
-   }
-   else {
-      /* no surface? */
-      surfWidth = sp->scissor.maxx;
-      surfHeight = sp->scissor.maxy;
-   }
+   uint surfWidth = sp->framebuffer.width;
+   uint surfHeight = sp->framebuffer.height;
 
    if (sp->rasterizer->scissor) {
       /* clip to scissor rect */