To query the size and number of levels we have to obtain the
sampler as source for the size query, but also the index for
the emulated level lookup, so default to always obtaining the
right sampler, and add a special case for obtaining the sampler
index.
v2: - Fix possible endless loop (John)
- Use the sampler source index to find find the real index
v3: Make loop easier to read, and rename variables (John)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: John Bates <jbates@chromium.org>