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>
This commit is contained in:
@@ -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. */
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user