From 7fab8675a6e8701da02da2b6e12c15920f6a9aa3 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Fri, 24 Jan 2025 10:54:00 +0200 Subject: [PATCH] anv: add a drirc to disable border colors without format Disable it by default on Android. Signed-off-by: Lionel Landwerlin Reviewed-by: Lucas Fryzek Part-of: --- src/intel/vulkan/anv_instance.c | 4 ++++ src/intel/vulkan/anv_physical_device.c | 3 ++- src/intel/vulkan/anv_private.h | 1 + src/util/driconf.h | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/intel/vulkan/anv_instance.c b/src/intel/vulkan/anv_instance.c index 99dcad7db19..527a82a35f0 100644 --- a/src/intel/vulkan/anv_instance.c +++ b/src/intel/vulkan/anv_instance.c @@ -53,6 +53,7 @@ static const driOptionDescription anv_dri_options[] = { DRI_CONF_ANV_MESH_CONV_PRIM_ATTRS_TO_VERT_ATTRS(-2) DRI_CONF_FORCE_VK_VENDOR() DRI_CONF_FAKE_SPARSE(false) + DRI_CONF_CUSTOM_BORDER_COLORS_WITHOUT_FORMAT(!DETECT_OS_ANDROID) #if DETECT_OS_ANDROID && ANDROID_API_LEVEL >= 34 DRI_CONF_VK_REQUIRE_ASTC(true) #else @@ -182,6 +183,9 @@ anv_init_dri_options(struct anv_instance *instance) instance->anv_upper_bound_descriptor_pool_sampler = driQueryOptionb(&instance->dri_options, "anv_upper_bound_descriptor_pool_sampler"); + instance->custom_border_colors_without_format = + driQueryOptionb(&instance->dri_options, + "custom_border_colors_without_format"); instance->stack_ids = driQueryOptioni(&instance->dri_options, "intel_stack_id"); switch (instance->stack_ids) { diff --git a/src/intel/vulkan/anv_physical_device.c b/src/intel/vulkan/anv_physical_device.c index a91ea236a2d..b2eda469415 100644 --- a/src/intel/vulkan/anv_physical_device.c +++ b/src/intel/vulkan/anv_physical_device.c @@ -567,7 +567,8 @@ get_features(const struct anv_physical_device *pdevice, /* VK_EXT_custom_border_color */ .customBorderColors = true, - .customBorderColorWithoutFormat = true, + .customBorderColorWithoutFormat = + pdevice->instance->custom_border_colors_without_format, /* VK_EXT_depth_clamp_zero_one */ .depthClampZeroOne = true, diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 4b89f3397b6..4042d6ced5b 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -1311,6 +1311,7 @@ struct anv_instance { bool compression_control_enabled; bool anv_fake_nonlocal_memory; bool anv_upper_bound_descriptor_pool_sampler; + bool custom_border_colors_without_format; /* HW workarounds */ bool no_16bit; diff --git a/src/util/driconf.h b/src/util/driconf.h index e724c1ccff3..d186b090f82 100644 --- a/src/util/driconf.h +++ b/src/util/driconf.h @@ -492,6 +492,10 @@ DRI_CONF_OPT_B(allow_multisampled_copyteximage, def, \ "Allow CopyTexSubImage and other to copy sampled framebuffer") +#define DRI_CONF_CUSTOM_BORDER_COLORS_WITHOUT_FORMAT(def) \ + DRI_CONF_OPT_B(custom_border_colors_without_format, def, \ + "Enable custom border colors without format") + #define DRI_CONF_NO_FP16(def) \ DRI_CONF_OPT_B(no_fp16, def, \ "Disable 16-bit float support")