diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-04-14 20:20:37 -0400 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2020-04-17 16:25:35 -0400 |
commit | aba7f09902f704819f0bc718a322793b265acd64 (patch) | |
tree | 14492c100d4d17aa4f02f34e439b13ef941d93c9 /src/panfrost/bifrost | |
parent | 438e445e17864e91704c5c8a6ed33bfefe329008 (diff) |
pan/bi: Handle st_vary with <4 components
Still no writemasks.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4615>
Diffstat (limited to 'src/panfrost/bifrost')
-rw-r--r-- | src/panfrost/bifrost/bifrost_compile.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index aa3de9ec356..adddef794ef 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -189,6 +189,9 @@ bi_emit_st_vary(bi_context *ctx, nir_intrinsic_instr *instr) address.dest_type = nir_type_uint32; address.writemask = (1 << 12) - 1; + unsigned nr = nir_intrinsic_src_components(instr, 0); + assert(nir_intrinsic_write_mask(instr) == ((1 << nr) - 1)); + bi_instruction st = { .type = BI_STORE_VAR, .src = { @@ -200,12 +203,15 @@ bi_emit_st_vary(bi_context *ctx, nir_intrinsic_instr *instr) nir_type_uint32, nir_type_uint32, nir_type_uint32, }, .swizzle = { - { 0, 1, 2, 3 }, + { 0 }, { 0 }, { 1 }, { 2} }, - .store_channels = 4, /* TODO: WRITEMASK */ + .store_channels = nr, }; + for (unsigned i = 0; i < nr; ++i) + st.swizzle[0][i] = i; + bi_emit(ctx, address); bi_emit(ctx, st); } |