Mesa (master): llvmpipe: Store the original triangle coordinates in the debug build.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Wed Mar 3 11:56:04 PST 2010


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

Author: José Fonseca <jfonseca at vmware.com>
Date:   Wed Mar  3 19:55:31 2010 +0000

llvmpipe: Store the original triangle coordinates in the debug build.

For debugging purposes only.

---

 src/gallium/drivers/llvmpipe/lp_rast.h      |    4 ++++
 src/gallium/drivers/llvmpipe/lp_setup_tri.c |    9 +++++++++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_rast.h b/src/gallium/drivers/llvmpipe/lp_rast.h
index d91c45e..dc5fc5f 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast.h
+++ b/src/gallium/drivers/llvmpipe/lp_rast.h
@@ -98,6 +98,10 @@ struct lp_rast_shader_inputs {
  * Objects of this type are put into the setup_context::data buffer.
  */
 struct lp_rast_triangle {
+#ifdef DEBUG
+   float v[3][2];
+#endif
+
    /* one-pixel sized trivial accept offsets for each plane */
    int ei1;                   
    int ei2;
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
index a8bf540..e75412a 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
@@ -297,6 +297,15 @@ do_triangle_ccw(struct setup_context *setup,
 
    tri = alloc_triangle(scene, setup->fs.nr_inputs, &tri_bytes);
 
+#ifdef DEBUG
+   tri->v[0][0] = v1[0][0];
+   tri->v[1][0] = v2[0][0];
+   tri->v[2][0] = v3[0][0];
+   tri->v[0][1] = v1[0][1];
+   tri->v[1][1] = v2[0][1];
+   tri->v[2][1] = v3[0][1];
+#endif
+
    tri->dx12 = x1 - x2;
    tri->dx23 = x2 - x3;
    tri->dx31 = x3 - x1;



More information about the mesa-commit mailing list