mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
radeonsi/gfx12: always set BO metadata, not just during export
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30063>
This commit is contained in:
parent
462ef2d638
commit
acb3d5f132
2 changed files with 11 additions and 3 deletions
|
|
@ -617,7 +617,8 @@ static void si_set_tex_bo_metadata(struct si_screen *sscreen, struct si_texture
|
|||
bool is_array = util_texture_is_array(res->target);
|
||||
uint32_t desc[8];
|
||||
|
||||
sscreen->make_texture_descriptor(sscreen, tex, true, res->target, res->format, swizzle, 0,
|
||||
sscreen->make_texture_descriptor(sscreen, tex, true, res->target,
|
||||
tex->is_depth ? tex->db_render_format : res->format, swizzle, 0,
|
||||
res->last_level, 0, is_array ? res->array_size - 1 : 0,
|
||||
res->width0, res->height0, res->depth0, true, desc, NULL);
|
||||
si_set_mutable_tex_desc_fields(sscreen, tex, &tex->surface.u.legacy.level[0], 0, 0,
|
||||
|
|
@ -1106,6 +1107,12 @@ static struct si_texture *si_texture_create_object(struct pipe_screen *screen,
|
|||
tex->can_sample_z = true;
|
||||
tex->can_sample_s = true;
|
||||
}
|
||||
|
||||
/* Always set BO metadata - required for programming DCC fields for GFX12 SDMA in the kernel.
|
||||
* If the texture is suballocated, this will overwrite the metadata for all suballocations,
|
||||
* but there is nothing we can do about that.
|
||||
*/
|
||||
si_set_tex_bo_metadata(sscreen, tex);
|
||||
return tex;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1324,7 +1324,8 @@ static void amdgpu_buffer_set_metadata(struct radeon_winsys *rws,
|
|||
struct radeon_surf *surf)
|
||||
{
|
||||
struct amdgpu_winsys *aws = amdgpu_winsys(rws);
|
||||
struct amdgpu_bo_real *bo = get_real_bo(amdgpu_winsys_bo(_buf));
|
||||
struct amdgpu_winsys_bo *bo = amdgpu_winsys_bo(_buf);
|
||||
struct amdgpu_bo_real *real = is_real_bo(bo) ? get_real_bo(bo) : get_slab_entry_real_bo(bo);
|
||||
struct amdgpu_bo_metadata metadata = {0};
|
||||
|
||||
ac_surface_compute_bo_metadata(&aws->info, surf, &metadata.tiling_info);
|
||||
|
|
@ -1332,7 +1333,7 @@ static void amdgpu_buffer_set_metadata(struct radeon_winsys *rws,
|
|||
metadata.size_metadata = md->size_metadata;
|
||||
memcpy(metadata.umd_metadata, md->metadata, sizeof(md->metadata));
|
||||
|
||||
amdgpu_bo_set_metadata(bo->bo_handle, &metadata);
|
||||
amdgpu_bo_set_metadata(real->bo_handle, &metadata);
|
||||
}
|
||||
|
||||
struct pb_buffer_lean *
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue