anv: don't advertise vk conformance on GPUs that aren't conformant
This sets the conformance version to 0.0.0.0 for GPUs that have incomplete support for vulkan, so that it's easier to check if vulkan is fully supported by a GPU at runtime for applications/libraries. $ vulkaninfo|grep conf MESA-INTEL: warning: Ivy Bridge Vulkan support is incomplete conformanceVersion = 0.0.0.0 Signed-off-by: Clayton Craft <clayton@craftyguy.net> Reviewed-by: Ivan Briano <ivan.briano@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13275>
This commit is contained in:
@@ -768,6 +768,7 @@ anv_physical_device_try_create(struct anv_instance *instance,
|
||||
goto fail_fd;
|
||||
}
|
||||
|
||||
bool is_alpha = true;
|
||||
if (devinfo.is_haswell) {
|
||||
mesa_logw("Haswell Vulkan support is incomplete");
|
||||
} else if (devinfo.ver == 7 && !devinfo.is_baytrail) {
|
||||
@@ -776,6 +777,7 @@ anv_physical_device_try_create(struct anv_instance *instance,
|
||||
mesa_logw("Bay Trail Vulkan support is incomplete");
|
||||
} else if (devinfo.ver >= 8 && devinfo.ver <= 12) {
|
||||
/* Gfx8-12 fully supported */
|
||||
is_alpha = false;
|
||||
} else {
|
||||
result = vk_errorf(instance, VK_ERROR_INCOMPATIBLE_DRIVER,
|
||||
"Vulkan not yet supported on %s", devinfo.name);
|
||||
@@ -809,6 +811,7 @@ anv_physical_device_try_create(struct anv_instance *instance,
|
||||
snprintf(device->path, ARRAY_SIZE(device->path), "%s", path);
|
||||
|
||||
device->info = devinfo;
|
||||
device->is_alpha = is_alpha;
|
||||
|
||||
device->pci_info.domain = drm_device->businfo.pci->domain;
|
||||
device->pci_info.bus = drm_device->businfo.pci->bus;
|
||||
@@ -2018,12 +2021,26 @@ anv_get_physical_device_properties_1_2(struct anv_physical_device *pdevice,
|
||||
memset(p->driverInfo, 0, sizeof(p->driverInfo));
|
||||
snprintf(p->driverInfo, VK_MAX_DRIVER_INFO_SIZE_KHR,
|
||||
"Mesa " PACKAGE_VERSION MESA_GIT_SHA1);
|
||||
p->conformanceVersion = (VkConformanceVersionKHR) {
|
||||
.major = 1,
|
||||
.minor = 2,
|
||||
.subminor = 0,
|
||||
.patch = 0,
|
||||
};
|
||||
|
||||
/* Don't advertise conformance with a particular version if the hardware's
|
||||
* support is incomplete/alpha.
|
||||
*/
|
||||
if (pdevice->is_alpha) {
|
||||
p->conformanceVersion = (VkConformanceVersionKHR) {
|
||||
.major = 0,
|
||||
.minor = 0,
|
||||
.subminor = 0,
|
||||
.patch = 0,
|
||||
};
|
||||
}
|
||||
else {
|
||||
p->conformanceVersion = (VkConformanceVersionKHR) {
|
||||
.major = 1,
|
||||
.minor = 2,
|
||||
.subminor = 0,
|
||||
.patch = 0,
|
||||
};
|
||||
}
|
||||
|
||||
p->denormBehaviorIndependence =
|
||||
VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL_KHR;
|
||||
|
@@ -880,6 +880,8 @@ struct anv_physical_device {
|
||||
struct brw_compiler * compiler;
|
||||
struct isl_device isl_dev;
|
||||
struct intel_perf_config * perf;
|
||||
/* True if hardware support is incomplete/alpha */
|
||||
bool is_alpha;
|
||||
/*
|
||||
* Number of commands required to implement a performance query begin +
|
||||
* end.
|
||||
|
Reference in New Issue
Block a user