Add support lavapipe (mesa vulkan software render)

This commit is contained in:
Denis Pauk 2020-10-01 23:36:44 +03:00 committed by Yamagi
parent d5f8791728
commit 00f676c973
2 changed files with 11 additions and 3 deletions

View file

@ -857,8 +857,11 @@ static void CreateSamplers()
samplerInfo.magFilter = VK_FILTER_NEAREST; samplerInfo.magFilter = VK_FILTER_NEAREST;
samplerInfo.minFilter = VK_FILTER_NEAREST; samplerInfo.minFilter = VK_FILTER_NEAREST;
samplerInfo.mipmapMode = VK_SAMPLER_MIPMAP_MODE_NEAREST; samplerInfo.mipmapMode = VK_SAMPLER_MIPMAP_MODE_NEAREST;
if (vk_device.features.samplerAnisotropy)
{
samplerInfo.anisotropyEnable = VK_TRUE; samplerInfo.anisotropyEnable = VK_TRUE;
samplerInfo.maxAnisotropy = vk_device.properties.limits.maxSamplerAnisotropy; samplerInfo.maxAnisotropy = vk_device.properties.limits.maxSamplerAnisotropy;
}
samplerInfo.maxLod = 1.f; samplerInfo.maxLod = 1.f;
VK_VERIFY(vkCreateSampler(vk_device.logical, &samplerInfo, NULL, &vk_samplers[S_ANISO_NEAREST])); VK_VERIFY(vkCreateSampler(vk_device.logical, &samplerInfo, NULL, &vk_samplers[S_ANISO_NEAREST]));

View file

@ -71,9 +71,14 @@ static void getBestPhysicalDevice(const VkPhysicalDevice *devices, int preferred
qboolean extSupported = deviceExtensionsSupported(&devices[i]); qboolean extSupported = deviceExtensionsSupported(&devices[i]);
// no required extensions? try next device // no required extensions? try next device
if (!extSupported || !deviceFeatures.samplerAnisotropy) if (!extSupported)
continue; continue;
if (!deviceFeatures.samplerAnisotropy)
{
R_Printf(PRINT_ALL, "...anisotropy filtering is unsupported.\n");
}
// if extensions are fine, query surface formats and present modes to see if the device can be used // if extensions are fine, query surface formats and present modes to see if the device can be used
VK_VERIFY(vkGetPhysicalDeviceSurfaceFormatsKHR(devices[i], vk_surface, &formatCount, NULL)); VK_VERIFY(vkGetPhysicalDeviceSurfaceFormatsKHR(devices[i], vk_surface, &formatCount, NULL));
VK_VERIFY(vkGetPhysicalDeviceSurfacePresentModesKHR(devices[i], vk_surface, &presentModesCount, NULL)); VK_VERIFY(vkGetPhysicalDeviceSurfacePresentModesKHR(devices[i], vk_surface, &presentModesCount, NULL));