}
bool
-texture_use_int_filter(const struct pipe_sampler_view *so, bool tex_desc)
+texture_use_int_filter(const struct pipe_sampler_view *sv,
+ const struct pipe_sampler_state *ss,
+ bool tex_desc)
{
- switch (so->target) {
+ switch (sv->target) {
case PIPE_TEXTURE_1D_ARRAY:
case PIPE_TEXTURE_2D_ARRAY:
if (tex_desc)
}
/* only unorm formats can use int filter */
- if (!util_format_is_unorm(so->format))
+ if (!util_format_is_unorm(sv->format))
return false;
- if (util_format_is_srgb(so->format))
+ if (util_format_is_srgb(sv->format))
return false;
- if (util_format_description(so->format)->layout == UTIL_FORMAT_LAYOUT_ASTC)
+ if (util_format_description(sv->format)->layout == UTIL_FORMAT_LAYOUT_ASTC)
return false;
- switch (so->format) {
+ if (ss->max_anisotropy > 1)
+ return false;
+
+ switch (sv->format) {
/* apparently D16 can't use int filter but D24 can */
case PIPE_FORMAT_Z16_UNORM:
case PIPE_FORMAT_R10G10B10A2_UNORM:
translate_texture_format(enum pipe_format fmt);
bool
-texture_use_int_filter(const struct pipe_sampler_view *so, bool tex_desc);
+texture_use_int_filter(const struct pipe_sampler_view *sv,
+ const struct pipe_sampler_state *ss,
+ bool tex_desc);
bool
texture_format_needs_swiz(enum pipe_format fmt);
if (util_format_is_srgb(so->format))
sv->SAMP_CTRL1 |= VIVS_NTE_DESCRIPTOR_SAMP_CTRL1_SRGB;
- if (texture_use_int_filter(so, true))
- sv->SAMP_CTRL0 |= VIVS_NTE_DESCRIPTOR_SAMP_CTRL0_INT_FILTER;
-
/* Create texture descriptor */
sv->bo = etna_bo_new(ctx->screen->dev, 0x100, DRM_ETNA_GEM_CACHE_WC);
if (!sv->bo)
if ((1 << x) & active_samplers) {
struct etna_sampler_state_desc *ss = etna_sampler_state_desc(ctx->sampler[x]);
struct etna_sampler_view_desc *sv = etna_sampler_view_desc(ctx->sampler_view[x]);
+
+ if (texture_use_int_filter(&sv->base, &ss->base, true))
+ sv->SAMP_CTRL0 |= VIVS_NTE_DESCRIPTOR_SAMP_CTRL0_INT_FILTER;
+
etna_set_state(stream, VIVS_NTE_DESCRIPTOR_TX_CTRL(x),
COND(sv->ts.enable, VIVS_NTE_DESCRIPTOR_TX_CTRL_TS_ENABLE) |
VIVS_NTE_DESCRIPTOR_TX_CTRL_TS_MODE(sv->ts.mode) |
VIVS_TE_SAMPLER_LOG_SIZE_WIDTH(etna_log2_fixp55(res->base.width0)) |
VIVS_TE_SAMPLER_LOG_SIZE_HEIGHT(etna_log2_fixp55(base_height)) |
COND(util_format_is_srgb(so->format) && !astc, VIVS_TE_SAMPLER_LOG_SIZE_SRGB) |
- COND(astc, VIVS_TE_SAMPLER_LOG_SIZE_ASTC) |
- COND(texture_use_int_filter(so, false), VIVS_TE_SAMPLER_LOG_SIZE_INT_FILTER);
+ COND(astc, VIVS_TE_SAMPLER_LOG_SIZE_ASTC);
sv->TE_SAMPLER_3D_CONFIG =
VIVS_TE_SAMPLER_3D_CONFIG_DEPTH(base_depth) |
VIVS_TE_SAMPLER_3D_CONFIG_LOG_DEPTH(etna_log2_fixp55(base_depth));
}
}
if (unlikely(dirty & (ETNA_DIRTY_SAMPLER_VIEWS))) {
+ struct etna_sampler_state *ss;
struct etna_sampler_view *sv;
for (int x = 0; x < VIVS_TE_SAMPLER__LEN; ++x) {
}
for (int x = 0; x < VIVS_TE_SAMPLER__LEN; ++x) {
if ((1 << x) & active_samplers) {
+ ss = etna_sampler_state(ctx->sampler[x]);
sv = etna_sampler_view(ctx->sampler_view[x]);
+
+ if (texture_use_int_filter(&sv->base, &ss->base, false))
+ sv->TE_SAMPLER_LOG_SIZE |= VIVS_TE_SAMPLER_LOG_SIZE_INT_FILTER;
+
/*02080*/ EMIT_STATE(TE_SAMPLER_LOG_SIZE(x), sv->TE_SAMPLER_LOG_SIZE);
}
}