[Mesa-dev] [PATCH 3/3 v2] R600/SI: Use unnormalized coordinates for sampling with the RECT target.

Michel Dänzer michel at daenzer.net
Wed Jan 16 06:27:54 PST 2013


From: Michel Dänzer <michel.daenzer at amd.com>


Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---

v2: Leave the target parameter unnamed to prevent noisy if harmless
build error messages.

 lib/Target/R600/R600Instructions.td |    7 +++++++
 lib/Target/R600/SIInstructions.td   |    6 ++++++
 2 files changed, 13 insertions(+)

diff --git a/lib/Target/R600/R600Instructions.td b/lib/Target/R600/R600Instructions.td
index 64bab18..b15ea76 100644
--- a/lib/Target/R600/R600Instructions.td
+++ b/lib/Target/R600/R600Instructions.td
@@ -342,6 +342,13 @@ def TEX_SHADOW : PatLeaf<
   }]
 >;
 
+def TEX_RECT : PatLeaf<
+  (imm),
+  [{uint32_t TType = (uint32_t)N->getZExtValue();
+    return TType == 5;
+  }]
+>;
+
 class EG_CF_RAT <bits <8> cf_inst, bits <6> rat_inst, bits<4> rat_id, dag outs,
                  dag ins, string asm, list<dag> pattern> :
     InstR600ISA <outs, ins, asm, pattern> {
diff --git a/lib/Target/R600/SIInstructions.td b/lib/Target/R600/SIInstructions.td
index 0f9d572..4164c55 100644
--- a/lib/Target/R600/SIInstructions.td
+++ b/lib/Target/R600/SIInstructions.td
@@ -1191,6 +1191,12 @@ def : Pat <
                 SReg_256:$rsrc, SReg_128:$sampler)
 >;
 
+def : Pat <
+  (int_SI_sample imm:$writemask, VReg_128:$coord, SReg_256:$rsrc, SReg_128:$sampler, TEX_RECT),
+  (IMAGE_SAMPLE imm:$writemask, 1, 0, 0, 0, 0, 0, 0, VReg_128:$coord,
+                SReg_256:$rsrc, SReg_128:$sampler)
+>;
+
 /* int_SI_sample_lod */
 def : Pat <
   (int_SI_sample_lod imm:$writemask, VReg_128:$coord, SReg_256:$rsrc, SReg_128:$sampler, imm),
-- 
1.7.10.4



More information about the mesa-dev mailing list