From: José Fonseca Date: Tue, 4 May 2010 12:31:50 +0000 (+0100) Subject: gallivm: Fix several glitches introduced in the prev commit. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4554cdc289f1d97855825127c0bf8c0e7f6a2eda;p=mesa.git gallivm: Fix several glitches introduced in the prev commit. --- diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c index 59279232717..d1592c22f43 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c @@ -954,12 +954,12 @@ lp_build_lod_selector(struct lp_build_sample_context *bld, dsdy = LLVMBuildExtractElement(bld->builder, ddy[0], index0, "dsdy"); dsdy = lp_build_abs(float_bld, dsdy); if (dims > 1) { - dtdx = LLVMBuildExtractElement(bld->builder, ddx[1], index0, "dsdx"); + dtdx = LLVMBuildExtractElement(bld->builder, ddx[1], index0, "dtdx"); dtdx = lp_build_abs(float_bld, dtdx); dtdy = LLVMBuildExtractElement(bld->builder, ddy[1], index0, "dtdy"); dtdy = lp_build_abs(float_bld, dtdy); if (dims > 2) { - drdx = LLVMBuildExtractElement(bld->builder, ddx[2], index0, "dsdx"); + drdx = LLVMBuildExtractElement(bld->builder, ddx[2], index0, "drdx"); drdx = lp_build_abs(float_bld, drdx); drdy = LLVMBuildExtractElement(bld->builder, ddy[2], index0, "drdy"); drdy = lp_build_abs(float_bld, drdy); diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h index 4ca730a98a0..71c51db7869 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h @@ -45,9 +45,6 @@ struct lp_build_context; struct lp_build_mask_context; -#define LP_BLD_SAMPLER_EXPLICIT_DERIVATIVES 1 - - /** * Sampler code generation interface. * diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index 6659cff8706..022223bb296 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c @@ -644,7 +644,7 @@ emit_tex( struct lp_build_tgsi_soa_context *bld, } /* FIXME: Treat TEX_MODIFIER_EXPLICIT_LOD correctly */ - if (modifier == TEX_MODIFIER_LOD_BIAS || TEX_MODIFIER_EXPLICIT_LOD) + if (modifier == TEX_MODIFIER_LOD_BIAS || modifier == TEX_MODIFIER_EXPLICIT_LOD) lodbias = emit_fetch( bld, inst, 0, 3 ); else lodbias = bld->base.zero; @@ -676,6 +676,10 @@ emit_tex( struct lp_build_tgsi_soa_context *bld, } unit = inst->Src[1].Register.Index; } + for (i = num_coords; i < 3; i++) { + ddx[i] = bld->base.undef; + ddy[i] = bld->base.undef; + } bld->sampler->emit_fetch_texel(bld->sampler, bld->base.builder,