diff options
author | Roland Scheidegger <sroland@vmware.com> | 2013-02-12 16:41:56 +0100 |
---|---|---|
committer | Roland Scheidegger <sroland@vmware.com> | 2013-02-12 16:51:11 +0100 |
commit | 427d36a22741890a7ce55b6b5bcd40fd4bdd2d35 (patch) | |
tree | 7f6cc467072b0a51068edabbb12dfc25eee080da /src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c | |
parent | 4bfdef87e66bfb2459af570351798d7754ddfb9f (diff) | |
download | external_mesa3d-427d36a22741890a7ce55b6b5bcd40fd4bdd2d35.zip external_mesa3d-427d36a22741890a7ce55b6b5bcd40fd4bdd2d35.tar.gz external_mesa3d-427d36a22741890a7ce55b6b5bcd40fd4bdd2d35.tar.bz2 |
gallium: fix tgsi SAMPLE_L opcode to use separate source for explicit lod
It looks like using coord.w as explicit lod value is a mistake, most likely
because some dx10 docs had it specified that way. Seems this was changed though:
http://msdn.microsoft.com/en-us/library/windows/desktop/hh447229%28v=vs.85%29.aspx
- let's just hope it doesn't depend on runtime build version or something.
Not only would this need translation (so go against the stated goal these
opcodes should be close to dx10 semantics) but it would prevent usage of this
opcode with cube arrays, which is apparently possible:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb509699%28v=vs.85%29.aspx
(Note not only does this show cube arrays using explicit lod, but also the
confusion with this opcode: it lists an explicit lod parameter value, but then
states last component of location is used as lod).
(For "true" hw drivers, only nv50 had code to handle it, and it appears the
code was already right for the new semantics, though fix up the seemingly
wrong c/d arguments while there.)
v2: fix comment, separate out other changes.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index 52a60dd..808e816 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c @@ -1428,9 +1428,8 @@ emit_sample(struct lp_build_tgsi_soa_context *bld, explicit_lod = NULL; } else if (modifier == LP_BLD_TEX_MODIFIER_EXPLICIT_LOD) { - /* lod bias comes from src 3.r but explicit lod from 0.a */ lod_bias = NULL; - explicit_lod = lp_build_emit_fetch( &bld->bld_base, inst, 0, 3 ); + explicit_lod = lp_build_emit_fetch( &bld->bld_base, inst, 3, 0 ); } else if (modifier == LP_BLD_TEX_MODIFIER_LOD_ZERO) { lod_bias = NULL; |