From 8a0c1dcbd6c484dcf36ab3f35e33c95a69c0c2af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Ondra=C4=8Dka?= Date: Sun, 23 Oct 2022 21:14:18 +0200 Subject: [PATCH] r300: respect buffer offset in r300_set_constant_buffer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Filip Gawin Reviewed-by: Emma Anholt Part-of: --- src/gallium/drivers/r300/r300_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 682abcb523b..6130b10602f 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -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; }