radeonsi: enable some sampler fields to match the closed driver
authorMarek Olšák <marek.olsak@amd.com>
Thu, 7 Apr 2016 15:02:51 +0000 (17:02 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 12 Apr 2016 12:29:48 +0000 (14:29 +0200)
copied from the Vulkan driver

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_state.c
src/gallium/drivers/radeonsi/sid.h

index 94130a99b1bafd6cbd00d276f8115ec21cdd02ea..9c8a9044d3050f2e9ff7e4e62ecf6729f1ab05c5 100644 (file)
@@ -3406,13 +3406,18 @@ static void *si_create_sampler_state(struct pipe_context *ctx,
                          r600_tex_aniso_filter(state->max_anisotropy) << 9 |
                          S_008F30_DEPTH_COMPARE_FUNC(si_tex_compare(state->compare_func)) |
                          S_008F30_FORCE_UNNORMALIZED(!state->normalized_coords) |
-                         S_008F30_DISABLE_CUBE_WRAP(!state->seamless_cube_map));
+                         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)));
        rstate->val[2] = (S_008F38_LOD_BIAS(S_FIXED(CLAMP(state->lod_bias, -16, 16), 8)) |
                          S_008F38_XY_MAG_FILTER(si_tex_filter(state->mag_img_filter) | aniso_flag_offset) |
                          S_008F38_XY_MIN_FILTER(si_tex_filter(state->min_img_filter) | aniso_flag_offset) |
-                         S_008F38_MIP_FILTER(si_tex_mipfilter(state->min_mip_filter)));
+                         S_008F38_MIP_FILTER(si_tex_mipfilter(state->min_mip_filter)) |
+                         S_008F38_MIP_POINT_PRECLAMP(1) |
+                         S_008F38_DISABLE_LSB_CEIL(1) |
+                         S_008F38_FILTER_PREC_FIX(1) |
+                         S_008F38_ANISO_OVERRIDE(sctx->b.chip_class >= VI));
        rstate->val[3] = S_008F3C_BORDER_COLOR_PTR(border_color_index) |
                         S_008F3C_BORDER_COLOR_TYPE(border_color_type);
        return rstate;
index 892084707d281805330672c2af398ec0c811286e..12b616e96a969c3491016aed3df3676ce55adf2c 100644 (file)
 #define   S_008F38_FILTER_PREC_FIX(x)                                 (((x) & 0x1) << 30)
 #define   G_008F38_FILTER_PREC_FIX(x)                                 (((x) >> 30) & 0x1)
 #define   C_008F38_FILTER_PREC_FIX                                    0xBFFFFFFF
+#define   S_008F38_ANISO_OVERRIDE(x)                                  (((x) & 0x1) << 31)
+#define   G_008F38_ANISO_OVERRIDE(x)                                  (((x) >> 31) & 0x1)
+#define   C_008F38_ANISO_OVERRIDE                                     0x7FFFFFFF
 #define R_008F3C_SQ_IMG_SAMP_WORD3                                      0x008F3C
 #define   S_008F3C_BORDER_COLOR_PTR(x)                                (((x) & 0xFFF) << 0)
 #define   G_008F3C_BORDER_COLOR_PTR(x)                                (((x) >> 0) & 0xFFF)