const unsigned min_filter = bld->static_sampler_state->min_img_filter;
const unsigned mag_filter = bld->static_sampler_state->mag_img_filter;
const unsigned target = bld->static_texture_state->target;
- LLVMValueRef first_level;
+ LLVMValueRef first_level, cube_rho = NULL;
/*
printf("%s mip %d min %d mag %d\n", __FUNCTION__,
*/
/*
- * Choose cube face, recompute texcoords and derivatives for the chosen face.
+ * Choose cube face, recompute texcoords for the chosen face and
+ * compute rho here too (as it requires transform of derivatives).
*/
if (target == PIPE_TEXTURE_CUBE) {
LLVMValueRef face, face_s, face_t;
- lp_build_cube_lookup(bld, *s, *t, *r, &face, &face_s, &face_t);
+ lp_build_cube_lookup(bld, *s, *t, *r, &face, &face_s, &face_t, &cube_rho);
*s = face_s; /* vec */
*t = face_t; /* vec */
/* use 'r' to indicate cube face */
* distinguish between minification/magnification with one mipmap level.
*/
lp_build_lod_selector(bld, texture_index, sampler_index,
- *s, *t, *r,
+ *s, *t, *r, cube_rho,
derivs, lod_bias, explicit_lod,
mip_filter,
lod_ipart, lod_fpart);