Mesa (master): r300g: add some assertions

Maciej Cencora osiris at kemper.freedesktop.org
Sun Sep 27 20:45:30 UTC 2009


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

Author: Maciej Cencora <m.cencora at gmail.com>
Date:   Sun Sep 27 22:20:41 2009 +0200

r300g: add some assertions

Not sure why we are getting a shader with two inputs with position semantic, but we don't know how to handle it correctly so it's better to stop the app than lock the machine.

---

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

diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c
index 2bbbcdf..083861a 100644
--- a/src/gallium/drivers/r300/r300_state_derived.c
+++ b/src/gallium/drivers/r300/r300_state_derived.c
@@ -55,6 +55,7 @@ static void r300_vs_tab_routes(struct r300_context* r300,
         for (i = 0; i < info->num_inputs; i++) {
             switch (info->input_semantic_name[i]) {
                 case TGSI_SEMANTIC_POSITION:
+                    assert(pos == FALSE);
                     pos = TRUE;
                     tab[i] = 0;
                     break;
@@ -63,10 +64,12 @@ static void r300_vs_tab_routes(struct r300_context* r300,
                     cols++;
                     break;
                 case TGSI_SEMANTIC_PSIZE:
+                    assert(psize == FALSE);
                     psize = TRUE;
                     tab[i] = 15;
                     break;
                 case TGSI_SEMANTIC_FOG:
+                    assert(fog == FALSE);
                     fog = TRUE;
                     /* Fall through */
                 case TGSI_SEMANTIC_GENERIC:




More information about the mesa-commit mailing list