diff --git a/src/panfrost/bifrost/bi_print.c b/src/panfrost/bifrost/bi_print.c index 502ceb0dab9..56e83be9b1d 100644 --- a/src/panfrost/bifrost/bi_print.c +++ b/src/panfrost/bifrost/bi_print.c @@ -243,8 +243,9 @@ bi_cond_name(enum bi_cond cond) static void bi_print_texture(struct bi_texture *tex, FILE *fp) { - fprintf(fp, " - texture %u, sampler %u", - tex->texture_index, tex->sampler_index); + fprintf(fp, " - texture %u, sampler %u%s", + tex->texture_index, tex->sampler_index, + tex->compute_lod ? ", compute lod" : ""); } void diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 841e5b6a820..3f086387319 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -948,6 +948,7 @@ emit_tex_compact(bi_context *ctx, nir_tex_instr *instr) .texture = { .texture_index = instr->texture_index, .sampler_index = instr->sampler_index, + .compute_lod = instr->op == nir_texop_tex, }, .dest = pan_dest_index(&instr->dest), .dest_type = instr->dest_type, diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index 24d26b2ec85..b986a12a3d6 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -245,6 +245,10 @@ 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; + + /* Should the LOD be computed based on neighboring pixels? Only valid + * in fragment shaders. */ + bool compute_lod; }; typedef struct {