mesa/st: Set PIPE_MAP_DISCARD_RANGE in fallback_copy_image

Enables some drivers to avoid reading from the destination when mapping it.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18257>
This commit is contained in:
Nanley Chery
2022-08-24 11:30:14 -07:00
committed by Marge Bot
parent c8d36f92a0
commit 9fe525e37b

View File

@@ -615,10 +615,11 @@ fallback_copy_image(struct st_context *st,
st_MapTextureImage(
st->ctx, dst_image, dst_z,
dst_x, dst_y, dst_w, dst_h,
GL_MAP_WRITE_BIT, &dst, &dst_stride);
GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_RANGE_BIT,
&dst, &dst_stride);
} else {
dst = pipe_texture_map(st->pipe, dst_res, 0, dst_z,
PIPE_MAP_WRITE,
PIPE_MAP_WRITE | PIPE_MAP_DISCARD_RANGE,
dst_x, dst_y, dst_w, dst_h,
&dst_transfer);
dst_stride = dst_transfer->stride;