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>
(cherry picked from commit 8a0c1dcbd6)
This commit is contained in:
Pavel Ondračka
2022-10-23 21:14:18 +02:00
committed by Dylan Baker
parent 80f296268e
commit 677721202e
2 changed files with 2 additions and 2 deletions

View File

@@ -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
},

View File

@@ -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;
}