zink: Add mapping for nir_op_ldexp, but disable it for 64-bit's sake.

We previously had GLSL do ldexp lowering to bitops, but NIR can do it
instead.  It's tempting to just pass the NIR op through to the host Vulkan
driver, but to do that we'd need to split up NIR's flag between 32 and
64-bit support, and that's not worth anyone's time for an op we've never
seen used.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
This commit is contained in:
Emma Anholt 2023-03-22 13:11:16 -07:00 committed by Marge Bot
parent 46bf687882
commit 675f4ff596
3 changed files with 12 additions and 0 deletions

View file

@ -2253,6 +2253,7 @@ emit_alu(struct ntv_context *ctx, nir_alu_instr *alu)
BUILTIN_BINOP(nir_op_imax, GLSLstd450SMax)
BUILTIN_BINOP(nir_op_umin, GLSLstd450UMin)
BUILTIN_BINOP(nir_op_umax, GLSLstd450UMax)
BUILTIN_BINOP(nir_op_ldexp, GLSLstd450Ldexp)
#undef BUILTIN_BINOP
case nir_op_fdot2:

View file

@ -1252,6 +1252,15 @@ zink_screen_init_compiler(struct zink_screen *screen)
.lower_extract_word = true,
.lower_insert_byte = true,
.lower_insert_word = true,
/* We can only support 32-bit ldexp, but NIR doesn't have a flag
* distinguishing 64-bit ldexp support (radeonsi *does* support 64-bit
* ldexp, so we don't just always lower it in NIR). Given that ldexp is
* effectively unused (no instances in shader-db), it's not worth the
* effort to do so.
* */
.lower_ldexp = true,
.lower_mul_high = true,
.lower_rotate = true,
.lower_uadd_carry = true,

View file

@ -1243,6 +1243,8 @@ zink_get_shader_param(struct pipe_screen *pscreen,
return 0;
case PIPE_SHADER_CAP_LDEXP_SUPPORTED:
return 1;
case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTERS:
case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS:
return 0; /* not implemented */