r300: respect buffer offset in r300_set_constant_buffer

Fixes constants upload with nine.
Thanks to Marek Olšák for pointing this out.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7481
Cc: mesa-stable
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19277>
This commit is contained in:
Pavel Ondračka
2022-10-23 21:14:18 +02:00
committed by Marge Bot
parent a17e801a9c
commit 8a0c1dcbd6

View File

@@ -2076,7 +2076,7 @@ static void r300_set_constant_buffer(struct pipe_context *pipe,
struct r300_resource *rbuf = r300_resource(cb->buffer);
if (rbuf && rbuf->malloced_buffer)
mapped = (uint32_t*)rbuf->malloced_buffer;
mapped = (uint32_t*)(rbuf->malloced_buffer + cb->buffer_offset);
else
return;
}