cs->min_lod = cs->max_lod = etna_float_to_fixp55(ss->min_lod);
}
+ /* if max_lod is 0, MIN filter will never be used (GC3000)
+ * when min filter is different from mag filter, we need HW to compute LOD
+ * the workaround is to set max_lod to at least 1
+ */
+ cs->max_lod_min = (ss->min_img_filter != ss->mag_img_filter) ? 1 : 0;
+
return cs;
}
ss = etna_sampler_state(ctx->sampler[x]);
sv = etna_sampler_view(ctx->sampler_view[x]);
+ unsigned max_lod = MAX2(MIN2(ss->max_lod, sv->max_lod), ss->max_lod_min);
+
/* min and max lod is determined both by the sampler and the view */
/*020C0*/ EMIT_STATE(TE_SAMPLER_LOD_CONFIG(x),
ss->TE_SAMPLER_LOD_CONFIG |
- VIVS_TE_SAMPLER_LOD_CONFIG_MAX(MIN2(ss->max_lod, sv->max_lod)) |
+ VIVS_TE_SAMPLER_LOD_CONFIG_MAX(max_lod) |
VIVS_TE_SAMPLER_LOD_CONFIG_MIN(MAX2(ss->min_lod, sv->min_lod)));
}
}
uint32_t TE_SAMPLER_CONFIG0;
uint32_t TE_SAMPLER_CONFIG1;
uint32_t TE_SAMPLER_LOD_CONFIG;
- unsigned min_lod, max_lod;
+ unsigned min_lod, max_lod, max_lod_min;
};
static inline struct etna_sampler_state *