Module: Mesa Branch: main Commit: d037fd539c8cfa91556fa59da671411006214780 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d037fd539c8cfa91556fa59da671411006214780
Author: Karol Herbst <[email protected]> Date: Wed Sep 28 03:21:05 2022 +0200 radeonsi: fail creating textures from user memory Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19151> --- src/gallium/drivers/radeonsi/si_buffer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/drivers/radeonsi/si_buffer.c b/src/gallium/drivers/radeonsi/si_buffer.c index 11c2cafbbac..7a07a84d362 100644 --- a/src/gallium/drivers/radeonsi/si_buffer.c +++ b/src/gallium/drivers/radeonsi/si_buffer.c @@ -630,6 +630,9 @@ static struct pipe_resource *si_buffer_from_user_memory(struct pipe_screen *scre const struct pipe_resource *templ, void *user_memory) { + if (templ->target != PIPE_BUFFER) + return NULL; + struct si_screen *sscreen = (struct si_screen *)screen; struct radeon_winsys *ws = sscreen->ws; struct si_resource *buf = si_alloc_buffer_struct(screen, templ, false);
