llvmpipe: Store the original triangle coordinates in the debug build.
authorJosé Fonseca <jfonseca@vmware.com>
Wed, 3 Mar 2010 19:55:31 +0000 (19:55 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Wed, 3 Mar 2010 19:55:49 +0000 (19:55 +0000)
For debugging purposes only.

src/gallium/drivers/llvmpipe/lp_rast.h
src/gallium/drivers/llvmpipe/lp_setup_tri.c

index d91c45eb2be16dcbc3e3c7d45a0f7c0d37eeb3a3..dc5fc5fc7d645a16592fdfdd50267b1c1cdd4fbc 100644 (file)
@@ -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;
index a8bf540803b8f5ba07057825f8f435a764d54234..e75412ac9aaca99e7c46856434388614a4ae54c3 100644 (file)
@@ -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;