softpipe: fix using non-zero layer in non-array view from array resource
authorRoland Scheidegger <sroland@vmware.com>
Thu, 22 Oct 2015 20:28:28 +0000 (22:28 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Sat, 24 Oct 2015 01:00:33 +0000 (03:00 +0200)
commitfb586e1edb207328534f554a9afaf2c07434e08e
tree52fe584fb45cd8d5651d345ddd278c68ab9e3e37
parentfe707c0373cf73f9323014f7bc38f20120d4f096
softpipe: fix using non-zero layer in non-array view from array resource

For vertex/geometry shader sampling, this is the same as for llvmpipe - just
use the original resource target.
For fragment shader sampling though (which does not use first-layer based mip
offsets) adjust the sampling code to use first_layer in the non-array cases.
While here also fix up some code which looked wrong wrt buffer texel fetch
(no piglit change).

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/drivers/softpipe/sp_state_sampler.c
src/gallium/drivers/softpipe/sp_tex_sample.c