st/mesa: fix bitmap texture target code and simplify tex sampler state
authorBrian Paul <brianp@vmware.com>
Tue, 9 Feb 2016 21:35:31 +0000 (14:35 -0700)
committerBrian Paul <brianp@vmware.com>
Wed, 10 Feb 2016 00:48:25 +0000 (17:48 -0700)
commit5e4de781fadea9e138e722c53a2e72eeb1d41a5a
tree6ba010e78914b65994efa4f4c76b7f57e0582a4b
parent9e2a9d5743246e0fdaa03fe90f8dc341cea10907
st/mesa: fix bitmap texture target code and simplify tex sampler state

Bitmaps may be drawn with a PIPE_TEXTURE_2D or PIPE_TEXTURE_RECT resource
as determined at context creation by checking if PIPE_CAP_NPOT_TEXTURES is
supported.  But many places in the bitmap code were hard-coded to use
PIPE_TEXTURE_2D.  Use st->internal_target instead.

I think an older NV chip is the only case where a gallium driver does not
support NPOT textures.  Bitmap drawing was probably broken for that GPU.

Also, we only need one sampler state with texcoord normalization set up
according to st->internal_target.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/mesa/state_tracker/st_cb_bitmap.c
src/mesa/state_tracker/st_context.h