softpipe: fix sp_get_dims() for PIPE_BUFFER
authorBrian Paul <brianp@vmware.com>
Thu, 10 Jul 2014 15:37:39 +0000 (09:37 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 10 Jul 2014 16:59:40 +0000 (10:59 -0600)
commitc45b9b572159983a20cf771016c3528a423643e1
treeb740caded7372a566f2fbf98cc1cd4a0aad3f7a6
parentfaa6b0cdc30c327871d7639ca3f1da5057d90d0a
softpipe: fix sp_get_dims() for PIPE_BUFFER

Before, we were checking the level against view->u.tex.last_level but
level is not valid for buffers.  Plus, the aliasing of the view->u.tex
view->u.buf members (a union) caused the level checking arithmetic to
be totally wrong.  The net effect is we always returned early for
PIPE_BUFFER size queries.

This fixes the piglit "textureSize 140 fs samplerBuffer" test.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/drivers/softpipe/sp_tex_sample.c