nvk: Add a couple descriptor set address helpers

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Faith Ekstrand 2023-01-30 20:11:48 -06:00 committed by Marge Bot
parent fca440dcb2
commit 6dfb36c636

View file

@ -3,6 +3,8 @@
#include "nvk_private.h"
#include "nouveau_bo.h"
#include "nouveau_push.h"
#include "vulkan/runtime/vk_object.h"
struct nvk_descriptor_set_layout;
@ -51,4 +53,18 @@ struct nvk_descriptor_set {
VK_DEFINE_HANDLE_CASTS(nvk_descriptor_set, base, VkDescriptorSet,
VK_OBJECT_TYPE_DESCRIPTOR_SET)
static void
nvk_push_descriptor_set_ref(struct nouveau_ws_push *push,
const struct nvk_descriptor_set *set)
{
if (set->bo)
nouveau_ws_push_ref(push, set->bo, NOUVEAU_WS_BO_RD);
}
static inline uint64_t
nvk_descriptor_set_addr(const struct nvk_descriptor_set *set)
{
return set->bo->offset + set->bo_offset;
}
#endif