Mesa (master): zink: enable 16-bit int support

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 30 12:11:51 UTC 2021


Module: Mesa
Branch: master
Commit: 404521529ce58ea48d102f32895b4f6c086a5d47
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=404521529ce58ea48d102f32895b4f6c086a5d47

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Tue Apr  6 18:52:19 2021 +0200

zink: enable 16-bit int support

The mysterious support_16bit_int_alu-option doesn't really mean what it
says. Instead it means "we support 16 bit compares, if 16 bit ALU
operations occur". And since 16 bit operations only appear if we're
lowering mediump/lowp, we can always set this option.

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_compiler.c | 1 +
 src/gallium/drivers/zink/zink_screen.c   | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/zink/zink_compiler.c b/src/gallium/drivers/zink/zink_compiler.c
index 03ba0b08e1a..ce6e3a7266f 100644
--- a/src/gallium/drivers/zink/zink_compiler.c
+++ b/src/gallium/drivers/zink/zink_compiler.c
@@ -391,6 +391,7 @@ zink_screen_init_compiler(struct zink_screen *screen)
       .has_fsub = true,
       .has_isub = true,
       .lower_mul_2x32_64 = true,
+      .support_16bit_alu = true, /* not quite what it sounds like */
    };
 
    screen->nir_options = default_options;
diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c
index 5c00b5430f5..1f654eea5f3 100644
--- a/src/gallium/drivers/zink/zink_screen.c
+++ b/src/gallium/drivers/zink/zink_screen.c
@@ -700,10 +700,12 @@ zink_get_shader_param(struct pipe_screen *pscreen,
    case PIPE_SHADER_CAP_FP16:
    case PIPE_SHADER_CAP_FP16_DERIVATIVES:
    case PIPE_SHADER_CAP_FP16_CONST_BUFFERS:
-   case PIPE_SHADER_CAP_INT16:
    case PIPE_SHADER_CAP_GLSL_16BIT_CONSTS:
       return 0; /* not implemented */
 
+   case PIPE_SHADER_CAP_INT16:
+      return screen->info.feats.features.shaderInt16;
+
    case PIPE_SHADER_CAP_PREFERRED_IR:
       return PIPE_SHADER_IR_NIR;
 



More information about the mesa-commit mailing list