mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 18:18:06 +02:00
panfrost: Add a minus(1) modifier to the Levels field
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7653>
This commit is contained in:
parent
a612c05b57
commit
74165b3a46
3 changed files with 6 additions and 6 deletions
|
|
@ -719,7 +719,7 @@ pandecode_texture_payload(mali_ptr payload,
|
|||
* 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)
|
||||
|
|
|
|||
|
|
@ -680,7 +680,7 @@
|
|||
<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>
|
||||
|
||||
|
|
@ -723,7 +723,7 @@
|
|||
<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"/>
|
||||
|
|
|
|||
|
|
@ -401,7 +401,7 @@ panfrost_new_texture(
|
|||
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;
|
||||
};
|
||||
|
||||
|
|
@ -480,14 +480,14 @@ panfrost_new_texture_bifrost(
|
|||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue