mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-21 04:38:09 +02:00
st/mesa: use roundf instead of floorf for lod-bias rounding
There's no good reason not to use a symmetric rounding mode here. This fixes the following GL CTS case for me: GTF-GL33.gtf21.GL3Tests.texture_lod_bias.texture_lod_bias_all Fixes:132b69c4ed("st/mesa: round lod_bias to a multiple of 1/256") Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6892> (cherry picked from commit7685c37bf4)
This commit is contained in:
parent
0c9b64f9f4
commit
09c31b46d3
2 changed files with 2 additions and 2 deletions
|
|
@ -220,7 +220,7 @@
|
|||
"description": "st/mesa: use roundf instead of floorf for lod-bias rounding",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": "132b69c4edb824c70c98f8937c63e49b04f3adff"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ st_convert_sampler(const struct st_context *st,
|
|||
* levels.
|
||||
*/
|
||||
sampler->lod_bias = CLAMP(sampler->lod_bias, -16, 16);
|
||||
sampler->lod_bias = floorf(sampler->lod_bias * 256) / 256;
|
||||
sampler->lod_bias = roundf(sampler->lod_bias * 256) / 256;
|
||||
|
||||
sampler->min_lod = MAX2(msamp->MinLod, 0.0f);
|
||||
sampler->max_lod = msamp->MaxLod;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue