mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-19 19:00:33 +01:00
nir/serialize: don't serialize redundant nir_intrinsic_instr::num_components
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
This commit is contained in:
parent
a2df670b14
commit
3d44aed09e
1 changed files with 16 additions and 6 deletions
|
|
@ -640,9 +640,9 @@ union packed_instr {
|
|||
struct {
|
||||
unsigned instr_type:4;
|
||||
unsigned intrinsic:9;
|
||||
unsigned num_components:3;
|
||||
unsigned const_indices_encoding:2;
|
||||
unsigned packed_const_indices:6;
|
||||
unsigned _pad:3;
|
||||
unsigned dest:8;
|
||||
} intrinsic;
|
||||
struct {
|
||||
|
|
@ -1122,8 +1122,6 @@ write_intrinsic(write_ctx *ctx, const nir_intrinsic_instr *intrin)
|
|||
|
||||
header.intrinsic.instr_type = intrin->instr.type;
|
||||
header.intrinsic.intrinsic = intrin->intrinsic;
|
||||
header.intrinsic.num_components =
|
||||
encode_num_components_in_3bits(intrin->num_components);
|
||||
|
||||
/* Analyze constant indices to decide how to encode them. */
|
||||
if (num_indices) {
|
||||
|
|
@ -1185,15 +1183,27 @@ read_intrinsic(read_ctx *ctx, union packed_instr header)
|
|||
unsigned num_srcs = nir_intrinsic_infos[op].num_srcs;
|
||||
unsigned num_indices = nir_intrinsic_infos[op].num_indices;
|
||||
|
||||
intrin->num_components =
|
||||
decode_num_components_in_3bits(header.intrinsic.num_components);
|
||||
|
||||
if (nir_intrinsic_infos[op].has_dest)
|
||||
read_dest(ctx, &intrin->dest, &intrin->instr, header);
|
||||
|
||||
for (unsigned i = 0; i < num_srcs; i++)
|
||||
read_src(ctx, &intrin->src[i], &intrin->instr);
|
||||
|
||||
/* Vectorized instrinsics have num_components same as dst or src that has
|
||||
* 0 components in the info. Find it.
|
||||
*/
|
||||
if (nir_intrinsic_infos[op].has_dest &&
|
||||
nir_intrinsic_infos[op].dest_components == 0) {
|
||||
intrin->num_components = nir_dest_num_components(intrin->dest);
|
||||
} else {
|
||||
for (unsigned i = 0; i < num_srcs; i++) {
|
||||
if (nir_intrinsic_infos[op].src_components[i] == 0) {
|
||||
intrin->num_components = nir_src_num_components(intrin->src[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (num_indices) {
|
||||
switch (header.intrinsic.const_indices_encoding) {
|
||||
case const_indices_6bit_all_combined: {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue