summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2016-03-13 19:13:09 +0100
committerEmil Velikov <[email protected]>2016-04-11 21:02:18 +0100
commitdde6d0efba39f49dc84f4bfdff778ab3c54e656f (patch)
treeb9bd7da602e9f1be25e2c7f2981239b41f958d1a /src
parentd9d703ee228d7deae8208e2fcee56b98f771df4f (diff)
softpipe: fix anisotropic filtering crash
The filt_args->offset wasn't assigned but was always used later leading to a crash (as far as I can tell, texel offsets don't actually make much sense with anisotropic filtering, but because there's no explicit setting if offsets are enabled there the array is always accessed). This fixes https://bugs.freedesktop.org/show_bug.cgi?id=94481 Reviewed-by: Eduardo Lima Mitev <[email protected]> CC: <[email protected]> (cherry picked from commit 9e9d69979c7aff7dac2d670af950f4a50273bcde)
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/softpipe/sp_tex_sample.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c
index e3e28a3ef32..e6bdd5030a7 100644
--- a/src/gallium/drivers/softpipe/sp_tex_sample.c
+++ b/src/gallium/drivers/softpipe/sp_tex_sample.c
@@ -2209,6 +2209,7 @@ img_filter_2d_ewa(const struct sp_sampler_view *sp_sview,
const float t[TGSI_QUAD_SIZE],
const float p[TGSI_QUAD_SIZE],
const uint faces[TGSI_QUAD_SIZE],
+ const int8_t *offset,
unsigned level,
const float dudx, const float dvdx,
const float dudy, const float dvdy,
@@ -2268,6 +2269,8 @@ img_filter_2d_ewa(const struct sp_sampler_view *sp_sview,
/* F *= formScale; */ /* no need to scale F as we don't use it below here */
args.level = level;
+ args.offset = offset;
+
for (j = 0; j < TGSI_QUAD_SIZE; j++) {
/* Heckbert MS thesis, p. 59; scan over the bounding box of the ellipse
* and incrementally update the value of Ax^2+Bxy*Cy^2; when this
@@ -2431,6 +2434,8 @@ mip_filter_linear_aniso(const struct sp_sampler_view *sp_sview,
const float dvdy = (t[QUAD_TOP_LEFT] - t[QUAD_BOTTOM_LEFT]) * t_to_v;
struct img_filter_args args;
+ args.offset = filt_args->offset;
+
if (filt_args->control == TGSI_SAMPLER_LOD_BIAS ||
filt_args->control == TGSI_SAMPLER_LOD_NONE ||
/* XXX FIXME */
@@ -2503,8 +2508,8 @@ mip_filter_linear_aniso(const struct sp_sampler_view *sp_sview,
* seem to be worth the extra running time.
*/
img_filter_2d_ewa(sp_sview, sp_samp, min_filter, mag_filter,
- s, t, p, filt_args->faces, level0,
- dudx, dvdx, dudy, dvdy, rgba);
+ s, t, p, filt_args->faces, filt_args->offset,
+ level0, dudx, dvdx, dudy, dvdy, rgba);
}
if (DEBUG_TEX) {