Skip to content

gallium: handle copy_image of depth textures

Eric Smith requested to merge ericsmith/mesa:ericsmith/copyimage_depth into main
gallium: handle copy_image of depth textures

copy_image calls blit now for multisampled images, including
depth. But blit explicitly uses only PIPE_MASK_RGBA, so it is
incapable of copying depth buffers.

This patch checks the destination format and uses PIPE_MASK_ZS if
it is a depth or stencil. Ideally we would simply use PIPE_MASK_RGBAZS
instead of PIPE_MASK_RGBA, but not all drivers actually handle
getting this mask (they probably should, but that's another story).    

The change to copy_image was in 5027b5aa2, so in some sense this
patch "fixes" that. In fact though the issue wasn't in the copy_image
change, it was always latent in blit().

Fixes: 5027b5aa28f ("gallium: stop calling resource_copy_region for multisampled copy_image")
Signed-off-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Edited by Eric Smith

Merge request reports