From a14c50bceb6b201e361b2cf6e3f453359d510284 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 21 Aug 2016 16:13:16 +0200 Subject: [PATCH] radeonsi: set more sampler settings MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Nicolai Hähnle --- src/gallium/drivers/radeonsi/si_state.c | 8 ++++++-- src/gallium/drivers/radeonsi/sid.h | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index 375e74bba55..a1c8720ce70 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -2826,7 +2826,8 @@ si_make_texture_descriptor(struct si_screen *screen, 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])) | @@ -3172,10 +3173,13 @@ static void *si_create_sampler_state(struct pipe_context *ctx, 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)) | diff --git a/src/gallium/drivers/radeonsi/sid.h b/src/gallium/drivers/radeonsi/sid.h index 9c74a6a8855..888de111a1f 100644 --- a/src/gallium/drivers/radeonsi/sid.h +++ b/src/gallium/drivers/radeonsi/sid.h @@ -2344,12 +2344,18 @@ #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 -- 2.30.2