Module: Mesa Branch: master Commit: 549a59f66e2d132e55b62017078734dbf0322a32 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=549a59f66e2d132e55b62017078734dbf0322a32
Author: Boris Brezillon <[email protected]> Date: Mon Nov 16 16:49:10 2020 +0100 pan/bi: Add a varying_index field to bi_texture So we can get rid of the offset adjusment done in pack_variant() Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7636> --- src/panfrost/bifrost/compiler.h | 2 +- src/panfrost/bifrost/gen_pack.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index 42b02a57f70..d2a021c71e1 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -261,7 +261,7 @@ struct bi_bitwise { struct bi_texture { /* Constant indices. Indirect would need to be in src[..] like normal, * we can reserve some sentinels there for that for future. */ - unsigned texture_index, sampler_index; + unsigned texture_index, sampler_index, varying_index; /* Should the LOD be computed based on neighboring pixels? Only valid * in fragment shaders. */ diff --git a/src/panfrost/bifrost/gen_pack.py b/src/panfrost/bifrost/gen_pack.py index 7d1f4387f0c..d633747dae0 100644 --- a/src/panfrost/bifrost/gen_pack.py +++ b/src/panfrost/bifrost/gen_pack.py @@ -392,7 +392,7 @@ def pack_derived(pos, exprs, imm_map, body, pack_exprs): IMMEDIATE_TABLE = { 'attribute_index': 'bi_get_immediate(ins, 0)', - 'varying_index': 'bi_get_immediate(ins, 0)', + 'varying_index': 'ins->texture.varying_index', 'index': 'ins->load_vary.index', 'texture_index': 'ins->texture.texture_index', 'sampler_index': 'ins->texture.sampler_index', @@ -452,7 +452,7 @@ def pack_variant(opname, states): if staging in ["r", "rw"]: offset += 1 - offset += len(set(["attribute_index", "varying_index"]) & set([x[0] for x in states[0][1].get("immediates", [])])) + offset += len(set(["attribute_index"]) & set([x[0] for x in states[0][1].get("immediates", [])])) pack_sources(states[0][1].get("srcs", []), common_body, pack_exprs, offset) _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
