diff options
author | Boris Brezillon <boris.brezillon@collabora.com> | 2020-11-16 16:49:10 +0100 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@collabora.com> | 2020-11-17 08:41:05 +0100 |
commit | 549a59f66e2d132e55b62017078734dbf0322a32 (patch) | |
tree | 6cc9b6aff83a48c731480197571c2a4849ecc8e6 /src/panfrost | |
parent | fb01328d30eb038023a0fb5bcbc80f7382754ab2 (diff) |
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 <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7636>
Diffstat (limited to 'src/panfrost')
-rw-r--r-- | src/panfrost/bifrost/compiler.h | 2 | ||||
-rw-r--r-- | 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) |