diff --git a/src/asahi/vulkan/hk_instance.c b/src/asahi/vulkan/hk_instance.c index a89417a0bbe..4be7a763da7 100644 --- a/src/asahi/vulkan/hk_instance.c +++ b/src/asahi/vulkan/hk_instance.c @@ -96,6 +96,7 @@ static const driOptionDescription hk_dri_options[] = { DRI_CONF_SECTION_MISCELLANEOUS DRI_CONF_HK_DISABLE_RGBA4_BORDER_COLOR_WORKAROUND(false) DRI_CONF_HK_DISABLE_BORDER_EMULATION(false) + DRI_CONF_HK_FAKE_MINMAX(false) DRI_CONF_SECTION_END }; /* clang-format on */ @@ -118,6 +119,9 @@ hk_init_dri_options(struct hk_instance *instance) instance->no_border = driQueryOptionb(&instance->dri_options, "hk_disable_border_emulation"); + + instance->fake_minmax = + driQueryOptionb(&instance->dri_options, "hk_fake_minmax"); } VKAPI_ATTR VkResult VKAPI_CALL diff --git a/src/asahi/vulkan/hk_instance.h b/src/asahi/vulkan/hk_instance.h index e8916dae3b0..eb39fab8af5 100644 --- a/src/asahi/vulkan/hk_instance.h +++ b/src/asahi/vulkan/hk_instance.h @@ -22,6 +22,7 @@ struct hk_instance { bool workaround_rgba4; bool no_border; + bool fake_minmax; }; VK_DEFINE_HANDLE_CASTS(hk_instance, vk.base, VkInstance, diff --git a/src/asahi/vulkan/hk_physical_device.c b/src/asahi/vulkan/hk_physical_device.c index bc6a4a7a105..b45a69f7141 100644 --- a/src/asahi/vulkan/hk_physical_device.c +++ b/src/asahi/vulkan/hk_physical_device.c @@ -212,7 +212,7 @@ hk_get_device_extensions(const struct hk_instance *instance, static void hk_get_device_features( - const struct agx_device *dev, + const struct agx_device *dev, const struct hk_instance *instance, const struct vk_device_extension_table *supported_extensions, struct vk_features *features) { @@ -331,7 +331,7 @@ hk_get_device_features( .descriptorBindingPartiallyBound = true, .descriptorBindingVariableDescriptorCount = true, .runtimeDescriptorArray = true, - .samplerFilterMinmax = false, + .samplerFilterMinmax = instance->fake_minmax, .scalarBlockLayout = true, .imagelessFramebuffer = true, .uniformBufferStandardLayout = true, @@ -838,7 +838,7 @@ hk_get_device_properties(const struct agx_device *dev, .maxDescriptorSetUpdateAfterBindSampledImages = HK_MAX_DESCRIPTORS, .maxDescriptorSetUpdateAfterBindStorageImages = HK_MAX_DESCRIPTORS, .maxDescriptorSetUpdateAfterBindInputAttachments = HK_MAX_DESCRIPTORS, - .filterMinmaxSingleComponentFormats = false, + .filterMinmaxSingleComponentFormats = instance->fake_minmax, .filterMinmaxImageComponentMapping = false, .maxTimelineSemaphoreValueDifference = UINT64_MAX, .framebufferIntegerColorSampleCounts = sample_counts, @@ -1188,7 +1188,7 @@ hk_create_drm_physical_device(struct vk_instance *_instance, hk_get_device_extensions(instance, &supported_extensions); struct vk_features supported_features; - hk_get_device_features(&pdev->dev, &supported_extensions, + hk_get_device_features(&pdev->dev, instance, &supported_extensions, &supported_features); struct vk_properties properties; diff --git a/src/util/00-mesa-defaults.conf b/src/util/00-mesa-defaults.conf index ae414e18af2..a31f1fee6f2 100644 --- a/src/util/00-mesa-defaults.conf +++ b/src/util/00-mesa-defaults.conf @@ -1489,5 +1489,14 @@ TODO: document the other workarounds. + + + diff --git a/src/util/driconf.h b/src/util/driconf.h index c9263074a9a..8ec236f4483 100644 --- a/src/util/driconf.h +++ b/src/util/driconf.h @@ -641,6 +641,10 @@ DRI_CONF_OPT_B(hk_disable_rgba4_border_color_workaround, def, \ "Use hardware opaque_black, breaking certain RGBA4 formats") +#define DRI_CONF_HK_FAKE_MINMAX(def) \ + DRI_CONF_OPT_B(hk_fake_minmax, def, \ + "Fake support for min/max filtering") + /** * \brief venus specific configuration options */