* properties, but dump extra
* possibilities to futureproof */
- int bitmap_count = levels + 1;
+ int bitmap_count = levels;
/* Miptree for each face */
if (dim == MALI_TEXTURE_DIMENSION_CUBE)
<field name="Texel ordering" size="4" start="2:24" type="Texture Layout"/>
<field name="Unknown" size="1" start="2:28" type="bool" default="true"/>
<field name="Manual stride" size="1" start="2:29" type="bool" default="false"/>
- <field name="Levels" size="8" start="3:24" type="uint"/>
+ <field name="Levels" size="8" start="3:24" type="uint" modifier="minus(1)" default="1"/>
<field name="Swizzle" size="12" start="4:0" type="uint"/>
</struct>
<field name="Height" size="16" start="1:16" type="uint" modifier="minus(1)"/>
<field name="Swizzle" size="12" start="2:0" type="uint"/>
<field name="Texel ordering" size="4" start="2:12" type="Texture Layout"/>
- <field name="Levels" size="5" start="2:16" type="uint"/>
+ <field name="Levels" size="5" start="2:16" type="uint" default="1" modifier="minus(1)"/>
<field name="Minimum level" size="5" start="2:24" type="uint"/>
<field name="Minimum LOD" size="13" start="3:0" type="uint" default="0"/>
<field name="Sample count" size="3" start="3:13" type="uint" default="1" modifier="log2"/>
cfg.dimension = dim;
cfg.texel_ordering = panfrost_modifier_to_layout(modifier);
cfg.manual_stride = manual_stride;
- cfg.levels = last_level - first_level;
+ cfg.levels = last_level - first_level + 1;
cfg.swizzle = swizzle;
};
cfg.sample_count = MAX2(nr_samples, 1);
cfg.swizzle = swizzle;
cfg.texel_ordering = panfrost_modifier_to_layout(modifier);
- cfg.levels = last_level - first_level;
+ cfg.levels = last_level - first_level + 1;
cfg.array_size = array_size;
cfg.surfaces = payload->gpu;
/* We specify API-level LOD clamps in the sampler descriptor
* and use these clamps simply for bounds checking */
cfg.minimum_lod = FIXED_16(0, false);
- cfg.maximum_lod = FIXED_16(cfg.levels, false);
+ cfg.maximum_lod = FIXED_16(cfg.levels - 1, false);
}
}