Merge commit 'origin/master' into gallium-0.2
[mesa.git] / src / gallium / drivers / softpipe / sp_state_derived.c
index 53b2056b8a6e58655fcbcdd2520f242f5ece1f17..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,8 +163,8 @@ softpipe_get_vbuf_vertex_info(struct softpipe_context *softpipe)
 static void
 compute_cliprect(struct softpipe_context *sp)
 {
-   uint surfWidth = sp->fb_width;
-   uint surfHeight = sp->fb_height;
+   uint surfWidth = sp->framebuffer.width;
+   uint surfHeight = sp->framebuffer.height;
 
    if (sp->rasterizer->scissor) {
       /* clip to scissor rect */