pan/bi: Track compute_lod in IR

We'll need to differentiate tex and txl.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6749>
This commit is contained in:
Alyssa Rosenzweig 2020-08-03 12:47:57 -04:00 committed by Marge Bot
parent 8dd3a81c1d
commit 67d89568af
3 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -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,

View File

@ -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 {