gallivm: fix out-of-bounds behavior for fetch/ld
authorRoland Scheidegger <sroland@vmware.com>
Tue, 6 Aug 2013 18:50:47 +0000 (20:50 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Thu, 8 Aug 2013 16:55:57 +0000 (18:55 +0200)
commitce0e66af0ad69607aedd6456081d369cc1bba33e
treeebddfe53c63b1d157812fd0d9c46c91669b4617f
parent883987503fc79691398eb024f37480ff083805a3
gallivm: fix out-of-bounds behavior for fetch/ld

For d3d10 and ARB_robust_buffer_access_behavior, we are required to return
0 for out-of-bounds coordinates (for which we can just enable the code already
there was just disabled). Additionally, also need to return 0 for
out-of-bounds mip level and out-of-bounds layer. This changes the logic
so instead of clamping the level/layer, an out-of-bound mask is computed
instead in this case (actual clamping then can be omitted just like with
coordinates, since we set the fetch offset to zero if that happens anyway).

Reviewed-by: Zack Rusin <zackr@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_sample.c
src/gallium/auxiliary/gallivm/lp_bld_sample.h
src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c