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);
}
/* 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;
}
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,