[Freedreno] [PATCH] freedreno/ir3: add TXL support

Ilia Mirkin imirkin at alum.mit.edu
Tue Sep 9 21:59:30 PDT 2014


Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---

Rob, this is a complete guess based on the SAML name. This is also not enough
to enable ARB_shader_texture_lod because it also introduces explicit
derivatives. However it _should_ be enough to make stuff like

PIGLIT_TEST="2D Texture lookup with explicit lod (Vertex shader)" bin/glean -o -v -v -v -t +glsl1 --quick

work. (Not a lot of examples of this in piglit...)

GLES3 should support the explicit derivatives stuff too, should be easy to
just dump a few shaders that exercise the various functionality...

 src/gallium/drivers/freedreno/ir3/ir3_compiler.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/freedreno/ir3/ir3_compiler.c b/src/gallium/drivers/freedreno/ir3/ir3_compiler.c
index 72ebb04..cd6d230 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_compiler.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_compiler.c
@@ -1143,6 +1143,7 @@ get_tex_info(struct ir3_compile_context *ctx,
 	switch (inst->Instruction.Opcode) {
 	case TGSI_OPCODE_TEX:
 	case TGSI_OPCODE_TXB:
+	case TGSI_OPCODE_TXL:
 		switch (tex) {
 		case TGSI_TEXTURE_1D:
 			return &tex1d;
@@ -1287,7 +1288,7 @@ trans_samp(const struct instr_translater *t,
 	add_dst_reg_wrmask(ctx, instr, dst, 0, dst->WriteMask);
 	add_src_reg_wrmask(ctx, instr, coord, coord->SwizzleX, tinf->src_wrmask);
 
-	if (t->tgsi_opc == TGSI_OPCODE_TXB)
+	if (t->opc != OPC_SAM)
 		add_src_reg_wrmask(ctx, instr, coord, coord->SwizzleW, 0x1);
 }
 
@@ -2090,6 +2091,7 @@ static const struct instr_translater translaters[TGSI_OPCODE_LAST] = {
 	INSTR(TEX,          trans_samp, .opc = OPC_SAM, .arg = TGSI_OPCODE_TEX),
 	INSTR(TXP,          trans_samp, .opc = OPC_SAM, .arg = TGSI_OPCODE_TXP),
 	INSTR(TXB,          trans_samp, .opc = OPC_SAMB, .arg = TGSI_OPCODE_TXB),
+	INSTR(TXL,          trans_samp, .opc = OPC_SAML, .arg = TGSI_OPCODE_TXL),
 	INSTR(DDX,          trans_deriv, .opc = OPC_DSX),
 	INSTR(DDY,          trans_deriv, .opc = OPC_DSY),
 	INSTR(SGT,          trans_cmp),
-- 
1.8.5.5



More information about the Freedreno mailing list