state[1] = (S_008F14_DATA_FORMAT(data_format) |
S_008F14_NUM_FORMAT(num_format));
state[2] = (S_008F18_WIDTH(width - 1) |
- S_008F18_HEIGHT(height - 1));
+ S_008F18_HEIGHT(height - 1) |
+ S_008F18_PERF_MOD(4));
state[3] = (S_008F1C_DST_SEL_X(si_map_swizzle(swizzle[0])) |
S_008F1C_DST_SEL_Y(si_map_swizzle(swizzle[1])) |
S_008F1C_DST_SEL_Z(si_map_swizzle(swizzle[2])) |
S_008F30_MAX_ANISO_RATIO(max_aniso_ratio) |
S_008F30_DEPTH_COMPARE_FUNC(si_tex_compare(state->compare_func)) |
S_008F30_FORCE_UNNORMALIZED(!state->normalized_coords) |
+ S_008F30_ANISO_THRESHOLD(max_aniso_ratio >> 1) |
+ S_008F30_ANISO_BIAS(max_aniso_ratio) |
S_008F30_DISABLE_CUBE_WRAP(!state->seamless_cube_map) |
S_008F30_COMPAT_MODE(sctx->b.chip_class >= VI));
rstate->val[1] = (S_008F34_MIN_LOD(S_FIXED(CLAMP(state->min_lod, 0, 15), 8)) |
- S_008F34_MAX_LOD(S_FIXED(CLAMP(state->max_lod, 0, 15), 8)));
+ S_008F34_MAX_LOD(S_FIXED(CLAMP(state->max_lod, 0, 15), 8)) |
+ S_008F34_PERF_MIP(max_aniso_ratio ? max_aniso_ratio + 6 : 0));
rstate->val[2] = (S_008F38_LOD_BIAS(S_FIXED(CLAMP(state->lod_bias, -16, 16), 8)) |
S_008F38_XY_MAG_FILTER(eg_tex_filter(state->mag_img_filter, max_aniso)) |
S_008F38_XY_MIN_FILTER(eg_tex_filter(state->min_img_filter, max_aniso)) |
#define S_008F30_FORCE_UNNORMALIZED(x) (((unsigned)(x) & 0x1) << 15)
#define G_008F30_FORCE_UNNORMALIZED(x) (((x) >> 15) & 0x1)
#define C_008F30_FORCE_UNNORMALIZED 0xFFFF7FFF
+#define S_008F30_ANISO_THRESHOLD(x) (((unsigned)(x) & 0x07) << 16)
+#define G_008F30_ANISO_THRESHOLD(x) (((x) >> 16) & 0x07)
+#define C_008F30_ANISO_THRESHOLD 0xFFF8FFFF
#define S_008F30_MC_COORD_TRUNC(x) (((unsigned)(x) & 0x1) << 19)
#define G_008F30_MC_COORD_TRUNC(x) (((x) >> 19) & 0x1)
#define C_008F30_MC_COORD_TRUNC 0xFFF7FFFF
#define S_008F30_FORCE_DEGAMMA(x) (((unsigned)(x) & 0x1) << 20)
#define G_008F30_FORCE_DEGAMMA(x) (((x) >> 20) & 0x1)
#define C_008F30_FORCE_DEGAMMA 0xFFEFFFFF
+#define S_008F30_ANISO_BIAS(x) (((unsigned)(x) & 0x3F) << 21)
+#define G_008F30_ANISO_BIAS(x) (((x) >> 21) & 0x3F)
+#define C_008F30_ANISO_BIAS 0xF81FFFFF
#define S_008F30_TRUNC_COORD(x) (((unsigned)(x) & 0x1) << 27)
#define G_008F30_TRUNC_COORD(x) (((x) >> 27) & 0x1)
#define C_008F30_TRUNC_COORD 0xF7FFFFFF