unsigned mag_filter = mag_nearest ? MALI_SAMP_MAG_NEAREST : 0;
unsigned mip_filter = mip_linear ?
(MALI_SAMP_MIP_LINEAR_1 | MALI_SAMP_MIP_LINEAR_2) : 0;
+ unsigned normalized = cso->normalized_coords ? MALI_SAMP_NORM_COORDS : 0;
struct mali_sampler_descriptor sampler_descriptor = {
- .filter_mode = min_filter | mag_filter | mip_filter
- | 0x20,
-
+ .filter_mode = min_filter | mag_filter | mip_filter | normalized,
.wrap_s = translate_tex_wrap(cso->wrap_s),
.wrap_t = translate_tex_wrap(cso->wrap_t),
.wrap_r = translate_tex_wrap(cso->wrap_r),
#define MALI_SAMP_MIP_LINEAR_1 (1 << 3)
#define MALI_SAMP_MIP_LINEAR_2 (1 << 4)
+/* Flag in filter_mode, corresponding to OpenCL's NORMALIZED_COORDS_TRUE
+ * sampler_t flag. For typical OpenGL textures, this is always set. */
+
+#define MALI_SAMP_NORM_COORDS (1 << 5)
+
/* Used for lod encoding. Thanks @urjaman for pointing out these routines can
* be cleaned up a lot. */