nir/intrinsics: Don't report negative dest_components
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 27 Mar 2018 23:12:16 +0000 (16:12 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 28 Mar 2018 01:18:26 +0000 (18:18 -0700)
I have no idea why but having dest_components == -1 was causing a memory
leak somewhere.  Without this, you can't get through a full shader-db
run without running out of memory.

Reviewed-by: Rob Clark <robdclark@gmail.com>
src/compiler/nir/nir_intrinsics_c.py

index 339214ac53e38bdb37ca59e5005e30ca54d4f412..4410bc63462e3d223c9ac295a87124e3e5ade528 100644 (file)
@@ -35,7 +35,7 @@ const nir_intrinsic_info nir_intrinsic_infos[nir_num_intrinsics] = {
    },
 % endif
    .has_dest = ${"true" if opcode.has_dest else "false"},
-   .dest_components = ${opcode.dest_components},
+   .dest_components = ${max(opcode.dest_components, 0)},
    .num_variables = ${opcode.num_variables},
    .num_indices = ${opcode.num_indices},
 % if opcode.indices: