Commit cff8c00a by Hernan Liatis

Advertise support for VK_KHR_swapchain

Bug: b/124265819 Change-Id: I19bbaeefe19ade1afeb6764d4f5576a29334d8bd Reviewed-on: https://swiftshader-review.googlesource.com/c/25490Tested-by: 's avatarHernan Liatis <hliatis@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent c6eb41be
...@@ -49,11 +49,6 @@ Device::Device(const Device::CreateInfo* info, void* mem) ...@@ -49,11 +49,6 @@ Device::Device(const Device::CreateInfo* info, void* mem)
// "The ppEnabledLayerNames and enabledLayerCount members of VkDeviceCreateInfo are deprecated and their values must be ignored by implementations." // "The ppEnabledLayerNames and enabledLayerCount members of VkDeviceCreateInfo are deprecated and their values must be ignored by implementations."
UNIMPLEMENTED(); // TODO(b/119321052): UNIMPLEMENTED() should be used only for features that must still be implemented. Use a more informational macro here. UNIMPLEMENTED(); // TODO(b/119321052): UNIMPLEMENTED() should be used only for features that must still be implemented. Use a more informational macro here.
} }
if(pCreateInfo->enabledExtensionCount)
{
UNIMPLEMENTED();
}
} }
void Device::destroy(const VkAllocationCallbacks* pAllocator) void Device::destroy(const VkAllocationCallbacks* pAllocator)
......
...@@ -97,6 +97,7 @@ static const VkExtensionProperties deviceExtensionProperties[] = ...@@ -97,6 +97,7 @@ static const VkExtensionProperties deviceExtensionProperties[] =
{ VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME, VK_KHR_SHADER_DRAW_PARAMETERS_SPEC_VERSION }, { VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME, VK_KHR_SHADER_DRAW_PARAMETERS_SPEC_VERSION },
{ VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_EXTENSION_NAME, VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_SPEC_VERSION }, { VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_EXTENSION_NAME, VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_SPEC_VERSION },
{ VK_KHR_VARIABLE_POINTERS_EXTENSION_NAME, VK_KHR_VARIABLE_POINTERS_SPEC_VERSION }, { VK_KHR_VARIABLE_POINTERS_EXTENSION_NAME, VK_KHR_VARIABLE_POINTERS_SPEC_VERSION },
{ VK_KHR_SWAPCHAIN_EXTENSION_NAME, VK_KHR_SWAPCHAIN_SPEC_VERSION },
}; };
VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkInstance* pInstance) VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkInstance* pInstance)
...@@ -292,6 +293,29 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, c ...@@ -292,6 +293,29 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, c
UNIMPLEMENTED(); // TODO(b/119321052): UNIMPLEMENTED() should be used only for features that must still be implemented. Use a more informational macro here. UNIMPLEMENTED(); // TODO(b/119321052): UNIMPLEMENTED() should be used only for features that must still be implemented. Use a more informational macro here.
} }
for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; ++i)
{
const char* currentExtensionName = pCreateInfo->ppEnabledExtensionNames[i];
uint32_t extensionPropertiesCount = sizeof(deviceExtensionProperties) / sizeof(deviceExtensionProperties[0]);
bool foundExtension = false;
for (uint32_t j = 0; j < extensionPropertiesCount; ++j)
{
if (strcmp(currentExtensionName, deviceExtensionProperties[j].extensionName) == 0)
{
foundExtension = true;
break;
}
}
if (!foundExtension)
{
return VK_ERROR_EXTENSION_NOT_PRESENT;
}
}
const VkBaseInStructure* extensionCreateInfo = reinterpret_cast<const VkBaseInStructure*>(pCreateInfo->pNext); const VkBaseInStructure* extensionCreateInfo = reinterpret_cast<const VkBaseInStructure*>(pCreateInfo->pNext);
while(extensionCreateInfo) while(extensionCreateInfo)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment