mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +02:00
ac/surface: add stencil-only support for host mem->surf copies
It's needed to tweak the surface info and to adjust the base pointer. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41000>
This commit is contained in:
parent
d1dd65d425
commit
fd95195f45
2 changed files with 20 additions and 4 deletions
|
|
@ -4688,9 +4688,15 @@ gfx10_surface_copy_mem_surface(struct ac_addrlib *addrlib, const struct radeon_i
|
|||
texel_scale = 3;
|
||||
}
|
||||
|
||||
/* Adjust surface info for a stencil-only copy. */
|
||||
if (surf_copy_region->is_stencil_only) {
|
||||
format = ADDR_FMT_8;
|
||||
bpe = 1;
|
||||
}
|
||||
|
||||
ADDR2_COPY_MEMSURFACE_INPUT input = {0};
|
||||
input.size = sizeof(ADDR2_COPY_MEMSURFACE_INPUT);
|
||||
input.swizzleMode = surf->has_stencil ?
|
||||
input.swizzleMode = (surf->has_stencil && surf_copy_region->is_stencil_only) ?
|
||||
surf->u.gfx9.zs.stencil_swizzle_mode :
|
||||
surf->u.gfx9.swizzle_mode;
|
||||
input.format = format;
|
||||
|
|
@ -4707,7 +4713,8 @@ gfx10_surface_copy_mem_surface(struct ac_addrlib *addrlib, const struct radeon_i
|
|||
input.numSamples = surf_info->samples;
|
||||
input.pitchInElement = surf->u.gfx9.pitch[surf_copy_region->level];
|
||||
input.pbXor = surf->tile_swizzle;
|
||||
input.pMappedSurface = (void *)surf_copy_region->surf_ptr;
|
||||
input.pMappedSurface = (char *)surf_copy_region->surf_ptr +
|
||||
(surf_copy_region->is_stencil_only ? surf->u.gfx9.zs.stencil_offset : 0);
|
||||
|
||||
ADDR_E_RETURNCODE res;
|
||||
ADDR2_COPY_MEMSURFACE_REGION region = {0};
|
||||
|
|
@ -4755,9 +4762,15 @@ gfx12_surface_copy_mem_surface(struct ac_addrlib *addrlib, const struct radeon_i
|
|||
texel_scale = 3;
|
||||
}
|
||||
|
||||
/* Adjust surface info for a stencil-only copy. */
|
||||
if (surf_copy_region->is_stencil_only) {
|
||||
format = ADDR_FMT_8;
|
||||
bpe = 1;
|
||||
}
|
||||
|
||||
ADDR3_COPY_MEMSURFACE_INPUT input = {0};
|
||||
input.size = sizeof(ADDR3_COPY_MEMSURFACE_INPUT);
|
||||
input.swizzleMode = surf->has_stencil ?
|
||||
input.swizzleMode = (surf->has_stencil && surf_copy_region->is_stencil_only) ?
|
||||
surf->u.gfx9.zs.stencil_swizzle_mode :
|
||||
surf->u.gfx9.swizzle_mode;
|
||||
input.format = format;
|
||||
|
|
@ -4773,7 +4786,8 @@ gfx12_surface_copy_mem_surface(struct ac_addrlib *addrlib, const struct radeon_i
|
|||
input.numSamples = surf_info->samples;
|
||||
input.pitchInElement = surf->u.gfx9.pitch[surf_copy_region->level];
|
||||
input.pbXor = surf->tile_swizzle;
|
||||
input.pMappedSurface = (void *)surf_copy_region->surf_ptr;
|
||||
input.pMappedSurface = (char *)surf_copy_region->surf_ptr +
|
||||
(surf_copy_region->is_stencil_only ? surf->u.gfx9.zs.stencil_offset : 0);
|
||||
|
||||
ADDR_E_RETURNCODE res;
|
||||
ADDR3_COPY_MEMSURFACE_REGION region = {0};
|
||||
|
|
|
|||
|
|
@ -558,6 +558,8 @@ struct ac_surface_copy_region {
|
|||
|
||||
uint64_t mem_row_pitch;
|
||||
uint64_t mem_slice_pitch;
|
||||
|
||||
bool is_stencil_only;
|
||||
};
|
||||
|
||||
bool ac_surface_copy_mem_to_surface(struct ac_addrlib *addrlib, const struct radeon_info *info,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue