Mesa (master): r300g/swtcl: do not emit texcoords if they are also stuffed in GA

Marek Olšák mareko at kemper.freedesktop.org
Mon Jul 12 23:35:50 UTC 2010


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

Author: Marek Olšák <maraeo at gmail.com>
Date:   Mon Jul 12 23:03:34 2010 +0200

r300g/swtcl: do not emit texcoords if they are also stuffed in GA

---

 src/gallium/drivers/r300/r300_state_derived.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c
index 3aa8deb..3760ff2 100644
--- a/src/gallium/drivers/r300/r300_state_derived.c
+++ b/src/gallium/drivers/r300/r300_state_derived.c
@@ -102,7 +102,8 @@ static void r300_draw_emit_all_attribs(struct r300_context* r300)
      * they won't be rasterized. */
     gen_count = 0;
     for (i = 0; i < ATTR_GENERIC_COUNT && gen_count < 8; i++) {
-        if (vs_outputs->generic[i] != ATTR_UNUSED) {
+        if (vs_outputs->generic[i] != ATTR_UNUSED &&
+            !(r300->sprite_coord_enable & (1 << i))) {
             r300_draw_emit_attrib(r300, EMIT_4F, INTERP_PERSPECTIVE,
                                   vs_outputs->generic[i]);
             gen_count++;
@@ -147,8 +148,10 @@ static void r300_swtcl_vertex_psc(struct r300_context *r300)
                vinfo->attrib[i].interp_mode, vinfo->attrib[i].emit,
                vs_output_tab[i]);
 
-        /* Make sure we have a proper destination for our attribute. */
-        assert(vs_output_tab[i] != -1);
+        if (vs_output_tab[i] == -1) {
+            assert(0);
+            abort();
+        }
 
         format = draw_translate_vinfo_format(vinfo->attrib[i].emit);
 




More information about the mesa-commit mailing list