Mesa (master): zink: also enable float16 from KHR extension
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Apr 30 12:11:51 UTC 2021
Module: Mesa
Branch: master
Commit: 91727182dc0cdcc74ff757074ae243cbfa7d18ba
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=91727182dc0cdcc74ff757074ae243cbfa7d18ba
Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date: Fri Apr 30 10:03:49 2021 +0200
zink: also enable float16 from KHR extension
This allows us to use 16 bit floats on pre Vulkan 1.2 drivers as well.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10101>
---
src/gallium/drivers/zink/zink_device_info.py | 3 +++
src/gallium/drivers/zink/zink_screen.c | 4 +++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/zink/zink_device_info.py b/src/gallium/drivers/zink/zink_device_info.py
index 4d4a56cd434..2fa1bf08884 100644
--- a/src/gallium/drivers/zink/zink_device_info.py
+++ b/src/gallium/drivers/zink/zink_device_info.py
@@ -156,6 +156,9 @@ EXTENSIONS = [
features=True,
conditions=["$feats.scalarBlockLayout"]),
Extension("VK_KHR_swapchain"),
+ Extension("VK_KHR_shader_float16_int8",
+ alias="shader_float16_int8",
+ features=True),
]
# constructor: Versions(device_version(major, minor, patch), struct_version(major, minor))
diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c
index 38bba9c7334..acee468b9ef 100644
--- a/src/gallium/drivers/zink/zink_screen.c
+++ b/src/gallium/drivers/zink/zink_screen.c
@@ -703,7 +703,9 @@ zink_get_shader_param(struct pipe_screen *pscreen,
case PIPE_SHADER_CAP_FP16:
case PIPE_SHADER_CAP_FP16_DERIVATIVES:
- return screen->info.feats12.shaderFloat16;
+ return screen->info.feats12.shaderFloat16 ||
+ (screen->info.have_KHR_shader_float16_int8 &&
+ screen->info.shader_float16_int8_feats.shaderFloat16);
case PIPE_SHADER_CAP_INT16:
return screen->info.feats.features.shaderInt16;
More information about the mesa-commit
mailing list