Mesa (master): gallivm: fix texel fetch for array textures (2)
Roland Scheidegger
sroland at kemper.freedesktop.org
Mon Dec 17 10:50:34 UTC 2012
Module: Mesa
Branch: master
Commit: 3d14b25030dc2ad8bc10400d686250979fbee70d
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3d14b25030dc2ad8bc10400d686250979fbee70d
Author: Roland Scheidegger <sroland at vmware.com>
Date: Fri Dec 14 21:17:05 2012 +0100
gallivm: fix texel fetch for array textures (2)
a460aea3f14222af46f88d1bc686f82180b8a872 wasn't entirely correct,
since all coords are already ints hence need to skip the iround.
Passes piglit texelFetch with sampler1DArray/sampler2DArray.
Reviewed-by: Dave Airlie <airlied at redhat.com>
---
src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
index 6839478..f1d2f51 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
@@ -984,7 +984,6 @@ lp_build_layer_coord(struct lp_build_sample_context *bld,
{
LLVMValueRef maxlayer;
- layer = lp_build_iround(&bld->coord_bld, layer);
maxlayer = bld->dynamic_state->depth(bld->dynamic_state,
bld->gallivm, unit);
maxlayer = lp_build_sub(&bld->int_bld, maxlayer, bld->int_bld.one);
@@ -1041,9 +1040,11 @@ lp_build_sample_common(struct lp_build_sample_context *bld,
derivs = &face_derivs;
}
else if (target == PIPE_TEXTURE_1D_ARRAY) {
- *r = lp_build_layer_coord(bld, unit, *t);
+ *r = lp_build_iround(&bld->coord_bld, *t);
+ *r = lp_build_layer_coord(bld, unit, *r);
}
else if (target == PIPE_TEXTURE_2D_ARRAY) {
+ *r = lp_build_iround(&bld->coord_bld, *r);
*r = lp_build_layer_coord(bld, unit, *r);
}
More information about the mesa-commit
mailing list