svga: fix persistent mapped surface update to constant buffer
authorCharmaine Lee <charmainel@vmware.com>
Mon, 29 Aug 2022 21:14:30 +0000 (14:14 -0700)
committerMarge Bot <emma+marge@anholt.net>
Mon, 25 Sep 2023 23:36:58 +0000 (23:36 +0000)
commitb46526b7a49253bc4d47932ce01589b45b225a91
tree44ce9a89fce61a24aaef52331c4ec01692c87486
parent4f96d2f6ba79d4146f989bc336b9bafb532e20b5
svga: fix persistent mapped surface update to constant buffer

Currently when a buffer is mapped with the persistent bit set and is
later bound as a constant buffer, the updated buffer content is not
properly updated to the constant buffer surface as the constant buffer
surface is different from the original buffer surface. Doing
a buffer copy to sync the content of the constant buffer will fix
the problem, but the buffer copy can be costly.
To properly fix the issue, instead of creating a secondary surface
for the constant buffer, the original buffer surface will be accessed as
a raw buffer.

This fixes the rendering issue running yuzu deko_basic.nro

Reviewed-by: Martin Krastev <krastevm@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25381>
src/gallium/drivers/svga/svga_resource_buffer_upload.c
src/gallium/drivers/svga/svga_screen_cache.h
src/gallium/drivers/svga/svga_state_constants.c