zink: implement half-float packing

This cap isn't really optional for drivers that implement GL SPIR-V
support, so let's just implement it.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4846
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11057>
This commit is contained in:
Erik Faye-Lund 2021-05-28 11:04:31 +02:00 committed by Marge Bot
parent 1887ff2ebb
commit ba392e9511
2 changed files with 4 additions and 0 deletions

View file

@ -1654,6 +1654,9 @@ emit_alu(struct ntv_context *ctx, nir_alu_instr *alu)
BUILTIN_UNOP(nir_op_ufind_msb, GLSLstd450FindUMsb)
BUILTIN_UNOP(nir_op_find_lsb, GLSLstd450FindILsb)
BUILTIN_UNOP(nir_op_ifind_msb, GLSLstd450FindSMsb)
BUILTIN_UNOP(nir_op_pack_half_2x16, GLSLstd450PackHalf2x16)
BUILTIN_UNOP(nir_op_unpack_half_2x16, GLSLstd450UnpackHalf2x16)
#undef BUILTIN_UNOP
case nir_op_frcp:

View file

@ -254,6 +254,7 @@ zink_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_INVALIDATE_BUFFER:
case PIPE_CAP_PREFER_REAL_BUFFER_IN_CONSTBUF0:
case PIPE_CAP_PACKED_UNIFORMS:
case PIPE_CAP_TGSI_PACK_HALF_FLOAT:
return 1;
case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION: