-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import image from dma_buf following VK_EXT_external_memory_dma_buf #2145
Conversation
Implements importing an image into Vulkan from a Linux dma_buf, according to the following Vulkan extensions: - https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_external_memory_dma_buf.html - https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_image_drm_format_modifier.html
Can you add the appropriate validation for any VUIDs that rely on the tiling of the image? Both for The Windows build is also currently failing, that should be fixed. |
Adds conditional compilation checks to functionality for importing vulkan images from a Linux dmabuf, as doing this only makes sense on Linux.
I noticed that on the VUIDs validation on |
Using the error is preferred. |
0355d80
to
d3fa5ec
Compare
@Rua The Windows check seems to be failing with the following message: Also, are there other things I need to address before this can get merged? I added the VUID checking for |
The Windows CI stuff has been intermittent for a while. This isn't caused by your code, so you don't need to worry about it. There are many other VUIDs throughout the Vulkan specification that reference the tiling of an image. Some examples:
You can get a better idea by searching for |
How can I validate On another note, how can I validate if something is in the vulkan |
What you describe is generally how Vulkano validates such things. If the called function is determined by some condition, then that condition is used when validating as well. In this particular case though, I think you can take a shortcut: if |
Actually, looking at the Vulkan spec closer, it seems that VUID-vkGetPhysicalDeviceImageFormatProperties-tiling-02248 is related to VUID-VkPhysicalDeviceImageFormatInfo2-tiling-02249. Since the non-2 version of the function has no way to provide |
Check for VUID-vkGetPhysicalDeviceImageFormatProperties-tiling-02248, and VUID-VkPhysicalDeviceImageFormatInfo2-tiling-02249
Or explanations of why they cannot yet be added
I created a list of all VUIDs by searching for VK_IMAGE_TILING_ or VK_EXT_image_drm_format_modifier.
|
Use lowercase for error, replace panic! with todo!, and make some comments show up in documentation.
Is there anything else that needs to be changed or added? |
You mention that there is no multiplanar support yet, but Vulkano does have support for multiplanar images. Do you mean multiplanar images specifically in combination with the extensions you're adding? |
…ulkano-rs#2145) * Import image from dma_buf Implements importing an image into Vulkan from a Linux dma_buf, according to the following Vulkan extensions: - https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_external_memory_dma_buf.html - https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_image_drm_format_modifier.html * Only compile dmabuf image importing on Linux Adds conditional compilation checks to functionality for importing vulkan images from a Linux dmabuf, as doing this only makes sense on Linux. * Add VUID checking for VkImageCreateInfo * Avoid Linux-only dependencies on other OSs * Add missing initializer to StorageImage * Add more VUID validation Check for VUID-vkGetPhysicalDeviceImageFormatProperties-tiling-02248, and VUID-VkPhysicalDeviceImageFormatInfo2-tiling-02249 * Add some more VUIDs Or explanations of why they cannot yet be added * Small fix * Add suggested fixes Use lowercase for error, replace panic! with todo!, and make some comments show up in documentation.
Update documentation to reflect any user-facing changes - in this repository.
Make sure that the changes are covered by unit-tests.
Run
cargo fmt
on the changes.Please put changelog entries in the description of this Pull Request
if knowledge of this change could be valuable to users. No need to put the
entries to the changelog directly, they will be transferred to the changelog
file by maintainers right after the Pull Request merge.
Please remove any items from the template below that are not applicable.
Describe in common words what is the purpose of this change, related
Github Issues, and highlight important implementation aspects:
Implements importing an image into Vulkan from a Linux dma_buf,
according to the following Vulkan extensions:
This functionality is already part of Ash and the Vulkan specification, so not many changes were necessary.
The main change was a new constructor to
StorageImage
that creates an image from a list of Unix file descriptors, a DRM_FORMAT_MODIFIER and some other parameters. This only adds support for importing single-planar images (those backed by a single file descriptor), despite the specification supporting multiple file descriptors.Changelog: