Mesa (master): i965/skl: Fix the order of the arguments for the LD sampler message

Neil Roberts nroberts at kemper.freedesktop.org
Wed Apr 8 11:13:28 UTC 2015


Module: Mesa
Branch: master
Commit: 4deca1274c25b80351dbec972b68ab6520a89b31
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4deca1274c25b80351dbec972b68ab6520a89b31

Author: Neil Roberts <neil at linux.intel.com>
Date:   Fri Mar  6 19:11:19 2015 +0000

i965/skl: Fix the order of the arguments for the LD sampler message

In Skylake the order of the arguments for sample messages with the LD
type are u, v, lod, r whereas previously they were u, lod, v, r.

This fixes 144 Piglit tests including ones that directly use
texelFetch and also some using the meta stencil blit path which
appears to use texelFetch in its shader.

v2: Fix sampling 1D textures

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>

---

 src/mesa/drivers/dri/i965/brw_fs_visitor.cpp |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index 3622e65..06337c9 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -1889,15 +1889,26 @@ fs_visitor::emit_texture_gen7(ir_texture_opcode op, fs_reg dst,
       length++;
       break;
    case ir_txf:
-      /* Unfortunately, the parameters for LD are intermixed: u, lod, v, r. */
+      /* Unfortunately, the parameters for LD are intermixed: u, lod, v, r.
+       * On Gen9 they are u, v, lod, r
+       */
+
       emit(MOV(retype(sources[length], BRW_REGISTER_TYPE_D), coordinate));
       coordinate = offset(coordinate, 1);
       length++;
 
+      if (brw->gen >= 9) {
+         if (coord_components >= 2) {
+            emit(MOV(retype(sources[length], BRW_REGISTER_TYPE_D), coordinate));
+            coordinate = offset(coordinate, 1);
+         }
+         length++;
+      }
+
       emit(MOV(retype(sources[length], BRW_REGISTER_TYPE_D), lod));
       length++;
 
-      for (int i = 1; i < coord_components; i++) {
+      for (int i = brw->gen >= 9 ? 2 : 1; i < coord_components; i++) {
 	 emit(MOV(retype(sources[length], BRW_REGISTER_TYPE_D), coordinate));
 	 coordinate = offset(coordinate, 1);
 	 length++;




More information about the mesa-commit mailing list