zink: check base-requirements
This one is a bit of a tough nut to deal with gracefully. Zink has a set of base-requirements that we always require. There's no Gallium caps to report these missing features, so we're essentially left with two options: 1. Fail to create the screen. 2. Ignore the missing fetures. Solution 1 will lead to difficulties bringing up a new Vulkan driver on Zink, and solution 2 will lead to mis-rendering. Since Zink is mostly an opt-in driver to use when there's no OpenGL driver available, we should probably do 2 for now. It seems better to have some mis-rendering than no rendering at all. But let's at least check, and print a warning. That way people get to know what's up. Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9925>
This commit is contained in:
committed by
Marge Bot
parent
920ecbefbd
commit
2de07d1ad2
@@ -1368,6 +1368,22 @@ pre_hash_descriptor_states(struct zink_screen *screen)
|
||||
screen->null_descriptor_hashes.buffer_view = _mesa_hash_data(&null_binfo, sizeof(VkBufferViewCreateInfo));
|
||||
}
|
||||
|
||||
static void
|
||||
check_base_requements(struct zink_screen *screen)
|
||||
{
|
||||
if (!screen->info.feats.features.logicOp ||
|
||||
!screen->info.feats.features.fillModeNonSolid ||
|
||||
!screen->info.feats.features.wideLines ||
|
||||
!screen->info.feats.features.largePoints ||
|
||||
!screen->info.feats.features.alphaToOne ||
|
||||
!screen->info.feats.features.shaderClipDistance ||
|
||||
!screen->info.have_KHR_maintenance1) {
|
||||
fprintf(stderr, "WARNING: The Vulkan device doesn't support "
|
||||
"the base Zink requirements, some incorrect rendering "
|
||||
"might occur\n");
|
||||
}
|
||||
}
|
||||
|
||||
static struct zink_screen *
|
||||
zink_internal_create_screen(const struct pipe_screen_config *config)
|
||||
{
|
||||
@@ -1421,6 +1437,8 @@ zink_internal_create_screen(const struct pipe_screen_config *config)
|
||||
if (!load_device_extensions(screen))
|
||||
goto fail;
|
||||
|
||||
check_base_requements(screen);
|
||||
|
||||
screen->base.get_name = zink_get_name;
|
||||
screen->base.get_vendor = zink_get_vendor;
|
||||
screen->base.get_device_vendor = zink_get_device_vendor;
|
||||
|
||||
Reference in New Issue
Block a user