diff options
author | Daniel Schürmann <[email protected]> | 2018-05-09 20:37:24 +0200 |
---|---|---|
committer | Connor Abbott <[email protected]> | 2019-06-13 12:44:23 +0000 |
commit | ea51275e07b06b16a952d8108c3a543e38249350 (patch) | |
tree | 6f3e3fd673c5af320d4bf2c7e6e3a9a9e1148cdb /src/compiler/nir/nir_print.c | |
parent | f2277c327a36eab8c233dd0e787a1632ec7cdc90 (diff) |
nir: add intrinsics for AMD_shader_ballot
Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_print.c')
-rw-r--r-- | src/compiler/nir/nir_print.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c index 03509e1cc65..d67c6c79c17 100644 --- a/src/compiler/nir/nir_print.c +++ b/src/compiler/nir/nir_print.c @@ -776,6 +776,7 @@ print_intrinsic_instr(nir_intrinsic_instr *instr, print_state *state) [NIR_INTRINSIC_ALIGN_OFFSET] = "align_offset", [NIR_INTRINSIC_DESC_TYPE] = "desc_type", [NIR_INTRINSIC_TYPE] = "type", + [NIR_INTRINSIC_SWIZZLE_MASK] = "swizzle_mask", }; for (unsigned idx = 1; idx < NIR_INTRINSIC_NUM_INDEX_FLAGS; idx++) { if (!info->index_map[idx]) @@ -827,6 +828,19 @@ print_intrinsic_instr(nir_intrinsic_instr *instr, print_state *state) fprintf(fp, " type=%s%u", name, size); else fprintf(fp, " type=%s", name); + } else if (idx == NIR_INTRINSIC_SWIZZLE_MASK) { + fprintf(fp, " swizzle_mask="); + unsigned mask = nir_intrinsic_swizzle_mask(instr); + if (instr->intrinsic == nir_intrinsic_quad_swizzle_amd) { + for (unsigned i = 0; i < 4; i++) + fprintf(fp, "%d", (mask >> (i * 2) & 3)); + } else if (instr->intrinsic == nir_intrinsic_masked_swizzle_amd) { + fprintf(fp, "((id & %d) | %d) ^ %d", mask & 0x1F, + (mask >> 5) & 0x1F, + (mask >> 10) & 0x1F); + } else { + fprintf(fp, "%d", mask); + } } else { unsigned off = info->index_map[idx] - 1; assert(index_name[idx]); /* forgot to update index_name table? */ |