summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/draw
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-01-22 12:17:02 -0700
committerBrian Paul <brianp@vmware.com>2010-01-22 12:17:02 -0700
commitcd8614b0287dc5a69725ec4ee0208fad61f7789e (patch)
tree3ee089b8384e7a60c5c3a3cc87f2a633bd724bbe /src/gallium/auxiliary/draw
parent2b20b604277e3cdf7afb2431b50dbb05da12ff1c (diff)
parent64871747bb7b611ffe429fbf1724bd98ee25dd84 (diff)
Merge branch 'mesa_7_7_branch'
Conflicts: src/gallium/auxiliary/draw/draw_context.c src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c src/gallium/auxiliary/pipebuffer/Makefile src/gallium/auxiliary/pipebuffer/SConscript src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c src/gallium/auxiliary/tgsi/tgsi_scan.c src/gallium/drivers/i915/i915_surface.c src/gallium/drivers/i915/i915_texture.c src/gallium/drivers/llvmpipe/lp_setup.c src/gallium/drivers/llvmpipe/lp_tex_sample_c.c src/gallium/drivers/llvmpipe/lp_texture.c src/gallium/drivers/softpipe/sp_prim_vbuf.c src/gallium/state_trackers/xorg/xorg_dri2.c src/gallium/winsys/drm/intel/gem/intel_drm_api.c src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c src/gallium/winsys/drm/radeon/core/radeon_drm.c src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c src/mesa/state_tracker/st_cb_clear.c
Diffstat (limited to 'src/gallium/auxiliary/draw')
-rw-r--r--src/gallium/auxiliary/draw/draw_context.c1
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe.c44
-rw-r--r--src/gallium/auxiliary/draw/draw_pt.c1
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_fetch.c1
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c1
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_post_vs.c1
-rw-r--r--src/gallium/auxiliary/draw/draw_vs_varient.c1
7 files changed, 33 insertions, 17 deletions
diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c
index e90dfc5aec..fb1bc05af4 100644
--- a/src/gallium/auxiliary/draw/draw_context.c
+++ b/src/gallium/auxiliary/draw/draw_context.c
@@ -34,7 +34,6 @@
#include "util/u_memory.h"
#include "util/u_math.h"
#include "draw_context.h"
-#include "draw_vbuf.h"
#include "draw_vs.h"
#include "draw_gs.h"
#include "draw_pt.h"
diff --git a/src/gallium/auxiliary/draw/draw_pipe.c b/src/gallium/auxiliary/draw/draw_pipe.c
index 1c6d657297..11d6485dcf 100644
--- a/src/gallium/auxiliary/draw/draw_pipe.c
+++ b/src/gallium/auxiliary/draw/draw_pipe.c
@@ -106,10 +106,9 @@ void draw_pipeline_destroy( struct draw_context *draw )
-
-
-
-
+/**
+ * Build primitive to render a point with vertex at v0.
+ */
static void do_point( struct draw_context *draw,
const char *v0 )
{
@@ -123,6 +122,10 @@ static void do_point( struct draw_context *draw,
}
+/**
+ * Build primitive to render a line with vertices at v0, v1.
+ * \param flags bitmask of DRAW_PIPE_EDGE_x, DRAW_PIPE_RESET_STIPPLE
+ */
static void do_line( struct draw_context *draw,
ushort flags,
const char *v0,
@@ -139,6 +142,10 @@ static void do_line( struct draw_context *draw,
}
+/**
+ * Build primitive to render a triangle with vertices at v0, v1, v2.
+ * \param flags bitmask of DRAW_PIPE_EDGE_x, DRAW_PIPE_RESET_STIPPLE
+ */
static void do_triangle( struct draw_context *draw,
ushort flags,
char *v0,
@@ -157,7 +164,10 @@ static void do_triangle( struct draw_context *draw,
}
-
+/*
+ * Set up macros for draw_pt_decompose.h template code.
+ * This code uses vertex indexes / elements.
+ */
#define QUAD(i0,i1,i2,i3) \
do_triangle( draw, \
( DRAW_PIPE_RESET_STIPPLE | \
@@ -175,16 +185,16 @@ static void do_triangle( struct draw_context *draw,
#define TRIANGLE(flags,i0,i1,i2) \
do_triangle( draw, \
- elts[i0], /* flags */ \
+ elts[i0], /* flags */ \
verts + stride * (elts[i0] & ~DRAW_PIPE_FLAG_MASK), \
- verts + stride * elts[i1], \
- verts + stride * elts[i2])
+ verts + stride * (elts[i1] & ~DRAW_PIPE_FLAG_MASK), \
+ verts + stride * (elts[i2] & ~DRAW_PIPE_FLAG_MASK) );
#define LINE(flags,i0,i1) \
do_line( draw, \
- elts[i0], \
+ elts[i0], \
verts + stride * (elts[i0] & ~DRAW_PIPE_FLAG_MASK), \
- verts + stride * elts[i1])
+ verts + stride * (elts[i1] & ~DRAW_PIPE_FLAG_MASK) );
#define POINT(i0) \
do_point( draw, \
@@ -213,7 +223,9 @@ 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 arbitary collection of vertices.
+ * For drawing indexed primitives.
*
* Vertex headers must be pre-initialized with the
* UNDEFINED_VERTEX_ID, this code will cause that id to become
@@ -243,6 +255,12 @@ void draw_pipeline_run( struct draw_context *draw,
draw->pipeline.vertex_count = 0;
}
+
+
+/*
+ * Set up macros for draw_pt_decompose.h template code.
+ * This code is for non-indexed rendering (no elts).
+ */
#define QUAD(i0,i1,i2,i3) \
do_triangle( draw, \
( DRAW_PIPE_RESET_STIPPLE | \
@@ -293,6 +311,10 @@ void draw_pipeline_run( struct draw_context *draw,
#include "draw_pt_decompose.h"
+
+/*
+ * For drawing non-indexed primitives.
+ */
void draw_pipeline_run_linear( struct draw_context *draw,
unsigned prim,
struct vertex_header *vertices,
diff --git a/src/gallium/auxiliary/draw/draw_pt.c b/src/gallium/auxiliary/draw/draw_pt.c
index a5ddec5286..f5ed32d0b0 100644
--- a/src/gallium/auxiliary/draw/draw_pt.c
+++ b/src/gallium/auxiliary/draw/draw_pt.c
@@ -33,7 +33,6 @@
#include "draw/draw_context.h"
#include "draw/draw_private.h"
#include "draw/draw_pt.h"
-#include "draw/draw_vs.h"
#include "tgsi/tgsi_dump.h"
#include "util/u_math.h"
#include "util/u_prim.h"
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch.c b/src/gallium/auxiliary/draw/draw_pt_fetch.c
index 55e7a7b81a..252be5053e 100644
--- a/src/gallium/auxiliary/draw/draw_pt_fetch.c
+++ b/src/gallium/auxiliary/draw/draw_pt_fetch.c
@@ -30,7 +30,6 @@
#include "draw/draw_context.h"
#include "draw/draw_private.h"
#include "draw/draw_vbuf.h"
-#include "draw/draw_vertex.h"
#include "draw/draw_pt.h"
#include "translate/translate.h"
#include "translate/translate_cache.h"
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c
index 734c05f068..c5dfbcfa3c 100644
--- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c
+++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c
@@ -40,7 +40,6 @@
#include "draw/draw_pt.h"
#include "draw/draw_vs.h"
-#include "translate/translate.h"
struct fetch_shade_emit;
diff --git a/src/gallium/auxiliary/draw/draw_pt_post_vs.c b/src/gallium/auxiliary/draw/draw_pt_post_vs.c
index 55151823a1..9728d5c2bd 100644
--- a/src/gallium/auxiliary/draw/draw_pt_post_vs.c
+++ b/src/gallium/auxiliary/draw/draw_pt_post_vs.c
@@ -30,7 +30,6 @@
#include "draw/draw_context.h"
#include "draw/draw_private.h"
#include "draw/draw_vbuf.h"
-#include "draw/draw_vertex.h"
#include "draw/draw_pt.h"
struct pt_post_vs {
diff --git a/src/gallium/auxiliary/draw/draw_vs_varient.c b/src/gallium/auxiliary/draw/draw_vs_varient.c
index 9f40030f39..b87a465f6b 100644
--- a/src/gallium/auxiliary/draw/draw_vs_varient.c
+++ b/src/gallium/auxiliary/draw/draw_vs_varient.c
@@ -38,7 +38,6 @@
#include "draw/draw_vertex.h"
#include "draw/draw_vs.h"
#include "translate/translate.h"
-#include "translate/translate_cache.h"
/* A first pass at incorporating vertex fetch/emit functionality into
*/