svga: don't call svga_texture_device_format_has_alpha() for PIPE_BUFFER
authorBrian Paul <brianp@vmware.com>
Fri, 30 Jun 2017 21:11:01 +0000 (14:11 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 3 Jul 2017 16:10:14 +0000 (10:10 -0600)
commit6158c0b5d8b6367a46acbe2fe20357210422c96f
treed42d43e845c2224c83d5c0975e6fc86c5dfbe351
parente6d1cc31fa7a7252c07933a7e311fb0d8b331e12
svga: don't call svga_texture_device_format_has_alpha() for PIPE_BUFFER

svga_texture_device_format_has_alpha() is only intended to work for
texture resources, not buffer resources.  This fixes a failed assertion
in the svga_texture() cast function when running texture buffer tests.

Also, add an assertion in svga_texture_device_format_has_alpha() to
catch the issue sooner.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
src/gallium/drivers/svga/svga_resource_texture.c
src/gallium/drivers/svga/svga_shader.c