lavapipe: add support for external memory/fd/sempahore extensions
These are just dummy versions of these but enough to pass CTS Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8218>
This commit is contained in:
@@ -1796,3 +1796,23 @@ void lvp_GetPrivateDataEXT(
|
||||
vk_object_base_get_private_data(&device->vk, objectType, objectHandle,
|
||||
privateDataSlot, pData);
|
||||
}
|
||||
|
||||
void lvp_GetPhysicalDeviceExternalFenceProperties(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
const VkPhysicalDeviceExternalFenceInfo *pExternalFenceInfo,
|
||||
VkExternalFenceProperties *pExternalFenceProperties)
|
||||
{
|
||||
pExternalFenceProperties->exportFromImportedHandleTypes = 0;
|
||||
pExternalFenceProperties->compatibleHandleTypes = 0;
|
||||
pExternalFenceProperties->externalFenceFeatures = 0;
|
||||
}
|
||||
|
||||
void lvp_GetPhysicalDeviceExternalSemaphoreProperties(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
const VkPhysicalDeviceExternalSemaphoreInfo *pExternalSemaphoreInfo,
|
||||
VkExternalSemaphoreProperties *pExternalSemaphoreProperties)
|
||||
{
|
||||
pExternalSemaphoreProperties->exportFromImportedHandleTypes = 0;
|
||||
pExternalSemaphoreProperties->compatibleHandleTypes = 0;
|
||||
pExternalSemaphoreProperties->externalSemaphoreFeatures = 0;
|
||||
}
|
||||
|
||||
@@ -67,13 +67,13 @@ EXTENSIONS = [
|
||||
Extension('VK_KHR_device_group_creation', 1, True),
|
||||
Extension('VK_KHR_draw_indirect_count', 1, True),
|
||||
Extension('VK_KHR_driver_properties', 1, True),
|
||||
Extension('VK_KHR_external_fence', 1, False),
|
||||
Extension('VK_KHR_external_fence', 1, True),
|
||||
Extension('VK_KHR_external_fence_capabilities', 1, True),
|
||||
Extension('VK_KHR_external_fence_fd', 1, False),
|
||||
Extension('VK_KHR_external_memory', 1, False),
|
||||
Extension('VK_KHR_external_memory', 1, True),
|
||||
Extension('VK_KHR_external_memory_capabilities', 1, True),
|
||||
Extension('VK_KHR_external_memory_fd', 1, False),
|
||||
Extension('VK_KHR_external_semaphore', 1, False),
|
||||
Extension('VK_KHR_external_semaphore', 1, True),
|
||||
Extension('VK_KHR_external_semaphore_capabilities', 1, True),
|
||||
Extension('VK_KHR_external_semaphore_fd', 1, False),
|
||||
Extension('VK_KHR_get_display_properties2', 1, 'VK_USE_PLATFORM_DISPLAY_KHR'),
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#include "lvp_private.h"
|
||||
#include "util/format/u_format.h"
|
||||
#include "util/u_math.h"
|
||||
#include "vk_util.h"
|
||||
|
||||
#define COMMON_NAME(x) [VK_FORMAT_##x] = PIPE_FORMAT_##x
|
||||
|
||||
#define FLOAT_NAME(x) [VK_FORMAT_##x##_SFLOAT] = PIPE_FORMAT_##x##_FLOAT
|
||||
@@ -411,12 +413,42 @@ VkResult lvp_GetPhysicalDeviceImageFormatProperties2(
|
||||
VkImageFormatProperties2 *base_props)
|
||||
{
|
||||
LVP_FROM_HANDLE(lvp_physical_device, physical_device, physicalDevice);
|
||||
const VkPhysicalDeviceExternalImageFormatInfo *external_info = NULL;
|
||||
VkExternalImageFormatProperties *external_props = NULL;
|
||||
VkResult result;
|
||||
result = lvp_get_image_format_properties(physical_device, base_info,
|
||||
&base_props->imageFormatProperties);
|
||||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
|
||||
vk_foreach_struct_const(s, base_info->pNext) {
|
||||
switch (s->sType) {
|
||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO:
|
||||
external_info = (const void *) s;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Extract output structs */
|
||||
vk_foreach_struct(s, base_props->pNext) {
|
||||
switch (s->sType) {
|
||||
case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES:
|
||||
external_props = (void *) s;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (external_info && external_info->handleType != 0) {
|
||||
external_props->externalMemoryProperties = (VkExternalMemoryProperties) {
|
||||
.externalMemoryFeatures = 0,
|
||||
.exportFromImportedHandleTypes = 0,
|
||||
.compatibleHandleTypes = 0,
|
||||
};
|
||||
}
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -443,3 +475,15 @@ void lvp_GetPhysicalDeviceSparseImageFormatProperties2(
|
||||
/* Sparse images are not yet supported. */
|
||||
*pPropertyCount = 0;
|
||||
}
|
||||
|
||||
void lvp_GetPhysicalDeviceExternalBufferProperties(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo,
|
||||
VkExternalBufferProperties *pExternalBufferProperties)
|
||||
{
|
||||
pExternalBufferProperties->externalMemoryProperties = (VkExternalMemoryProperties) {
|
||||
.externalMemoryFeatures = 0,
|
||||
.exportFromImportedHandleTypes = 0,
|
||||
.compatibleHandleTypes = 0,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user