diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-08-13 09:27:16 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-08-14 16:57:24 -0700 |
commit | 03350eb8b809d369a6af884a41dca0804c22de69 (patch) | |
tree | c278dc8e770be0a1a1342da5dbfb4ab28ff7fa93 /src/panfrost/midgard/mir.c | |
parent | cf3bb10f51e28f775744e5c24b30c27b25c40fdb (diff) |
pan/midgard: Add mir_ubo_shift helper
Different UBO reads have different shift requirements.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/panfrost/midgard/mir.c')
-rw-r--r-- | src/panfrost/midgard/mir.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/panfrost/midgard/mir.c b/src/panfrost/midgard/mir.c index 8422e93c989..97921a419f2 100644 --- a/src/panfrost/midgard/mir.c +++ b/src/panfrost/midgard/mir.c @@ -425,3 +425,24 @@ mir_mask_of_read_components(midgard_instruction *ins, unsigned node) return mask; } + +unsigned +mir_ubo_shift(midgard_load_store_op op) +{ + switch (op) { + case midgard_op_ld_ubo_char: + return 0; + case midgard_op_ld_ubo_char2: + return 1; + case midgard_op_ld_ubo_char4: + return 2; + case midgard_op_ld_ubo_short4: + return 3; + case midgard_op_ld_ubo_int4: + return 4; + default: + unreachable("Invalid op"); + } +} + + |