hk: fake min/max filtering for proton

this gets us to fl12_0.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33682>
This commit is contained in:
Alyssa Rosenzweig 2025-02-21 11:51:43 -05:00 committed by Marge Bot
parent 383a3065b8
commit 839b01bd2d
5 changed files with 22 additions and 4 deletions

View file

@ -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

View file

@ -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,

View file

@ -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;

View file

@ -1489,5 +1489,14 @@ TODO: document the other workarounds.
<application name="Control (DX11)" executable="Control_DX11.exe">
<option name="hk_disable_border_emulation" value="true" />
</application>
<engine engine_name_match="DXVK|vkd3d">
<!--
Apple hardware lacks min/max filtering, but this is required for
FL12_0. Fortunately, this is an obscure feature and we support
the rest of FL12_0, so we prefer to fake support and fail D3D
conformance rather than be limited to FL11.
-->
<option name="hk_fake_minmax" value="true" />
</engine>
</device>
</driconf>

View file

@ -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
*/