From 025da70013ae95680a495fcbf2af6b86bd821887 Mon Sep 17 00:00:00 2001 From: Asahi Lina Date: Wed, 30 Aug 2023 15:42:04 +0900 Subject: [PATCH] asahi: Add and support the no_fp16 driconf flag This is the driconf equivalent of our debug no16 flag, which disables fp16 support to work around apps using bad GLSL precision qualifiers. Signed-off-by: Asahi Lina Reviewed-by: Alyssa Rosenzweig Reviewed-by: Eric Engestrom Part-of: --- src/gallium/drivers/asahi/agx_pipe.c | 4 ++++ src/gallium/drivers/asahi/driinfo_asahi.h | 1 + src/util/driconf.h | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/src/gallium/drivers/asahi/agx_pipe.c b/src/gallium/drivers/asahi/agx_pipe.c index de7a5120f91..87db9186f1a 100644 --- a/src/gallium/drivers/asahi/agx_pipe.c +++ b/src/gallium/drivers/asahi/agx_pipe.c @@ -2150,6 +2150,10 @@ agx_screen_create(int fd, struct renderonly *ro, driParseConfigFiles(config->options, config->options_info, 0, "asahi", NULL, NULL, NULL, 0, NULL, 0); + /* Forward no16 flag from driconf */ + if (driQueryOptionb(config->options, "no_fp16")) + agx_screen->dev.debug |= AGX_DBG_NO16; + agx_screen->dev.fd = fd; agx_screen->dev.ro = ro; diff --git a/src/gallium/drivers/asahi/driinfo_asahi.h b/src/gallium/drivers/asahi/driinfo_asahi.h index 243f2383376..e9eb7ea849d 100644 --- a/src/gallium/drivers/asahi/driinfo_asahi.h +++ b/src/gallium/drivers/asahi/driinfo_asahi.h @@ -2,4 +2,5 @@ /* clang-format off */ DRI_CONF_SECTION_MISCELLANEOUS + DRI_CONF_NO_FP16(false) DRI_CONF_SECTION_END diff --git a/src/util/driconf.h b/src/util/driconf.h index b9132f00e49..009fcce7b0c 100644 --- a/src/util/driconf.h +++ b/src/util/driconf.h @@ -465,6 +465,10 @@ DRI_CONF_OPT_B(allow_multisampled_copyteximage, def, \ "Allow CopyTexSubImage and other to copy sampled framebuffer") +#define DRI_CONF_NO_FP16(def) \ + DRI_CONF_OPT_B(no_fp16, def, \ + "Disable 16-bit float support") + /** * \brief Initialization configuration options */