st/nine: Clamp max_anisotropy

GL does the same.

Fixes the low texture quality issue of
https://github.com/iXit/wine-nine-standalone/issues/21

The are some indications it might not be the native
behaviour (which makes sense, the native filtering
of states seems more to not update internal states
when the passed value is invalid).
However it's better visually to have anisotropic filtering
enabled in these buggy cases.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>
This commit is contained in:
Axel Davy 2021-03-18 23:36:28 +01:00 committed by Marge Bot
parent 619c53489f
commit a849923aea
1 changed files with 1 additions and 1 deletions

View File

@ -240,7 +240,7 @@ nine_convert_sampler_state(struct cso_context *ctx, int idx, const DWORD *ss)
samp.mag_img_filter = (ss[D3DSAMP_MAGFILTER] == D3DTEXF_POINT && !ss[NINED3DSAMP_SHADOW]) ? PIPE_TEX_FILTER_NEAREST : PIPE_TEX_FILTER_LINEAR;
if (ss[D3DSAMP_MINFILTER] == D3DTEXF_ANISOTROPIC ||
ss[D3DSAMP_MAGFILTER] == D3DTEXF_ANISOTROPIC)
samp.max_anisotropy = ss[D3DSAMP_MAXANISOTROPY];
samp.max_anisotropy = MIN2(16, ss[D3DSAMP_MAXANISOTROPY]);
samp.compare_mode = ss[NINED3DSAMP_SHADOW] ? PIPE_TEX_COMPARE_R_TO_TEXTURE : PIPE_TEX_COMPARE_NONE;
samp.compare_func = PIPE_FUNC_LEQUAL;
samp.normalized_coords = 1;