From d545897f1a59555843a7b22c4cb4ac5e3a7a0b25 Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Mon, 6 Nov 2017 19:28:55 -0800 Subject: RFC: anv: Enable VK_EXT_image_drm_format_modifier The draft spec lives at http://kiwitree.net/~chadv/vulkan/#1.0-VK_EXT_image_drm_format_modifier. This extension spec has a complete, working API. I'm happy with the API, and believe it's good enough. But the spec language has some outstanding issues that prevent it from being submitted as-is to Khronos: the spec language needs more polish, and the appendix chaper has a list of incomplete TODOs. --- src/intel/vulkan/anv_extensions.py | 1 + src/intel/vulkan/anv_image.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/intel/vulkan/anv_extensions.py b/src/intel/vulkan/anv_extensions.py index 83a93bdbf86..89957cce32e 100644 --- a/src/intel/vulkan/anv_extensions.py +++ b/src/intel/vulkan/anv_extensions.py @@ -87,6 +87,7 @@ EXTENSIONS = [ Extension('VK_KHX_multiview', 1, True), Extension('VK_EXT_debug_report', 8, True), Extension('VK_EXT_external_memory_dma_buf', 1, True), + Extension('VK_EXT_image_drm_format_modifier', 1, True), Extension('VK_EXT_queue_family_foreign', 1, True), ] diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index bf636ce4b65..a289ac8f944 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -1552,3 +1552,13 @@ anv_image_get_surface_for_aspect_mask(const struct anv_image *image, uint32_t plane = anv_image_aspect_to_plane(image->aspects, sanitized_mask); return &image->planes[plane].surface; } + +VkResult +anv_GetImageDrmFormatModifierEXT(VkDevice device_h, + VkImage image_h, + uint64_t *pDrmFormatModifier) +{ + ANV_FROM_HANDLE(anv_image, image, image_h); + *pDrmFormatModifier = image->drm_format_mod; + return VK_SUCCESS; +} -- cgit v1.2.3