From 677721202e234c96e03c87fb0c4fa24eac0306e1 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: (cherry picked from commit 8a0c1dcbd6c484dcf36ab3f35e33c95a69c0c2af) --- .pick_status.json | 2 +- src/gallium/drivers/r300/r300_state.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 5e34f402f6c..a9ce84de079 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1579,7 +1579,7 @@ "description": "r300: respect buffer offset in r300_set_constant_buffer", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 930da10cf2d..f214e842d04 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -2075,7 +2075,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; }