Skip to content
Snippets Groups Projects
Commit f924841f authored by Niklas Haas's avatar Niklas Haas
Browse files

vulkan: allow blacklisting specific pl_gpu_caps

Ostensibly for testing, in reality so we can make CI work again :^)
parent aec4a92b
No related branches found
No related tags found
1 merge request!73CI fixes
......@@ -2,7 +2,7 @@ project('libplacebo', ['c', 'cpp'],
license: 'LGPL2.1+',
default_options: ['c_std=c99'],
meson_version: '>=0.47',
version: '1.21.0',
version: '1.22.0',
)
# Version number
......
......@@ -163,6 +163,10 @@ struct pl_vulkan_params {
// enabled if supported by the device, but otherwise skipped.
const char **opt_extensions;
int num_opt_extensions;
// Restrict specific features to e.g. work around driver bugs, or simply
// for testing purposes
pl_gpu_caps blacklist_caps; // capabilities to be excluded
};
// Default/recommended parameters. Should generally be safe and efficient.
......
......@@ -519,16 +519,21 @@ static bool device_init(struct vk_ctx *vk, const struct pl_vulkan_params *params
}
}
if (idx_tf >= 0 && idx_tf != idx_gfx)
PL_INFO(vk, "Using async transfer (QF %d)", idx_tf);
if (idx_comp >= 0 && idx_comp != idx_gfx)
PL_INFO(vk, "Using async compute (QF %d)", idx_comp);
// Fall back to supporting compute shaders via the graphics pool for
// devices which support compute shaders but not async compute.
if (idx_comp < 0 && qfs[idx_gfx].queueFlags & VK_QUEUE_COMPUTE_BIT)
idx_comp = idx_gfx;
if (params->blacklist_caps & PL_GPU_CAP_COMPUTE) {
PL_INFO(vk, "Disabling compute shaders (blacklisted)");
idx_comp = -1;
}
if (idx_tf >= 0 && idx_tf != idx_gfx)
PL_INFO(vk, "Using async transfer (QF %d)", idx_tf);
if (idx_comp >= 0 && idx_comp != idx_gfx)
PL_INFO(vk, "Using async compute (QF %d)", idx_comp);
// Cache the transfer queue alignment requirements
if (idx_tf >= 0)
vk->transfer_alignment = qfs[idx_tf].minImageTransferGranularity;
......@@ -700,6 +705,10 @@ const struct pl_vulkan *pl_vulkan_create(struct pl_context *ctx,
if (!pl_vk->gpu)
goto error;
// Blacklist / restrict features
pl_gpu_caps *caps = (pl_gpu_caps*) &pl_vk->gpu->caps;
*caps &= ~(params->blacklist_caps);
// Expose the resulting vulkan objects
pl_vk->instance = vk->inst;
pl_vk->phys_device = vk->physd;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment