Mesa (master): tgsi: Fix token builder.

Keith Whitwell keithw at kemper.freedesktop.org
Tue Dec 1 06:43:36 PST 2009


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

Author: Michal Krol <michal at vmware.com>
Date:   Wed Nov 25 16:08:36 2009 +0100

tgsi: Fix token builder.

---

 src/gallium/auxiliary/tgsi/tgsi_build.c |   33 +-----------------------------
 src/gallium/auxiliary/tgsi/tgsi_build.h |   10 ---------
 2 files changed, 2 insertions(+), 41 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_build.c b/src/gallium/auxiliary/tgsi/tgsi_build.c
index c35634c..d80222b 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_build.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_build.c
@@ -531,9 +531,7 @@ tgsi_build_full_instruction(
                                           header);
    }
 
-   if( tgsi_compare_instruction_label(
-         full_inst->Label,
-         tgsi_default_instruction_label() ) ) {
+   if (full_inst->Instruction.Label) {
       struct tgsi_instruction_label *instruction_label;
 
       if( maxsize <= size )
@@ -550,9 +548,7 @@ tgsi_build_full_instruction(
       prev_token = (struct tgsi_token  *) instruction_label;
    }
 
-   if( tgsi_compare_instruction_texture(
-         full_inst->Texture,
-         tgsi_default_instruction_texture() ) ) {
+   if (full_inst->Instruction.Texture) {
       struct tgsi_instruction_texture *instruction_texture;
 
       if( maxsize <= size )
@@ -745,13 +741,6 @@ tgsi_build_instruction_predicate(int index,
    return instruction_predicate;
 }
 
-/** test for inequality of 32-bit values pointed to by a and b */
-static INLINE boolean
-compare32(const void *a, const void *b)
-{
-   return *((uint32_t *) a) != *((uint32_t *) b);
-}
-
 struct tgsi_instruction_label
 tgsi_default_instruction_label( void )
 {
@@ -763,15 +752,6 @@ tgsi_default_instruction_label( void )
    return instruction_label;
 }
 
-unsigned
-tgsi_compare_instruction_label(
-   struct tgsi_instruction_label a,
-   struct tgsi_instruction_label b )
-{
-   a.Padding = b.Padding = 0;
-   return compare32(&a, &b);
-}
-
 struct tgsi_instruction_label
 tgsi_build_instruction_label(
    unsigned label,
@@ -801,15 +781,6 @@ tgsi_default_instruction_texture( void )
    return instruction_texture;
 }
 
-unsigned
-tgsi_compare_instruction_texture(
-   struct tgsi_instruction_texture a,
-   struct tgsi_instruction_texture b )
-{
-   a.Padding = b.Padding = 0;
-   return compare32(&a, &b);
-}
-
 struct tgsi_instruction_texture
 tgsi_build_instruction_texture(
    unsigned texture,
diff --git a/src/gallium/auxiliary/tgsi/tgsi_build.h b/src/gallium/auxiliary/tgsi/tgsi_build.h
index 0fbc8b1..f46f9b6 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_build.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_build.h
@@ -174,11 +174,6 @@ tgsi_build_instruction_predicate(int index,
 struct tgsi_instruction_label
 tgsi_default_instruction_label( void );
 
-unsigned
-tgsi_compare_instruction_label(
-   struct tgsi_instruction_label a,
-   struct tgsi_instruction_label b );
-
 struct tgsi_instruction_label
 tgsi_build_instruction_label(
    unsigned label,
@@ -189,11 +184,6 @@ tgsi_build_instruction_label(
 struct tgsi_instruction_texture
 tgsi_default_instruction_texture( void );
 
-unsigned
-tgsi_compare_instruction_texture(
-   struct tgsi_instruction_texture a,
-   struct tgsi_instruction_texture b );
-
 struct tgsi_instruction_texture
 tgsi_build_instruction_texture(
    unsigned texture,



More information about the mesa-commit mailing list