[Mesa-dev] [PATCH 3/3] mesa: glGet: fix parameter lookup for apps using multiple APIs

Eric Anholt eric at anholt.net
Fri Aug 24 11:21:03 PDT 2012


Imre Deak <imre.deak at intel.com> writes:
> -	 if (values[table[hash & mask]].pname == d->pname)
> -	    break;
> -	 hash += prime_step;
> -	 j++;
> +        if (values[TABLE_IDX(table[hash & mask])].pname == d->pname)
> +           break;
> +        hash += prime_step;
> +        j++;

indentation changes, fold them into the first patch.

> -      if (likely(d->pname == pname))
> +      if (likely(d->pname == pname && (TABLE_API(table_val) & api_bit)))
> +         /*
> +          * Don't bail out here if the API doesn't match, since the same pname
> +          * can be present in the table for other APIs (with different
> +          * semantics).
> +          */
>           break;

How many of the pnames appear twice in the values table?  Would they be
better handled by doing some custom checking that was api-dependent, and
then not having the hash table be api-dependent?

It seems like it would be nice to do the hash table generation at build
time instead, so that it was constant data.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120824/6f4417ed/attachment.pgp>


More information about the mesa-dev mailing list