mesa/st: discard whole resource when mapping drawpixels texture

The texture resource has just been allocated for the whole purpose
of holding the drawpixels data. Make the drivers life a bit easier
by telling it that we aren't interested in any previous content
when mapping the resource.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23546>
This commit is contained in:
Lucas Stach 2023-06-09 11:57:52 +02:00 committed by Marge Bot
parent 1a975bc278
commit 12b816ce79

View file

@ -656,8 +656,8 @@ make_texture(struct st_context *st,
/* map texture transfer */
dest = pipe_texture_map(pipe, pt, 0, 0,
PIPE_MAP_WRITE, 0, 0,
width, height, &transfer);
PIPE_MAP_WRITE | PIPE_MAP_DISCARD_WHOLE_RESOURCE,
0, 0, width, height, &transfer);
if (!dest) {
pipe_resource_reference(&pt, NULL);
_mesa_unmap_pbo_source(ctx, unpack);