From 43048c7093c367897fbcbb3ca8580e9c122cd6f6 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Mon, 8 Jun 2015 14:45:47 -0400 Subject: [PATCH] freedreno/ir3: only unminify txf coords on a3xx Seems like a4xx gets this right. Signed-off-by: Rob Clark --- src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c index 5c215a5..a9a8df3 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c @@ -109,6 +109,11 @@ struct ir3_compile { */ bool levels_add_one; + /* on a3xx, we need to scale up integer coords for isaml based + * on LoD: + */ + bool unminify_coords; + /* for looking up which system value is which */ unsigned sysval_semantics[8]; @@ -225,10 +230,12 @@ compile_init(struct ir3_compiler *compiler, /* need special handling for "flat" */ ctx->flat_bypass = true; ctx->levels_add_one = false; + ctx->unminify_coords = false; } else { /* no special handling for "flat" */ ctx->flat_bypass = false; ctx->levels_add_one = true; + ctx->unminify_coords = true; } ctx->compiler = compiler; @@ -1592,11 +1599,12 @@ emit_tex(struct ir3_compile *ctx, nir_tex_instr *tex) tex_info(tex, &flags, &coords); /* scale up integer coords for TXF based on the LOD */ - if (opc == OPC_ISAML) { + if (ctx->unminify_coords && (opc == OPC_ISAML)) { assert(has_lod); for (i = 0; i < coords; i++) coord[i] = ir3_SHL_B(b, coord[i], 0, lod, 0); } + /* * lay out the first argument in the proper order: * - actual coordinates first -- 2.7.4