[Mesa-dev] [PATCH 71/78] i965/nir/vec4: Implement nir_texop_tex and nir_texop_txl texture ops

Eduardo Lima Mitev elima at igalia.com
Fri Jun 26 01:07:27 PDT 2015


From: Alejandro PiƱeiro <apinheiro at igalia.com>

The implementation of these two operations is very similar, so it makes sense
to group them together.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89580
---
 src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
index 6d572be..92c88d4 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
@@ -1598,7 +1598,21 @@ vec4_visitor::nir_emit_texture(nir_tex_instr *instr)
 
       /* Load the LOD info */
       if (instr->op == nir_texop_tex || instr->op == nir_texop_txl) {
-         /* @TODO: not yet implemented */
+         int mrf, writemask;
+         mrf = param_base + 1;
+         if (shadow_compare) {
+            writemask = WRITEMASK_Y;
+            /* mlen already incremented on shadow comparitor loading */
+         } else {
+            writemask = WRITEMASK_X;
+            inst->mlen++;
+         }
+
+         if (instr->op == nir_texop_tex)
+            lod = src_reg(0.0f);
+
+         lod.swizzle = BRW_SWIZZLE_XXXX;
+         emit(MOV(dst_reg(MRF, mrf, lod.type, writemask), lod));
       } else if (instr->op == nir_texop_txf) {
          /* @TODO: not yet implemented */
       } else if (instr->op == nir_texop_txf_ms) {
-- 
2.1.4



More information about the mesa-dev mailing list