From 7fdb090709dcfcc1de00d46456e1aae6e8a7493e Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 7 Oct 2020 18:32:32 -0400 Subject: [PATCH] pan/bi: Implement txb Also uses the 8.8 signed fixed-point format. dEQP-GLES2.functional.shaders.texture_functions.fragment.texture2d_bias Signed-off-by: Alyssa Rosenzweig Reviewed-by: Boris Brezillon Part-of: --- src/panfrost/bifrost/bifrost_compile.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 4382a57..1cb293e 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -1129,6 +1129,7 @@ emit_texc(bi_context *ctx, nir_tex_instr *instr) switch (instr->op) { case nir_texop_tex: case nir_texop_txl: + case nir_texop_txb: break; default: unreachable("Unsupported texture op"); @@ -1177,11 +1178,13 @@ emit_texc(bi_context *ctx, nir_tex_instr *instr) tex.swizzle[1][0] = 0; tex.swizzle[2][0] = 1; break; + case nir_tex_src_lod: if (nir_src_is_const(instr->src[i].src) && nir_src_as_uint(instr->src[i].src) == 0) { desc.lod_mode = BIFROST_LOD_MODE_ZERO; } else { assert(base == nir_type_float); + assert(sz == 16 || sz == 32); dregs[BIFROST_TEX_DREG_LOD] = bi_emit_lod_88(ctx, index, sz == 16); @@ -1189,6 +1192,16 @@ emit_texc(bi_context *ctx, nir_tex_instr *instr) } break; + + case nir_tex_src_bias: + /* Upper 16-bits interpreted as a clamp, leave zero */ + assert(base == nir_type_float); + assert(sz == 16 || sz == 32); + dregs[BIFROST_TEX_DREG_LOD] = + bi_emit_lod_88(ctx, index, sz == 16); + desc.lod_mode = BIFROST_LOD_MODE_BIAS; + break; + default: unreachable("Unhandled src type in texc emit"); } -- 2.7.4