panvk: Rework the NULL test in panvk_buffer_{gpu_ptr,range}()
We are about to allow buffer memory allocation from the cmd_buffer memory pool. In order to allow that, we need to tweak the NULL checks done in panvk_buffer_{gpu_ptr,range}() to use the device address instead of the bo field. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29451>
This commit is contained in:

committed by
Marge Bot

parent
1b16f9ec05
commit
495b718b3f
@@ -38,7 +38,7 @@ VK_DEFINE_NONDISP_HANDLE_CASTS(panvk_buffer, vk.base, VkBuffer,
|
||||
static inline uint64_t
|
||||
panvk_buffer_gpu_ptr(const struct panvk_buffer *buffer, uint64_t offset)
|
||||
{
|
||||
if (buffer->bo == NULL)
|
||||
if (!buffer->dev_addr)
|
||||
return 0;
|
||||
|
||||
return buffer->dev_addr + offset;
|
||||
@@ -48,7 +48,7 @@ static inline uint64_t
|
||||
panvk_buffer_range(const struct panvk_buffer *buffer, uint64_t offset,
|
||||
uint64_t range)
|
||||
{
|
||||
if (buffer->bo == NULL)
|
||||
if (!buffer->dev_addr)
|
||||
return 0;
|
||||
|
||||
return vk_buffer_range(&buffer->vk, offset, range);
|
||||
|
Reference in New Issue
Block a user