[Mesa-dev] Merging translate and unnormalized-coords-hint?
Luca Barbieri
luca at luca-barbieri.com
Tue Aug 17 08:43:40 PDT 2010
> I'm not sure it's really worth bothering about all those cases to
> optimize some divs or muls away.
Yes, the gain might be marginal, but once you change internal code to
support either normalization, supporting fine grained preferences is a
tiny change.
> Hence one flag (for tex rect) would be
> sufficient, otherwise just use normalized.
Yes (for the needs of nv30, with loss of generality).
However this way you have the following weird check:
use_normalized_coords = (texture->target != PIPE_TEXTURE_RECT) ||
screen->get_param(PIPE_CAP_PREFER_NORMALIZED_EVEN_FOR_RECT);
With a per-resource cap, you have this natural one instead:
use_normalized_coords = (texture->flags &
PIPE_RESOURCE_FLAG_PREFER_NORMALIZED_COORDS);
And if you have two flags, you can also do this
use_normalized_coords = !(texture->flags &
PIPE_RESOURCE_FLAG_PREFER_UNNORMALIZED_COORDS);
depending on the preference of the state tracker itself (they differ
if neither flag is set).
It seems to me that the second and third checks are way cleaner than
the first, and I can't think of anything that would negatively balance
this significant gain.
More information about the mesa-dev
mailing list