lavapipe: fix BufferDeviceAddress usage
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Sat, 22 Oct 2022 16:47:29 +0000 (12:47 -0400)
committerMarge Bot <emma+marge@anholt.net>
Tue, 25 Oct 2022 01:32:58 +0000 (01:32 +0000)
this is supposed to return the address at the start of the buffer,
not the address at the start of the memory allocation

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19274>

src/gallium/frontends/lavapipe/lvp_image.c

index 4411941..290716b 100644 (file)
@@ -440,7 +440,7 @@ VKAPI_ATTR VkDeviceAddress VKAPI_CALL lvp_GetBufferDeviceAddress(
 {
    LVP_FROM_HANDLE(lvp_buffer, buffer, pInfo->buffer);
 
-   return (VkDeviceAddress)(uintptr_t)buffer->pmem;
+   return (VkDeviceAddress)(uintptr_t)((char*)buffer->pmem + buffer->offset);
 }
 
 VKAPI_ATTR uint64_t VKAPI_CALL lvp_GetBufferOpaqueCaptureAddress(