diff options
author | Michal Krol <michal@vmware.com> | 2010-01-06 18:36:45 +0100 |
---|---|---|
committer | Michal Krol <michal@vmware.com> | 2010-01-07 07:58:07 +0100 |
commit | 8d38ef455196e6ddda22536e435638a02a7b48f3 (patch) | |
tree | 5899a81d62d8b01d28a909b9edb6d5c89f2b92d5 /src/gallium/drivers/svga/svga_state_fs.c | |
parent | 6f498a7eff26dc055c0a1f75ce3102aa4a1a0141 (diff) |
svga: Fix fs key size computation and key comparison.
This also allows us to have texture_target
back as a bitfield and save us a few bytes.
Diffstat (limited to 'src/gallium/drivers/svga/svga_state_fs.c')
-rw-r--r-- | src/gallium/drivers/svga/svga_state_fs.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gallium/drivers/svga/svga_state_fs.c b/src/gallium/drivers/svga/svga_state_fs.c index 272d1dd14e..bba80a93a5 100644 --- a/src/gallium/drivers/svga/svga_state_fs.c +++ b/src/gallium/drivers/svga/svga_state_fs.c @@ -40,8 +40,13 @@ static INLINE int compare_fs_keys( const struct svga_fs_compile_key *a, const struct svga_fs_compile_key *b ) { - unsigned keysize = svga_fs_key_size( a ); - return memcmp( a, b, keysize ); + unsigned keysize_a = svga_fs_key_size( a ); + unsigned keysize_b = svga_fs_key_size( b ); + + if (keysize_a != keysize_b) { + return (int)(keysize_a - keysize_b); + } + return memcmp( a, b, keysize_a ); } |