mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 05:08:08 +02:00
zink: Output PackHalf2x16 to uint not float
Fixes InconsistentSpirv validation errors reporting that PackHalf2x16
outputs uint rather than float.
For example the previous code generates the following SPIR-V with
PackHalf2x16 output as a float:
%2018 = OpExtInst %float %1 PackHalf2x16 %2017
%2019 = OpBitcast %uint %2018
The new code generates:
%2018 = OpExtInst %uint %1 PackHalf2x16 %2017
%2019 = OpBitcast %uint %2018
cc: mesa-stable
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14568>
(cherry picked from commit 985dae7f41)
This commit is contained in:
parent
f85939fa86
commit
83011a9226
2 changed files with 8 additions and 2 deletions
|
|
@ -1408,7 +1408,7 @@
|
|||
"description": "zink: Output PackHalf2x16 to uint not float",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1742,7 +1742,13 @@ 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_UNOPF(nir_op_pack_half_2x16, GLSLstd450PackHalf2x16)
|
||||
|
||||
case nir_op_pack_half_2x16:
|
||||
assert(nir_op_infos[alu->op].num_inputs == 1);
|
||||
result = emit_builtin_unop(ctx, GLSLstd450PackHalf2x16, get_dest_type(ctx, &alu->dest.dest, nir_type_uint), src[0]);
|
||||
force_float = true;
|
||||
break;
|
||||
|
||||
BUILTIN_UNOPF(nir_op_unpack_half_2x16, GLSLstd450UnpackHalf2x16)
|
||||
BUILTIN_UNOPF(nir_op_pack_64_2x32, GLSLstd450PackDouble2x32)
|
||||
#undef BUILTIN_UNOP
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue