Mesa (mesa_7_5_branch): tgsi: add semantic_names[] string for TGSI_SEMANTIC_FACE

Brian Paul brianp at kemper.freedesktop.org
Fri Jul 10 22:34:57 UTC 2009


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

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Jul 10 15:41:26 2009 -0600

tgsi: add semantic_names[] string for TGSI_SEMANTIC_FACE

Fixes TGSI dump output when front/back-face register is declared.

Also, add some assertions to make sure the semantic/interpolate string
arrays have as many elements as there are tokens in the p_shader_tokens.h
file.  That should catch problems like this in the future.

---

 src/gallium/auxiliary/tgsi/tgsi_dump.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_dump.c b/src/gallium/auxiliary/tgsi/tgsi_dump.c
index 9b84471..a6994ec 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_dump.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_dump.c
@@ -28,6 +28,7 @@
 #include "util/u_debug.h"
 #include "util/u_string.h"
 #include "util/u_math.h"
+#include "util/u_memory.h"
 #include "tgsi_dump.h"
 #include "tgsi_info.h"
 #include "tgsi_iterate.h"
@@ -108,7 +109,8 @@ static const char *semantic_names[] =
    "FOG",
    "PSIZE",
    "GENERIC",
-   "NORMAL"
+   "NORMAL",
+   "FACE"
 };
 
 static const char *immediate_type_names[] =
@@ -224,6 +226,9 @@ iter_declaration(
 {
    struct dump_ctx *ctx = (struct dump_ctx *)iter;
 
+   assert(Elements(semantic_names) == TGSI_SEMANTIC_COUNT);
+   assert(Elements(interpolate_names) == TGSI_INTERPOLATE_COUNT);
+
    TXT( "DCL " );
 
    _dump_register(




More information about the mesa-commit mailing list