nv50: handle PIPE_TEX_FILTER_ANISO case

Set the same bits as for linear filtering (in addition
to max anisotropy), and 2 unknown bits I've seen set.
This commit is contained in:
Christoph Bumiller 2009-10-22 22:57:30 +02:00
parent 4b8de9bd7c
commit 198925caa1
2 changed files with 13 additions and 15 deletions

View file

@ -146,6 +146,7 @@ nv50_sampler_state_create(struct pipe_context *pipe,
(wrap_mode(cso->wrap_r) << 6));
switch (cso->mag_img_filter) {
case PIPE_TEX_FILTER_ANISO:
case PIPE_TEX_FILTER_LINEAR:
tsc[1] |= NV50TSC_1_1_MAGF_LINEAR;
break;
@ -156,6 +157,7 @@ nv50_sampler_state_create(struct pipe_context *pipe,
}
switch (cso->min_img_filter) {
case PIPE_TEX_FILTER_ANISO:
case PIPE_TEX_FILTER_LINEAR:
tsc[1] |= NV50TSC_1_1_MINF_LINEAR;
break;
@ -183,21 +185,15 @@ nv50_sampler_state_create(struct pipe_context *pipe,
else
if (cso->max_anisotropy >= 12.0)
tsc[0] |= (6 << 20);
else
if (cso->max_anisotropy >= 10.0)
tsc[0] |= (5 << 20);
else
if (cso->max_anisotropy >= 8.0)
tsc[0] |= (4 << 20);
else
if (cso->max_anisotropy >= 6.0)
tsc[0] |= (3 << 20);
else
if (cso->max_anisotropy >= 4.0)
tsc[0] |= (2 << 20);
else
if (cso->max_anisotropy >= 2.0)
tsc[0] |= (1 << 20);
else {
tsc[0] |= (int)(cso->max_anisotropy * 0.5f) << 20;
if (cso->max_anisotropy >= 4.0)
tsc[1] |= NV50TSC_1_1_UNKN_ANISO_35;
else
if (cso->max_anisotropy >= 2.0)
tsc[1] |= NV50TSC_1_1_UNKN_ANISO_15;
}
if (cso->compare_mode == PIPE_TEX_COMPARE_R_TO_TEXTURE) {
tsc[0] |= (1 << 8);

View file

@ -133,6 +133,8 @@
#define NV50TSC_1_1_MIPF_NEAREST 0x00000080
#define NV50TSC_1_1_MIPF_LINEAR 0x000000c0
#define NV50TSC_1_1_LOD_BIAS_MASK 0x01fff000
#define NV50TSC_1_1_UNKN_ANISO_15 0x10000000
#define NV50TSC_1_1_UNKN_ANISO_35 0x18000000
#define NV50TSC_1_2_MIN_LOD_MASK 0x00000f00
#define NV50TSC_1_2_MAX_LOD_MASK 0x00f00000