1
0
Fork 0
forked from fte/fteqw

If the user picks an explicit vulkan device, attempt to ignore any issues from vulkan not reporting any render queues that can present to the screen. This allows us to start up with mesa's software vulkan implementation.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5843 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2021-05-09 13:01:44 +00:00
parent b4b4653b68
commit 440a8e7b53

View file

@ -4542,6 +4542,7 @@ qboolean VK_Init(rendererstate_t *info, const char **sysextnames, qboolean (*cre
const char *extensions[8];
uint32_t extensions_count = 0;
qboolean ignorequeuebugs = false;
qboolean okay;
vrsetup_t vrsetup = {sizeof(vrsetup)};
@ -4798,12 +4799,20 @@ qboolean VK_Init(rendererstate_t *info, const char **sysextnames, qboolean (*cre
break; //okay, this one should be usable
}
if (j == queue_count)
{
if ((wantdev >= 0 && i==wantdev) || (wantdev==-1 && *info->subrenderer && !Q_strcasecmp(props.deviceName, info->subrenderer)))
{
Con_Printf(CON_WARNING"vulkan: attempting to use device \"%s\" despite no device queues being able to present to window surface\n", props.deviceName);
ignorequeuebugs = true;
}
else
{
//no queues can present to that surface, so I guess we can't use that device
Con_DLPrintf((wantdev != i)?1:0, "vulkan: ignoring device \"%s\" as it can't present to window\n", props.deviceName);
continue;
}
}
}
Con_DPrintf("Found Vulkan Device \"%s\"\n", props.deviceName);
if (!vk.gpu)
@ -4980,12 +4989,19 @@ qboolean VK_Init(rendererstate_t *info, const char **sysextnames, qboolean (*cre
if (vk.queuefam[0] == ~0u || vk.queuefam[1] == ~0u)
{
if (ignorequeuebugs && queue_count>0)
{
vk.queuefam[0] = vk.queuefam[1] = 0;
}
else
{
free(queueprops);
Con_Printf(CON_ERROR"vulkan: unable to find suitable queues\n");
return false;
}
}
}
{
uint32_t extcount = 0, i;