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>
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:
.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,
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 */