lima_tex_desc *desc = pdesc;
unsigned first_level;
unsigned last_level;
- bool mipmapping;
memset(desc, 0, desc_size);
if (last_level - first_level >= LIMA_MAX_MIP_LEVELS)
last_level = first_level + LIMA_MAX_MIP_LEVELS - 1;
+ desc->miplevels = (last_level - first_level);
+
switch (sampler->base.min_mip_filter) {
case PIPE_TEX_MIPFILTER_LINEAR:
- desc->min_mipfilter = 3;
+ desc->min_mipfilter_1 = 0;
+ desc->min_mipfilter_2 = 3;
+ break;
case PIPE_TEX_MIPFILTER_NEAREST:
- mipmapping = true;
- desc->miplevels = (last_level - first_level);
+ desc->min_mipfilter_1 = 0x1ff;
+ desc->min_mipfilter_2 = 0;
break;
case PIPE_TEX_MIPFILTER_NONE:
default:
- mipmapping = false;
break;
}
switch (sampler->base.mag_img_filter) {
case PIPE_TEX_FILTER_LINEAR:
desc->mag_img_filter_nearest = 0;
- /* no mipmap, filter_mag = linear */
- if (!mipmapping)
- desc->disable_mipmap = 1;
break;
case PIPE_TEX_FILTER_NEAREST:
default:
uint32_t stride: 13;
uint32_t unknown_0_2: 1;
- /* Word 1*/
+ /* Word 1-3 */
uint32_t unknown_1_1: 10;
uint32_t texture_2d: 1;
uint32_t unknown_1_2: 13;
uint32_t miplevels: 4;
- uint32_t unknown_1_3: 3;
- uint32_t disable_mipmap: 1;
-
- /* Word 2-3 */
- uint32_t unknown_2_1: 8;
+ uint32_t min_mipfilter_1: 9; /* 0x0 for linear, 0x1ff for nearest */
+ uint32_t unknown_2_1: 3;
uint32_t has_stride: 1;
- uint32_t min_mipfilter: 2; /* 0x3 for linear, 0x0 for neares */
+ uint32_t min_mipfilter_2: 2; /* 0x3 for linear, 0x0 for nearest */
uint32_t min_img_filter_nearest: 1;
uint32_t mag_img_filter_nearest: 1;
uint32_t wrap_s_clamp_to_edge: 1;
union {
uint32_t va[0];
struct __attribute__((__packed__)) {
- uint32_t unknown_6_1: 12;
+ uint32_t unknown_6_1: 13;
uint32_t layout: 2;
- uint32_t unknown_6_2: 10;
+ uint32_t unknown_6_2: 9;
uint32_t unknown_6_3: 6;
#define VA_BIT_OFFSET 30
#define VA_BIT_SIZE 26