Skip to content

Commit

Permalink
external_memory_fd: Initialize output struct with proper sType
Browse files Browse the repository at this point in the history
MemoryFdPropertiesKHR is a struct that, despite being used as output,
hsa to be initialized properly with a valid sType set, otherwise:

    Validation Error: [ VUID-VkMemoryFdPropertiesKHR-sType-sType ] Object 0: handle = 0x7f035464d648, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xdc6b3a0d | vkGetMemoryFdPropertiesKHR: parameter pMemoryFdProperties->sType must be VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR. The Vulkan spec states: sType must be VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR (https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VUID-VkMemoryFdPropertiesKHR-sType-sType)
  • Loading branch information
MarijnS95 authored and Ralith committed Mar 12, 2021
1 parent b3a010a commit 7e9abd2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ash/src/extensions/khr/external_memory_fd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl ExternalMemoryFd {
handle_type: vk::ExternalMemoryHandleTypeFlags,
fd: i32,
) -> VkResult<vk::MemoryFdPropertiesKHR> {
let mut memory_fd_properties = mem::zeroed();
let mut memory_fd_properties = Default::default();
self.external_memory_fd_fn
.get_memory_fd_properties_khr(self.handle, handle_type, fd, &mut memory_fd_properties)
.result_with_success(memory_fd_properties)
Expand Down

0 comments on commit 7e9abd2

Please sign in to comment.