tgsi: Fix token builder.
authorMichal Krol <michal@vmware.com>
Wed, 25 Nov 2009 15:08:36 +0000 (16:08 +0100)
committerMichal Krol <michal@vmware.com>
Wed, 25 Nov 2009 15:08:36 +0000 (16:08 +0100)
src/gallium/auxiliary/tgsi/tgsi_build.c
src/gallium/auxiliary/tgsi/tgsi_build.h

index c35634c..d80222b 100644 (file)
@@ -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,
index 0fbc8b1..f46f9b6 100644 (file)
@@ -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,