diff --git a/.pick_status.json b/.pick_status.json index a77d8b54a30..49e4c192f11 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -934,7 +934,7 @@ "description": "panfrost: disable round_to_nearest_even for NEAREST samplers", "nominated": true, "nomination_type": 4, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index fe17ff39777..39ca2074998 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -227,6 +227,14 @@ panfrost_create_sampler_state(struct pipe_context *pctx, cfg.border_color_a = so->base.border_color.ui[3]; #if PAN_ARCH >= 6 + /* + * Disabling round_to_nearest_even for NEAREST filters ensures proper + * floor() behavior as required by OpenCL_C spec section 8.2. + */ + if (cso->mag_img_filter == PIPE_TEX_FILTER_NEAREST && + cso->min_img_filter == PIPE_TEX_FILTER_NEAREST) + cfg.round_to_nearest_even = false; + if (cso->max_anisotropy > 1) { cfg.maximum_anisotropy = cso->max_anisotropy; cfg.lod_algorithm = MALI_LOD_ALGORITHM_ANISOTROPIC;