Mesa (master): draw: Cosmetic cleanups and comments.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Sun Apr 18 08:38:10 UTC 2010


Module: Mesa
Branch: master
Commit: b609cfc7c9c38f26e7e6d6f7dd5dd6d38f4ed209
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b609cfc7c9c38f26e7e6d6f7dd5dd6d38f4ed209

Author: José Fonseca <jfonseca at vmware.com>
Date:   Sun Apr 18 09:45:54 2010 +0200

draw: Cosmetic cleanups and comments.

---

 src/gallium/auxiliary/draw/draw_context.c   |    6 ++++++
 src/gallium/auxiliary/draw/draw_pipe.c      |    2 +-
 src/gallium/auxiliary/draw/draw_pipe_vbuf.c |    2 +-
 src/gallium/auxiliary/draw/draw_vertex.h    |    4 ++--
 4 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c
index b6574a9..99f4e6d 100644
--- a/src/gallium/auxiliary/draw/draw_context.c
+++ b/src/gallium/auxiliary/draw/draw_context.c
@@ -56,6 +56,12 @@ fail:
 
 boolean draw_init(struct draw_context *draw)
 {
+   /*
+    * Note that several functions compute the clipmask of the predefined
+    * formats with hardcoded formulas instead of using these. So modifications
+    * here must be reflected there too.
+    */
+
    ASSIGN_4V( draw->plane[0], -1,  0,  0, 1 );
    ASSIGN_4V( draw->plane[1],  1,  0,  0, 1 );
    ASSIGN_4V( draw->plane[2],  0, -1,  0, 1 );
diff --git a/src/gallium/auxiliary/draw/draw_pipe.c b/src/gallium/auxiliary/draw/draw_pipe.c
index 83dc1a3..b8f57dd 100644
--- a/src/gallium/auxiliary/draw/draw_pipe.c
+++ b/src/gallium/auxiliary/draw/draw_pipe.c
@@ -225,7 +225,7 @@ static void do_triangle( struct draw_context *draw,
 
 
 /**
- * Code to run the pipeline on a fairly arbitary collection of vertices.
+ * Code to run the pipeline on a fairly arbitrary collection of vertices.
  * For drawing indexed primitives.
  *
  * Vertex headers must be pre-initialized with the
diff --git a/src/gallium/auxiliary/draw/draw_pipe_vbuf.c b/src/gallium/auxiliary/draw/draw_pipe_vbuf.c
index 1c7db00..ee2b811 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_vbuf.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_vbuf.c
@@ -235,7 +235,7 @@ vbuf_start_prim( struct vbuf_stage *vbuf, uint prim )
    for (i = 0; i < vbuf->vinfo->num_attribs; i++) {
       unsigned emit_sz = 0;
       unsigned src_buffer = 0;
-      unsigned output_format;
+      enum pipe_format output_format;
       unsigned src_offset = (vbuf->vinfo->attrib[i].src_index * 4 * sizeof(float) );
 
       output_format = draw_translate_vinfo_format(vbuf->vinfo->attrib[i].emit);
diff --git a/src/gallium/auxiliary/draw/draw_vertex.h b/src/gallium/auxiliary/draw/draw_vertex.h
index ca27237..3af31ff 100644
--- a/src/gallium/auxiliary/draw/draw_vertex.h
+++ b/src/gallium/auxiliary/draw/draw_vertex.h
@@ -142,7 +142,7 @@ void draw_dump_emitted_vertex(const struct vertex_info *vinfo,
                               const uint8_t *data);
 
 
-static INLINE unsigned draw_translate_vinfo_format(enum attrib_emit emit)
+static INLINE enum pipe_format draw_translate_vinfo_format(enum attrib_emit emit)
 {
    switch (emit) {
    case EMIT_OMIT:
@@ -166,7 +166,7 @@ static INLINE unsigned draw_translate_vinfo_format(enum attrib_emit emit)
    }
 }
 
-static INLINE unsigned draw_translate_vinfo_size(enum attrib_emit emit)
+static INLINE enum attrib_emit draw_translate_vinfo_size(enum attrib_emit emit)
 {
    switch (emit) {
    case EMIT_OMIT:




More information about the mesa-commit mailing list