adding vkGetBufferDeviceAddress
Build / build (push) Failing after 0s
Test / build_and_test (push) Failing after 7s

This commit is contained in:
2026-06-26 23:28:32 +02:00
parent 47c63705e2
commit b13a256eb6
8 changed files with 180 additions and 59 deletions
+6
View File
@@ -52,3 +52,9 @@ pub inline fn getMemoryRequirements(self: *Self, requirements: *vk.MemoryRequire
requirements.memory_type_bits = self.allowed_memory_types.mask;
self.vtable.getMemoryRequirements(self, requirements);
}
pub inline fn getDeviceAddress(self: *Self) VkError!vk.DeviceAddress {
const memory = self.memory orelse return 0;
const map = try memory.map(self.offset, self.size);
return @intCast(@intFromPtr(map.ptr));
}
+31
View File
@@ -239,6 +239,9 @@ const device_pfn_map = block: {
functionMapEntryPoint("vkFreeDescriptorSets"),
functionMapEntryPoint("vkFreeMemory"),
functionMapEntryPoint("vkGetBufferMemoryRequirements"),
functionMapEntryPoint("vkGetBufferDeviceAddress"),
functionMapEntryPoint("vkGetBufferDeviceAddressEXT"),
functionMapEntryPoint("vkGetBufferDeviceAddressKHR"),
functionMapEntryPoint("vkGetDeviceMemoryCommitment"),
functionMapEntryPoint("vkGetDeviceGroupPeerMemoryFeatures"),
functionMapEntryPoint("vkGetDeviceGroupPeerMemoryFeaturesKHR"),
@@ -1398,6 +1401,34 @@ pub export fn apeGetBufferMemoryRequirements(p_device: vk.Device, p_buffer: vk.B
buffer.getMemoryRequirements(requirements);
}
pub export fn apeGetBufferDeviceAddress(p_device: vk.Device, info: *const vk.BufferDeviceAddressInfo) callconv(vk.vulkan_call_conv) vk.DeviceAddress {
entryPointBeginLogTrace(.vkGetBufferDeviceAddress);
defer entryPointEndLogTrace();
Dispatchable(Device).checkHandleValidity(p_device) catch |err| {
errorLogger(err);
return 0;
};
const buffer = NonDispatchable(Buffer).fromHandleObject(info.buffer) catch |err| {
errorLogger(err);
return 0;
};
return buffer.getDeviceAddress() catch |err| {
errorLogger(err);
return 0;
};
}
pub export fn apeGetBufferDeviceAddressEXT(p_device: vk.Device, info: *const vk.BufferDeviceAddressInfo) callconv(vk.vulkan_call_conv) vk.DeviceAddress {
return @call(.always_inline, apeGetBufferDeviceAddress, .{ p_device, info });
}
pub export fn apeGetBufferDeviceAddressKHR(p_device: vk.Device, info: *const vk.BufferDeviceAddressInfo) callconv(vk.vulkan_call_conv) vk.DeviceAddress {
return @call(.always_inline, apeGetBufferDeviceAddress, .{ p_device, info });
}
pub export fn apeGetDeviceMemoryCommitment(p_device: vk.Device, p_memory: vk.DeviceMemory, committed_memory: *vk.DeviceSize) callconv(vk.vulkan_call_conv) void {
entryPointBeginLogTrace(.vkGetDeviceMemoryCommitment);
defer entryPointEndLogTrace();